Commit 029b94e9 authored by Huangnan's avatar Huangnan

fix

parent f6292ba1
Pipeline #41936 failed with stages
in 1 minute and 58 seconds
--相信于明日芳香的花蕾
local s,id,o=GetID()
function s.initial_effect(c)
--特殊召唤
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(s.tg1)
e1:SetOperation(s.op1)
c:RegisterEffect(e1)
--获得抗性
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetTarget(s.tg2)
e2:SetOperation(s.op2)
c:RegisterEffect(e2)
--破坏效果
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,id+o*2)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(s.tg3)
e3:SetOperation(s.op3)
c:RegisterEffect(e3)
--攻击无效
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BE_BATTLE_TARGET)
e4:SetRange(LOCATION_GRAVE)
e4:SetCost(s.cost4)
e4:SetCountLimit(1,id+o*3)
e4:SetCondition(s.con4)
e4:SetOperation(s.op4)
c:RegisterEffect(e4)
end
function s.f1(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function s.f2(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsControler(tp)
end
function s.f3(c,tp)
return (c:IsControler(tp) and c:IsRace(RACE_PLANT) and c:IsType(TYPE_MONSTER) and c:IsFaceup())
or (c:IsControler(1-tp) and c:IsType(TYPE_MONSTER))
end
function s.f4(c,e)
return c:IsRelateToEffect(e) and c:IsDestructable(e)
end
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(s.f1,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function s.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.f1,tp,LOCATION_HAND,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,nil,tp,tp,false,false,POS_FACEUP)
end
end
function s.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return s.f2(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.f2,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.f2,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function s.op2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local ct=1
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(s.val2)
if Duel.GetTurnPlayer()==1-tp then
ct=2
end
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,ct)
e1:SetOwnerPlayer(tp)
tc:RegisterEffect(e1)
end
end
function s.val2(e,re,rp)
return rp==1-e:GetOwnerPlayer()
end
function s.tg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return s.f3(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.f3,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.IsExistingTarget(s.f3,tp,0,LOCATION_MZONE,2,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,s.f3,tp,LOCATION_MZONE,0,1,1,nil,tp)
local g2=Duel.SelectTarget(tp,s.f3,tp,0,LOCATION_MZONE,2,2,nil,tp)
g1:Merge(g2)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0)
end
function s.op3(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=g1:Filter(s.f4,nil,e)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function s.con4(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget()
return c and c:IsControler(tp) and c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_ONFIELD)
end
function s.cost4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function s.op4(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
\ No newline at end of file
......@@ -30,7 +30,7 @@ function c23100143.initial_effect(c)
end
c23100143.named_with_ZhanShuRenXing=true
function c23100143.thfilter(c)
return c.named_with_ZhanShuRenXing and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
return c.named_with_ZhanShuRenXing and c:IsAbleToHand()
end
function c23100143.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c23100143.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -34,7 +34,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.spfil(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS)
end
function cm.spcon(e,c)
if c==nil then return true end
......
......@@ -26,7 +26,7 @@ function cm.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m+10000000)
e2:SetCountLimit(1,m+10000000)
e2:SetTarget(cm.sptg2)
e2:SetOperation(cm.spop2)
c:RegisterEffect(e2)
......
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