Commit 1b118948 authored by mercury233's avatar mercury233

fix

parent 82e0c288
......@@ -54,7 +54,8 @@ function c101108003.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c101108003.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Equip(tp,tc,c,false)
......
......@@ -57,7 +57,8 @@ function c101108004.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c101108004.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Equip(tp,tc,c,false)
......@@ -78,17 +79,17 @@ function c101108004.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c101108004.filter(c)
return c:IsFaceup() and c:IsSetCard(0x27a) and c:GetSequence()<5
return c:IsFaceup() and c:IsSetCard(0x27a) and c:GetSequence()<5 and c:IsAbleToHand()
end
function c101108004.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101108004.filter,tp,LOCATION_SZONE,0,1,nil)
and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,c101108004.filter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,2,0,0)
end
......
......@@ -53,7 +53,8 @@ function c101108005.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c101108005.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Equip(tp,tc,c,false)
......
......@@ -54,7 +54,8 @@ function c101108006.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c101108006.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Equip(tp,tc,c,false)
......
......@@ -56,7 +56,8 @@ function c101108007.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c101108007.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Equip(tp,tc,c,false)
......
......@@ -12,7 +12,7 @@ function c101108039.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,101108039)
e1:SetCondition(c101108039.spcon)
e1:SetTarget(c101108039.sptg)
......
......@@ -26,20 +26,25 @@ function c101108041.initial_effect(c)
e2:SetOperation(c101108041.spop)
c:RegisterEffect(e2)
end
function c101108041.tgfilter(c)
return c:IsRace(RACE_ZOMBIE) and c:IsAbleToGrave()
function c101108041.tgfilter(c,lv,olv)
local clv=c:GetOriginalLevel()
return c:IsRace(RACE_ZOMBIE) and c:IsAbleToGrave() and clv~=olv and math.abs(clv-olv)~=lv
end
function c101108041.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101108041.tgfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then
local c=e:GetHandler()
return c:IsLevelAbove(0)
and Duel.IsExistingMatchingCard(c101108041.tgfilter,tp,LOCATION_DECK,0,1,nil,c:GetLevel(),c:GetOriginalLevel())
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101108041.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101108041.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c101108041.tgfilter,tp,LOCATION_DECK,0,1,1,nil,c:GetLevel(),c:GetOriginalLevel())
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) and tc:GetLevel()>0
and c:IsFaceup() and c:IsRelateToEffect(e) then
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
......@@ -52,7 +57,7 @@ function c101108041.cfilter(c,tp)
return c:GetPreviousRaceOnField()&RACE_ZOMBIE~=0 and c:IsPreviousControler(tp)
end
function c101108041.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101108041.cfilter,1,nil,tp)
return eg:IsExists(c101108041.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c101108041.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -74,9 +74,6 @@ end
function c101108071.filter(c)
return c:IsSetCard(0x27a) and c:IsFaceup()
end
function c101108071.filter1(c,e)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsRelateToEffect(e)
end
function c101108071.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
......@@ -89,11 +86,10 @@ function c101108071.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c101108071.eqop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:Filter(c101108071.filter1,nil,e):GetFirst()
g:RemoveCard(tc)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local tc=g:Filter(Card.IsLocation,nil,LOCATION_MZONE):GetFirst()
local ec=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE):GetFirst()
if tc and ec and ec:IsRelateToEffect(e) then
if tc and ec and tc:IsFaceup() and tc:IsControler(tp) then
if not Duel.Equip(tp,ec,tc) then return end
--equip limit
local e1=Effect.CreateEffect(e:GetHandler())
......
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