Commit 2591de10 authored by songtongtong's avatar songtongtong

bug fix

parent 329a5f31
No preview for this file type
--魔女的事后惩罚 --魔女的事后惩罚
local m=33501032 local m=33501032
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE) e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetLabelObject(ge1) e1:SetLabelObject(ge1)
e1:SetTarget(cm.thtg) e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop) e1:SetOperation(cm.thop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not cm.global_check then if not cm.global_check then
cm.global_check=true cm.global_check=true
Sre_setback={0} Sre_setback={0}
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING) ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop) ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler() local tc=re:GetHandler()
if tc:IsType(TYPE_MONSTER) then if tc:IsType(TYPE_MONSTER) then
Sre_setback[1]=tc Sre_setback[1]=tc
end end
if tc:GetLocation()~=re:GetActivateLocation() then -- if tc:GetLocation()~=re:GetActivateLocation() then
Sre_setback[1]=0 -- Sre_setback[1]=0
end -- end
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local res=false local res=false
if Sre_setback[1]~=0 then if Sre_setback[1]~=0 then
res=Sre_setback[1] res=Sre_setback[1]
end end
if chk==0 then return res and not res:IsDisabled() end if chk==0 then return res and not res:IsDisabled() end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,Sre_setback[1],1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,Sre_setback[1],1,0,0)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Sre_setback[1] local tc=Sre_setback[1]
if tc then if tc and tc:IsType(TYPE_MONSTER) then
local e1=Effect.CreateEffect(c) 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) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) 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) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
end local num=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
if c:IsRelateToEffect(e) and c:IsCanTurnSet() and e:IsHasType(EFFECT_TYPE_ACTIVATE) then for i=1,num do
Duel.BreakEffect() local te,tgp=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
c:CancelToGrave() if (te:IsActiveType(TYPE_MONSTER) and te:GetHandler()==tc) then
Duel.ChangePosition(c,POS_FACEDOWN) Duel.NegateActivation(i)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0) end
end end
end
if c:IsRelateToEffect(e) and c:IsCanTurnSet() and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end end
\ No newline at end of file
--星光歌剧 凤满 --星光歌剧 凤满
if not pcall(function() require("expansions/script/c64839999") end) then require("script/c64839999") end local m=64832035
local m,cm=rscf.DefineCard(64832035) local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e2=rsef.STO(c,EVENT_SUMMON_SUCCESS,{m,1},{1,m},"dish,se,th","de",rscon.sumtype("adv"),nil,rsop.target({2,"dish"},{cm.thfilter,"th",LOCATION_DECK }),cm.thop) --summon with 1 tribute
local e3=rsef.STO(c,EVENT_SUMMON_SUCCESS,{m,2},{1,m},"td,des","de",rscon.sumtype("adv"),nil,rsop.target2(cm.fun,cm.tdfilter,"td",0,LOCATION_ONFIELD),cm.tdop) local e1=Effect.CreateEffect(c)
local e4=rsef.STO(c,EVENT_SUMMON_SUCCESS,{m,3},{1,m},"dish,dr","de",rscon.sumtype("adv"),nil,rsop.target({cm.dishfilter,"dish",LOCATION_HAND,0,1},{1,"dr"}),cm.drop) e1:SetDescription(aux.Stringid(m,0))
--summon with 1 tribute e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetDescription(aux.Stringid(m,0)) e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCondition(cm.otcon)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetOperation(cm.otop)
e1:SetCode(EFFECT_SUMMON_PROC) e1:SetValue(SUMMON_TYPE_ADVANCE)
e1:SetCondition(cm.otcon) c:RegisterEffect(e1)
e1:SetOperation(cm.otop) --Set
e1:SetValue(SUMMON_TYPE_ADVANCE) local e2=Effect.CreateEffect(c)
c:RegisterEffect(e1) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
end e2:SetCode(EVENT_SUMMON_SUCCESS)
function cm.otfilter(c) e2:SetProperty(EFFECT_FLAG_DELAY)
return c:IsSetCard(0x6410) and c:IsAbleToRemoveAsCost() e2:SetCountLimit(1,m)
end e2:SetCondition(cm.setcon)
function cm.otcon(e,c,minc) e2:SetTarget(cm.settg)
if c==nil then return true end e2:SetOperation(cm.setop)
local tp=c:GetControler() c:RegisterEffect(e2)
local mg=Duel.GetMatchingGroup(cm.otfilter,tp,LOCATION_EXTRA,0,nil) end
return c:IsLevelAbove(5) and minc<=1 and #mg>0 function cm.otfilter(c)
end return c:IsSetCard(0x6410) and c:IsAbleToRemoveAsCost()
function cm.otop(e,tp,eg,ep,ev,re,r,rp,c) end
rsop.SelectRemove(tp,cm.otfilter,tp,LOCATION_EXTRA,0,1,1,nil,{POS_FACEUP,REASON_COST }) function cm.otcon(e,c,minc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if c==nil then return true end
end local tp=c:GetControler()
function cm.thfilter(c) local mg=Duel.GetMatchingGroup(cm.otfilter,tp,LOCATION_EXTRA,0,nil)
return c:IsSetCard(0x6410) and c:IsAbleToHand() return c:IsLevelAbove(5) and minc<=1 and #mg>0
end end
function cm.thop(e,tp) function cm.otop(e,tp,eg,ep,ev,re,r,rp,c)
if rsop.SelectToGrave(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,2,2,{REASON_DISCARD+REASON_EFFECT },REASON_EFFECT)>0 then rsop.SelectRemove(tp,cm.otfilter,tp,LOCATION_EXTRA,0,1,1,nil,{POS_FACEUP,REASON_COST })
rsop.SelectToHand(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,{}) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
end end
end
function cm.fun(g,e,tp) function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD) return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end end
function cm.tdfilter(c,e,tp) function cm.thfilter(c)
return c:IsAbleToDeck() and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,c:GetEquipGroup()) return c:IsSetCard(0x6410) and c:IsAbleToHand()
end end
function cm.tdop(e,tp) function cm.disfilter(c)
local ct,og,tc=rsop.SelectToDeck(tp,cm.tdfilter,tp,0,LOCATION_ONFIELD,1,1,nil,{},e,tp) return c:IsSetCard(0x6410) and c:IsDiscardable()
if tc and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then end
rsop.SelectOC(nil,true) function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
rsop.SelectDestroy(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil,{}) local b1=Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,nil) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
end local b2=Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil)
end local b3=Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,nil) and Duel.IsPlayerCanDraw(tp,1)
function cm.dishfilter(c) if chk==0 then return b1 or b2 or b3 end
return c:IsDiscardable(REASON_EFFECT) and c:IsSetCard(0x6410) local off=1
end local ops={}
function cm.drop(e,tp) local opval={}
if rsop.SelectToGrave(tp,cm.dishfilter,tp,LOCATION_HAND,0,1,1,nil,{REASON_EFFECT+REASON_DISCARD })>0 then if b1 then
Duel.Draw(tp,1,REASON_EFFECT) ops[off]=aux.Stringid(m,1)
end opval[off]=0
end off=off+1
\ No newline at end of file end
if b2 then
ops[off]=aux.Stringid(m,2)
opval[off]=1
off=off+1
end
if b3 then
ops[off]=aux.Stringid(m,3)
opval[off]=2
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
e:SetLabel(sel)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,sel+1))
if sel==0 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
elseif sel==1 then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_TODECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
else
e:SetCategory(CATEGORY_DRAW)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local sel=e:GetLabel()
local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,nil) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil)
local b3=Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,nil) and Duel.IsPlayerCanDraw(tp,1)
if sel==0 then
if Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_EFFECT+REASON_DISCARD,nil)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
elseif sel==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,1,nil)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g2=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Destroy(g2,REASON_EFFECT)
end
else
if Duel.DiscardHand(tp,cm.disfilter,1,1,REASON_EFFECT+REASON_DISCARD,nil)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
--Virtual UP-若白 --Virtual UP-若白
local m=92900021 local m=92900021
local cm=_G["c"..m] local cm=_G["c"..m]
function c92900021.initial_effect(c) function c92900021.initial_effect(c)
--xyz summon --xyz summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,cm.mfilter,cm.xyzcheck,2,2,cm.ovfilter,aux.Stringid(m,0)) aux.AddXyzProcedureLevelFree(c,cm.mfilter,cm.xyzcheck,2,2,cm.ovfilter,aux.Stringid(m,0))
--disable spsummon --disable spsummon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1) e3:SetTargetRange(1,1)
e3:SetTarget(cm.splimit) e3:SetTarget(cm.splimit)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--todeck --todeck
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TODECK) e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetCost(cm.tdcost) e2:SetCost(cm.tdcost)
e2:SetTarget(cm.tdtg) e2:SetTarget(cm.tdtg)
e2:SetOperation(cm.tdop) e2:SetOperation(cm.tdop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.xyzcheck(g) function cm.xyzcheck(g)
return g:GetClassCount(Card.GetRace)==g:GetCount() return g:GetClassCount(Card.GetRace)==g:GetCount()
end end
function cm.mfilter(c,xyzc) function cm.mfilter(c,xyzc)
return c:IsXyzType(TYPE_XYZ) and c:IsLevel(5) return c:IsXyzType(TYPE_XYZ) and c:IsLevel(5)
end end
function cm.xyzcheck(g) function cm.xyzcheck(g)
return g:GetClassCount(Card.GetRace)==g:GetCount() return g:GetClassCount(Card.GetRace)==g:GetCount()
end end
function cm.ovfilter(c) function cm.ovfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x9a0) and not c:IsCode(m) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x9a0) and not c:IsCode(m)
end end
function cm.lvcheck(c) function cm.lvcheck(c)
return c:IsFaceup() and c:IsLevelAbove(1) return c:IsFaceup() and c:IsLevelAbove(1)
end end
function cm.lvfilter(c,lv,tp) function cm.lvfilter(c,lv,tp)
return c:IsControler(tp) and c:IsLevel(lv) return c:IsControler(tp) and c:IsLevel(lv)
end end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp) function cm.splimit(e,c,sump,sumtype,sumpos,targetp)
local g=Duel.GetMatchingGroup(cm.lvcheck,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.lvcheck,tp,LOCATION_MZONE,0,nil)
local lv=c:GetLevel() local lv=c:GetLevel()
if lv>0 then if lv>0 then
return g and #g>0 and not g:IsExists(cm.lvfilter,1,nil,lv,sump)--g:IsExists(cm.lvfilter,1,nil,lv,sump) return g and #g>0 and not g:IsExists(cm.lvfilter,1,nil,lv,sump)--g:IsExists(cm.lvfilter,1,nil,lv,sump)
else return false end else return false end
end end
function cm.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function cm.tdfilter(c) function cm.tdfilter(c)
return c:IsAbleToDeck() return c:IsAbleToDeck()
end end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and cm.tdfilter(chkc) and chkc~=e:GetHandler() end if chkc then return chkc:IsOnField() and cm.tdfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,cm.tdfilter,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp) function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end end
end end
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