Commit 7a10016c authored by mercury233's avatar mercury233

update scripts

parent c86789f2
...@@ -49,7 +49,7 @@ function c100226001.initial_effect(c) ...@@ -49,7 +49,7 @@ function c100226001.initial_effect(c)
c:RegisterEffect(e7) c:RegisterEffect(e7)
end end
function c100226001.valcheck(e,c) function c100226001.valcheck(e,c)
local g=c:GetMaterial() local g=c:GetMaterial():Filter(Card.IsRace,nil,RACE_SPELLCASTER)
if g:GetClassCount(Card.GetCode)==5 then e:GetLabelObject():SetLabel(1) end if g:GetClassCount(Card.GetCode)==5 then e:GetLabelObject():SetLabel(1) end
end end
function c100226001.descon(e,tp,eg,ep,ev,re,r,rp) function c100226001.descon(e,tp,eg,ep,ev,re,r,rp)
......
--Goddess of Sweet Revenge
function c100241001.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c100241001.condition)
e1:SetCost(c100241001.cost)
e1:SetTarget(c100241001.target)
e1:SetOperation(c100241001.operation)
c:RegisterEffect(e1)
end
function c100241001.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD+LOCATION_HAND,0,e:GetHandler())==0
end
function c100241001.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c100241001.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
if sg:FilterCount(Card.IsDestructable,nil,e)>0 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
end
function c100241001.filter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100241001.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if Duel.Destroy(sg,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c100241001.filter,tp,LOCATION_DECK,0,1,nil,e,tp) then
Duel.BreakEffect()
local tc=Duel.SelectMatchingCard(tp,c100241001.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--悪魔嬢リリス
--Lilith, Lady of Lament
--Scripted by Eerie Code
function c100306000.initial_effect(c)
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(1000)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c100306000.atkcon)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100306000)
e2:SetCost(c100306000.thcost)
e2:SetTarget(c100306000.thtg)
e2:SetOperation(c100306000.thop)
c:RegisterEffect(e2)
end
function c100306000.atkcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function c100306000.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsAttribute,1,nil,ATTRIBUTE_DARK) end
local g=Duel.SelectReleaseGroup(tp,Card.IsAttribute,1,1,nil,ATTRIBUTE_DARK)
Duel.Release(g,REASON_COST)
end
function c100306000.thfilter(c)
return c:GetType()==TYPE_TRAP and c:IsSSetable()
end
function c100306000.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c100306000.thfilter,tp,LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100306000.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100306000.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,3,3,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SET)
local tg=sg:Select(1-tp,1,1,nil)
Duel.SSet(tp,tg:GetFirst())
Duel.ConfirmCards(1-tp,tg)
end
end
--闇黒の魔王ディアボロス
--Darkest Diabolos, King of the Lair
--Scripted by Eerie Code
function c100306001.initial_effect(c)
--cannot release
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_RELEASE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetTarget(c100306001.rellimit)
c:RegisterEffect(e1)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100306001,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_RELEASE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e4:SetCountLimit(1,100306001)
e4:SetCondition(c100306001.spcon)
e4:SetTarget(c100306001.sptg)
e4:SetOperation(c100306001.spop)
c:RegisterEffect(e4)
--to deck
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100306001,1))
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,100306001+100)
e5:SetCost(c100306001.tdcost)
e5:SetTarget(c100306001.tdtg)
e5:SetOperation(c100306001.tdop)
c:RegisterEffect(e5)
end
function c100306001.rellimit(e,c,tp,sumtp)
return c==e:GetHandler()
end
function c100306001.spcfilter(c,tp)
return c:GetPreviousControler()==tp and c:GetPreviousAttributeOnField()==ATTRIBUTE_DARK
end
function c100306001.spcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c100306001.spcfilter,1,nil,tp)
end
function c100306001.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100306001.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100306001.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsAttribute,1,nil,ATTRIBUTE_DARK) end
local g=Duel.SelectReleaseGroup(tp,Card.IsAttribute,1,1,nil,ATTRIBUTE_DARK)
Duel.Release(g,REASON_COST)
end
function c100306001.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,nil) end
end
function c100306001.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(1-tp,Card.IsAbleToDeck,1-tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SelectOption(1-tp,aux.Stringid(100306001,2),aux.Stringid(100306001,3))==0 then
Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
else
Duel.SendtoDeck(g,nil,1,REASON_EFFECT)
end
end
end
--悪王アフリマ
--Ahrima, King of Wickedness
--Script by nekrozar
function c100306002.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100306002,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c100306002.thcost)
e1:SetTarget(c100306002.thtg)
e1:SetOperation(c100306002.thop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100306002,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100306002)
e2:SetCost(c100306002.drcost)
e2:SetTarget(c100306002.drtg)
e2:SetOperation(c100306002.drop)
c:RegisterEffect(e2)
end
function c100306002.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c100306002.thfilter1(c)
return c:IsCode(100306022) and c:IsAbleToHand()
end
function c100306002.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c100306002.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100306002.thop(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetFirstMatchingCard(c100306002.thfilter1,tp,LOCATION_DECK,0,nil)
if tg then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function c100306002.thfilter2(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsDefenseAbove(2000) and c:IsAbleToHand()
end
function c100306002.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return ((Duel.CheckReleaseGroup(tp,Card.IsAttribute,1,nil,ATTRIBUTE_DARK) and Duel.IsPlayerCanDraw(tp,1))
or (Duel.CheckReleaseGroup(tp,Card.IsAttribute,1,c,ATTRIBUTE_DARK) and Duel.IsExistingMatchingCard(c100306002.thfilter2,tp,LOCATION_DECK,0,1,nil))) end
local sg=nil
if Duel.IsExistingMatchingCard(c100306002.thfilter2,tp,LOCATION_DECK,0,1,nil) and not Duel.IsPlayerCanDraw(tp,1) then
sg=Duel.SelectReleaseGroup(tp,Card.IsAttribute,1,1,c,ATTRIBUTE_DARK)
else
sg=Duel.SelectReleaseGroup(tp,Card.IsAttribute,1,1,nil,ATTRIBUTE_DARK)
end
e:SetLabelObject(sg:GetFirst())
Duel.Release(sg,REASON_COST)
end
function c100306002.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetLabelObject()~=e:GetHandler() then
e:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND+CATEGORY_SEARCH)
end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100306002.drop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject()~=e:GetHandler() and Duel.IsExistingMatchingCard(c100306002.thfilter2,tp,LOCATION_DECK,0,1,nil)
and (not Duel.IsPlayerCanDraw(tp,1) or Duel.SelectYesNo(tp,aux.Stringid(100306002,2))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100306002.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
else
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
end
--闇黒世界-シャドウ・ディストピア-
--Lair of Darkness
--Script by mercury233
--not fully implemented
function c100306022.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--attribute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsFaceup))
e2:SetValue(ATTRIBUTE_DARK)
c:RegisterEffect(e2)
--release replace
--local e3=Effect.CreateEffect(c)
--c:RegisterEffect(e3)
--token
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_RELEASE)
e4:SetRange(LOCATION_FZONE)
e4:SetOperation(c100306022.regop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetRange(LOCATION_FZONE)
e5:SetCountLimit(1)
e5:SetTarget(c100306022.sptg)
e5:SetOperation(c100306022.spop)
c:RegisterEffect(e5)
end
function c100306022.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetFlagEffectLabel(100306022)
if ct then
c:SetFlagEffectLabel(100306022,ct+eg:GetCount())
else
c:RegisterFlagEffect(100306022,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,eg:GetCount())
end
end
function c100306022.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=e:GetHandler():GetFlagEffectLabel(100306022)
if ct then
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ct,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,0,0)
end
end
function c100306022.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetFlagEffectLabel(100306022)
if not ct then return end
local p=Duel.GetTurnPlayer()
if not Duel.IsPlayerCanSpecialSummonMonster(tp,100306022+100,0,0x4011,1000,1000,3,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE,p) then return end
local ft=Duel.GetLocationCount(p,LOCATION_MZONE)
ct=math.min(ct,ft)
if ct>1 and Duel.IsPlayerAffectedByEffect(p,59822133) then ct=1 end
for i=1,ct do
local token=Duel.CreateToken(tp,100306022+100)
Duel.SpecialSummonStep(token,0,tp,p,false,false,POS_FACEUP_DEFENSE)
end
Duel.SpecialSummonComplete()
end
--悪のデッキ破壊ウイルス
--Grinning Ghost Virus
--Scripted by Eerie Code
function c100306030.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_TOHAND+0x1c0)
e1:SetCost(c100306030.cost)
e1:SetTarget(c100306030.target)
e1:SetOperation(c100306030.activate)
c:RegisterEffect(e1)
end
function c100306030.costfilter(c,matk)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAttackBelow(matk)
end
function c100306030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c100306030.target(e,tp,eg,ep,ev,re,r,rp,chk)
local dc=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND+LOCATION_DECK)
local matk=math.min(3000,dc*500)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return matk>0 and Duel.CheckReleaseGroup(tp,c100306030.costfilter,1,nil,matk)
end
local g=Duel.SelectReleaseGroup(tp,c100306030.costfilter,1,1,nil,matk)
e:SetLabel(g:GetFirst():GetAttack())
Duel.Release(g,REASON_COST)
local ct=math.floor(g:GetFirst()/500)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,ct,1-tp,LOCATION_DECK+LOCATION_HAND)
end
function c100306030.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=e:GetLabel()
local ct=math.floor(atk/500)
local g=Duel.SelectMatchingCard(1-tp,nil,1-tp,LOCATION_DECK+LOCATION_HAND,0,ct,ct,nil)
if g:GetCount()~=0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE)
for oc in aux.Next(og) do
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_GRAVE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
oc:RegisterEffect(e3)
end
end
if atk>=2000 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DRAW)
e1:SetOperation(c100306030.desop)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,3)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(c100306030.turncon)
e2:SetOperation(c100306030.turnop)
e2:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,3)
Duel.RegisterEffect(e2,tp)
e2:SetLabelObject(e1)
c:RegisterFlagEffect(1082946,RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,3)
c100306030[c]=e2
end
end
function c100306030.desop(e,tp,eg,ep,ev,re,r,rp)
if ep==e:GetOwnerPlayer() then return end
local c=e:GetHandler()
local hg=eg:Filter(Card.IsLocation,nil,LOCATION_HAND)
if hg:GetCount()==0 then return end
Duel.ConfirmCards(1-ep,hg)
local dg=hg:Filter(Card.IsType,nil,TYPE_MONSTER)
if Duel.Destroy(dg,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE)
for oc in aux.Next(og) do
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_GRAVE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
oc:RegisterEffect(e3)
end
end
Duel.ShuffleHand(ep)
end
function c100306030.turncon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c100306030.turnop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
ct=ct+1
e:SetLabel(ct)
e:GetHandler():SetTurnCounter(ct)
if ct==3 then
e:GetLabelObject():Reset()
e:GetOwner():ResetFlagEffect(1082946)
end
end
--ウィジェット・キッド
--Widget Kid
--Scripted by Eerie Code
function c100318003.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100318003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100318003)
e1:SetTarget(c100318003.sptg)
e1:SetOperation(c100318003.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c100318003.filter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100318003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100318003.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100318003.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,c100318003.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
--サイバース・ホワイトハット
--Cyberse Whitehat
--Scripted by Eerie Code
function c100318004.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100318004,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100318004)
e1:SetCondition(c100318004.spcon)
c:RegisterEffect(e1)
--atk down
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100318004,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c100318004.atkcon)
e2:SetTarget(c100318004.atktg)
e2:SetOperation(c100318004.atkop)
c:RegisterEffect(e2)
end
function c100318004.filter(c,tp,race)
if c:IsFacedown() then return false end
if not race then
return Duel.IsExistingMatchingCard(c100318004.filter,tp,LOCATION_MZONE,0,1,c,tp,c:GetRace())
else
return c:IsRace(race)
end
end
function c100318004.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100318004.filter,c:GetControler(),LOCATION_MZONE,0,1,nil,c:GetControler())
end
function c100318004.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK
end
function c100318004.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function c100318004.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
\ No newline at end of file
--サイバネット・リカバー
--Cynet Recover
--Scripted by Eerie Code
function c100318021.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100318021,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100318021)
e2:SetCondition(c100318021.spcon)
e2:SetTarget(c100318021.sptg)
e2:SetOperation(c100318021.spop)
c:RegisterEffect(e2)
end
function c100318021.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and bit.band(c:GetPreviousTypeOnField(),TYPE_LINK)~=0
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp)
end
function c100318021.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100318021.cfilter,1,nil,tp)
end
function c100318021.filter(c,e,tp)
return not c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100318021.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100318021.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100318021.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100318021.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100318021.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--ペンテスタッグ
--Pentestag
--Scripted by Eerie Code
function c100318042.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_PIERCE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLinkState))
c:RegisterEffect(e1)
end
--空牙団の舵手 ヘルマー
--Helmer, Helmsman of the Skyfang Brigade
--Scripted by Eerie Code
function c100408016.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100408016,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,100408016)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c100408016.sptg)
e1:SetOperation(c100408016.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100408016,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100408016+100)
e2:SetCondition(c100408016.drcon)
e2:SetCost(c100408016.drcost)
e2:SetTarget(c100408016.drtg)
e2:SetOperation(c100408016.drop)
c:RegisterEffect(e2)
end
function c100408016.spfilter(c,e,tp)
return c:IsSetCard(0x214) and not c:IsCode(100408016) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100408016.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100408016.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100408016.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,c100408016.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
function c100408016.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x214) and c:IsControler(tp)
end
function c100408016.drcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c100408016.cfilter,1,nil,tp)
end
function c100408016.drcfilter(c)
return c:IsSetCard(0x214) and c:IsDiscardable()
end
function c100408016.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100408016.drcfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c100408016.drcfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c100408016.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100408016.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--空牙団の参謀 シール
--
--Scripted by Eerie Code
function c100408018.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100408018,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,100408018)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c100408018.sptg)
e1:SetOperation(c100408018.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100408018,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100408018+100)
e2:SetCondition(c100408018.thcon)
e2:SetTarget(c100408018.thtg)
e2:SetOperation(c100408018.thop)
c:RegisterEffect(e2)
end
function c100408018.spfilter(c,e,tp)
return c:IsSetCard(0x214) and not c:IsCode(100408018) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100408018.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100408018.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100408018.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,c100408018.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
function c100408018.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x214) and c:IsControler(tp)
end
function c100408018.thcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c100408018.cfilter,1,nil,tp)
end
function c100408018.thfilter(c)
return c:IsSetCard(0x214) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c100408018.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100408018.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100408018.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectTarget(tp,c100408018.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0)
end
function c100408018.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
--空牙団の豪傑 ダイナ
--
--Scripted by Eerie Code
function c100408021.initial_effect(c)
--banish
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100408021)
e1:SetTarget(c100408021.rmtg)
e1:SetOperation(c100408021.rmop)
c:RegisterEffect(e1)
--atk limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(c100408021.atlimit)
c:RegisterEffect(e2)
end
function c100408021.filter(c)
return c:IsFaceup() and c:IsSetCard(0x214)
end
function c100408021.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100408021.filter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return g:GetCount()~=0
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
end
function c100408021.rmop(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(c100408021.filter,tp,LOCATION_MZONE,0,nil)
local ct=cg:GetClassCount(Card.GetCode)
if ct==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,ct,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c100408021.atlimit(e,c)
return c:IsFaceup() and c:IsSetCard(0x214) and c~=e:GetHandler()
end
--閃刀姫-カガリ
--Brandish Maiden Kagari
--Scripted by Eerie Code
function c100408027.initial_effect(c)
c:SetSPSummonOnce(100408027)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c100408027.matfilter,1,1)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetValue(c100408027.atkval)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100408027,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetTarget(c100408027.thtg)
e3:SetOperation(c100408027.thop)
c:RegisterEffect(e3)
end
function c100408027.matfilter(c)
return c:IsLinkSetCard(0x1215) and not c:IsLinkAttribute(ATTRIBUTE_FIRE)
end
function c100408027.atkval(e)
return Duel.GetMatchingGroupCount(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,TYPE_SPELL)*100
end
function c100408027.thfilter(c,tp)
return c:IsSetCard(0x215) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c100408027.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100408027.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100408027.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectTarget(tp,c100408027.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,1,0,0)
end
function c100408027.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
--閃刀姫-シズク
--Brandish Maiden Shizuku
--Scripted by Eerie Code
function c100408028.initial_effect(c)
c:SetSPSummonOnce(100408028)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c100408028.matfilter,1,1)
--atk down
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(c100408028.atkval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetOperation(c100408028.regop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100408028,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c100408028.thcon)
e4:SetTarget(c100408028.thtg)
e4:SetOperation(c100408028.thop)
c:RegisterEffect(e4)
end
function c100408028.matfilter(c)
return c:IsLinkSetCard(0x1215) and not c:IsLinkAttribute(ATTRIBUTE_WATER)
end
function c100408028.atkval(e)
return Duel.GetMatchingGroupCount(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,TYPE_SPELL)*-100
end
function c100408028.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(100408028,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c100408028.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(100408028)~=0
end
function c100408028.thfilter(c,tp)
return c:IsSetCard(0x215) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,c:GetCode())
end
function c100408028.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100408028.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100408028.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100408028.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--閃刀姫-レイ
--Brandish Maiden Rei
--Script by nekrozar
function c100408029.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100408029,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100408029)
e1:SetCost(c100408029.spcost1)
e1:SetTarget(c100408029.sptg1)
e1:SetOperation(c100408029.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100408029,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100408129)
e2:SetCondition(c100408029.spcon2)
e2:SetTarget(c100408029.sptg2)
e2:SetOperation(c100408029.spop2)
c:RegisterEffect(e2)
end
function c100408029.spcost1(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 c100408029.spfilter1(c,e,tp,ec)
return c:IsSetCard(0x1215) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,ec,c,0x30)>0
end
function c100408029.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100408029.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100408029.spop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100408029.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,e:GetHandler())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,0x30)
end
end
function c100408029.cfilter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and bit.band(c:GetPreviousTypeOnField(),TYPE_LINK)~=0
and c:IsPreviousSetCard(0x1215) and (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT)))
end
function c100408029.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100408029.cfilter,1,nil,tp,rp)
end
function c100408029.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100408029.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--閃刀起動-エンゲージ
--Brandish Start-Up Engage
--Scripted by ahtelel
function c100408030.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100408030.condition)
e1:SetTarget(c100408030.target)
e1:SetOperation(c100408030.activate)
c:RegisterEffect(e1)
end
function c100408030.cfilter(c)
return c:GetSequence()<5
end
function c100408030.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100408030.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100408030.filter(c)
return c:IsSetCard(0x215) and c:IsAbleToHand() and not c:IsCode(100408030)
end
function c100408030.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100408030.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
end
end
function c100408030.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100408030.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsPlayerCanDraw(tp,1)
and Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3
and Duel.SelectYesNo(tp,aux.Stringid(100408030,0)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
--閃刀術式-アフターバーナー
--Brandish Skill Afterburner
--Scripted by ahtelel
function c100408031.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100408031.condition)
e1:SetTarget(c100408031.target)
e1:SetOperation(c100408031.activate)
c:RegisterEffect(e1)
end
function c100408031.cfilter(c)
return c:GetSequence()<5
end
function c100408031.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100408031.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100408031.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100408031.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then
local dg=Duel.GetMatchingGroup(Card.Type,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
if dg:GetCount()>0 and Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 and Duel.SelectYesNo(tp,aux.Stringid(100408031,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=dg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
--閃刀術式-ジャミングウェーブ
--Brandish Skill Jamming Wave
--Script by nekrozar
function c100408032.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100408032.condition)
e1:SetTarget(c100408032.target)
e1:SetOperation(c100408032.activate)
c:RegisterEffect(e1)
end
function c100408032.cfilter(c)
return c:GetSequence()<5
end
function c100408032.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100408032.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100408032.filter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c100408032.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c100408032.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c100408032.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c100408032.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100408032.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local dg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if dg:GetCount()>0 and Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 and Duel.SelectYesNo(tp,aux.Stringid(100408032,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=dg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
--閃刀機-ホーネットビット
--Brandish Mecha Hornet Bit
--Script by nekrozar
function c100408033.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100408033.condition)
e1:SetTarget(c100408033.target)
e1:SetOperation(c100408033.activate)
c:RegisterEffect(e1)
end
function c100408033.cfilter(c)
return c:GetSequence()<5
end
function c100408033.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100408033.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100408033.target(e,tp,eg,ep,ev,re,r,rp,chk)
local atk=0
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
atk=1500
end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,100408133,0,0x4011,atk,atk,1,RACE_WARRIOR,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c100408033.activate(e,tp,eg,ep,ev,re,r,rp)
local atk=0
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
atk=1500
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,100408133,0,0x4011,atk,atk,1,RACE_WARRIOR,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE) then return end
local token=Duel.CreateToken(tp,100408133)
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
token:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e2)
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetValue(1500)
e3:SetReset(RESET_EVENT+0x1fe0000)
token:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE)
token:RegisterEffect(e4)
end
end
Duel.SpecialSummonComplete()
end
--閃刀機-ウィドウアンカー
--Brandish Mecha Widow Anchor
--Scripted by ahtelel
function c100408034.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100408034.condition)
e1:SetTarget(c100408034.target)
e1:SetOperation(c100408034.activate)
c:RegisterEffect(e1)
end
function c100408034.cfilter(c)
return c:GetSequence()<5
end
function c100408034.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100408034.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100408034.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled()
end
function c100408034.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100408034.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100408034.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100408034.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
e:SetCategory(CATEGORY_DISABLE+CATEGORY_CONTROL)
end
end
function c100408034.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 and tc:IsControlerCanBeChanged() and Duel.SelectYesNo(tp,aux.Stringid(100408034,0)) then
Duel.BreakEffect()
Duel.GetControl(tc,tp,PHASE_END,1)
end
end
end
--閃刀機-イーグルブースター
--Brandish Mecha Eagle Booster
--Script by nekrozar
function c100408035.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100408035.condition)
e1:SetTarget(c100408035.target)
e1:SetOperation(c100408035.activate)
c:RegisterEffect(e1)
end
function c100408035.cfilter(c)
return c:GetSequence()<5
end
function c100408035.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100408035.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100408035.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c100408035.activate(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_IMMUNE_EFFECT)
e1:SetValue(c100408035.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
end
function c100408035.efilter(e,re)
return e:GetHandler()~=re:GetOwner()
end
--閃刀機-シャークキャノン
--Brandish Mecha Shark Cannon
--Scripted by ahtelel
function c100408036.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100408036.condition)
e1:SetTarget(c100408036.target)
e1:SetOperation(c100408036.activate)
c:RegisterEffect(e1)
end
function c100408036.cfilter(c)
return c:GetSequence()<5
end
function c100408036.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100408036.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100408036.filter(c,e,tp,spchk)
return c:IsType(TYPE_MONSTER) and (c:IsAbleToRemove() or (spchk and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c100408036.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local spchk=false
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
spchk=true
end
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and c100408036.filter(c,e,tp,spchk) end
if chk==0 then return Duel.IsExistingTarget(c100408036.filter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c100408036.filter,tp,0,LOCATION_GRAVE,1,1,nil)
if spchk and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false) and not g:GetFirst():IsAbleToRemove() then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
elseif not (spchk and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false)) and g:GetFirst():IsAbleToRemove() then
e:SetCategory(CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
end
function c100408036.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToRemove() or Duel.SelectYesNo(tp,aux.Stringid(100408036,0))) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
--閃刀機関-マルチロール
--Brandish Mechanism Multi-Roll
--Script by nekrozar
function c100408038.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100408038,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetTarget(c100408038.tgtg)
e2:SetOperation(c100408038.tgop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100408038,1))
e3:SetCategory(CATEGORY_LEAVE_GRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(c100408038.settg)
e3:SetOperation(c100408038.setop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
e4:SetLabelObject(e3)
e4:SetOperation(c100408038.regop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_CHAIN_NEGATED)
e5:SetOperation(c100408038.regop2)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e6:SetOperation(c100408038.clearop)
c:RegisterEffect(e6)
end
function c100408038.tgtg(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~=c end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c100408038.tgop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(c100408038.actop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.BreakEffect()
Duel.SendtoGrave(tc,REASON_EFFECT)
end
function c100408038.actop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
Duel.SetChainLimit(c100408038.chainlm)
end
end
function c100408038.chainlm(e,rp,tp)
return tp==rp
end
function c100408038.regop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsSetCard(0x215) and re:IsActiveType(TYPE_SPELL) and rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) then
local val=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(val+1)
end
end
function c100408038.regop2(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsSetCard(0x215) and re:IsActiveType(TYPE_SPELL) and rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) then
local val=e:GetLabelObject():GetLabel()
if val==0 then val=1 end
e:GetLabelObject():SetLabel(val-1)
end
end
function c100408038.clearop(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(0)
end
function c100408038.setfilter(c)
return c:IsSetCard(0x215) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function c100408038.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetLabel()
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(c100408038.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
function c100408038.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ct=e:GetLabel()
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ct>ft then ct=ft end
if ct<=0 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c100408038.setfilter),tp,LOCATION_GRAVE,0,nil)
if g:GetCount()==0 then return end
local tg=Group.CreateGroup()
repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
tg:Merge(sg)
g:Remove(Card.IsCode,nil,sg:GetFirst():GetCode())
ct=ct-1
until ct==0 or g:GetCount()==0 or not Duel.SelectYesNo(tp,aux.Stringid(100408038,2))
local tc=tg:GetFirst()
while tc do
Duel.SSet(tp,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+0x47e0000)
tc:RegisterEffect(e1)
tc=tg:GetNext()
end
Duel.ConfirmCards(1-tp,tg)
end
--閃刀空域-エリアゼロ
--Brandish Airspace Area Zero
--Scripted by Eerie Code
function c100408039.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--excavate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100408039,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,100408039)
e2:SetTarget(c100408039.thtg)
e2:SetOperation(c100408039.thop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100408039,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,100408039+100)
e3:SetCondition(c100408039.spcon)
e3:SetTarget(c100408039.sptg)
e3:SetOperation(c100408039.spop)
c:RegisterEffect(e3)
end
function c100408039.thtg(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~=c end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,0,1,c)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c100408039.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if g:GetCount()>0 then
if g:IsExists(Card.IsSetCard,1,nil,0x215) then
if Duel.SelectYesNo(tp,aux.Stringid(100408039,2)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,Card.IsSetCard,1,1,nil,0x215)
if sg:GetFirst():IsAbleToHand() then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
else
Duel.SendtoGrave(sg,REASON_RULE)
end
end
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
Duel.ShuffleDeck(tp)
end
end
function c100408039.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_FZONE)
end
function c100408039.spfilter(c,e,tp)
return c:IsSetCard(0x1215) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100408039.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100408039.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100408039.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,c100408039.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--烈風の空牙団
--Script by nekrozar
function c100408100.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100408100+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100408100.target)
e1:SetOperation(c100408100.activate)
c:RegisterEffect(e1)
end
function c100408100.filter(c,e,tp)
return c:IsSetCard(0x214) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100408100.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100408100.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100408100.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100408100.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100408100.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--閃刀機構-ハーキュリーベース
--Script by nekrozar
function c100408101.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100408101.condition)
e1:SetTarget(c100408101.target)
e1:SetOperation(c100408101.activate)
c:RegisterEffect(e1)
--cannot direct attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
c:RegisterEffect(e2)
--extra attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e3:SetValue(1)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100408101,0))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c100408101.drcon)
e4:SetTarget(c100408101.drtg)
e4:SetOperation(c100408101.drop)
c:RegisterEffect(e4)
--todeck
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100408101,1))
e5:SetCategory(CATEGORY_TODECK)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetCondition(c100408101.tdcon)
e5:SetTarget(c100408101.tdtg)
e5:SetOperation(c100408101.tdop)
c:RegisterEffect(e5)
--Equip limit
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e6:SetCode(EFFECT_EQUIP_LIMIT)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c100408101.cfilter(c)
return c:GetSequence()<5
end
function c100408101.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100408101.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100408101.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c100408101.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c100408101.drcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 and eg:GetFirst()==ec and Duel.GetAttacker()==ec
end
function c100408101.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100408101.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c100408101.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c100408101.tdfilter(c)
return c:IsSetCard(0xdc) and not c:IsCode(100408101) and c:IsAbleToDeck()
end
function c100408101.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100408101.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100408101.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100408101.tdfilter,tp,LOCATION_GRAVE,0,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c100408101.tdop(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.SendtoDeck(g,nil,2,REASON_EFFECT)
end
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