Commit 98e00b1c authored by Nemo Ma's avatar Nemo Ma

fix

parent 0135c3a1
--降阶魔法 心之牺牲
function c33700167.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c33700167.cost)
e1:SetTarget(c33700167.target)
e1:SetOperation(c33700167.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(33700167,ACTIVITY_SPSUMMON,c33700167.counterfilter)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c33700167.cost)
e1:SetTarget(c33700167.target)
e1:SetOperation(c33700167.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(33700167,ACTIVITY_SPSUMMON,c33700167.counterfilter)
end
function c33700167.counterfilter(c)
return c:IsType(TYPE_XYZ)
return c:IsType(TYPE_XYZ)
end
function c33700167.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(33700167,tp,ACTIVITY_SPSUMMON)==0 end
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(c33700167.splimit)
e1:SetLabelObject(e)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(c33700167.splimit)
e1:SetLabelObject(e)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c33700167.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return se~=e:GetLabelObject() or not se:IsType(TYPE_XYZ)
return se~=e:GetLabelObject()
end
function c33700167.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0 and Duel.IsExistingMatchingCard(c33700167.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank(),c:GetOverlayCount())
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0
and Duel.IsExistingMatchingCard(c33700167.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank(),c:GetOverlayCount(),c:GetRace(),c:GetAttribute())
end
function c33700167.filter2(c,e,tp,g,rk,og)
return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and g:IsCanBeXyzMaterial(c) and c:GetRank()<rk and
c:GetRank()>=og
function c33700167.filter2(c,e,tp,tc,rk,og,race,attr)
return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:GetRace()==race or c:GetAttribute()==attr)
and c:GetRank()<rk and c:GetRank()>=og
end
function c33700167.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c33700167.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33700167.filter,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.GetMZoneCount(tp)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c33700167.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetOverlayCount()*1000)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_EXTRA)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c33700167.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c33700167.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c33700167.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetOverlayCount()*1000)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_EXTRA)
end
function c33700167.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local mg=tc:GetOverlayGroup()
Duel.SendtoGrave(mg,REASON_EFFECT)
if mg:GetCount()>0 and Duel.Recover(tp,mg:GetCount()*1000,REASON_EFFECT)>0 then
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c33700167.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Overlay(g,Group.FromCards(tc,e:GetHandler()))
end
end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc or not tc:IsRelateToEffect(e) then return end
local mg=tc:GetOverlayGroup()
local ogc=mg:GetCount()
Duel.SendtoGrave(mg,REASON_EFFECT)
if ogc>0 and Duel.Recover(tp,ogc*1000,REASON_EFFECT)>0 then
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c33700167.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank(),ogc,tc:GetRace(),tc:GetAttribute())
local sc=g:GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
Duel.Overlay(sc,Group.FromCards(tc))
end
if c:IsRelateToEffect(e) then
c:CancelToGrave()
Duel.Overlay(sc,Group.FromCards(c))
end
end
end
--月球意识 篝
function c33701060.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--disable field
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33701060,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c33701060.spcost)
e2:SetTarget(c33701060.sptg)
e2:SetOperation(c33701060.spop)
e2:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_DRAW)
e2:SetCode(EVENT_PHASE+PHASE_END,2)
e2:SetCountLimit(1)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--spsummon bgm
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
e8:SetOperation(c33701060.sumsuc)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function c33701060.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(33701060,0))
end
function c33701060.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c33701060.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.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,33701058,0,0x4011,0,3000,10,RACE_PLANT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c33701060.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,33701058,0,0x4011,0,3000,10,RACE_PLANT,ATTRIBUTE_EARTH) then
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,33701058,0,0x4011,0,3000,10,RACE_PLANT,ATTRIBUTE_EARTH) then
local token=Duel.CreateToken(tp,33701058)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK)
local e1=Effect.CreateEffect(e:GetHandler())
-- 不会被战斗破坏
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_EQUIP)
-- 不能改变表示形式
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e3)
local de=Effect.CreateEffect(e:GetHandler())
de:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
de:SetCode(EVENT_PHASE+PHASE_END,2)
de:SetCategory(CATEGORY_TOHAND)
de:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
de:SetCountLimit(1)
de:SetValue(c33701060.aclimit)
de:SetTarget(c33701060.destg)
de:SetOperation(c33701060.desop)
Duel.RegisterEffect(de,tp)
-- 给衍生物加Flag
token:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
-- 注册结束阶段效果
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabelObject(token)
e2:SetCondition(s.thcon)
e2:SetOperation(s.thop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function c33701060.aclimit(e,re,tp)
return not re:GetHandler():IsCode(33701058)
function s.cfilter(c)
return c:IsFaceup() and c:IsCode(33701058)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local token=e:GetLabelObject()
return token and token:GetFlagEffect(id)>0 and token:IsLocation(LOCATION_MZONE)
end
function c33701060.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and c:GetFlagEffect(id)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
and Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) end
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end
function c33701060.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.SendtoHand(g,nil,REASON_EFFECT)
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
end
\ No newline at end of file
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