Commit 37606a3a authored by POLYMER's avatar POLYMER

fix

parent fe880222
No preview for this file type
......@@ -127,11 +127,11 @@ function c114303426.operation2(e,tp,eg,ep,ev,re,r,rp)
c114303426.operation(e,tp,eg,ep,ev,re,r,rp)
end
local re=Duel.RegisterEffect
Duel.RegisterEffect=function(e,tp)
if e:GetOwner():IsOriginalCodeRule(51194046) and e:GetCode()==EFFECT_MATERIAL_CHECK
then
e:SetTargetRange(LOCATION_HAND+LOCATION_DECK,LOCATION_HAND+LOCATION_DECK)
local st=Effect.SetTargetRange
Effect.SetTargetRange=function(e,s,o)
if e:GetOwner():IsOriginalCodeRule(51194046) and e:GetCode()==EFFECT_MATERIAL_CHECK then
return st(e,LOCATION_HAND+LOCATION_DECK,LOCATION_HAND+LOCATION_DECK)
else
return st(e,s,o)
end
return re(e,tp)
end
......@@ -70,7 +70,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(g2)
if Duel.SendtoGrave(g2,REASON_EFFECT)==0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
if c:IsRelateToEffect(e) and c:IsSSetable(true) then
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
......@@ -78,7 +78,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
else
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
if c:IsRelateToEffect(e) and c:IsSSetable(true) then
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
......
--红色的落穴
local m=11451427
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -24,7 +23,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and rc:IsCanTurnSet() then
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and rc:IsSSetable(true) then
rc:CancelToGrave()
Duel.ChangePosition(rc,POS_FACEDOWN)
Duel.RaiseEvent(rc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
......
......@@ -272,7 +272,7 @@ end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=e:GetHandler():GetCardTarget()
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,g) and c:IsCanTurnSet() and (not re or re:GetCode()~=EFFECT_SPSUMMON_PROC or Duel.GetLocationCountFromEx(re:GetHandlerPlayer(),re:GetHandlerPlayer(),Group.__sub(eg,g),re:GetHandler())>0) end
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,g) and c:IsSSetable(true) and (not re or re:GetCode()~=EFFECT_SPSUMMON_PROC or Duel.GetLocationCountFromEx(re:GetHandlerPlayer(),re:GetHandlerPlayer(),Group.__sub(eg,g),re:GetHandler())>0) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
g:KeepAlive()
e:SetLabelObject(g)
......
......@@ -59,7 +59,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 then
local ct=Duel.GetFlagEffect(tp,m)
local rflag=false
if ct>=1 and c:IsRelateToEffect(e) and c:IsCanTurnSet() then
if ct>=1 and c:IsRelateToEffect(e) and c:IsSSetable(true) then
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
......
......@@ -68,7 +68,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler())
end
function cm.dsfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
return c:IsFaceup() and (c:IsCanTurnSet() or (c:IsSSetable(true) and c:IsLocation(LOCATION_SZONE)))
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -102,7 +102,7 @@ function cm.rscon2(e,tp,eg,ep,ev,re,r,rp)
return ev==e:GetLabel()
end
function cm.rsop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(re) and e:GetHandler():IsFaceup() and e:GetHandler():IsCanTurnSet() then
if e:GetHandler():IsRelateToEffect(re) and e:GetHandler():IsFaceup() and e:GetHandler():IsSSetable(true) then
e:GetHandler():CancelToGrave()
Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN)
else
......@@ -142,7 +142,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end--]]
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
if c:IsRelateToEffect(e) and c:IsSSetable(true) then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
......@@ -177,7 +177,7 @@ function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsType(TYPE_TRAP) and rp==tp
end
function cm.filter2(c)
return c:IsType(TYPE_COUNTER) and c:IsFaceup() and ((c:IsLocation(LOCATION_MZONE) and ((bit.band(c:GetOriginalType(),TYPE_SPELL+TYPE_TRAP)~=0 and (not c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsCanTurnSet()) or (c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and c:IsCanTurnSet())) or (bit.band(c:GetOriginalType(),TYPE_SPELL+TYPE_TRAP)==0 and c:IsCanTurnSet()))) or (c:IsLocation(LOCATION_SZONE) and c:IsSSetable(true))) and not (c:IsType(TYPE_PENDULUM) and c:IsLocation(LOCATION_PZONE))
return c:IsType(TYPE_COUNTER) and c:IsFaceup() and c:IsSSetable(true)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
......@@ -234,7 +234,7 @@ function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
end
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
if c:IsRelateToEffect(e) and c:IsSSetable(true) then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
......
......@@ -121,7 +121,7 @@ function cm.initial_effect(c)
rpz:RegisterEffect(e4)--]]
return sg
end
end
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -159,13 +159,13 @@ function cm.tdfilter(c,tp)
end
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local set=(c:IsCanTurnSet() and c:IsLocation(LOCATION_SZONE)) or c:IsSSetable()
local set=(c:IsSSetable(true) and c:IsLocation(LOCATION_SZONE)) or c:IsSSetable()
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
return rp==tp and de and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():GetReasonEffect()==de and set and cm.tdfilter(re:GetHandler(),tp) and dp==1-tp
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local set=(c:IsCanTurnSet() and c:IsLocation(LOCATION_SZONE)) or c:IsSSetable()
local set=(c:IsSSetable(true) and c:IsLocation(LOCATION_SZONE)) or c:IsSSetable()
local rc=re:GetHandler()
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SendtoHand(rc,nil,REASON_EFFECT) and set then
if c:IsLocation(LOCATION_SZONE) then
......@@ -222,7 +222,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
local c=e:GetHandler()
local set=(c:IsCanTurnSet() and c:IsLocation(LOCATION_SZONE)) or c:IsSSetable()
local set=(c:IsSSetable(true) and c:IsLocation(LOCATION_SZONE)) or c:IsSSetable()
if set then
if c:IsLocation(LOCATION_SZONE) then
Duel.ChangePosition(c,POS_FACEDOWN)
......
......@@ -197,7 +197,7 @@ function cm.nnfilter(c,tc)
return c==tc or (s<5 and seq<5 and math.abs(seq-s)<=1 and c:IsControler(tp) and c:IsLocation(loc))
end
function cm.dsfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
return c:IsFaceup() and (c:IsCanTurnSet() or (c:IsSSetable(true) and c:IsLocation(LOCATION_SZONE)))
end
function cm.tfilter(c)
return c:IsFacedown() and c:IsOnField()
......
......@@ -4,7 +4,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x1)
--link summon
aux.AddLinkProcedure(c,nil,2,4,c11561048.lcheck)
aux.AddLinkProcedure(c,nil,2,4,c11561051.lcheck)
-- aux.AddLinkProcedure(c,nil,2)
c:EnableReviveLimit()
--add counter
......
......@@ -26,7 +26,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
if c:IsRelateToEffect(e) and c:IsCanTurnSet() and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
if c:IsRelateToEffect(e) and c:IsSSetable(true) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
......
--竜剣士ラスターP
function c192746535.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetCondition(c192746535.thcon)
e2:SetTarget(c192746535.thtg)
e2:SetOperation(c192746535.thop)
c:RegisterEffect(e2)
--cannot be material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(c192746535.splimit)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e5)
end
function c192746535.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c192746535.thfilter(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function c192746535.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local sc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(c192746535.thfilter,tp,LOCATION_DECK,0,1,nil,sc:GetCode()) end
Duel.SetTargetCard(sc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c192746535.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c192746535.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c192746535.splimit(e,c)
if not c then return false end
return not c:IsSetCard(0xc7)
end
\ No newline at end of file
......@@ -56,7 +56,7 @@ end
function cm.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsCanOverlay,tp,0,LOCATION_GRAVE,1,nil) end
and Duel.IsExistingMatchingCard(Card.IsCanOverlay,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
......@@ -64,7 +64,7 @@ function cm.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsCanOverlay),tp,0,LOCATION_GRAVE,1,1,nil)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsCanOverlay),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.Overlay(tc,g)
end
end
\ No newline at end of file
......@@ -64,6 +64,10 @@ function Auxiliary.PreloadUds()
table_range[e]=r
return _SetRange(e,r,...)
end
local _IsCanTurnSet=Card.IsCanTurnSet
function Card.IsCanTurnSet(c)
return (c:IsSSetable(true) and c:IsLocation(LOCATION_SZONE)) or ((_IsCanTurnSet(c) and not c:IsLocation(LOCATION_SZONE)))
end
EFFECT_FLAG_CANNOT_NEGATE=EFFECT_FLAG_CANNOT_NEGATE or 0x200
--require("script/procedure.lua")
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