Commit 0099c4ce authored by Tang Xinwei's avatar Tang Xinwei

new cards added 24PP

parent 0cdfdc27
--既视感分割者
--Amiya
function c100214005.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100214005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100214005)
e1:SetCost(c100214005.spcost)
e1:SetTarget(c100214005.sptg)
e1:SetOperation(c100214005.spop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100214005,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100214105)
e2:SetTarget(c100214005.destg)
e2:SetOperation(c100214005.desop)
c:RegisterEffect(e2)
end
function c100214005.cfilter(c,tp)
return (c:IsControler(tp) or c:IsFaceup()) and c:IsCode(100214005) and c:IsReleasable()
end
function c100214005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local rg=Duel.GetMatchingGroup(c100214005.cfilter,tp,LOCATION_MZONE,0,nil,tp)
if chk==0 then return Duel.GetMZoneCount(tp,rg)>0 end
ct=Duel.Release(rg,REASON_COST)*2
e:SetLabel(ct)
end
function c100214005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,100214105,0,TYPES_TOKEN_MONSTER,200,200,1,RACE_MACHINE,ATTRIBUTE_FIRE) end
local ct=e:GetLabel()
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c100214005.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=e:GetLabel()
if ft>0 and ct>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,100214105,0,TYPES_TOKEN_MONSTER,200,200,1,RACE_MACHINE,ATTRIBUTE_FIRE) then
local count=math.min(ft,ct)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then count=1 end
if count>1 then
local num={}
local i=1
while i<=count do
num[i]=i
i=i+1
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100214005,2))
count=Duel.AnnounceNumber(tp,table.unpack(num))
end
for i=1,count do
local token=Duel.CreateToken(tp,100214105)
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(100214005,3))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetLabel(tp)
e1:SetOperation(c100214005.damop)
token:RegisterEffect(e1,true)
end
end
Duel.SpecialSummonComplete()
end
end
function c100214005.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetLabel()
if c:IsReason(REASON_DESTROY) then
Duel.Damage(1-tp,500,REASON_EFFECT)
end
e:Reset()
end
function c100214005.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TOKEN)
end
function c100214005.desfilter2(c,e)
return c100214005.desfilter(c) and c:IsCanBeEffectTarget(e)
end
function c100214005.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c100214005.desfilter(chkc) end
local g=Duel.GetMatchingGroup(c100214005.desfilter2,tp,LOCATION_MZONE,0,nil,e)
if chk==0 then return g:GetCount()~=0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,g:GetCount(),nil)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c100214005.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()~=0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--石油采掘
--Amiya
function c100214006.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100214006,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100214006+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100214006.target)
e1:SetOperation(c100214006.activate)
c:RegisterEffect(e1)
end
function c100214006.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToHand()
end
function c100214006.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c100214006.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100214006.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100214006.filter,tp,LOCATION_GRAVE,0,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c100214006.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
--地缚共振
function c100214011.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100214011,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100214011)
e2:SetCondition(c100214011.damcon)
e2:SetTarget(c100214011.damtg)
e2:SetOperation(c100214011.damop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100214011,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,100214111)
e3:SetCondition(c100214011.descon)
e3:SetTarget(c100214011.destg)
e3:SetOperation(c100214011.desop)
c:RegisterEffect(e3)
end
function c100214011.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonLocation(LOCATION_EXTRA)
and not c:IsType(TYPE_TOKEN)
and c:IsReason(REASON_EFFECT)
end
function c100214011.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100214011.cfilter,1,nil,tp)
end
function c100214011.tgfilter(c,e)
return c:IsCanBeEffectTarget(e) and not c:IsAttack(0)
end
function c100214011.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=eg:Filter(c100214011.cfilter,nil,tp):Filter(c100214011.tgfilter,nil,e)
if chkc then return mg:IsContains(chkc) end
if chk==0 then return mg:GetCount()>0 end
local g=mg
if mg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
g=mg:Select(tp,1,1,nil)
end
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,0)
end
function c100214011.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Damage(tp,tc:GetAttack()/2,REASON_EFFECT)
Duel.Damage(1-tp,tc:GetAttack()/2,REASON_EFFECT)
end
end
function c100214011.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsControler(tp) and tc:IsFaceup() and tc:IsAttribute(ATTRIBUTE_DARK) and tc:IsType(TYPE_SYNCHRO) and tc:IsSummonLocation(LOCATION_EXTRA)
end
function c100214011.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100214011.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end
end
\ No newline at end of file
--电极兽 阳离子
function c100214012.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100214012,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,100214012)
e1:SetTarget(c100214012.thtg)
e1:SetOperation(c100214012.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100214012,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100214112)
e2:SetTarget(c100214012.lvtg)
e2:SetOperation(c100214012.lvop)
c:RegisterEffect(e2)
end
function c100214012.thfilter(c)
return c:IsCode(100214013) and c:IsAbleToHand()
end
function c100214012.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100214012.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,0,0,0)
end
function c100214012.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsRace(RACE_THUNDER) and c:IsLevelBelow(4)
end
function c100214012.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100214012.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(c100214012.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(100214012,2)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,c100214012.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100214012.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100214012.splimit(e,c)
return not (c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_LIGHT)) and c:IsLocation(LOCATION_EXTRA)
end
function c100214012.lvfilter(c,lv)
return c:IsFaceup() and c:IsRace(RACE_THUNDER) and not c:IsLevel(lv) and c:IsLevelAbove(1)
end
function c100214012.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100214012.lvfilter(chkc,e:GetHandler():GetLevel()) end
if chk==0 then return Duel.IsExistingTarget(c100214012.lvfilter,tp,LOCATION_MZONE,0,1,nil,e:GetHandler():GetLevel()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100214012.lvfilter,tp,LOCATION_MZONE,0,1,1,nil,e:GetHandler():GetLevel())
end
function c100214012.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(tc:GetLevel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--电极兽 阴离子
function c100214013.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100214013,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,100214013)
e1:SetTarget(c100214013.lvtg)
e1:SetOperation(c100214013.lvop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100214013,1))
e2:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100214113)
e2:SetTarget(c100214013.drtg)
e2:SetOperation(c100214013.drop)
c:RegisterEffect(e2)
end
function c100214013.thfilter(c)
return c:IsCode(20802187) and c:IsAbleToHand()
end
function c100214013.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return not c:IsLevel(4) end
end
function c100214013.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and not c:IsLevel(4) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
if c:IsLevel(4) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c100214013.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(100214013,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100214013.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
end
function c100214013.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,c) and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,1,c)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100214013.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local g=Group.FromCards(c,tc)
if Duel.SendtoGrave(g,REASON_EFFECT)~=2 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
--纳祭升阶
function c100214014.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100214014,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100214014+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100214014.target)
e1:SetOperation(c100214014.activate)
c:RegisterEffect(e1)
end
function c100214014.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c100214014.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,rk+1)
end
function c100214014.filter2(c,e,tp,rk)
return c:IsRank(rk) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100214014.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c100214014.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100214014.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100214014.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100214014.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
local g=tc:GetOverlayGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:FilterSelect(tp,Card.IsAbleToRemove,2,2,nil,POS_FACEUP)
if rg and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100214014.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetRank()+1)
local sc=g:GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(100214014,1))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
--同调恐慌
function c100214017.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100214017,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetCondition(c100214017.condition)
e1:SetTarget(c100214017.target)
e1:SetOperation(c100214017.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(c100214017.splimit)
c:RegisterEffect(e2)
end
function c100214017.spcfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelAbove(1)
end
function c100214017.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsType(TYPE_SYNCHRO)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100214017.gcheck(g,tp,ec)
return g:FilterCount(Card.IsType,nil,TYPE_TUNER)==1 and g:GetSum(Card.GetLevel)==ec:GetLevel()
end
function c100214017.tgfilter(c,e,tp,ct)
local g=Duel.GetMatchingGroup(c100214017.spcfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
return c:IsCanBeEffectTarget(e) and c:IsLevelAbove(1) and g:CheckSubGroup(c100214017.gcheck,2,ct,tp,c)
end
function c100214017.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100214017.cfilter,1,nil,tp)
end
function c100214017.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=eg:Filter(c100214017.cfilter,nil,tp):Filter(c100214017.tgfilter,nil,e,tp,ct)
if chk==0 then return mg:GetCount()>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
local g=mg
if mg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
g=mg:Select(tp,1,1,nil)
end
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c100214017.descon)
e1:SetOperation(c100214017.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
c:SetTurnCounter(0)
c:RegisterEffect(e1)
end
function c100214017.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c100214017.spcfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
if tc:IsRelateToEffect(e) and g:CheckSubGroup(c100214017.gcheck,2,ct,tp,tc) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c100214017.gcheck,false,2,ct,tp,tc)
local sc=sg:GetFirst()
while sc do
Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100214017,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
sc:RegisterEffect(e2)
sc=sg:GetNext()
end
Duel.SpecialSummonComplete()
end
end
function c100214017.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c100214017.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==3 then
Duel.Destroy(c,REASON_RULE)
end
end
function c100214017.splimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_SYNCHRO)==SUMMON_TYPE_SYNCHRO
end
\ No newline at end of file
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