Commit 83026835 authored by Nemo Ma's avatar Nemo Ma

fix

parent 18161111
......@@ -21,16 +21,10 @@ function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_HAND,0)
e3:SetTargetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0)
e3:SetTarget(cm.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetTargetRange(LOCATION_GRAVE,0)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetTargetRange(LOCATION_MZONE,0)
c:RegisterEffect(e5)
--become effect
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
......@@ -41,43 +35,26 @@ function cm.initial_effect(c)
e8:SetTarget(cm.betg)
c:RegisterEffect(e8)
end
function cm.AddFlagEffectLabel(code)
local lab={Duel.GetFlagEffectLabel(tp,m)}
if not lab or #lab==0 then Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1,code) return end
table.insert(lab,code)
Duel.SetFlagEffectLabel(tp,m,table.unpack(lab))
end
function cm.CheckFlagEffectLabel(code)
local lab={Duel.GetFlagEffectLabel(tp,m)}
if not lab or #lab==0 then return true end
for _,ct in pairs(lab) do
if ct==code then return false end
end
return true
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
local code=c:GetOriginalCode()
return Duel.GetFlagEffect(tp,m)==0 and rc~=c and rc:IsLocation(c:GetLocation()) and rc:IsControler(tp) and rc:IsSetCard(0x132)-- and cm.CheckFlagEffectLabel(code)
local loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION)
return Duel.GetFlagEffect(tp,m)==0 and rc~=c and loc==c:GetLocation() and rc:IsControler(tp) and rc:IsSetCard(0x132)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local code=c:GetOriginalCode()
--cm.AddFlagEffectLabel(code)
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=re:GetTarget()
if chk==0 then
e:SetProperty(re:GetProperty())
e:SetProperty(re:GetProperty()&EFFECT_FLAG_CARD_TARGET)
e:SetLabel(re:GetLabel())
e:SetLabelObject(re:GetLabelObject())
return not tg or tg(e,tp,eg,ep,ev,re,r,rp,0)
end
e:SetCategory(re:GetCategory())
e:SetProperty(re:GetProperty())
e:SetProperty(re:GetProperty()&EFFECT_FLAG_CARD_TARGET)
e:SetLabel(re:GetLabel())
e:SetLabelObject(re:GetLabelObject())
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
......@@ -100,7 +77,6 @@ function cm.rscon(e,tp,eg,ep,ev,re,r,rp)
return re==e:GetLabelObject()
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
re:SetCategory(0)
re:SetProperty(0)
re:SetLabel(0)
re:SetLabelObject(nil)
......
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
end
function cm.spfilter(c,e,tp,mg)
if bit.band(c:GetType(),0x81)~=0x81 or c.mat_filter or c.mat_group_check or not (c:IsAttribute(ATTRIBUTE_WIND) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)) then return false end
local ct=math.max(1,tc:GetLevel()//3)
local ct=math.max(1,c:GetLevel()//3)
return #mg>0 and mg:CheckSubGroup(cm.fselect,ct,ct,c,tp)
end
function cm.fselect(g,c,tp)
......
......@@ -84,8 +84,9 @@ end
function cm.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
end
function cm.matval(e,c,mg)
return c:IsType(TYPE_LINK) and mg:IsExists(cm.mfilter,1,nil)
function cm.matval(e,lc,mg,c,tp)
if not lc or not lc:IsType(TYPE_LINK) then return false,nil end
return true,not mg or mg:IsExists(cm.mfilter,1,nil)
end
function cm.mattg(e,c)
return cm.Code0(c) and c:IsType(TYPE_MONSTER)
......
......@@ -78,11 +78,11 @@ function cm.lpop(e,tp,eg,ep,ev,re,r,rp)
c:ReverseInDeck()
end
end
function cm.damcon(e)
function cm.damcon(e,c)
local tp=e:GetHandlerPlayer()
local g=Duel.GetDecktopGroup(tp,1)
return g:IsContains(e:GetHandler()) and c:IsFaceup()
return g:IsContains(e:GetHandler()) and e:GetHandler():IsFaceup()
end
function cm.val(e)
function cm.val(e,c)
return dam*2
end
\ No newline at end of file
......@@ -79,6 +79,9 @@ function c9910026.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
ec:CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,rc,1,0,0)
end
function c9910026.matfilter(c,e)
return c:IsCanOverlay() and not c:IsImmuneToEffect(e)
end
function c9910026.xfilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and not c:IsImmuneToEffect(e)
end
......@@ -102,7 +105,7 @@ function c9910026.spop(e,tp,eg,ep,ev,re,r,rp)
local rc=ec:GetReasonCard()
if rc:IsOnField() then rc:RegisterFlagEffect(9910026,RESET_EVENT+RESETS_STANDARD,0,1) end
local lg=rc:GetOverlayGroup()
local g1=Duel.GetMatchingGroup(Card.IsCanOverlay,tp,0,LOCATION_ONFIELD,nil)
local g1=Duel.GetMatchingGroup(c9910026.matfilter,tp,0,LOCATION_ONFIELD,nil,e)
local g2=Duel.GetMatchingGroup(c9910026.xfilter,tp,LOCATION_MZONE,0,nil,e)
if g1:GetCount()>0 and g2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9910026,0)) then
Duel.BreakEffect()
......
......@@ -41,8 +41,9 @@ function c9910141.xmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c9910141.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c9910141.xmfilter(c,tp)
function c9910141.xmfilter(c,tp,e)
return not c:IsType(TYPE_TOKEN) and (c:IsControler(tp) or c:IsAbleToChangeControler())
and not (e and c:IsImmuneToEffect(e))
end
function c9910141.xmtarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -52,7 +53,7 @@ end
function c9910141.xmoperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c9910141.xmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c,tp)
local g=Duel.SelectMatchingCard(tp,c9910141.xmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c,tp,e)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
......
......@@ -38,8 +38,9 @@ end
function c9910561.xmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c9910561.xmfilter(c,tp)
function c9910561.xmfilter(c,tp,e)
return not c:IsType(TYPE_TOKEN) and (c:IsControler(tp) or c:IsAbleToChangeControler())
and not (e and c:IsImmuneToEffect(e))
end
function c9910561.xmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -49,7 +50,7 @@ function c9910561.xmop(e,tp,eg,ep,ev,re,r,rp)
local c=aux.ExceptThisCard(e)
if not c then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c9910561.xmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c,tp)
local g=Duel.SelectMatchingCard(tp,c9910561.xmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c,tp,e)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
......
......@@ -71,11 +71,14 @@ end
function c9910646.xmcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c9910646.matfilter(c,e)
return c:IsCanOverlay() and not c:IsImmuneToEffect(e)
end
function c9910646.xmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()-c:GetOverlayCount()
local loc=LOCATION_ONFIELD+LOCATION_GRAVE
local g=Duel.GetMatchingGroup(Card.IsCanOverlay,tp,loc,loc,c,tp)
local g=Duel.GetMatchingGroup(c9910646.matfilter,tp,loc,loc,c,tp,e)
if ct<=0 or ct>g:GetCount() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:Select(tp,ct,ct,nil)
......
......@@ -85,18 +85,18 @@ end
function c9910649.xfilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and not c:IsImmuneToEffect(e)
end
function c9910649.ofilter(c)
return not c:IsType(TYPE_TOKEN)
function c9910649.ofilter(c,e)
return c:IsCanOverlay() and not c:IsImmuneToEffect(e)
end
function c9910649.dsop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
local g=Duel.GetMatchingGroup(c9910649.xfilter,tp,LOCATION_MZONE,0,nil,e)
if g:GetCount()==0 or Duel.SelectOption(tp,1191,aux.Stringid(9910649,1))==0 then
local sg=eg:Filter(c9910649.ofilter,nil,e)
if g:GetCount()==0 or sg:GetCount()==0 or Duel.SelectOption(tp,1191,aux.Stringid(9910649,1))==0 then
Duel.SendtoGrave(eg,REASON_EFFECT)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=g:Select(tp,1,1,nil):GetFirst()
local sg=eg:Filter(c9910649.ofilter,nil)
local og=Group.CreateGroup()
for sc in aux.Next(sg) do
og:Merge(sc:GetOverlayGroup())
......
......@@ -11,8 +11,8 @@ function c9910651.initial_effect(c)
e1:SetOperation(c9910651.activate)
c:RegisterEffect(e1)
end
function c9910651.cfilter(c,rk)
return c:IsLevelBelow(rk) and c:IsFaceup() and c:IsCanOverlay()
function c9910651.cfilter(c,rk,e)
return c:IsLevelBelow(rk) and c:IsFaceup() and c:IsCanOverlay() and not (e and c:IsImmuneToEffect(e))
end
function c9910651.filter1(c,e,tp)
local rk=c:GetRank()
......@@ -42,7 +42,7 @@ function c9910651.activate(e,tp,eg,ep,ev,re,r,rp)
local ra=tc:GetRace()
local att=tc:GetAttribute()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
local sg=Duel.GetMatchingGroup(c9910651.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,tc,rk)
local sg=Duel.GetMatchingGroup(c9910651.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,tc,rk,e)
if sg:GetCount()==0 then return end
local og=Group.CreateGroup()
for sc in aux.Next(sg) do
......
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