Commit f589aa50 authored by VanillaSalt's avatar VanillaSalt

new

parent cc2b930a
...@@ -583,9 +583,11 @@ uint32 card::is_xyz_level(card* pcard, uint32 lv) { ...@@ -583,9 +583,11 @@ uint32 card::is_xyz_level(card* pcard, uint32 lv) {
uint32 lev; uint32 lev;
effect_set eset; effect_set eset;
filter_effect(EFFECT_XYZ_LEVEL, &eset); filter_effect(EFFECT_XYZ_LEVEL, &eset);
if(eset.count) if(eset.count) {
lev = eset[0]->get_value(pcard); pduel->lua->add_param(this, PARAM_TYPE_CARD);
else pduel->lua->add_param(pcard, PARAM_TYPE_CARD);
lev = eset[0]->get_value(2);
} else
lev = get_level(); lev = get_level();
return ((lev & 0xffff) == lv) || ((lev >> 16) == lv); return ((lev & 0xffff) == lv) || ((lev >> 16) == lv);
} }
......
--クリフォート・エイリアス
function c13073850.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--splimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(c13073850.splimit)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_PZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xaa))
e3:SetValue(300)
c:RegisterEffect(e3)
--summon with no tribute
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(13073850,0))
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_SUMMON_PROC)
e4:SetCondition(c13073850.ntcon)
c:RegisterEffect(e4)
--change level
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SUMMON_COST)
e5:SetOperation(c13073850.lvop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_SPSUMMON_COST)
e6:SetOperation(c13073850.lvop2)
c:RegisterEffect(e6)
--immune
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c13073850.immcon)
e7:SetValue(c13073850.efilter)
c:RegisterEffect(e7)
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(13073850,1))
e8:SetCategory(CATEGORY_TOHAND)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e8:SetCode(EVENT_SUMMON_SUCCESS)
e8:SetProperty(EFFECT_FLAG_CARD_TARGET)
e8:SetCondition(c13073850.thcon)
e8:SetTarget(c13073850.thtg)
e8:SetOperation(c13073850.thop)
c:RegisterEffect(e8)
--tribute check
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetCode(EFFECT_MATERIAL_CHECK)
e9:SetValue(c13073850.valcheck)
e9:SetLabelObject(e8)
c:RegisterEffect(e9)
end
function c13073850.splimit(e,c)
return not c:IsSetCard(0xaa)
end
function c13073850.ntcon(e,c)
if c==nil then return true end
return c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c13073850.lvcon(e)
return e:GetHandler():GetMaterialCount()==0
end
function c13073850.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c13073850.lvcon)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c13073850.lvcon)
e2:SetValue(1800)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
end
function c13073850.lvop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1800)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
end
function c13073850.immcon(e)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_NORMAL)==SUMMON_TYPE_NORMAL
end
function c13073850.efilter(e,te)
if not te:IsActiveType(TYPE_MONSTER) or not te:IsHasType(0x7e0) then return false end
local tc=te:GetHandler()
local lv=e:GetHandler():GetLevel()
if te:IsActiveType(TYPE_XYZ) then
return tc:GetOriginalRank()<lv
end
return tc:GetOriginalLevel()<lv
end
function c13073850.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE and e:GetLabel()==1
end
function c13073850.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetChainLimit(c13073850.chlimit)
end
function c13073850.chlimit(e,ep,tp)
return tp==ep
end
function c13073850.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c13073850.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsSetCard,1,nil,0xaa) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
--星因士 リゲル
function c13851202.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,13851202)
e1:SetTarget(c13851202.target)
e1:SetOperation(c13851202.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c13851202.filter(c)
return c:IsFaceup() and c:IsSetCard(0x9c)
end
function c13851202.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c13851202.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c13851202.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c13851202.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c13851202.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCountLimit(1)
e2:SetOperation(c13851202.tgop)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
end
function c13851202.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
--インフェルノイド・ネヘモス
function c14799437.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c14799437.spcon)
e2:SetOperation(c14799437.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(14799437,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c14799437.destg)
e3:SetOperation(c14799437.desop)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(14799437,1))
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e4:SetCode(EVENT_CHAINING)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetCountLimit(1)
e4:SetCondition(c14799437.negcon)
e4:SetCost(c14799437.negcost)
e4:SetTarget(c14799437.negtg)
e4:SetOperation(c14799437.negop)
c:RegisterEffect(e4)
end
function c14799437.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c14799437.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=0
for i=0,4 do
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,i)
if tc and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) then
if tc:IsType(TYPE_XYZ) then sum=sum+tc:GetRank()
else sum=sum+tc:GetLevel() end
end
end
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c14799437.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,3,c)
else
local ct=-ft+1
return Duel.IsExistingMatchingCard(c14799437.spfilter,tp,LOCATION_MZONE,0,ct,nil)
and Duel.IsExistingMatchingCard(c14799437.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,3,c)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c14799437.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,3,c)
end
end
function c14799437.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if ft>0 then
g=Duel.SelectMatchingCard(tp,c14799437.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,3,3,c)
else
local sg=Duel.GetMatchingGroup(c14799437.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,c)
local ct=-ft+1
g=sg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE)
if ct<3 then
sg:Sub(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=sg:Select(tp,3-ct,3-ct,nil)
g:Merge(g2)
end
end
else
g=Duel.SelectMatchingCard(tp,c14799437.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,3,3,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c14799437.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c14799437.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function c14799437.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c14799437.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsReleasable,1,nil) end
local g=Duel.SelectReleaseGroup(tp,Card.IsReleasable,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c14799437.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsAbleToRemove() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function c14799437.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
--インフェルノイド・アシュメダイ
function c25811989.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c25811989.spcon)
e2:SetOperation(c25811989.spop)
c:RegisterEffect(e2)
--handes
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(25811989,0))
e3:SetCategory(CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(c25811989.thcon)
e3:SetTarget(c25811989.thtg)
e3:SetOperation(c25811989.thop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(25811989,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCost(c25811989.rmcost)
e4:SetTarget(c25811989.rmtg)
e4:SetOperation(c25811989.rmop)
c:RegisterEffect(e4)
end
function c25811989.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c25811989.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=0
for i=0,4 do
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,i)
if tc and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) then
if tc:IsType(TYPE_XYZ) then sum=sum+tc:GetRank()
else sum=sum+tc:GetLevel() end
end
end
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c25811989.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,2,c)
else
local ct=-ft+1
return Duel.IsExistingMatchingCard(c25811989.spfilter,tp,LOCATION_MZONE,0,ct,nil)
and Duel.IsExistingMatchingCard(c25811989.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,2,c)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c25811989.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,2,c)
end
end
function c25811989.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if ft>0 then
g=Duel.SelectMatchingCard(tp,c25811989.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,2,2,c)
else
local sg=Duel.GetMatchingGroup(c25811989.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,c)
local ct=-ft+1
g=sg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE)
if ct<2 then
sg:Sub(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=sg:Select(tp,1,1,nil)
g:Merge(g2)
end
end
else
g=Duel.SelectMatchingCard(tp,c25811989.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,2,2,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c25811989.thcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()~=nil
end
function c25811989.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c25811989.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(ep,LOCATION_HAND,0)
local sg=g:RandomSelect(ep,1)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
function c25811989.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsReleasable,1,nil) end
local g=Duel.SelectReleaseGroup(tp,Card.IsReleasable,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c25811989.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c25811989.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--インフェルノイド・ベルゼブル
function c26034577.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c26034577.spcon)
e2:SetOperation(c26034577.spop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(26034577,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c26034577.thtg)
e3:SetOperation(c26034577.thop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(26034577,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(c26034577.rmcon)
e4:SetCost(c26034577.rmcost)
e4:SetTarget(c26034577.rmtg)
e4:SetOperation(c26034577.rmop)
c:RegisterEffect(e4)
end
function c26034577.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c26034577.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=0
for i=0,4 do
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,i)
if tc and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) then
if tc:IsType(TYPE_XYZ) then sum=sum+tc:GetRank()
else sum=sum+tc:GetLevel() end
end
end
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c26034577.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,c)
else
return Duel.IsExistingMatchingCard(c26034577.spfilter,tp,LOCATION_MZONE,0,1,nil)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c26034577.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,c)
end
end
function c26034577.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
g=Duel.SelectMatchingCard(tp,c26034577.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
else
g=Duel.SelectMatchingCard(tp,c26034577.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
else
g=Duel.SelectMatchingCard(tp,c26034577.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c26034577.thfilter(c)
return c:IsFaceup() and c:IsAbleToHand()
end
function c26034577.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c26034577.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c26034577.thfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c26034577.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c26034577.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c26034577.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c26034577.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsReleasable,1,nil) end
local g=Duel.SelectReleaseGroup(tp,Card.IsReleasable,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c26034577.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c26034577.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
...@@ -53,9 +53,9 @@ function c27756115.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,9 +53,9 @@ function c27756115.eqop(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP) e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(c27756115.valcon)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetValue(c27756115.valcon)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c27756115.eqlimit(e,c) function c27756115.eqlimit(e,c)
...@@ -74,7 +74,8 @@ function c27756115.cfilter(c,e,tp) ...@@ -74,7 +74,8 @@ function c27756115.cfilter(c,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end end
function c27756115.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c27756115.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c27756115.cfilter,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and eg:IsExists(c27756115.cfilter,1,nil,e,tp) end
local g=eg:Filter(c27756115.cfilter,nil,e,tp) local g=eg:Filter(c27756115.cfilter,nil,e,tp)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
......
--アポクリフォート・カーネル
function c40061558.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--tribute limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRIBUTE_LIMIT)
e2:SetValue(c40061558.tlimit)
c:RegisterEffect(e2)
--summon with 3 tribute
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e3:SetCondition(c40061558.ttcon)
e3:SetOperation(c40061558.ttop)
e3:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_LIMIT_SET_PROC)
c:RegisterEffect(e4)
--immune
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetOperation(c40061558.immop)
c:RegisterEffect(e5)
--control
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_CONTROL)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetTarget(c40061558.cttg)
e6:SetOperation(c40061558.ctop)
c:RegisterEffect(e6)
end
function c40061558.tlimit(e,c)
return not c:IsSetCard(0xaa)
end
function c40061558.ttcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end
function c40061558.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c40061558.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c40061558.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
function c40061558.efilter(e,te)
if te:IsActiveType(TYPE_SPELL+TYPE_TRAP) then return true end
if te:IsActiveType(TYPE_MONSTER) and te:IsHasType(0x7e0) then
local lv=e:GetHandler():GetLevel()
local ec=te:GetHandler()
if te:IsActiveType(TYPE_XYZ) then
return ec:GetOriginalRank()<lv
else
return ec:GetOriginalLevel()<lv
end
end
return false
end
function c40061558.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c40061558.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp,PHASE_END,1) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
--クリフォート・アセンブラ
function c51194046.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--splimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(c51194046.splimit)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(51194046,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1)
e3:SetCondition(c51194046.drcon)
e3:SetTarget(c51194046.drtg)
e3:SetOperation(c51194046.drop)
c:RegisterEffect(e3)
if not c51194046.global_check then
c51194046.global_check=true
c51194046[0]=0
c51194046[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(c51194046.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD)
ge2:SetCode(EFFECT_MATERIAL_CHECK)
ge2:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
ge2:SetValue(c51194046.valcheck)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(c51194046.clearop)
Duel.RegisterEffect(ge3,0)
end
end
function c51194046.splimit(e,c)
return not c:IsSetCard(0xaa)
end
function c51194046.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if bit.band(tc:GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE then
local p=tc:GetSummonPlayer()
c51194046[p]=c51194046[p]+e:GetLabel()
end
end
function c51194046.valcheck(e,c)
local ct=c:GetMaterial():FilterCount(Card.IsSetCard,nil,0xaa)
e:GetLabelObject():SetLabel(ct)
end
function c51194046.clearop(e,tp,eg,ep,ev,re,r,rp)
c51194046[0]=0
c51194046[1]=0
end
function c51194046.drcon(e,tp,eg,ep,ev,re,r,rp)
return c51194046[tp]>0
end
function c51194046.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,c51194046[tp]) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,c51194046[tp])
end
function c51194046.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,c51194046[tp],REASON_EFFECT)
end
--インフェルノイド・ヴァエル
function c51316684.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c51316684.spcon)
e2:SetOperation(c51316684.spop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(51316684,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c51316684.rmcon)
e3:SetTarget(c51316684.rmtg)
e3:SetOperation(c51316684.rmop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(51316684,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCost(c51316684.rmcost2)
e4:SetTarget(c51316684.rmtg2)
e4:SetOperation(c51316684.rmop2)
c:RegisterEffect(e4)
end
function c51316684.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c51316684.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=0
for i=0,4 do
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,i)
if tc and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) then
if tc:IsType(TYPE_XYZ) then sum=sum+tc:GetRank()
else sum=sum+tc:GetLevel() end
end
end
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c51316684.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,2,c)
else
local ct=-ft+1
return Duel.IsExistingMatchingCard(c51316684.spfilter,tp,LOCATION_MZONE,0,ct,nil)
and Duel.IsExistingMatchingCard(c51316684.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,2,c)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c51316684.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,2,c)
end
end
function c51316684.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if ft>0 then
g=Duel.SelectMatchingCard(tp,c51316684.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,2,2,c)
else
local sg=Duel.GetMatchingGroup(c51316684.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,c)
local ct=-ft+1
g=sg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE)
if ct<2 then
sg:Sub(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=sg:Select(tp,1,1,nil)
g:Merge(g2)
end
end
else
g=Duel.SelectMatchingCard(tp,c51316684.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,2,2,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c51316684.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroup():GetCount()>0
end
function c51316684.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c51316684.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c51316684.rmcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsReleasable,1,nil) end
local g=Duel.SelectReleaseGroup(tp,Card.IsReleasable,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c51316684.rmtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c51316684.rmop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--インフェルノイド・ルキフグス
function c52038272.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c52038272.spcon)
e2:SetOperation(c52038272.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(52038272,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(c52038272.descost)
e3:SetTarget(c52038272.destg)
e3:SetOperation(c52038272.desop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(52038272,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(c52038272.rmcon)
e4:SetCost(c52038272.rmcost)
e4:SetTarget(c52038272.rmtg)
e4:SetOperation(c52038272.rmop)
c:RegisterEffect(e4)
end
function c52038272.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c52038272.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=0
for i=0,4 do
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,i)
if tc and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) then
if tc:IsType(TYPE_XYZ) then sum=sum+tc:GetRank()
else sum=sum+tc:GetLevel() end
end
end
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c52038272.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,c)
else
return Duel.IsExistingMatchingCard(c52038272.spfilter,tp,LOCATION_MZONE,0,1,nil)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c52038272.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,c)
end
end
function c52038272.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
g=Duel.SelectMatchingCard(tp,c52038272.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
else
g=Duel.SelectMatchingCard(tp,c52038272.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
else
g=Duel.SelectMatchingCard(tp,c52038272.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c52038272.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c52038272.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c52038272.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
function c52038272.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c52038272.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsReleasable,1,nil) end
local g=Duel.SelectReleaseGroup(tp,Card.IsReleasable,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c52038272.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c52038272.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--RR-バニシング・レイニアス
function c53251824.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(c53251824.regop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c53251824.spcon)
e3:SetTarget(c53251824.sptg)
e3:SetOperation(c53251824.spop)
c:RegisterEffect(e3)
end
function c53251824.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(53251824,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c53251824.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(53251824)>0
end
function c53251824.spfilter(c,e,tp)
return c:IsSetCard(0xba) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c53251824.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c53251824.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c53251824.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c53251824.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
...@@ -6,7 +6,6 @@ function c64373401.initial_effect(c) ...@@ -6,7 +6,6 @@ function c64373401.initial_effect(c)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetValue(1)
e1:SetCondition(c64373401.hspcon) e1:SetCondition(c64373401.hspcon)
e1:SetOperation(c64373401.hspop) e1:SetOperation(c64373401.hspop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
......
--星因士 カペラ
function c86466163.initial_effect(c)
--xyzlv
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86466163,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,86466163)
e1:SetOperation(c86466163.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c86466163.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(c86466163.xyzlv)
e1:SetReset(RESET_PHASE+RESET_END)
Duel.RegisterEffect(e1,tp)
end
function c86466163.xyzlv(e,c,rc)
if c:IsLevelBelow(4) and c:IsSetCard(0x9c) and rc.xyz_count>2 then
return 0x50000+c:GetLevel()
end
return c:GetLevel()
end
--クリフォート・アクセス
function c87588741.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--splimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(c87588741.splimit)
c:RegisterEffect(e2)
--atk down
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_PZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetValue(-300)
c:RegisterEffect(e3)
--summon with no tribute
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(87588741,0))
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_SUMMON_PROC)
e4:SetCondition(c87588741.ntcon)
c:RegisterEffect(e4)
--change level
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SUMMON_COST)
e5:SetOperation(c87588741.lvop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_SPSUMMON_COST)
e6:SetOperation(c87588741.lvop2)
c:RegisterEffect(e6)
--immune
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c87588741.immcon)
e7:SetValue(c87588741.efilter)
c:RegisterEffect(e7)
--damage
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(87588741,1))
e8:SetCategory(CATEGORY_DAMAGE+CATEGORY_RECOVER)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e8:SetCode(EVENT_SUMMON_SUCCESS)
e8:SetCondition(c87588741.damcon)
e8:SetTarget(c87588741.damtg)
e8:SetOperation(c87588741.damop)
c:RegisterEffect(e8)
--tribute check
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetCode(EFFECT_MATERIAL_CHECK)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e9:SetValue(c87588741.valcheck)
e9:SetLabelObject(e8)
c:RegisterEffect(e9)
end
function c87588741.splimit(e,c)
return not c:IsSetCard(0xaa)
end
function c87588741.ntcon(e,c)
if c==nil then return true end
return c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c87588741.lvcon(e)
return e:GetHandler():GetMaterialCount()==0
end
function c87588741.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c87588741.lvcon)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c87588741.lvcon)
e2:SetValue(1800)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
end
function c87588741.lvop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1800)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
end
function c87588741.immcon(e)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_NORMAL)==SUMMON_TYPE_NORMAL
end
function c87588741.efilter(e,te)
if not te:IsActiveType(TYPE_MONSTER) or not te:IsHasType(0x7e0) then return false end
local tc=te:GetHandler()
local lv=e:GetHandler():GetLevel()
if te:IsActiveType(TYPE_XYZ) then
return tc:GetOriginalRank()<lv
end
return tc:GetOriginalLevel()<lv
end
function c87588741.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE and e:GetLabel()==1
end
function c87588741.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct1=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
local ct2=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_GRAVE,nil,TYPE_MONSTER)
local ct=ct2-ct1
if chk==0 then return ct>0 end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*300)
end
function c87588741.damop(e,tp,eg,ep,ev,re,r,rp)
local ct1=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
local ct2=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_GRAVE,nil,TYPE_MONSTER)
local ct=ct2-ct1
if ct>0 then
local val=Duel.Recover(tp,ct*300,REASON_EFFECT)
Duel.Damage(1-tp,val,REASON_EFFECT)
end
end
function c87588741.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsSetCard,1,nil,0xaa) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
--インフェルノイド・アドラメレク
function c88301393.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c88301393.spcon)
e2:SetOperation(c88301393.spop)
c:RegisterEffect(e2)
--chain attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88301393,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCondition(c88301393.atcon)
e3:SetOperation(c88301393.atop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(88301393,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCost(c88301393.rmcost)
e4:SetTarget(c88301393.rmtg)
e4:SetOperation(c88301393.rmop)
c:RegisterEffect(e4)
end
function c88301393.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c88301393.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=0
for i=0,4 do
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,i)
if tc and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) then
if tc:IsType(TYPE_XYZ) then sum=sum+tc:GetRank()
else sum=sum+tc:GetLevel() end
end
end
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c88301393.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,2,c)
else
local ct=-ft+1
return Duel.IsExistingMatchingCard(c88301393.spfilter,tp,LOCATION_MZONE,0,ct,nil)
and Duel.IsExistingMatchingCard(c88301393.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,2,c)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c88301393.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,2,c)
end
end
function c88301393.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if ft>0 then
g=Duel.SelectMatchingCard(tp,c88301393.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,2,2,c)
else
local sg=Duel.GetMatchingGroup(c88301393.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,c)
local ct=-ft+1
g=sg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE)
if ct<2 then
sg:Sub(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=sg:Select(tp,1,1,nil)
g:Merge(g2)
end
end
else
g=Duel.SelectMatchingCard(tp,c88301393.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,2,2,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c88301393.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:IsReason(REASON_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and c:IsChainAttackable()
end
function c88301393.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
end
function c88301393.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsReleasable,1,nil) end
local g=Duel.SelectReleaseGroup(tp,Card.IsReleasable,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c88301393.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c88301393.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--インフェルノイド・アスタロス
function c89423971.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c89423971.spcon)
e2:SetOperation(c89423971.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(89423971,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(c89423971.descost)
e3:SetTarget(c89423971.destg)
e3:SetOperation(c89423971.desop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(89423971,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(c89423971.rmcon)
e4:SetCost(c89423971.rmcost)
e4:SetTarget(c89423971.rmtg)
e4:SetOperation(c89423971.rmop)
c:RegisterEffect(e4)
end
function c89423971.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c89423971.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=0
for i=0,4 do
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,i)
if tc and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) then
if tc:IsType(TYPE_XYZ) then sum=sum+tc:GetRank()
else sum=sum+tc:GetLevel() end
end
end
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c89423971.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,c)
else
return Duel.IsExistingMatchingCard(c89423971.spfilter,tp,LOCATION_MZONE,0,1,nil)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c89423971.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,c)
end
end
function c89423971.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
g=Duel.SelectMatchingCard(tp,c89423971.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
else
g=Duel.SelectMatchingCard(tp,c89423971.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
else
g=Duel.SelectMatchingCard(tp,c89423971.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c89423971.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c89423971.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c89423971.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c89423971.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c89423971.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c89423971.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c89423971.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
function c89423971.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c89423971.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsReleasable,1,nil) end
local g=Duel.SelectReleaseGroup(tp,Card.IsReleasable,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c89423971.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c89423971.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
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