Commit 1a9d086c authored by Amiya's avatar Amiya

Merge branch 'master' of git.mycard.moe:mycard/pre-release-database-cdb

parents 58fbc53c 4331fa0f
...@@ -11,7 +11,7 @@ function s.initial_effect(c) ...@@ -11,7 +11,7 @@ function s.initial_effect(c)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(s.splimit) e1:SetValue(s.splimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to hand or spsummon --to hand or spsummon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,0))
...@@ -20,10 +20,11 @@ function s.initial_effect(c) ...@@ -20,10 +20,11 @@ function s.initial_effect(c)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id)
e2:SetCondition(s.tscon) e2:SetCondition(s.tscon)
e2:SetTarget(s.tstg) e2:SetTarget(s.tstg)
e2:SetOperation(s.tsop) e2:SetOperation(s.tsop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA) return not e:GetHandler():IsLocation(LOCATION_EXTRA)
...@@ -35,7 +36,7 @@ function s.ffilter1(c,fc,sub,mg,sg) ...@@ -35,7 +36,7 @@ function s.ffilter1(c,fc,sub,mg,sg)
return c:GetEquipGroup():IsExists(s.eqilter,1,nil) return c:GetEquipGroup():IsExists(s.eqilter,1,nil)
end end
function s.ffilter2(c,fc,sub,mg,sg) function s.ffilter2(c,fc,sub,mg,sg)
return c:GetOriginalType()&TYPE_MONSTER~=0 and c:IsRace(RACE_FIEND) return c:GetOriginalType()&TYPE_MONSTER~=0 and c:GetOriginalRace()&RACE_FIEND~=0
end end
function s.tgfilter(c) function s.tgfilter(c)
return c:IsPreviousLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER) return c:IsPreviousLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER)
...@@ -43,15 +44,15 @@ end ...@@ -43,15 +44,15 @@ end
function s.tscon(e,tp,eg,ep,ev,re,r,rp) function s.tscon(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end if not re then return false end
local rc=re:GetHandler() local rc=re:GetHandler()
return rp==tp and r&REASON_COST>0 and eg:IsExists(s.tgfilter,1,nil) return r&REASON_COST~=0 and eg:IsExists(s.tgfilter,1,nil)
end end
function s.eqfilter(c) function s.eqfilter(c)
return c:IsPreviousLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER) and not c:IsForbidden() return c:IsPreviousLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end end
function s.tstg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local b1=eg:IsExists(s.eqfilter,1,nil) and Duel.GetFlagEffect(tp,id)==0 local b1=eg:IsExists(s.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
local b2=Duel.IsPlayerCanDraw(tp,1) and Duel.GetFlagEffect(tp,id+o)==0 local b2=Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=0 local op=0
if b1 and b2 then if b1 and b2 then
...@@ -63,17 +64,15 @@ function s.tstg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -63,17 +64,15 @@ function s.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
e:SetLabel(op) e:SetLabel(op)
if op==0 then if op==0 then
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,0,0)
else else
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
end end
function s.tsop(e,tp,eg,ep,ev,re,r,rp) function s.tsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if e:GetLabel()==0 then if e:GetLabel()==0 then
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=eg:FilterSelect(tp,s.eqfilter,1,1,nil):GetFirst() local ec=eg:FilterSelect(tp,s.eqfilter,1,1,nil):GetFirst()
if not Duel.Equip(tp,ec,c) then return end if not Duel.Equip(tp,ec,c) then return end
......
...@@ -10,14 +10,14 @@ function s.initial_effect(c) ...@@ -10,14 +10,14 @@ function s.initial_effect(c)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.filter(c,tp) function s.filter(c,tp)
local code=c:GetOriginalCode() local code=c:GetOriginalCode()
return c:IsFaceup() and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,2,nil,code) return c:IsFaceup() and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,2,nil,code)
end end
function s.eqfilter(c,code) function s.eqfilter(c,code)
return c:IsOriginalCodeRule(code) and not c:IsForbidden() return c:IsOriginalCodeRule(code) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc,tp) end
...@@ -32,7 +32,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -32,7 +32,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE)>1 then if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_SZONE)>1
and Duel.GetMatchingGroupCount(aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,nil,tc:GetOriginalCode())>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,2,2,nil,tc:GetOriginalCode()) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,2,2,nil,tc:GetOriginalCode())
if #g<2 then return end if #g<2 then return end
......
...@@ -5,63 +5,61 @@ function s.initial_effect(c) ...@@ -5,63 +5,61 @@ function s.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsLevelAbove(1)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.cfilter(chkc) end local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,0,1,nil) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
if c:IsRelateToEffect(e) then if tc:IsFaceup() and tc:IsType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e) then
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetLevel()) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) e1:SetValue(math.ceil(tc:GetAttack()/2))
c:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(tc:GetLevel())
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e2)
end end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
local e2=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_REDIRECT) e3:SetReset(RESET_EVENT+RESETS_REDIRECT)
e2:SetValue(LOCATION_REMOVED) e3:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2,true) c:RegisterEffect(e3,true)
end
if not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(math.ceil(tc:GetAttack()/2))
tc:RegisterEffect(e1)
end end
local e2=Effect.CreateEffect(e:GetHandler()) local e4=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0) e4:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END) e4:SetReset(RESET_PHASE+PHASE_END)
e2:SetTarget(s.splimit) e4:SetTarget(s.splimit)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e4,tp)
end end
function s.splimit(e,c) function s.splimit(e,c)
return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA) return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
......
...@@ -27,7 +27,7 @@ function s.initial_effect(c) ...@@ -27,7 +27,7 @@ function s.initial_effect(c)
e2:SetCondition(s.sccon) e2:SetCondition(s.sccon)
e2:SetTarget(s.sctarg) e2:SetTarget(s.sctarg)
e2:SetOperation(s.scop) e2:SetOperation(s.scop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.spcost1(e,tp,eg,ep,ev,re,r,rp,chk) function s.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end
...@@ -39,7 +39,7 @@ function s.filter(c) ...@@ -39,7 +39,7 @@ function s.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function s.destg(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:IsOnField() and s.filter(chkc) end if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and s.filter(chkc) end
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
......
...@@ -3,7 +3,7 @@ local s,id,o=GetID() ...@@ -3,7 +3,7 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,s.ffilter,2,true) aux.AddFusionProcFunRep(c,s.ffilter,2,true)
--to grave --to grave
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
...@@ -15,13 +15,14 @@ function s.initial_effect(c) ...@@ -15,13 +15,14 @@ function s.initial_effect(c)
e1:SetCondition(s.tgcon) e1:SetCondition(s.tgcon)
e1:SetTarget(s.tgtg) e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop) e1:SetOperation(s.tgop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
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_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id+o)
e2:SetCost(s.spcost) e2:SetCost(s.spcost)
e2:SetTarget(s.sptg) e2:SetTarget(s.sptg)
e2:SetOperation(s.spop) e2:SetOperation(s.spop)
...@@ -34,7 +35,7 @@ function s.tgcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,7 +35,7 @@ function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end end
function s.tgfilter(c) function s.tgfilter(c)
return c:IsRace(RACE_FIEND) return c:IsRace(RACE_FIEND) and c:IsAbleToGrave()
end end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
...@@ -54,7 +55,7 @@ function s.rselect(g) ...@@ -54,7 +55,7 @@ function s.rselect(g)
return g:GetClassCount(Card.GetAttributeInGrave)==1 return g:GetClassCount(Card.GetAttributeInGrave)==1
end end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_GRAVE,0,e:GetHandler())
if chk==0 then return g:CheckSubGroup(s.rselect,2,2) end if chk==0 then return g:CheckSubGroup(s.rselect,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,s.rselect,false,2,2) local sg=g:SelectSubGroup(tp,s.rselect,false,2,2)
...@@ -65,9 +66,8 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -65,9 +66,8 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
......
...@@ -68,13 +68,12 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,13 +68,12 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function s.poscon(e,tp,eg,ep,ev,re,r,rp) function s.poscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end end
function s.filter(c) function s.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsFacedown() return c:IsType(TYPE_MONSTER) and c:IsFacedown() and c:IsDefensePos()
end end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
......
...@@ -10,29 +10,30 @@ function s.initial_effect(c) ...@@ -10,29 +10,30 @@ function s.initial_effect(c)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation) e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search --spsummon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
e2:SetTarget(s.thtg) e2:SetTarget(s.sptg)
e2:SetOperation(s.thop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() --search
e3:SetCode(EVENT_SPSUMMON_SUCCESS) local e3=Effect.CreateEffect(c)
c:RegisterEffect(e3) e3:SetDescription(aux.Stringid(id,2))
--spsummon e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
local e4=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetDescription(aux.Stringid(id,0)) e3:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetType(EFFECT_TYPE_IGNITION) e3:SetCountLimit(1,id+o*2)
e4:SetRange(LOCATION_HAND) e3:SetTarget(s.thtg)
e4:SetCountLimit(1,id+o*2) e3:SetOperation(s.thop)
e4:SetTarget(s.sptg) c:RegisterEffect(e3)
e4:SetOperation(s.spop) local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function s.filter(c) function s.filter(c)
...@@ -47,12 +48,25 @@ end ...@@ -47,12 +48,25 @@ end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
if e:GetHandler():IsControlerCanBeChanged() then local c=e:GetHandler()
Duel.GetControl(e:GetHandler(),1-tp) if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
end end
end end
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)
end
end
function s.thfilter(c) function s.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x2be) and c:IsAbleToHand() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x2be) and c:IsAbleToHand()
end end
...@@ -67,15 +81,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -67,15 +81,4 @@ function s.thop(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 s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)
end
end end
\ No newline at end of file
...@@ -10,27 +10,27 @@ function s.initial_effect(c) ...@@ -10,27 +10,27 @@ function s.initial_effect(c)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation) e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon --spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_HAND)
e4:SetCountLimit(1,id+o)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
--cannot be target
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetDescription(aux.Stringid(id,1))
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetRange(LOCATION_MZONE) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(LOCATION_ONFIELD,0) e2:SetCountLimit(1,id+o)
e2:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_SPELL)) e2:SetTarget(s.sptg)
e2:SetValue(1) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(aux.TargetBoolFunction(aux.AND(Card.IsType,Card.IsFaceup),TYPE_SPELL))
e3:SetValue(1)
c:RegisterEffect(e3)
end end
function s.filter(c) function s.filter(c)
return c:IsFaceup() and not c:IsSetCard(0x2be) return c:IsFaceup() and not c:IsSetCard(0x2be)
...@@ -43,25 +43,26 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -43,25 +43,26 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,1-tp,POS_FACEUP_DEFENSE)
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then
local tg=Duel.GetDecktopGroup(tp,3) local tg=Duel.GetDecktopGroup(tp,3)
if #tg==0 then return end if #tg==0 then return end
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)>0 then if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
Duel.BreakEffect() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) then
if Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) if #g>0 then
if #g>0 then Duel.BreakEffect()
Duel.SpecialSummon(g:GetFirst(),0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) Duel.SpecialSummon(g:GetFirst(),0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
end end
end end
if e:GetHandler():IsControlerCanBeChanged() then local c=e:GetHandler()
Duel.GetControl(e:GetHandler(),1-tp) if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
end end
end end
end end
......
...@@ -10,30 +10,31 @@ function s.initial_effect(c) ...@@ -10,30 +10,31 @@ function s.initial_effect(c)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation) e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--ChangePosition --spsummon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_POSITION) e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
e2:SetTarget(s.postg) e2:SetTarget(s.sptg)
e2:SetOperation(s.posop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() --ChangePosition
e3:SetCode(EVENT_SPSUMMON_SUCCESS) local e3=Effect.CreateEffect(c)
c:RegisterEffect(e3) e3:SetDescription(aux.Stringid(id,2))
--spsummon e3:SetCategory(CATEGORY_POSITION)
local e4=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetDescription(aux.Stringid(id,0)) e3:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetType(EFFECT_TYPE_IGNITION) e3:SetCountLimit(1,id+o*2)
e4:SetRange(LOCATION_HAND) e3:SetTarget(s.postg)
e4:SetCountLimit(1,id+o*2) e3:SetOperation(s.posop)
e4:SetTarget(s.sptg) c:RegisterEffect(e3)
e4:SetOperation(s.spop) local e4=e3:Clone()
c:RegisterEffect(e4) e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end end
function s.filter(c) function s.filter(c)
return c:IsFaceup() and not c:IsSetCard(0x2be) return c:IsFaceup() and not c:IsSetCard(0x2be)
...@@ -48,18 +49,34 @@ end ...@@ -48,18 +49,34 @@ end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then
Duel.Draw(1-tp,1,REASON_EFFECT) Duel.Draw(1-tp,1,REASON_EFFECT)
Duel.ShuffleHand(tp)
local tg1=Duel.GetFieldGroup(tp,LOCATION_HAND,0) local tg1=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) if tg1:GetCount()>0 then
local tc1=tg1:Select(tp,1,1,nil):GetFirst() Duel.ShuffleHand(tp)
Duel.SendtoGrave(tc1,REASON_EFFECT) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
if e:GetHandler():IsControlerCanBeChanged() then local tc1=tg1:Select(tp,1,1,nil):GetFirst()
Duel.GetControl(e:GetHandler(),1-tp) Duel.BreakEffect()
Duel.SendtoGrave(tc1,REASON_EFFECT)
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
end end
end end
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)
end
end
function s.posfilter(c) function s.posfilter(c)
return c:IsFacedown() and c:IsDefensePos() return c:IsType(TYPE_MONSTER) and c:IsFacedown() and c:IsDefensePos()
end end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
...@@ -70,18 +87,8 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,18 +87,8 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.HintSelection(g)
local pos=Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEUP_DEFENSE) local pos=Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEUP_DEFENSE)
Duel.ChangePosition(tc,pos) Duel.ChangePosition(tc,pos)
end end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)
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