Commit 113a0e3d authored by Damien Lawford's avatar Damien Lawford

New Scripts

New cards from Lord of the Tachyon Galaxy/Extra Pack: Sword of Knights.
parent d9bb51a9
--Trifortressops
function c12275533.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12275533,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_ATTACK+0x1c0)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c12275533.condition)
e1:SetTarget(c12275533.target)
e1:SetOperation(c12275533.operation)
c:RegisterEffect(e1)
--sum limit
if not c12275533.global_check then
c12275533.global_check=true
c12275533[0]=0
c12275533[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c12275533.checkop1)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
local ge3=ge1:Clone()
ge3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge4:SetOperation(c12275533.clear)
Duel.RegisterEffect(ge4,0)
end
end
function c12275533.checkop1(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
c12275533[tc:GetSummonPlayer()]= c12275533[tc:GetSummonPlayer()] + 1
tc=eg:GetNext()
end
end
function c12275533.clear(e,tp,eg,ep,ev,re,r,rp)
c12275533[0]=0
c12275533[1]=0
end
function c12275533.condition(e,tp,eg,ep,ev,re,r,rp)
return c12275533[1-tp]>=3
end
function c12275533.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,12275533)==0 and
Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,tp,0,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,12275533,RESET_CHAIN,0,0)
end
function c12275533.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
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:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetOperation(c12275533.adjustop)
c:RegisterEffect(e2)
end
function c12275533.adjustop(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_COPY_INHERIT)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetCode(EFFECT_UPDATE_DEFENCE)
e1:SetValue(-500)
c:RegisterEffect(e1)
end
--エクシーズ·リボーン
function c43841694.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c43841694.cost)
e1:SetTarget(c43841694.target)
e1:SetOperation(c43841694.activate)
c:RegisterEffect(e1)
end
function c43841694.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,43841694)==0 end
Duel.RegisterFlagEffect(tp,43841694,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c43841694.filter(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c43841694.filter2(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL)
end
function c43841694.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c43841694.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c43841694.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsExistingTarget(c43841694.filter2,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,c43841694.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g2=Duel.SelectTarget(tp,c43841694.filter2,tp,LOCATION_REMOVED,0,1,2,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,1,0,0)
end
function c43841694.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsType,nil,TYPE_SPELL):Filter(Card.IsRelateToEffect,nil,e)
local tc=e:GetLabelObject()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
if sg:GetCount()>0 then
Duel.Overlay(tc,sg)
end
end
end
--異怪の妖精 エルフォビア
function c44663232.initial_effect(c)
--xyz limit
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(44663232,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c44663232.cost)
e2:SetOperation(c44663232.operation)
c:RegisterEffect(e2)
end
function c44663232.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and not c:IsPublic()
end
function c44663232.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c44663232.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c44663232.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
e:SetLabel(g:GetFirst():GetLevel())
Duel.ShuffleHand(tp)
end
function c44663232.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetLabel(e:GetLabel())
e1:SetReset(RESET_PHASE+PHASE_MAIN1+RESET_OPPO_TURN)
e1:SetValue(c44663232.val)
Duel.RegisterEffect(e1,tp)
end
function c44663232.val(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():GetLevel()>e:GetLabel()
end
\ No newline at end of file
-- 炎虎梁山爆 function c70946699.initial_effect(c) --recover local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCategory(CATEGORY_RECOVER) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(c70946699.target) e1:SetOperation(c70946699.operation) c:RegisterEffect(e1) --damage local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(c70946699.damcon) e2:SetTarget(c70946699.damtg) e2:SetOperation(c70946699.damop) c:RegisterEffect(e2) end function c70946699.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c70946699.filter,tp,LOCATION_SZONE,0,1,nil) end Duel.SetTargetPlayer(tp) local rec=Duel.GetMatchingGroupCount(c70946699.filter,tp,LOCATION_SZONE,0,nil)*500 Duel.SetTargetParam(rec) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec) end function c70946699.filter(c) return c:IsType(TYPE_CONTINUOUS) and c:IsFaceup() end function c70946699.operation(e,tp,eg,ep,ev,re,r,rp) local rec=Duel.GetMatchingGroupCount(c70946699.filter,tp,LOCATION_MZONE,0,nil)*500 local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end function c70946699.damcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():GetReasonPlayer()~=tp and e:GetHandler():GetPreviousControler()==tp end function c70946699.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(rp) local rec=Duel.GetMatchingGroupCount(c70946699.filter,tp,LOCATION_GRAVE,0,nil)*500 Duel.SetTargetParam(rec) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,rp,500) end function c70946699.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end
\ No newline at end of file
--トーテムバード
function c71068247.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WIND),3),2)
c:EnableReviveLimit()
--negate activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71068247,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c71068247.condition1)
e1:SetCost(c71068247.cost1)
e1:SetTarget(c71068247.target1)
e1:SetOperation(c71068247.operation1)
c:RegisterEffect(e1)
--loose attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCondition(c71068247.adcon)
e2:SetValue(-300)
c:RegisterEffect(e2)
end
function c71068247.condition1(e,tp,eg,ep,ev,re,r,rp,chk)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c71068247.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c71068247.target1(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():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c71068247.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c71068247.adcon(e)
return e:GetHandler():GetOverlayCount()==0
end
\ No newline at end of file
--天命の聖剣
function c7452945.initial_effect(c)
c:SetUniqueOnField(1,0,7452945)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c7452945.target)
e1:SetOperation(c7452945.operation)
c:RegisterEffect(e1)
--cannot be destroyed
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetTarget(c7452945.reptg)
e2:SetCountLimit(1)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c7452945.eqlimit)
c:RegisterEffect(e3)
--equip
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_EQUIP)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CHAIN_UNIQUE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c7452945.eqcon)
e4:SetCost(c7452945.eqcost)
e4:SetTarget(c7452945.eqtg)
e4:SetOperation(c7452945.operation)
c:RegisterEffect(e4)
end
function c7452945.eqlimit(e,c)
return c:IsRace(RACE_WARRIOR)
end
function c7452945.eqfilter1(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end
function c7452945.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c7452945.eqfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c7452945.eqfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c7452945.eqfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c7452945.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and c:CheckUniqueOnField(tp) then
Duel.Equip(tp,c,tc)
end
end
function c7452945.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
return true
end
function c7452945.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c7452945.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(c7452945)==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-200)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c7452945,RESET_EVENT+0x1fe0000,0,0)
e:SetLabelObject(e1)
e:SetLabel(2)
else
local pe=e:GetLabelObject()
local ct=e:GetLabel()
e:SetLabel(ct+1)
pe:SetValue(ct*-200)
end
end
function c7452945.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsReason(REASON_DESTROY) and c:CheckUniqueOnField(tp)
end
function c7452945.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,c7452945)==0 end
Duel.RegisterFlagEffect(tp,c7452945,RESET_PHASE+PHASE_END,0,1)
end
function c7452945.eqfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x107a) and c:IsRace(RACE_WARRIOR)
end
function c7452945.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c7452945.eqfilter2(chkc) end
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c7452945.eqfilter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c7452945.eqfilter2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
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