Commit 328435de authored by 聖園ミカ's avatar 聖園ミカ 🐟

wocaonima

parent 679f74c3
No preview for this file type
--神社 --神社
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900001.initial_effect(c)
local m , cm = rscf.DefineCard(37900001) local e0=Effect.CreateEffect(c)
function cm.initial_effect(c) e0:SetType(EFFECT_TYPE_ACTIVATE)
local e1 = rsef.A(c) e0:SetCode(EVENT_FREE_CHAIN)
local e2 = rsef.FC(c,EVENT_TO_GRAVE,nil,nil,nil,LOCATION_SZONE,nil,cm.ctop) c:RegisterEffect(e0)
local e3 = rsef.FV_Card(c,"atk+",cm.atkval,aux.TRUE,{ LOCATION_MZONE,LOCATION_MZONE },nil,LOCATION_SZONE) local e1=Effect.CreateEffect(c)
local e4 = rsef.FV_Card(c,"def+",cm.atkval2,aux.TRUE,{ LOCATION_MZONE,LOCATION_MZONE },nil,LOCATION_SZONE) e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
local e5 = rsef.STO(c,EVENT_LEAVE_FIELD,"th",nil,"se,th","de",nil,nil,rsop.target(cm.thfilter,"th",LOCATION_DECK),cm.thop) e1:SetCode(EVENT_TO_GRAVE)
end e1:SetRange(LOCATION_SZONE)
function cm.ctop(e,tp,eg,ep,ev,re,r,rp) e1:SetOperation(c37900001.op)
e:GetHandler():AddCounter(0x1389,#eg) c:RegisterEffect(e1)
end local e2=Effect.CreateEffect(c)
function cm.atkval(e,c) e2:SetType(EFFECT_TYPE_FIELD)
return -100 * e:GetHandler():GetCounter(0x1389) e2:SetRange(LOCATION_SZONE)
end e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
function cm.atkval2(e,c) e2:SetCode(EFFECT_UPDATE_DEFENSE)
return 100 * e:GetHandler():GetCounter(0x1389) e2:SetTarget(aux.TargetBoolFunction(aux.TRUE))
end e2:SetValue(c37900001.val1)
function cm.thfilter(c) c:RegisterEffect(e2)
return c:IsSetCard(0x389) and c:IsAbleToHand() local e3=Effect.CreateEffect(c)
end e3:SetType(EFFECT_TYPE_FIELD)
function cm.thop(e,tp) e3:SetRange(LOCATION_SZONE)
local ct,og,tc = rsop.SelectToHand(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,{}) e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
if not tc or not tc:IsLocation(LOCATION_HAND) then return end e3:SetCode(EFFECT_UPDATE_ATTACK)
local e1 = rsef.FV_Player({e:GetHandler(),tp},"act~",cm.val(tc),nil,{1,0},nil,nil,nil,rsrst.ep) e3:SetTarget(aux.TargetBoolFunction(aux.TRUE))
end e3:SetValue(c37900001.val2)
function cm.val(tc) c:RegisterEffect(e3)
return function(e,re) local e4=Effect.CreateEffect(c)
return re:GetHandler():IsCode(tc:GetCode()) e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(c37900001.con4)
e4:SetTarget(c37900001.tg4)
e4:SetOperation(c37900001.op4)
c:RegisterEffect(e4)
end
function c37900001.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=eg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if g:GetCount()>0 then
c:AddCounter(0x1389,g:GetCount())
end end
end
function c37900001.val1(e)
local c=e:GetHandler()
return c:GetCounter(0x1389)*100
end
function c37900001.val2(e)
local c=e:GetHandler()
return -c:GetCounter(0x1389)*100
end
function c37900001.con4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c37900001.q(c)
return c:IsAbleToHand() and c:IsSetCard(0x389)
end
function c37900001.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37900001.q,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c37900001.op4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c37900001.q,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(c37900001.aclimit)
e1:SetLabel(tc:GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c37900001.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end end
\ No newline at end of file
--神隐之地 --神隐之地
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900002.initial_effect(c)
local m , cm = rscf.DefineCard(37900002,"ShenYing") local e0=Effect.CreateEffect(c)
function cm.initial_effect(c) e0:SetType(EFFECT_TYPE_ACTIVATE)
local e1 = rsef.A(c) e0:SetCode(EVENT_FREE_CHAIN)
local e2 = rsef.QO(c,nil,"td",1,"td,ct","tg",LOCATION_FZONE,nil,nil,rstg.target(cm.tdfilter,"td",rsloc.gr),cm.tdop) c:RegisterEffect(e0)
local e3 = rsef.QO(c,nil,"th",1,"th,ct","tg",LOCATION_FZONE,nil,rscost.rmct(0x1389,2),rstg.target(cm.thfilter,"th",rsloc.gr),cm.thop) local e1=Effect.CreateEffect(c)
local e4 = rsef.FV_Card(c,"indct",cm.indval,cm.indtg,{LOCATION_SZONE,0},nil,LOCATION_FZONE) e1:SetType(EFFECT_TYPE_QUICK_O)
local e5 = rsef.FV_Card(c,"indb",1,cm.indtg2,{ LOCATION_MZONE,LOCATION_MZONE },nil,LOCATION_FZONE) e1:SetCode(EVENT_FREE_CHAIN)
local e6 = rsef.FV_Card(c,"inde",1,cm.indtg3,{ LOCATION_MZONE,LOCATION_MZONE },nil,LOCATION_FZONE) e1:SetCategory(CATEGORY_GRAVE_ACTION+CATEGORY_COUNTER)
end e1:SetRange(LOCATION_FZONE)
function cm.tdfilter(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
return c:IsSetCard(0x389) and c:RemovePosCheck() and c:IsAbleToDeck() e1:SetCountLimit(1)
end e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_MAIN_END+TIMINGS_CHECK_MONSTER+TIMING_SSET)
function cm.tdop(e,tp) e1:SetTarget(c37900002.tg)
local tc = rscf.GetTargetCard() e1:SetOperation(c37900002.op)
if tc and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) > 0 and tc:IsLocation(rsloc.de) then c:RegisterEffect(e1)
e:GetHandler():AddCounter(0x1389,1) local e2=Effect.CreateEffect(c)
end e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(c37900002.tg2)
e2:SetValue(c37900002.indct)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c37900002.tg3)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(c37900002.tg4)
e4:SetValue(1)
c:RegisterEffect(e4)
end
function c37900002.q(c)
return c:IsAbleToDeck() and c:IsSetCard(0x389)
end end
function cm.thfilter(c) function c37900002.w(c,sc)
return c:IsSetCard(0x389) and c:RemovePosCheck() and c:IsAbleToHand() return c:IsAbleToHand() and c:IsSetCard(0x389)
end end
function cm.thop(e,tp) function c37900002.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc = rscf.GetTargetCard() local c=e:GetHandler()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT) > 0 and tc:IsLocation(LOCATION_HAND) then if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and (c37900002.q(chkc) or c37900002.w(chkc)) end
e:GetHandler():AddCounter(0x1389,1) if chk==0 then return Duel.IsExistingTarget(c37900002.q,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) or (Duel.IsExistingTarget(c37900002.w,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and c:GetCounter(0x1389)>=2) end
if Duel.IsExistingTarget(c37900002.q,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and not (Duel.IsExistingTarget(c37900002.w,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and c:GetCounter(0x1389)>=2) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c37900002.q,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
e:SetCategory(CATEGORY_TODECK)
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
if not Duel.IsExistingTarget(c37900002.q,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.IsExistingTarget(c37900002.w,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and c:GetCounter(0x1389)>=2 then
c:RemoveCounter(tp,0x1389,2,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c37900002.w,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
e:SetCategory(CATEGORY_TOHAND)
e:SetLabel(1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
if (c:GetCounter(0x1389)>=2 and Duel.IsExistingTarget(c37900002.w,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)) and Duel.IsExistingTarget(c37900002.q,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) then
if Duel.SelectYesNo(tp,aux.Stringid(37900002,0)) then
c:RemoveCounter(tp,0x1389,2,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c37900002.w,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
e:SetCategory(CATEGORY_TOHAND)
e:SetLabel(1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c37900002.q,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
e:SetCategory(CATEGORY_TODECK)
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
end end
end end
function cm.indtg(e,c) function c37900002.op(e,tp,eg,ep,ev,re,r,rp)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x389) local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if e:GetLabel()==0 then
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)>0 then
c:AddCounter(0x1389,1)
end
else
if Duel.SendtoHand(tc,tp,REASON_EFFECT)>0 then
c:AddCounter(0x1389,1)
end
end
end
end end
function cm.indval(e,re,r,rp) function c37900002.indct(e,re,r,rp)
if r & REASON_EFFECT ~= 0 then if bit.band(r,REASON_EFFECT)~=0 then
return 1 return 1
else return 0 end else return 0 end
end end
function cm.indtg2(e,c) function c37900002.tg2(e,c)
return c:GetAttack() < c:GetBaseAttack() return c:IsType(TYPE_SPELL) and c:IsFaceup() and c:IsSetCard(0x389)
end end
function cm.indtg3(e,c) function c37900002.tg3(e,c)
return c:GetDefense() > c:GetBaseDefense() return c:GetAttack()<c:GetBaseAttack()
end end
function c37900002.tg4(e,c)
return c:GetDefense()>c:GetBaseDefense()
end
\ No newline at end of file
--神隐的奇迹 --神隐的奇迹
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900003.initial_effect(c)
local m , cm = rscf.DefineCard(37900003,"ShenYing") local e1=Effect.CreateEffect(c)
function cm.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE)
local e1 = rsef.A(c,nil,nil,nil,nil,"dis~,dise~,neg~",cm.con,nil,nil,cm.act) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_MAIN_END+TIMINGS_CHECK_MONSTER+TIMING_SSET)
e1:SetCondition(c37900003.con)
e1:SetTarget(c37900003.tg)
e1:SetOperation(c37900003.op)
c:RegisterEffect(e1)
end end
function cm.con(e,tp) function c37900003.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp) <= 1000 return Duel.GetLP(tp)<=1000
end end
function cm.act(e,tp) function c37900003.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler() if chk==0 then return true end
if Duel.GetLP(tp) > 1000 then return end
local e1 = rsef.FC({c,tp},EVENT_SUMMON_SUCCESS,nil,nil,nil,nil,cm.reccon,cm.recop)
local e2 = rsef.FC({c,tp},EVENT_SPSUMMON_SUCCESS,nil,nil,nil,nil,cm.reccon,cm.recop)
local e3 = rsef.FV_Card({c,tp},"atkpd",1,aux.TargetBoolFunction(Card.IsSetCard,0x389),{ LOCATION_MZONE,LOCATION_MZONE })
end end
function cm.cfilter(c,tp) function c37900003.op(e,tp,eg,ep,ev,re,r,rp)
return c:IsFaceup() and c:IsSetCard(0x389) and c:IsAttackAbove(1) local c=e:GetHandler()
if Duel.GetLP(tp)<=1000 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c37900003.mattg)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetOperation(c37900003.reop)
Duel.RegisterEffect(e3,tp)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e4,tp)
end
end
function c37900003.mattg(e,c)
return c:IsFaceup() and c:IsSetCard(0x389)
end end
function cm.reccon(e,tp,eg) function c37900003.q(c)
return eg:IsExists(cm.cfilter,1,nil,tp) return c:IsSetCard(0x389) and not c:IsAttack(0)
end end
function cm.recop(e,tp,eg) function c37900003.reop(e,tp,eg,ep,ev,re,r,rp)
local rg = eg:Filter(cm.cfilter,nil,tp) local g=eg:Filter(c37900003.q,nil)
if #rg <= 0 then return end if g:GetCount()>0 then
rshint.Card(m) local tc=g:GetFirst()
if #rg > 1 then while tc do
rshint.Select(tp,HINTMSG_FACEUP) local atk=tc:GetAttack()
rg = rg:Select(tp,1,1,nil) Duel.Recover(tp,atk,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end end
Duel.HintSelection(rg)
local rc = rg:GetFirst()
if Duel.Recover(tp,rc:GetAttack(),REASON_EFFECT) > 0 then
local e1 = rscf.QuickBuff({e:GetHandler(),rc},"fatk",0)
end end
end end
\ No newline at end of file
--现世的神隐事件 --现世的神隐事件
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900004.initial_effect(c)
local m , cm = rscf.DefineCard(37900004,"ShenYing") local e1=Effect.CreateEffect(c)
function cm.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE)
local e1 = rsef.A(c,nil,nil,{1,m},"sp,se,th",nil,nil,nil,rsop.target({ cm.spfilter,"sp",LOCATION_HAND },{ aux.TRUE,"dum",LOCATION_DECK,0,5 }),cm.act) e1:SetCode(EVENT_FREE_CHAIN)
local e2 = rsef.FTO(c,EVENT_PHASE+PHASE_END,"set",{1,m},"set",nil,LOCATION_GRAVE,nil,aux.bfgcost,rsop.target(cm.setfilter,"set",LOCATION_DECK),cm.setop) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetCountLimit(1,37900004)
e1:SetTarget(c37900004.tg)
e1:SetOperation(c37900004.op)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,37900004)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c37900004.tg2)
e2:SetOperation(c37900004.op2)
c:RegisterEffect(e2)
end end
function cm.spfilter(c,e,tp) function c37900004.q(c,e,tp)
return c:IsSetCard(0x389) and rscf.spfilter2()(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsSetCard(0x389)
end end
function cm.thfilter(c) function c37900004.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,5)
if chk==0 then return Duel.IsExistingMatchingCard(c37900004.q,tp,LOCATION_HAND,0,1,nil,e,tp) and g:GetCount()==5 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c37900004.thfilter(c)
return c:IsSetCard(0x389) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x389) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end end
function cm.act(e,tp) function c37900004.op(e,tp,eg,ep,ev,re,r,rp)
local e1 = rsef.FV_Player({e:GetHandler(),tp},"sp~",nil,cm.sptg,{1,0},nil,nil,nil,rsrst.ep) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if rsop.SelectSpecialSummon(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,{},e,tp) <= 0 then return end local g=Duel.SelectMatchingCard(tp,c37900004.q,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=4 then return end if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.ConfirmDecktop(tp,5) local g=Duel.GetDecktopGroup(tp,2)
local g=Duel.GetDecktopGroup(tp,5) if g:GetCount()==5 then
local ct=#g Duel.ConfirmDecktop(tp,5)
if ct>0 and g:FilterCount(cm.thfilter,nil)>0 and rshint.SelectYesNo(tp,"th") then if g:IsExists(c37900004.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(37900004,0)) then
Duel.DisableShuffleCheck() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:FilterSelect(tp,c37900004.thfilter,1,1,nil)
local sg=g:FilterSelect(tp,cm.thfilter,1,1,nil) if Duel.SendtoHand(sg,nil,REASON_EFFECT) then
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg)
Duel.ConfirmCards(1-tp,sg) Duel.ShuffleHand(tp)
Duel.ShuffleHand(tp) g:Sub(sg)
ct=#g-#sg end
end end
if ct>0 then Duel.SortDecktop(tp,tp,#g-1)
Duel.SortDecktop(tp,tp,ct) for i=1,#g-1 do
for i=1,ct do local dg=Duel.GetDecktopGroup(tp,1)
local mg=Duel.GetDecktopGroup(tp,1) Duel.MoveSequence(dg:GetFirst(),SEQ_DECKBOTTOM)
Duel.MoveSequence(mg:GetFirst(),1) end
end end
end end
end end
function cm.sptg(e,c) function c37900004.setfilter(c,tp)
return not c:IsSetCard(0x389) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not c:IsCode(37900004) and c:IsSetCard(0x389)
end end
function cm.setfilter(c,e,tp) function c37900004.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
return not c:IsCode(m) and c:IsSetCard(0x389) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() if chk==0 then return Duel.IsExistingMatchingCard(c37900004.setfilter,tp,LOCATION_DECK,0,1,nil,tp) end
end end
function cm.setop(e,tp) function c37900004.op2(e,tp,eg,ep,ev,re,r,rp)
rsop.SelectSSet(tp,cm.setfilter,tp,LOCATION_DECK,0,1,1,nil,{}) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c37900004.setfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
if g:GetCount()>0 then
Duel.SSet(tp,g)
end
end end
\ No newline at end of file
--神隐事件·符卡重构 --神隐事件·符卡重构
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900006.initial_effect(c)
local m,cm = rscf.DefineCard(37900006)
function cm.initial_effect(c)
local e2 = rsef.I(c,"td",{1,m},"td,dr",nil,LOCATION_GRAVE,nil,nil,rsop.target(Card.IsAbleToDeck,"td"),cm.tdop)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW) e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,37900006)
e1:SetCost(cm.cost) e1:SetCost(c37900006.cost)
e1:SetTarget(cm.target) e1:SetTarget(c37900006.target)
e1:SetOperation(cm.activate) e1:SetOperation(c37900006.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,37900006)
e2:SetTarget(c37900006.tg2)
e2:SetOperation(c37900006.op2)
c:RegisterEffect(e2)
end end
function cm.tdop(e,tp) function c37900006.q(c)
local c = rscf.GetSelf(e) return c:IsDiscardable() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x389)
if not c or Duel.SendtoDeck(c,nil,2,REASON_EFFECT) <= 0 or not Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) or not Duel.IsPlayerCanDraw(tp,1) or not rshint.SelectYesNo(tp,"td") then return end end
if rsop.SelectToDeck(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil,{}) > 0 then function c37900006.cost(e,tp,eg,ep,ev,re,r,rp,chk)
rsop.ToDeckDraw(tp,1) if chk==0 then return Duel.IsExistingMatchingCard(c37900006.q,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c37900006.q,tp,LOCATION_HAND,0,1,1,e:GetHandler())
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end end
end end
function cm.filter(c) function c37900006.target(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsSetCard(0x389) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.filter,1,1,REASON_COST+REASON_DISCARD)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2) Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function c37900006.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
end end
function c37900006.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_GRAVE)
end
function c37900006.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SendtoDeck(c,nil,2,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(37900006,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoDeck(g,nil,2,REASON_EFFECT)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--神隐之乡的日常生活 --神隐之乡的日常生活
function c37900007.initial_effect(c) function c37900007.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetDescription(aux.Stringid(37900007,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) e1:SetRange(LOCATION_SZONE)
--e2 e1:SetCountLimit(1,37900007)
e1:SetTarget(c37900007.tg)
e1:SetOperation(c37900007.op)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37900007,0)) e2:SetDescription(aux.Stringid(37900007,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,37900007) e2:SetCountLimit(1,37900007)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetTarget(c37900007.tg2)
local c=e:GetHandler() e2:SetOperation(c37900007.op2)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end c:RegisterEffect(e2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK) local e3=Effect.CreateEffect(c)
end) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
if not e:GetHandler():IsRelateToEffect(e) then return end e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c37900007.con3)
e3:SetTarget(c37900007.tg3)
e3:SetOperation(c37900007.op3)
c:RegisterEffect(e3)
end
function c37900007.q(c)
return c:IsSetCard(0x389) and c:IsAbleToHand()
end
function c37900007.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,3)
local sg=g:Filter(Card.IsAbleToHand,nil)
if chk==0 then return sg:GetCount()==3 end
end
function c37900007.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,3)
local sg=g:Filter(Card.IsAbleToHand,nil)
if sg:GetCount()==3 then
Duel.ConfirmDecktop(tp,3) Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if g:GetCount()>0 then if g:GetCount()>0 then
if g:IsExists(c37900007.opf2,1,nil) then Duel.DisableShuffleCheck()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND) if g:IsExists(c37900007.q,1,nil) then
local sg=g:FilterSelect(tp,c37900007.opf2,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c37900007.q,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
g:Sub(sg)
end end
Duel.ShuffleDeck(tp)
end end
end) end
c:RegisterEffect(e2)
--e3
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(37900007,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,37900007)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c37900007.tgf3,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c37900007.tgf3),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end)
c:RegisterEffect(e3)
--e4
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end)
e4:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c37900007.tgf4,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_GRAVE)
end)
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tg=Duel.GetMatchingGroup(c37900007.tgf4,tp,LOCATION_GRAVE,0,nil,e,tp)
if ft<=0 or tg:GetCount()==0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,ft,ft,nil)
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
end)
c:RegisterEffect(e4)
end end
--e2 function c37900007.w(c,e,tp)
function c37900007.opf2(c) return c:IsSetCard(0x389) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
return c:IsSetCard(0x389) and c:IsAbleToHand()
end end
--e3 function c37900007.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
function c37900007.tgf3(c,e,tp) if chk==0 then return Duel.IsExistingMatchingCard(c37900007.w,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x389) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end end
--e4 function c37900007.op2(e,tp,eg,ep,ev,re,r,rp)
function c37900007.tgf4(c,e,sp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x389) and c:IsCanBeSpecialSummoned(e,0,sp,false,false) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c37900007.w,e,tp),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp)
and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,c:GetCode()) if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c37900007.con3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c37900007.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37900007.w,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c37900007.op4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c37900007.w,tp,LOCATION_GRAVE,0,nil,e,tp)
if ct<=0 or g:GetCount()==0 then return end
ct=math.min(ct,g:GetClassCount(Card.GetCode))
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,ct,ct)
if sg and sg:GetCount()>0 then
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
tc=sg:GetNext()
end
end
end
end end
\ No newline at end of file
--欢迎来到神隐之乡 --欢迎来到神隐之乡
local m=37900008 function c37900008.initial_effect(c)
local cm=_G["c"..m] local e1=Effect.CreateEffect(c)
Duel.LoadScript("c16199990.lua") e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES)
function cm.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE)
local e1=rsef.ACT(c,nil,nil,{1,m,1},"se,th,sp",nil,nil,nil,cm.tg,cm.thop) e1:SetCode(EVENT_FREE_CHAIN)
--sset e1:SetCountLimit(1,37900008+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c37900008.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,m+100) e2:SetCountLimit(1,47900008)
e2:SetCost(cm.sscost) e2:SetCost(c37900008.cost)
e2:SetTarget(cm.sstg) e2:SetTarget(c37900008.tg)
e2:SetOperation(cm.ssop) e2:SetOperation(c37900008.op)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,4))
e4:SetCategory(CATEGORY_DAMAGE+CATEGORY_DEFCHANGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetOperation(cm.desop)
c:RegisterEffect(e4)
end end
function cm.filter(c,e,tp) function c37900008.q(c)
return (c:IsSetCard(0x389) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or (c:IsSetCard(0xce0) and c:IsAbleToHand()) return c:IsSetCard(0xce0) and c:IsAbleToHand()
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c37900008.w(c,e,tp)
if chk==0 then return true end return c:IsSetCard(0x389) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.thop(e,tp) function c37900008.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT) if (Duel.IsExistingMatchingCard(c37900008.q,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(c37900008.w,tp,LOCATION_DECK,0,1,nil,e,tp)) and Duel.SelectEffectYesNo(tp,c,aux.Stringid(37900008,2)) then
local sg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if Duel.IsExistingMatchingCard(c37900008.q,tp,LOCATION_DECK,0,1,nil) and not Duel.IsExistingMatchingCard(c37900008.w,tp,LOCATION_DECK,0,1,nil,e,tp) then
if sg:GetCount()>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=sg:GetFirst() local g=Duel.SelectMatchingCard(tp,c37900008.q,tp,LOCATION_DECK,0,1,1,nil)
local op=0 if g:GetCount()>0 then
local a=tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsSetCard(0x389) Duel.SendtoHand(g,tp,REASON_EFFECT)
local b=tc:IsAbleToHand() and tc:IsSetCard(0xce0) Duel.ConfirmCards(1-tp,g)
if a and b then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif a then
op=Duel.SelectOption(tp,aux.Stringid(m,1))
elseif b then
op=Duel.SelectOption(tp,aux.Stringid(m,2))+1
end end
end
if not Duel.IsExistingMatchingCard(c37900008.q,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c37900008.w,tp,LOCATION_DECK,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37900008.w,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
g:GetFirst():RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
g:GetFirst():RegisterEffect(e2,true)
end
end
end
if Duel.IsExistingMatchingCard(c37900008.q,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c37900008.w,tp,LOCATION_DECK,0,1,nil,e,tp) then
local op=Duel.SelectOption(tp,aux.Stringid(37900008,0),aux.Stringid(37900008,1))
if op==0 then if op==0 then
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local e1=Effect.CreateEffect(e:GetHandler()) local g=Duel.SelectMatchingCard(tp,c37900008.q,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37900008.w,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) g:GetFirst():RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
end g:GetFirst():RegisterEffect(e2,true)
Duel.SpecialSummonComplete() end
else end
Duel.SendtoHand(tc,tp,REASON_EFFECT)
end end
end end
end end
end
function cm.solvefun(g,tp)
local tc=g:GetFirst()
local b1=tc:IsType(TYPE_MONSTER) and tc:IsSetCard(0xce0) and tc:IsAbleToHand()
local b2=tc:IsSetCard(0xce0) and tc:IsAbleToGrave()
if b1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end end
function cm.sscost(e,tp,eg,ep,ev,re,r,rp,chk) function c37900008.cost(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 local c=e:GetHandler()
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,c) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,nil)
end end
function cm.thcheck(c) function c37900008.e(c)
return (c:IsSetCard(0xce0) or c:IsSetCard(0x389)) and c:IsAbleToHand() return (c:IsSetCard(0x389) or c:IsSetCard(0xce0)) and c:IsAbleToHand()
end end
function cm.sstg(e,tp,eg,ep,ev,re,r,rp,chk) function c37900008.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thcheck,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c37900008.e,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.ssop(e,tp,eg,ep,ev,re,r,rp) function c37900008.op(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.thcheck,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c37900008.e,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,tp,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
--黑白魔法使 --黑白魔法使
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900011.initial_effect(c)
local m,cm = rscf.DefineCard(37900011) aux.AddXyzProcedure(c,nil,6,2,c37900011.ovfilter,aux.Stringid(37900011,0),2,c37900011.xyzop)
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2,cm.ovfilter,aux.Stringid(m,0),2,cm.xyzop)
c:EnableReviveLimit() c:EnableReviveLimit()
--recover
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_RECOVER) e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCost(rscost.rmxyz(1)) e1:SetCost(c37900011.cost)
e1:SetTarget(cm.rectg) e1:SetTarget(c37900011.tg)
e1:SetOperation(cm.recop) e1:SetOperation(c37900011.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Pos Change
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SET_POSITION) e2:SetCode(EFFECT_SET_POSITION)
...@@ -26,7 +19,6 @@ function cm.initial_effect(c) ...@@ -26,7 +19,6 @@ function cm.initial_effect(c)
e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(POS_FACEUP_DEFENSE) e2:SetValue(POS_FACEUP_DEFENSE)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DEFENSE_ATTACK) e3:SetCode(EFFECT_DEFENSE_ATTACK)
...@@ -35,62 +27,57 @@ function cm.initial_effect(c) ...@@ -35,62 +27,57 @@ function cm.initial_effect(c)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x389)) e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x389))
e3:SetValue(1) e3:SetValue(1)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--material
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1) e4:SetCountLimit(1)
e4:SetTarget(cm.mttg) e4:SetTarget(c37900011.tg4)
e4:SetOperation(cm.mtop) e4:SetOperation(c37900011.op4)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.ovfilter(c) function c37900011.ovfilter(c)
return c:IsFaceup() and c:IsCode(37900096) return c:IsFaceup() and c:IsCode(37900096)
end end
function cm.xyzop(e,tp,chk) function c37900011.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end if chk==0 then return Duel.GetFlagEffect(tp,37900011)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) Duel.RegisterFlagEffect(tp,37900011,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end end
function cm.recfilter(c) function c37900011.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c37900011.recfilter(c)
local atk,def = c:GetAttack(),c:GetDefense() local atk,def = c:GetAttack(),c:GetDefense()
if def <= 0 then def = 0 end if def <= 0 then def = 0 end
return c:IsFaceup() and atk+def > 0 return c:IsFaceup() and atk+def > 0
end end
function cm.rectg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c37900011.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.recfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c37900011.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
if chk==0 then return Duel.IsExistingTarget(cm.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
local tc = g:GetFirst()
local atk,def = tc:GetAttack(),tc:GetDefense()
if def <= 0 then def = 0 end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,atk+def)
end end
function cm.recop(e,tp,eg,ep,ev,re,r,rp) function c37900011.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if tc:IsRelateToEffect(e) and tc:IsFaceup() then local g=Duel.SelectMatchingCard(tp,c37900011.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local atk,def = tc:GetAttack(),tc:GetDefense() if g:GetCount()>0 then
if def <= 0 then def = 0 end local atk,def = g:GetFirst():GetAttack(),g:GetFirst():GetDefense()
if atk+def > 0 then Duel.Recover(tp,atk+def,REASON_EFFECT)
Duel.Recover(tp,atk+def,REASON_EFFECT)
end
end end
end end
function cm.mtfilter(c) function c37900011.mtfilter(c)
return c:IsSetCard(0x389) and c:IsType(TYPE_MONSTER) and c:IsCanOverlay() return c:IsSetCard(0x389) and c:IsType(TYPE_MONSTER) and c:IsCanOverlay()
end end
function cm.mttg(e,tp,eg,ep,ev,re,r,rp,chk) function c37900011.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(cm.mtfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end and Duel.IsExistingMatchingCard(c37900011.mtfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp) function c37900011.op4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,cm.mtfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c37900011.mtfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Overlay(c,g) Duel.Overlay(c,g)
end end
end end
\ No newline at end of file
--色彩艳丽的门卫 --红魔馆门番·华人小姑娘
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900012.initial_effect(c)
local m,cm = rscf.DefineCard(37900012) aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),7,2,c37900012.ovfilter,aux.Stringid(37900012,1),2,c37900012.xyzop)
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),7,2,cm.ovfilter,aux.Stringid(m,0),2,cm.xyzop)
c:EnableReviveLimit() c:EnableReviveLimit()
local e4 = rsef.I(c,"des",nil,"des,sp,dd",nil,LOCATION_MZONE,nil,rscost.rmxyz(1),rsop.target(aux.TRUE,"des",0,LOCATION_MZONE,true),cm.desop)
--battle indes
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetCountLimit(2) e1:SetCountLimit(2)
e1:SetValue(cm.valcon) e1:SetValue(c37900012.valcon)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--target/atk protection
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE) e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetValue(cm.atlimit) e2:SetValue(c37900012.atlimit)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
...@@ -29,38 +23,84 @@ function cm.initial_effect(c) ...@@ -29,38 +23,84 @@ function cm.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0) e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(cm.tglimit) e3:SetTarget(c37900012.tglimit)
e3:SetValue(aux.tgoval) e3:SetValue(aux.tgoval)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_DECKDES)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(c37900012.cost)
e4:SetTarget(c37900012.tg)
e4:SetOperation(c37900012.op)
c:RegisterEffect(e4)
end end
function cm.ovfilter(c) function c37900012.ovfilter(c)
return c:IsFaceup() and c:IsCode(37900097) return c:IsFaceup() and c:IsCode(37900097)
end end
function cm.xyzop(e,tp,chk) function c37900012.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end if chk==0 then return Duel.GetFlagEffect(tp,37900012)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) Duel.RegisterFlagEffect(tp,37900012,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end end
function cm.atlimit(e,c) function c37900012.valcon(e,re,r,rp)
return r & (REASON_BATTLE + REASON_EFFECT) ~=0
end
function c37900012.atlimit(e,c)
return c~=e:GetHandler() return c~=e:GetHandler()
end end
function cm.tglimit(e,c) function c37900012.tglimit(e,c)
return c~=e:GetHandler() return c~=e:GetHandler()
end end
function cm.valcon(e,re,r,rp) function c37900012.cost(e,tp,eg,ep,ev,re,r,rp,chk)
return r & (REASON_BATTLE + REASON_EFFECT) ~=0 if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c37900012.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),1-tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,1-tp,LOCATION_DECK)
end end
function cm.desop(e,tp) function c37900012.t(c,e,tp)
local g = Duel.GetFieldGroup(tp,0,LOCATION_MZONE) return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local ct = Duel.Destroy(g,REASON_EFFECT)
if ct <= 0 then return end
local sg = Duel.GetMatchingGroup(cm.spfilter,tp,0,LOCATION_DECK,nil,e,tp)
local ft = Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if #sg <= 0 or ft <= 0 then return end
local sct = math.min(#sg, ft ,ct)
if rscon.bsdcheck(1-tp) then sct = 1 end
if not rshint.SelectYesNo(1-tp,"sp") then return end
rsgf.SelectSpecialSummon(sg,1-tp,aux.TRUE,sct,sct,nil,{0,1-tp,1-tp,false,false,POS_FACEUP_ATTACK,nil,{"dis,dise","fatk",0}},e,tp)
end end
function cm.spfilter(c,e,tp) function c37900012.op(e,tp,eg,ep,ev,re,r,rp)
return c:IsCanBeSpecialSummoned(e,0,1-tp,false,false,POS_FACEUP_ATTACK,1-tp) local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
if g:GetCount()>0 then
local ct=Duel.Destroy(g,REASON_EFFECT)
local sg=Duel.GetMatchingGroup(c37900012.t,tp,0,LOCATION_DECK,nil,e,tp)
if ct>0 and sg:GetCount()>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(37900012,0)) then
Duel.BreakEffect()
local ct2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if ct>ct2 then ct=ct2 end
if ct>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local gg=Duel.SelectMatchingCard(1-tp,c37900012.t,tp,0,LOCATION_DECK,ct,ct,nil,e,tp)
if Duel.SpecialSummon(gg,0,1-tp,1-tp,false,false,POS_FACEUP)>0 then
local tc=gg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
tc=gg:GetNext()
end
end
end
end
end end
\ No newline at end of file
--隐居地上的月球公主 --隐居地上的月球公主
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900013.initial_effect(c)
local m,cm = rscf.DefineCard(37900013) c:SetSPSummonOnce(37900013)
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x389),3,3) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x389),3,3)
local e1 = rsef.I(c,"td",1,"td,se,th",nil,LOCATION_MZONE,nil,nil,cm.tdtg,cm.tdop) local e0=Effect.CreateEffect(c)
local e3,e4 = rsef.SV_Card(c,"indb,rdamb",1,"sr",LOCATION_MZONE) e0:SetDescription(aux.Stringid(37900013,0))
local e5= rsef.STO(c,EVENT_TO_GRAVE,"sp",nil,"sp","de",nil,nil,rsop.target(cm.spfilter,"sp",rsloc.dg),cm.spop) e0:SetType(EFFECT_TYPE_FIELD)
local e6 = rsef.SV_Card(c,"lsmat~",1,"cd") e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
--extra material e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c37900013.linkcon)
e0:SetOperation(c37900013.linkop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e2:SetValue(1)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(cm.linkcon)
e2:SetOperation(cm.linkop)
e2:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
c:RegisterEffect(e3)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(c37900013.tgtg)
e1:SetOperation(c37900013.tgop)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCategory(CATEGORY_TODECK+CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c37900013.tg)
e4:SetOperation(c37900013.op)
c:RegisterEffect(e4)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e6:SetValue(1)
c:RegisterEffect(e6)
end end
function cm.spfilter(c,e,tp) function c37900013.lmfilter(c,lc,tp,og,lmat)
return rscf.spfilter2()(c,e,tp) and c:IsCode(37900098)
end
function cm.spop(e,tp)
rsop.SelectSpecialSummon(tp,aux.NecroValleyFilter(cm.spfilter),tp,rsloc.dg,0,1,1,nil,{},e,tp)
end
function cm.lmfilter(c,lc,tp,og,lmat)
return c:IsFaceup() and c:IsCanBeLinkMaterial(lc) and c:IsLinkCode(37900098) return c:IsFaceup() and c:IsCanBeLinkMaterial(lc) and c:IsLinkCode(37900098)
and Duel.GetLocationCountFromEx(tp,tp,c,lc)>0 and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_LMATERIAL) and Duel.GetLocationCountFromEx(tp,tp,c,lc)>0 and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_LMATERIAL)
and (not og or og:IsContains(c)) and (not lmat or lmat==c) and (not og or og:IsContains(c)) and (not lmat or lmat==c)
end end
function cm.linkcon(e,c,og,lmat,min,max) function c37900013.linkcon(e,c,og,lmat,min,max)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(cm.lmfilter,tp,LOCATION_MZONE,0,1,nil,c,tp,og,lmat) return Duel.IsExistingMatchingCard(c37900013.lmfilter,tp,LOCATION_MZONE,0,1,nil,c,tp,og,lmat)
end end
function cm.linkop(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max) function c37900013.linkop(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max)
local mg=Duel.SelectMatchingCard(tp,cm.lmfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp,og,lmat) local mg=Duel.SelectMatchingCard(tp,c37900013.lmfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp,og,lmat)
c:SetMaterial(mg) c:SetMaterial(mg)
Duel.SendtoGrave(mg,REASON_MATERIAL+REASON_LINK) Duel.SendtoGrave(mg,REASON_MATERIAL+REASON_LINK)
end end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) function c37900013.tgfilter(c,e,tp)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end return c:IsCode(37900098) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end end
function cm.thfilter(c) function c37900013.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsSetCard(0x389) and c:IsAbleToHand() if chk==0 then return Duel.IsExistingMatchingCard(c37900013.tgfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp) function c37900013.tgop(e,tp,eg,ep,ev,re,r,rp)
rsop.SelectToDeck(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil,{nil,1,REASON_EFFECT }) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if not rsop.CheckOperateSuccess(LOCATION_DECK) then return end local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c37900013.tgfilter,e,tp),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.ShuffleDeck(tp) if g:GetCount()>0 then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.ConfirmDecktop(p,3)
local g=Duel.GetDecktopGroup(p,3)
local sg = g:Filter(cm.thfilter,nil)
if #sg > 0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sg)
Duel.ShuffleHand(p)
end end
Duel.ShuffleDeck(p) end
function c37900013.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,3)
local fg=g:Filter(Card.IsAbleToHand,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) and fg:GetCount()==3 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c37900013.q(c)
return c:IsAbleToHand() and c:IsSetCard(0x389)
end
function c37900013.op(e,tp,eg,ep,ev,re,r,rp)
local ag=Duel.GetDecktopGroup(tp,3)
local fg=ag:Filter(Card.IsAbleToHand,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoDeck(g,tp,1,REASON_EFFECT)>0 and fg:GetCount()==3 then
Duel.ConfirmDecktop(tp,3)
Duel.DisableShuffleCheck()
if fg:IsExists(c37900013.q,1,nil) then
local sg=fg:Filter(c37900013.q,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
g:Sub(sg)
end
Duel.ShuffleDeck(tp)
end
end end
\ No newline at end of file
--永远的巫女 --永远的巫女
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900014.initial_effect(c)
local m,cm = rscf.DefineCard(37900014) aux.AddXyzProcedure(c,nil,6,2,c37900014.ovfilter,aux.Stringid(37900014,0),2,c37900014.xyzop)
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2,cm.ovfilter,aux.Stringid(m,0),2,cm.xyzop)
c:EnableReviveLimit() c:EnableReviveLimit()
local e3 = rsef.I(c,nil,1,nil,nil,LOCATION_MZONE,nil,
rscost.rmxmat(1),nil,cm.op)
--
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
...@@ -17,44 +11,58 @@ function cm.initial_effect(c) ...@@ -17,44 +11,58 @@ function cm.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetValue(1) e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--def Up local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c37900014.cost)
e3:SetTarget(c37900014.tg)
e3:SetOperation(c37900014.op)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_DEFCHANGE) e4:SetCategory(CATEGORY_DEFCHANGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLE_DESTROYING) e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetCondition(aux.bdocon) e4:SetCondition(aux.bdocon)
e4:SetOperation(cm.defop) e4:SetOperation(c37900014.op4)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.defop(e,tp) function c37900014.ovfilter(c)
local c = rscf.GetFaceUpSelf(e)
if not c then return end
local e1 = rscf.QuickBuff(c,"def+",1000)
end
function cm.ovfilter(c)
return c:IsFaceup() and c:IsCode(37900092) return c:IsFaceup() and c:IsCode(37900092)
end end
function cm.xyzop(e,tp,chk) function c37900014.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end if chk==0 then return Duel.GetFlagEffect(tp,37900014)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) Duel.RegisterFlagEffect(tp,37900014,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end end
function cm.op(e,tp) function c37900014.op4(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetReset(rsrst.ep)
e1:SetValue(cm.indct)
--Duel.RegisterEffect(e1,tp)
if c:IsRelateToEffect(e) and c:IsFaceup() then if c:IsRelateToEffect(e) and c:IsFaceup() then
local e2 = rscf.QuickBuff(c,"atka",1,"rst",rsrst.std_ep) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end end
end end
function cm.indct(e,re,r,rp) function c37900014.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if bit.band(r,REASON_BATTLE)~=0 then if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
return 1 e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
else return 0 end end
function c37900014.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c37900014.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ATTACK_ALL)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e4)
end
end end
\ No newline at end of file
--幽人的庭师 --幽人的庭师
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900015.initial_effect(c)
local m,cm = rscf.DefineCard(37900015) aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),7,2,c37900015.ovfilter,aux.Stringid(37900015,0),2,c37900015.xyzop)
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),7,2,cm.ovfilter,aux.Stringid(m,0),2,cm.xyzop)
c:EnableReviveLimit() c:EnableReviveLimit()
local e1 = rsef.SV_Card(c,"im",cm.imval,"sr",LOCATION_MZONE) local e1=Effect.CreateEffect(c)
local e2 = rsef.SV_Card(c,"indb",cm.dval,"sr",LOCATION_MZONE) e1:SetType(EFFECT_TYPE_SINGLE)
local e3 = rsef.I(c,"pos",1,"pos",nil,LOCATION_MZONE, e1:SetCode(EFFECT_IMMUNE_EFFECT)
nil,rscost.rmxmat(1), e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
rsop.target(cm.pfilter,"pos",LOCATION_MZONE, e1:SetRange(LOCATION_MZONE)
LOCATION_MZONE,true,true,c),cm.pop) e1:SetValue(c37900015.ind2)
local e4 = rsef.STO(c,EVENT_BATTLE_DESTROYING,"def",nil, c:RegisterEffect(e1)
"def",nil,aux.bdcon,nil,nil,cm.bdop) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(c37900015.ind1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c37900015.cost)
e3:SetTarget(c37900015.tg)
e3:SetOperation(c37900015.op)
c:RegisterEffect(e3)
end end
function cm.ovfilter(c) function c37900015.ovfilter(c)
return c:IsFaceup() and c:IsCode(37900095) return c:IsFaceup() and c:IsCode(37900095)
end end
function cm.xyzop(e,tp,chk) function c37900015.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end if chk==0 then return Duel.GetFlagEffect(tp,37900015)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) Duel.RegisterFlagEffect(tp,37900015,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end end
function cm.imval(e,re) function c37900015.ind1(e,c)
local def1, def2 = re:GetHandler():GetBaseDefense(), e:GetHandler():GetDefense() local def1=e:GetHandler():GetDefense()
if def1 < 0 or def2 < 0 then return false end return c:GetDefense()>def1 and c:IsFaceup()
return re:IsActiveType(TYPE_MONSTER) and def1 < def2
end end
function cm.dval(e,c) function c37900015.ind2(e,te)
local def = e:GetHandler():GetDefense() return te:IsActiveType(TYPE_MONSTER) and te:GetHandler():GetBaseDefense()<e:GetHandler():GetDefense()
if def < 0 then return false end
if c:IsDefensePos() and Duel.GetAttacker()==c then
return c:IsAttackAbove(def + 1)
else
return c:IsDefenseAbove(def + 1)
end
end end
function cm.pfilter(c) function c37900015.cost(e,tp,eg,ep,ev,re,r,rp,chk)
return not c:IsAttackPos() and c:IsCanChangePosition() and c:IsType(TYPE_EFFECT) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function cm.pop(e,tp) function c37900015.q(c)
local c = rscf.GetFaceUpSelf(e) return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsPosition(POS_FACEUP_DEFENSE) and c:IsCanChangePosition()
local g = Duel.GetMatchingGroup(cm.pfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c)
if #g <= 0 or Duel.ChangePosition(g,POS_FACEUP_ATTACK) <= 0 or not c then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCondition(cm.tdcon)
e1:SetOperation(cm.tdop)
e1:SetReset(rsrst.std_ep)
c:RegisterEffect(e1)
end end
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp) function c37900015.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler() local c=e:GetHandler()
local tc = c:GetBattleTarget() local g=Duel.GetMatchingGroup(c37900015.q,tp,LOCATION_MZONE,LOCATION_MZONE,c)
local def = math.max(c:GetDefense() - 1, 0) if chk==0 then return g:GetCount()>0 end
return tc and tc:IsFaceup() and (tc:IsDefenseBelow(def) or tc:IsAttackBelow(def)) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp) function c37900015.op(e,tp,eg,ep,ev,re,r,rp)
rshint.Card(m) local c=e:GetHandler()
local tc = e:GetHandler():GetBattleTarget() local g=Duel.GetMatchingGroup(c37900015.q,tp,LOCATION_MZONE,LOCATION_MZONE,c)
local atk = tc:GetBaseAttack() if g:GetCount()>0 then
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) > 0 and tc:IsLocation(rsloc.de) and atk > 0 then if Duel.ChangePosition(g,POS_FACEUP_ATTACK)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.BreakEffect() local e3=Effect.CreateEffect(c)
Duel.Damage(1-tp,atk,REASON_EFFECT) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_START)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(c37900015.condition)
e3:SetTarget(c37900015.target)
e3:SetOperation(c37900015.thop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
end
end end
end end
function cm.bdop(e,tp) function c37900015.cfilter(c)
local c = rscf.GetFaceUpSelf(e) return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsCode(89631139)
if not c then return end end
local e1 = rscf.QuickBuff(c,"def+",1000) function c37900015.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:GetDefense()>bc:GetAttack() or (not bc:IsType(TYPE_LINK) and c:GetDefense()>bc:GetDefense())
end
function c37900015.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if chk==0 then return bc:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,bc,1,1-tp,LOCATION_MZONE)
end
function c37900015.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsRelateToBattle(e) then
if Duel.SendtoDeck(bc,nil,2,REASON_EFFECT)>0 then
local atk=bc:GetBaseAttack()
if atk>0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
end end
\ No newline at end of file
--完美潇洒的女仆长 --完美潇洒的女仆长
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900016.initial_effect(c)
local m,cm = rscf.DefineCard(37900016) c:SetSPSummonOnce(37900016)
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x389),3,3) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x389),3,3)
local e1 = rsef.SV_Card(c,"lsmat~",1,"cd")
local e3 = rsef.FV_Player(c,"act~",1,nil,{0,1},nil,LOCATION_MZONE,
rscon.phbp)
local e6 = rsef.I(c,"sp",1,"td,sp",nil,LOCATION_MZONE,nil,nil,
rsop.target({Card.IsAbleToDeck,"td",LOCATION_HAND },
{cm.spfilter,"sp",rsloc.hg}),cm.spop)
--extra material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(37900016,0))
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_EXTRA) e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(cm.linkcon) e2:SetCondition(c37900016.linkcon)
e2:SetOperation(cm.linkop) e2:SetOperation(c37900016.linkop)
e2:SetValue(SUMMON_TYPE_LINK) e2:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--battle
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) e4:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
...@@ -33,27 +23,66 @@ function cm.initial_effect(c) ...@@ -33,27 +23,66 @@ function cm.initial_effect(c)
e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e5:SetValue(1) e5:SetValue(1)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,1)
e3:SetCondition(c37900016.actcon)
e3:SetValue(1)
c:RegisterEffect(e3)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_SPSUMMON+CATEGORY_SPECIAL_SUMMON)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c37900016.tg)
e1:SetOperation(c37900016.op)
c:RegisterEffect(e1)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e6:SetValue(1)
c:RegisterEffect(e6)
end end
function cm.lmfilter(c,lc,tp,og,lmat) function c37900016.lmfilter(c,lc,tp,og,lmat)
return c:IsFaceup() and c:IsCanBeLinkMaterial(lc) and c:IsLinkCode(37900093) return c:IsFaceup() and c:IsCanBeLinkMaterial(lc) and c:IsLinkCode(37900093)
and Duel.GetLocationCountFromEx(tp,tp,c,lc)>0 and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_LMATERIAL) and Duel.GetLocationCountFromEx(tp,tp,c,lc)>0 and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_LMATERIAL)
and (not og or og:IsContains(c)) and (not lmat or lmat==c) and (not og or og:IsContains(c)) and (not lmat or lmat==c)
end end
function cm.linkcon(e,c,og,lmat,min,max) function c37900016.linkcon(e,c,og,lmat,min,max)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(cm.lmfilter,tp,LOCATION_MZONE,0,1,nil,c,tp,og,lmat) return Duel.IsExistingMatchingCard(c37900016.lmfilter,tp,LOCATION_MZONE,0,1,nil,c,tp,og,lmat)
end end
function cm.linkop(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max) function c37900016.linkop(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max)
local mg=Duel.SelectMatchingCard(tp,cm.lmfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp,og,lmat) local mg=Duel.SelectMatchingCard(tp,c37900016.lmfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp,og,lmat)
c:SetMaterial(mg) c:SetMaterial(mg)
Duel.SendtoGrave(mg,REASON_MATERIAL+REASON_LINK) Duel.SendtoGrave(mg,REASON_MATERIAL+REASON_LINK)
end end
function cm.spfilter(c,e,tp) function c37900016.actcon(e)
return c:IsSetCard(0x389) and rscf.spfilter2()(c,e,tp) local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()==e:GetHandler():GetControler() and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end end
function cm.spop(e,tp) function c37900016.q(c,e,tp)
if rsop.SelectOperate("tdb",tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil,{}) > 0 and rsop.CheckOperateCorrectly(LOCATION_DECK) then return c:IsSetCard(0x389) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
rsop.SelectOperate("sp",tp,aux.NecroValleyFilter(cm.spfilter),tp,rsloc.hg,0,1,1,nil,{},e,tp) end
end function c37900016.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(c37900016.q,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c37900016.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoDeck(g,tp,SEQ_DECKBOTTOM,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(c37900016.q,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c37900016.q,e,tp),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end end
\ No newline at end of file
--不明的魔法之元 --不明的魔法之元
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900017.initial_effect(c)
local m,cm = rscf.DefineCard(37900017) aux.AddXyzProcedure(c,nil,6,2,c37900017.ovfilter,aux.Stringid(37900017,0),2,c37900017.xyzop)
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2,cm.ovfilter,aux.Stringid(m,0),2,cm.xyzop)
c:EnableReviveLimit() c:EnableReviveLimit()
--[[local e1 = rsef.QO(c,nil,"axmat",1,nil,nil,LOCATION_MZONE,nil, local e0=Effect.CreateEffect(c)
rscost.rmxmat(1),rsop.target({Card.IsCanOverlay,"axmat", e0:SetType(EFFECT_TYPE_SINGLE)
LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c}, e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
{cm.xyzfilter,"dum"}),cm.matop)]]-- e0:SetRange(LOCATION_MZONE)
local e1 = rsef.I(c,"atk",1,"atk",nil,LOCATION_MZONE,nil, e0:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
rscost.rmxmat(1),nil,cm.atkop) e0:SetCountLimit(2)
local e2 = rsef.FV_Card(c,"im",cm.imval, e0:SetValue(c37900017.valcon)
aux.TargetBoolFunction(Card.IsType,TYPE_SPELL+TYPE_TRAP), c:RegisterEffect(e0)
{LOCATION_ONFIELD,0},nil,LOCATION_MZONE) local e1=Effect.CreateEffect(c)
local e3 = rsef.SV_Card(c,"indct",rsval.indbae(),"sr",LOCATION_MZONE, e1:SetDescription(aux.Stringid(37900017,1))
nil,nil,nil,2) e1:SetType(EFFECT_TYPE_SINGLE)
end e1:SetCode(EFFECT_IMMUNE_EFFECT)
function cm.atkop(e,tp) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
local e1 = rsef.FV_Card({e:GetHandler(),tp},"def+",500, e1:SetRange(LOCATION_SZONE)
aux.TargetBoolFunction(Card.IsSetCard,0x389),{LOCATION_MZONE,0}) e1:SetValue(c37900017.efilter)
end local e2=Effect.CreateEffect(c)
function cm.ovfilter(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_SZONE,0)
e2:SetTarget(c37900017.mattg)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c37900017.cost)
e3:SetTarget(c37900017.tg)
e3:SetOperation(c37900017.op)
c:RegisterEffect(e3)
end
function c37900017.ovfilter(c)
return c:IsFaceup() and c:IsCode(37900094) return c:IsFaceup() and c:IsCode(37900094)
end end
function cm.xyzop(e,tp,chk) function c37900017.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end if chk==0 then return Duel.GetFlagEffect(tp,37900017)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) Duel.RegisterFlagEffect(tp,37900017,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c37900017.valcon(e,re,r,rp)
return r & (REASON_BATTLE + REASON_EFFECT) ~=0
end
function c37900017.mattg(e,c)
return c:IsSetCard(0x389) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsFaceup()
end
function c37900017.efilter(e,te)
return not te:GetOwner():IsSetCard(0x389)
end
function c37900017.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c37900017.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end end
function cm.xyzfilter(c) function c37900017.q(c)
return c:IsType(TYPE_XYZ) return c:IsFaceup() and c:IsSetCard(0x389)
end end
function cm.matop(e,tp) function c37900017.op(e,tp,eg,ep,ev,re,r,rp)
local c = rscf.GetFaceUpSelf(e) local c=e:GetHandler()
if not c or not c:IsType(TYPE_XYZ) then return end local e1=Effect.CreateEffect(c)
local og,tc = rsop.SelectCards("axmat",tp,cm.matfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e) e1:SetType(EFFECT_TYPE_FIELD)
if tc then e1:SetTargetRange(LOCATION_MZONE,0)
rsop.Overlay(e,c,tc) e1:SetCode(EFFECT_UPDATE_ATTACK)
end e1:SetTarget(c37900017.ttg)
e1:SetValue(500)
Duel.RegisterEffect(e1,tp)
end end
function cm.matfilter(c,e) function c37900017.ttg(e,c)
return c:IsCanOverlay() and not c:IsImmuneToEffect(e) return c:IsFaceup() and c:IsSetCard(0x389)
end end
function cm.imval(e,re)
local rc = re:GetHandler()
return rsval.imes(e,re) and rc ~= e:GetOwner() and rc:IsSetCard(0x389)
end
\ No newline at end of file
--不老不死的魔女 --不老不死的魔女
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900029.initial_effect(c)
local m,cm = rscf.DefineCard(37900029)
function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
local e1 = rsef.FC(c,EVENT_TO_GRAVE,nil,nil,nil,LOCATION_MZONE,nil,cm.ctop) local e0=Effect.CreateEffect(c)
local e2 = rsef.QO(c,nil,"ae",1,nil,nil,LOCATION_MZONE,nil,rscost.reglabel(100),cm.tg,cm.op) e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
local e3 = rsef.STO(c,EVENT_TO_GRAVE,"sp",{1,m},"sp","de",nil,nil,rsop.target(rscf.spfilter2(),"sp"),cm.spop) e0:SetCode(EVENT_TO_GRAVE)
e0:SetRange(LOCATION_MZONE)
e0:SetOperation(c37900029.op0)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_MAIN_END+TIMINGS_CHECK_MONSTER+TIMING_SSET)
e1:SetCountLimit(1)
e1:SetTarget(c37900029.tg)
e1:SetOperation(c37900029.op)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,37900029)
e2:SetTarget(c37900029.tg2)
e2:SetOperation(c37900029.op2)
c:RegisterEffect(e2)
end end
function cm.spcon(e) function c37900029.op0(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) if eg:GetCount()>0 then
local ag=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if ag:GetCount()>0 then
local tc=ag:GetFirst()
while tc do
tc:AddCounter(0x1389,eg:GetCount())
tc=ag:GetNext()
end
end
end
end end
function cm.spop(e,tp) function c37900029.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = rscf.GetSelf(e) local c=e:GetHandler()
if c then if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x1389,4,REASON_COST) end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) local ct=Duel.GetCounter(tp,1,1,0x1389)
local op=100
if ct<8 then
Duel.RemoveCounter(tp,1,1,0x1389,4,REASON_COST)
e:SetValue(4)
end
if ct>=8 and ct<12 then
op=Duel.SelectOption(tp,aux.Stringid(37900029,5),aux.Stringid(37900029,6))
end
if ct>=12 and ct<16 then
op=Duel.SelectOption(tp,aux.Stringid(37900029,5),aux.Stringid(37900029,6),aux.Stringid(37900029,7))
end
if ct>=16 and ct<20 then
op=Duel.SelectOption(tp,aux.Stringid(37900029,5),aux.Stringid(37900029,6),aux.Stringid(37900029,7),aux.Stringid(37900029,8))
end
if ct>=20 then
op=Duel.SelectOption(tp,aux.Stringid(37900029,5),aux.Stringid(37900029,6),aux.Stringid(37900029,7),aux.Stringid(37900029,8),aux.Stringid(37900029,9))
end
if op==0 then
Duel.RemoveCounter(tp,1,1,0x1389,4,REASON_COST)
e:SetValue(4)
end
if op==1 then
Duel.RemoveCounter(tp,1,1,0x1389,8,REASON_COST)
e:SetValue(8)
end
if op==2 then
Duel.RemoveCounter(tp,1,1,0x1389,12,REASON_COST)
e:SetValue(12)
e:SetCategory(CATEGORY_ATKCHANGE)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,c,0,0,4000)
end end
if op==3 then
Duel.RemoveCounter(tp,1,1,0x1389,16,REASON_COST)
e:SetValue(16)
e:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,c,0,0,4000)
Duel.SetOperationInfo(0,CATEGORY_DEFCHANGE,c,0,0,4000)
end
if op==4 then
Duel.RemoveCounter(tp,1,1,0x1389,20,REASON_COST)
e:SetValue(20)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,c,0,0,4000)
Duel.SetOperationInfo(0,CATEGORY_DEFCHANGE,c,0,0,4000)
e:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end end
function cm.cfilter(c) function c37900029.q(c,e,tp)
return c:IsFaceup() and c:IsCanAddCounter(0x1389,1) return not c:IsType(TYPE_EFFECT) and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp)>0
end end
function cm.ctop(e,tp,eg) function c37900029.op(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local c=e:GetHandler()
for tc in aux.Next(g) do local rct=e:GetValue()
tc:AddCounter(0x1389,#eg) if c:IsRelateToEffect(e) and c:IsFaceup() then
if rct>=4 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37900029,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end end
end if rct>=8 then
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) local e2=Effect.CreateEffect(c)
local c = e:GetHandler() e2:SetDescription(aux.Stringid(37900029,1))
if chk == 0 then e2:SetType(EFFECT_TYPE_SINGLE)
if e:GetLabel() ~= 100 then return false end e2:SetCode(EFFECT_IMMUNE_EFFECT)
e:SetLabel(0) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
return Duel.IsCanRemoveCounter(tp,1,1,0x1389,4,REASON_EFFECT) e2:SetRange(LOCATION_SZONE)
end e2:SetValue(c37900029.efilter)
local ct = Duel.GetCounter(tp,1,1,0x1389) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ct = math.min(ct,20) c:RegisterEffect(e2)
local list = { }
for i = 4, ct do
if Duel.IsCanRemoveCounter(tp,1,1,0x1389,ct,REASON_EFFECT) then
table.insert(list,ct)
end
end end
local rct = Duel.AnnounceNumber(tp,table.unpack(list)) if rct>=12 then
Duel.RemoveCounter(tp,1,1,0x1389,rct,REASON_EFFECT) local atk=c:GetBaseAttack()*2
local cate = 0 local e1=Effect.CreateEffect(c)
if rct >= 12 then e1:SetType(EFFECT_TYPE_SINGLE)
cate = cate | CATEGORY_ATKCHANGE e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(37900029,2))
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ATTACK_ALL)
e3:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
end end
if rct >= 16 then if rct>=16 then
cate = cate | CATEGORY_DEFCHANGE local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetValue(rct*100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
if rct>=20 and Duel.IsExistingMatchingCard(c37900029.q,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(37900029,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37900029.q,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetDescription(aux.Stringid(37900029,4))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetOperation(c37900029.opr)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
g:GetFirst():RegisterEffect(e1,true)
if Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end end
if rct >= 20 then
cate = cate | (CATEGORY_SPECIAL_SUMMON + CATEGORY_DRAW)
end end
e:SetCategory(cate)
e:SetValue(rct)
end end
function cm.op(e,tp) function c37900029.efilter(e,te)
local rct = e:GetValue() return te:GetOwner()~=e:GetOwner()
local c = rscf.GetFaceUpSelf(e) end
if rct >= 4 and c then function c37900029.opr(e,tp,eg,ep,ev,re,r,rp)
local e1 = rsef.SV_Card(c,"indb",1,nil,nil,nil,rsrst.std_ep) local c=e:GetHandler()
end if c:IsAbleToDeck() then
if rct >= 8 and c then Duel.SendtoDeck(c,nil,2,REASON_RULE)
local e2 = rsef.SV_Card(c,"im",rsval.imes,nil,nil,nil,rsrst.std_ep)
end
if rct >= 12 and c then
local e3 = rsef.SV_Card(c,"fatk",c:GetAttack() * 2,nil,nil,nil,rsrst.std_dis+rsrst.ep)
local e4 = rsef.SV_Card(c,"atka",1,nil,nil,nil,rsrst.std_ep)
end
if rct >= 16 and c then
local e5,e6 = rsef.SV_Card(c,"atk+,def+",rct * 100,nil,nil,nil,rsrst.std_dis+rsrst.ep)
end
if rct >= 20 then
local sg = Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if #sg > 0 and Duel.IsPlayerCanDraw(tp,1) and rshint.SelectYesNo(tp,"sp") then
if rsgf.SelectSpecialSummon(sg,tp,aux.TRUE,1,1,nil,{0,tp,tp,false,false,POS_FACEUP,nil,nil,"td"},e,tp) > 0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end end
end end
function cm.spfilter(c,e,tp) function c37900029.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
return rscf.spfilter2()(c,e,tp) and c:IsType(TYPE_LINK) and not c:IsType(TYPE_EFFECT) local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_GRAVE)
end
function c37900029.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end end
\ No newline at end of file
--护界神·提露密努斯·艾斯特 --护界神·提露密努斯·艾斯特
if not pcall(function() dofile("expansions/script/c37900000.lua") end) then dofile("script/c37900000.lua") end function c37900030.initial_effect(c)
local m,cm = rscf.DefineCard(37900030) aux.AddXyzProcedure(c,nil,8,3,c37900030.ovfilter,aux.Stringid(37900030,0))
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,8,2,cm.ovfilter,aux.Stringid(m,0))
c:EnableReviveLimit() c:EnableReviveLimit()
--atk local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e3:SetValue(1)
c:RegisterEffect(e3)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetRange(LOCATION_MZONE)
e0:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e0:SetCountLimit(2)
e0:SetValue(c37900030.valcon)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1)) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(rscon.sumtypes("xyz")) e1:SetCondition(c37900030.atkcon)
e1:SetCost(cm.atkcost) e1:SetCost(c37900030.atkcost)
e1:SetOperation(cm.atkop) e1:SetOperation(c37900030.atkop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--pos change
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_POSITION) e2:SetCategory(CATEGORY_POSITION)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCost(rscost.rmxyz(1)) --e2:SetCost(c37900030.cost)
e2:SetTarget(cm.target) e2:SetTarget(c37900030.tg)
e2:SetOperation(cm.operation) e2:SetOperation(c37900030.op)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--battle indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e3:SetCountLimit(2)
e3:SetValue(cm.valcon)
c:RegisterEffect(e3)
end end
function cm.ovfilter(c) function c37900030.ovfilter(c)
return c:IsFaceup() and c:IsRank(7) and c:IsSetCard(0x389,0x381) return c:IsFaceup() and c:IsRank(7) and c:IsSetCard(0x389,0x381)
end end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) function c37900030.valcon(e,re,r,rp)
return r & (REASON_BATTLE + REASON_EFFECT) ~=0
end
function c37900030.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c37900030.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>1000 end if chk==0 then return Duel.GetLP(tp)>1000 end
local lp=Duel.GetLP(tp) local lp=Duel.GetLP(tp)
e:SetLabel(lp-1000) e:SetLabel(lp-1000)
Duel.PayLPCost(tp,lp-1000) Duel.PayLPCost(tp,lp-1000)
end end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function c37900030.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -61,32 +65,45 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,32 +65,45 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
end end
function cm.pfilter(c) function c37900030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsAttackPos() and c:IsType(TYPE_EFFECT) and c:IsCanChangePosition() if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.pfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function c37900030.pfilter(c)
local c = rscf.GetSelf(e) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_EFFECT) and c:IsCanChangePosition()
local g=Duel.GetMatchingGroup(cm.pfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
if not c then return end
local e1 = rsef.SC(c,EVENT_BATTLE_START,nil,nil,nil,cm.tgcon,cm.tgop,rsrst.std_ep)
end end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp) function c37900030.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler() local c=e:GetHandler()
local a = Duel.GetAttackTarget() local g=Duel.GetMatchingGroup(c37900030.pfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c)
if not a then return false end if chk==0 then return g:GetCount()>0 end
local atk,def = a:GetAttack(),a:GetDefense()
if atk >= 0 and c:IsAttackAbove(atk + 1) then return true end
if def >= 0 and c:IsAttackAbove(def + 1) then return true end
return false
end end
function cm.tgop(e,tp) function c37900030.op(e,tp,eg,ep,ev,re,r,rp)
rshint.Card(m) local c=e:GetHandler()
Duel.SendtoGrave(Duel.GetAttackTarget(),REASON_RULE) local g=Duel.GetMatchingGroup(c37900030.pfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c)
if g:GetCount()>0 then
if Duel.ChangePosition(g,POS_FACEUP_DEFENSE)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_START)
e1:SetRange(LOCATION_MZONE)
e1:SetDescription(aux.Stringid(37900030,1))
e1:SetCondition(c37900030.con22)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetOperation(c37900030.op22)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
end end
function cm.valcon(e,re,r,rp) function c37900030.con22(e,tp,eg,ep,ev,re,r,rp)
return r & (REASON_BATTLE + REASON_EFFECT) ~=0 local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:GetAttack()>bc:GetAttack() or (not bc:IsType(TYPE_LINK) and c:GetAttack()>bc:GetDefense())
end end
function c37900030.op22(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsRelateToBattle(e) and bc:IsAbleToGrave() then
Duel.SendtoGrave(bc,REASON_RULE,1-tp)
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