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