Commit bf2f51f8 authored by Tachibana's avatar Tachibana

watele

parent e5afb31f
Pipeline #6815 passed with stages
in 38 minutes and 40 seconds
No preview for this file type
......@@ -39,7 +39,7 @@ function cm.thfilter(c)
return rk.check(c,"FAIRY") and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
......
......@@ -9,7 +9,18 @@ function cm.initial_effect(c)
e0:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
c:RegisterEffect(e0)
--control
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_CONTROL+CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--recover
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
......@@ -25,6 +36,57 @@ function cm.initial_effect(c)
e3:SetOperation(cm.recop)
c:RegisterEffect(e3)
end
--
unction cm.desfilter(c)
return c:IsFaceup() and rk.check(c,"FAIRY")
end
function cm.ctfilter(c)
return c:IsControlerCanBeChanged()
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(cm.ctfilter,tp,0,LOCATION_MZONE,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g2=Duel.SelectTarget(tp,cm.ctfilter,tp,0,LOCATION_MZONE,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,g1:GetCount(),0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()~=2 then Duel.SendtoGrave(tc,REASON_EFFECT) return end
local tc=g:Filter(Card.IsControler,nil,tp)
local tc2=g:Filter(Card.IsControler,nil,1-tp)
if tc2:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
if not Duel.Equip(tp,c,tc) then return end
--equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetLabelObject(tc)
e1:SetValue(cm.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetOwnerPlayer(tp)
e3:SetValue(cm.ctval)
c:RegisterEffect(e3)
end
end
function cm.eqlimit(e,c)
return c==e:GetLabelObject()
end
function cm.ctval(e,c)
return e:GetHandlerPlayer()
end
--recover
function cm.rmfilter(c,e,tp)
return c:IsAbleToRemoveAsCost() and rk.check(c,"FAIRY") and c:IsType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,c)
......
......@@ -50,11 +50,12 @@ function cm.initial_effect(c)
c:RegisterEffect(ea)
--remove and recover
local eb=Effect.CreateEffect(c)
eb:SetDescription(aux.Stringid(m,0))
eb:SetCategory(CATEGORY_TOGRAVE)
eb:SetDescription(aux.Stringid(m,1))
eb:SetCategory(CATEGORY_REMOVE+CATEGORY_RECOVER)
eb:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
eb:SetCode(EVENT_PAY_LPCOST)
eb:SetRange(LOCATION_MZONE)
eb:SetProperty(EFFECT_FLAG_DELAY)
eb:SetCountLimit(1,m+101)
eb:SetCondition(cm.tgcon)
eb:SetTarget(cm.tgtg)
......@@ -108,14 +109,14 @@ function cm.actop(e,tp,eg,ep,ev,re,r,rp)
end
--remove and recover
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
return ep==tp
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_ONFIELD)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,2,nil)
if g:GetCount()>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Recover(tp,ev*2,REASON_EFFECT)
......
......@@ -17,7 +17,7 @@ function cm.initial_effect(c)
--todeck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
......@@ -60,19 +60,20 @@ function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spc(c,e,tp,lv)
return c:IsLevel(lv) and c:IsType(TYPE_RITUAL) and rk.check(c,"FAIRY") and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,false)
return c:IsLevel(lv) and c:IsType(TYPE_RITUAL) and rk.check(c,"FAIRY") and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.BreakEffect()
local og=Duel.GetOperatedGroup()
if og:GetCount()>0 then
local sum=og:GetSum(Card.GetLevel)
if Duel.IsExistingMatchingCard(cm.spc,tp,LOCATION_DECK,0,1,nil,e,tp,sum) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spc,tp,LOCATION_DECK,0,1,1,nil,e,tp,sum)
Duel.SpecialSummon(sg,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(sg,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
local tc=sg:GetFirst()
tc:CompleteProcedure()
end
......
......@@ -42,6 +42,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.grck(c)
return rk.check(c,"FAIRY") and c:IsAbleToRemove()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg1=Duel.GetRitualMaterial(tp)
......@@ -63,7 +66,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE):Filter(rk.check(c,"FAIRY"),nil)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE):Filter(cm.grck,nil)
mat:Sub(mat2)
Duel.ReleaseRitualMaterial(mat)
Duel.Remove(mat2,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
......
......@@ -38,7 +38,7 @@ function cm.thfilter(c)
return c:IsCode(16114209) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
......
......@@ -19,7 +19,7 @@ function cm.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.atkcon)
......@@ -57,8 +57,8 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()
and (Duel.GetAttacker():IsControler(tp) and Duel.GetAttacker():IsRace(RACE_SPELLCASTER)
or Duel.GetAttackTarget():IsControler(tp) and Duel.GetAttackTarget():IsRace(RACE_SPELLCASTER))
and (Duel.GetAttacker():IsControler(tp) and rk.check(Duel.GetAttacker(),"FAIRY")
or Duel.GetAttackTarget():IsControler(tp) and rk.check(Duel.GetAttackTarget(),"FAIRY"))
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cfilter(c,tp)
function cm.cfilter(c,e,tp)
return rk.check(c,"FAIRY") and c:IsFaceup() and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(cm.exc,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,c:GetAttribute(),c:GetRank()+c:GetLevel())
end
......@@ -32,11 +32,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=100 then
return false
else
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e,tp)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp):GetFirst()
local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst()
Duel.SendtoGrave(tc,REASON_COST)
e:SetLabel(tc:GetAttribute(),tc:GetLevel()+tc:GetRank())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
......
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