Commit 5a95626d authored by POLYMER's avatar POLYMER

fix

parent 30a482cc
No preview for this file type
...@@ -26,7 +26,7 @@ function s.initial_effect(c) ...@@ -26,7 +26,7 @@ function s.initial_effect(c)
end end
function s.tgfilter(c) function s.tgfilter(c)
return c:IsCode(17337400) and c:IsAbleToGrave() return c:IsCode(17337400) and c:IsAbleToGraveAsCost()
end end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
-- 半魔的忠仆
local s,id=GetID() local s,id=GetID()
function s.initial_effect(c) function s.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -30,25 +31,25 @@ function s.initial_effect(c) ...@@ -30,25 +31,25 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.cfilter(c)
return c:IsSetCard(0x3f50) and c:IsFaceup()
end
function s.tfilter(c,tp) function s.tfilter(c,tp)
return c:IsSetCard(0x3f50) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsControler(tp) return c:IsSetCard(0x3f50) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsControler(tp)
end end
function s.spcon1(e,tp,eg,ep,ev,re,r,rp) function s.spcon1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttackTarget() local tc=Duel.GetAttackTarget()
return tc and s.tfilter(tc,tp) return tc and s.tfilter(tc,tp)
end end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp) function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:GetCount()==1 and s.tfilter(g:GetFirst(),tp) return g and g:GetCount()==1 and s.tfilter(g:GetFirst(),tp)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
local tc=nil local tc=nil
if e:GetCode()==EVENT_BE_BATTLE_TARGET then if e:GetCode()==EVENT_BE_BATTLE_TARGET then
tc=Duel.GetAttackTarget() tc=Duel.GetAttackTarget()
...@@ -57,16 +58,13 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -57,16 +58,13 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
tc=g:GetFirst() tc=g:GetFirst()
end end
e:SetLabelObject(tc) e:SetLabelObject(tc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if c:IsDefensePos() and tc and tc:IsLocation(LOCATION_MZONE) and tc:IsControler(tp) then if c:IsDefensePos() and tc and tc:IsLocation(LOCATION_MZONE) and tc:IsControler(tp) then
if tc:IsAbleToHand() and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then if tc:IsAbleToHand() and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
...@@ -78,7 +76,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,7 +76,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsSetCard(0x3f50) and c:IsFaceupEx() and c:IsAbleToHand() return c:IsSetCard(0x3f50) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToHand()
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -93,14 +91,17 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -93,14 +91,17 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc or not tc:IsRelateToEffect(e) then return end if not tc or not tc:IsRelateToEffect(e) then return end
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA) then
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
if Duel.IsExistingMatchingCard(aux.FilterBoolFunction(Card.IsSetCard,0x3f50),tp,LOCATION_MZONE,0,1,c) then if Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,c) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
......
...@@ -24,7 +24,7 @@ function s.initial_effect(c) ...@@ -24,7 +24,7 @@ function s.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
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,id+1)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetTarget(s.disptg) e2:SetTarget(s.disptg)
e2:SetOperation(s.dispop) e2:SetOperation(s.dispop)
......
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