Commit 9cb2c777 authored by mercury233's avatar mercury233

fix

parent 2e41dccb
...@@ -33,7 +33,6 @@ function s.initial_effect(c) ...@@ -33,7 +33,6 @@ function s.initial_effect(c)
e4:SetCode(EVENT_TO_GRAVE) e4:SetCode(EVENT_TO_GRAVE)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id+o) e4:SetCountLimit(1,id+o)
e4:SetCondition(s.mtcon)
e4:SetTarget(s.mttg) e4:SetTarget(s.mttg)
e4:SetOperation(s.mtop) e4:SetOperation(s.mtop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
...@@ -78,21 +77,17 @@ end ...@@ -78,21 +77,17 @@ end
function s.cfilter(c,tp) function s.cfilter(c,tp)
return not c:IsType(TYPE_TOKEN) and c:IsType(TYPE_MONSTER) return not c:IsType(TYPE_TOKEN) and c:IsType(TYPE_MONSTER)
and c:GetOwner()==1-tp and c:IsReason(REASON_EFFECT) and c:GetOwner()==1-tp and c:IsReason(REASON_EFFECT)
and c:IsFaceupEx() and c:IsFaceupEx() and c:IsCanOverlay()
end
function s.mtcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end end
function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk) function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=eg:Filter(s.cfilter,nil,tp) local g=eg:Filter(s.cfilter,nil,tp)
local mg=g:Filter(Card.IsCanOverlay,nil) if chk==0 then return #g>0 end
if chk==0 then return #mg>0 end Duel.SetTargetCard(g)
end end
function s.mtop(e,tp,eg,ep,ev,re,r,rp) function s.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=eg:Filter(s.cfilter,nil,tp) local g=eg:Filter(s.cfilter,nil,tp)
local mg=g:Filter(aux.NecroValleyFilter(Card.IsCanOverlay),nil) local mg=g:Filter(aux.NecroValleyFilter(Card.IsRelateToChain),nil)
if #mg>0 and c:IsRelateToChain() and c:IsType(TYPE_XYZ) then if #mg>0 and c:IsRelateToChain() and c:IsType(TYPE_XYZ) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local og=mg:Select(tp,1,1,nil) local og=mg:Select(tp,1,1,nil)
......
...@@ -21,6 +21,13 @@ function s.initial_effect(c) ...@@ -21,6 +21,13 @@ function s.initial_effect(c)
e2:SetValue(1) e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--bp disable --bp disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(s.disop)
c:RegisterEffect(e3)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD) e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_DISABLE) e5:SetCode(EFFECT_DISABLE)
...@@ -30,6 +37,7 @@ function s.initial_effect(c) ...@@ -30,6 +37,7 @@ function s.initial_effect(c)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e6=e5:Clone() local e6=e5:Clone()
e6:SetCode(EFFECT_DISABLE_EFFECT) e6:SetCode(EFFECT_DISABLE_EFFECT)
e6:SetValue(RESET_TURN_SET)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
...@@ -58,11 +66,21 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,11 +66,21 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.AdjustInstantly(e:GetHandler())
end
function s.disfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x189,0x17a) and c:IsControler(tp)
end
function s.distg(e,c) function s.distg(e,c)
if c:GetFlagEffect(id)~=0 then return true end local fid=e:GetHandler():GetFieldID()
local tc=c:GetBattleTarget() for _,flag in ipairs({c:GetFlagEffectLabel(id)}) do
if tc and tc:IsFaceup() and tc:IsSetCard(0x189,0x17a) and tc:IsControler(e:GetHandlerPlayer()) then if flag==fid then return true end
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) end
local bc=c:GetBattleTarget()
if bc and s.disfilter(bc,e:GetHandlerPlayer()) then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
return true return true
end end
return false
end end
...@@ -46,7 +46,7 @@ function s.GetLegalAttributesOnly(tp) ...@@ -46,7 +46,7 @@ function s.GetLegalAttributesOnly(tp)
while a<ATTRIBUTE_ALL do while a<ATTRIBUTE_ALL do
local check=true local check=true
for p=0,1 do for p=0,1 do
if not Duel.IsPlayerCanSpecialSummonMonster(tp,id+100,0x13f,TYPES_TOKEN_MONSTER,0,0,4,RACE_FIEND,a,POS_FACEUP_DEFENSE,p) then if not Duel.IsPlayerCanSpecialSummonMonster(tp,id+o,0x13f,TYPES_TOKEN_MONSTER,0,0,4,RACE_FIEND,a,POS_FACEUP_DEFENSE,p) then
check=false check=false
break break
end end
...@@ -79,14 +79,14 @@ function s.tkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,14 +79,14 @@ function s.tkop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) or Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==0 or not c:IsLocation(LOCATION_EXTRA) then return end if not c:IsRelateToEffect(e) or Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==0 or not c:IsLocation(LOCATION_EXTRA) then return end
local attr=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) local attr=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if not attr or attr==0 if not attr or attr==0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+100,0x13f,TYPES_TOKEN_MONSTER,0,0,4,RACE_FIEND,a,POS_FACEUP_DEFENSE,tp) or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+o,0x13f,TYPES_TOKEN_MONSTER,0,0,4,RACE_FIEND,a,POS_FACEUP_DEFENSE,tp)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+100,0x13f,TYPES_TOKEN_MONSTER,0,0,4,RACE_FIEND,a,POS_FACEUP_DEFENSE,1-tp) or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+o,0x13f,TYPES_TOKEN_MONSTER,0,0,4,RACE_FIEND,a,POS_FACEUP_DEFENSE,1-tp)
or Duel.GetMZoneCount(tp,c)<=0 or Duel.GetMZoneCount(1-tp,c,tp)<=0 or Duel.GetMZoneCount(tp,c)<=0 or Duel.GetMZoneCount(1-tp,c,tp)<=0
or Duel.IsPlayerAffectedByEffect(tp,59822133) then or Duel.IsPlayerAffectedByEffect(tp,59822133) then
return return
end end
for p=tp,1-tp,1-2*tp do for p=tp,1-tp,1-2*tp do
local token=Duel.CreateToken(tp,id+100) local token=Duel.CreateToken(tp,id+o)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
......
...@@ -25,6 +25,7 @@ function c101111045.initial_effect(c) ...@@ -25,6 +25,7 @@ function c101111045.initial_effect(c)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101111046) e2:SetCountLimit(1,101111046)
e2:SetCondition(c101111045.descon)
e2:SetTarget(c101111045.destg) e2:SetTarget(c101111045.destg)
e2:SetOperation(c101111045.desop) e2:SetOperation(c101111045.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -54,6 +55,9 @@ function c101111045.srop(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,6 +55,9 @@ function c101111045.srop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c101111045.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsLocation,1,nil,LOCATION_ONFIELD+LOCATION_OVERLAY)
end
function c101111045.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c101111045.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) 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