Commit 80445408 authored by nanahira's avatar nanahira

pre

parent 2a116ce2
--アンダークロックテイカー
--Underclock Taker
--Script by nekrozar
function c101003039.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2)
c:EnableReviveLimit()
--atkdown
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003039,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c101003039.atktg)
e1:SetOperation(c101003039.atkop)
c:RegisterEffect(e1)
end
function c101003039.atkfilter(c,g)
return c:IsFaceup() and c:GetAttack()>0 and g:IsContains(c)
end
function c101003039.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local lg=e:GetHandler():GetLinkedGroup()
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101003039.atkfilter,tp,LOCATION_MZONE,0,1,nil,lg)
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectTarget(tp,c101003039.atkfilter,tp,LOCATION_MZONE,0,1,1,nil,lg)
e:SetLabelObject(g:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c101003039.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc1=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc2=g:GetFirst()
if tc1==tc2 then tc2=g:GetNext() end
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then
local atk=tc1:GetAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc2:RegisterEffect(e1)
end
end
--オルターガイスト・ヘクスティア
--Altergeist Hextia
--Scripted by Eerie Code
function c101003046.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x103),2,2)
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101003046.atkval)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101003046,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c101003046.discon)
e2:SetCost(c101003046.discost)
e2:SetTarget(c101003046.distg)
e2:SetOperation(c101003046.disop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101003046,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,101003046)
e3:SetCondition(c101003046.thcon)
e3:SetTarget(c101003046.thtg)
e3:SetOperation(c101003046.thop)
c:RegisterEffect(e3)
end
function c101003046.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x103) and c:GetBaseAttack()>=0
end
function c101003046.atkval(e,c)
local lg=c:GetLinkedGroup():Filter(c101003046.atkfilter,nil)
return g:GetSum(Card.GetBaseAttack)
end
function c101003046.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c101003046.cfilter(c,g)
return c:IsFaceup() and c:IsSetCard(0x103)
and g:IsContains(c) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c101003046.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.CheckReleaseGroup(tp,c101003046.cfilter,1,nil,lg) end
local g=Duel.SelectReleaseGroup(tp,c101003046.cfilter,1,1,nil,lg)
Duel.Release(g,REASON_COST)
end
function c101003046.distg(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 c101003046.disop(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 c101003046.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101003046.thfilter(c)
return c:IsSetCard(0x103) and c:IsAbleToHand()
end
function c101003046.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003046.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101003046.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101003046.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
......@@ -22,7 +22,9 @@ function c101003059.eqfilter(c,tc,tp)
end
function c101003059.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101003059.filter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
local ft=0
if e:GetHandler():IsLocation(LOCATION_HAND) then ft=1 end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>ft
and Duel.IsExistingTarget(c101003059.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101003059.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
......@@ -33,7 +35,7 @@ function c101003059.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c101003059.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tc,tp)
if g:GetCounter()>0 then
if g:GetCount()>0 then
Duel.Equip(tp,g:GetFirst(),tc)
end
end
......
--ダウンビート
--Downbeat
--Script by nekrozar
function c101003063.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101003063+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c101003063.cost)
e1:SetTarget(c101003063.target)
e1:SetOperation(c101003063.activate)
e1:SetLabel(0)
c:RegisterEffect(e1)
end
function c101003063.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c101003063.costfilter(c,e,tp)
return c:GetOriginalLevel()>0 and Duel.IsExistingMatchingCard(c101003063.spfilter,tp,LOCATION_DECK,0,1,nil,c,e,tp)
end
function c101003063.spfilter(c,tc,e,tp)
return c:GetOriginalLevel()==tc:GetOriginalLevel()-1
and c:GetOriginalRace()==tc:GetOriginalRace()
and c:GetOriginalAttribute()==tc:GetOriginalAttribute()
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101003063.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.CheckReleaseGroup(tp,c101003063.costfilter,1,nil,e,tp)
end
e:SetLabel(0)
local g=Duel.SelectReleaseGroup(tp,c101003063.costfilter,1,1,nil,e,tp)
Duel.Release(g,REASON_COST)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101003063.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101003063.spfilter,tp,LOCATION_DECK,0,1,1,nil,tc,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--オルターガイスト・マテリアリゼーション
--Altergeist Materialization
--Scripted by Eerie Code
function c101003070.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c101003070.target)
e1:SetOperation(c101003070.operation)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c101003070.desop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101003070)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c101003070.thtg)
e3:SetOperation(c101003070.thop)
c:RegisterEffect(e3)
end
function c101003070.spfilter(c,e,tp)
return c:IsSetCard(0x103) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function c101003070.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101003070.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101003070.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101003070.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101003070.eqlimit(e,c)
return e:GetLabelObject()==c
end
function c101003070.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) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)==0 then return end
Duel.Equip(tp,c,tc)
c:CancelToGrave()
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c101003070.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
end
function c101003070.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c101003070.thfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSetCard(0x103) and c:IsAbleToHand()
end
function c101003070.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101003070.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101003070.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101003070.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101003070.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
--六武衆の真影
--Legendary Shadow of the Six Samurai
--Script by nekrozar
function c15327215.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(15327215,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,15327215)
e1:SetCondition(c15327215.spcon)
e1:SetTarget(c15327215.sptg)
e1:SetOperation(c15327215.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(15327215,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c15327215.cost)
e3:SetOperation(c15327215.operation)
c:RegisterEffect(e3)
end
function c15327215.cfilter(c,tp)
return c:IsFaceup() and c:GetSummonPlayer()==tp and c:IsSetCard(0x103d)
end
function c15327215.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c15327215.cfilter,1,nil,tp)
end
function c15327215.sptg(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 c15327215.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 c15327215.filter(c,mc)
return c:IsLevelBelow(4) and c:IsSetCard(0x3d) and c:IsAbleToRemoveAsCost()
and not (c:GetLevel()==mc:GetLevel() and c:IsAttribute(mc:GetAttribute()) and c:GetAttack()==mc:GetAttack() and c:GetDefense()==mc:GetDefense())
end
function c15327215.cost(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c15327215.filter,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c15327215.filter,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabelObject(g:GetFirst())
end
function c15327215.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local lv=tc:GetLevel()
local att=tc:GetAttribute()
local atk=tc:GetAttack()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL_FINAL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(att)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(atk)
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
e4:SetValue(def)
c:RegisterEffect(e4)
end
end
......@@ -12,9 +12,6 @@ function c30907810.initial_effect(c)
e1:SetOperation(c30907810.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e2)
--activate from hand
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
......
--The splendid VENUS
function c5645210.initial_effect(c)
--atk,def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c5645210.target)
e1:SetValue(-500)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c5645210.target)
e1:SetValue(-500)
c:RegisterEffect(e1)
--cannot disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetTarget(c5645210.distarget)
c:RegisterEffect(e3)
--inactivatable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_INACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(c5645210.effectfilter)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_DISEFFECT)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(c5645210.effectfilter)
c:RegisterEffect(e5)
end
function c5645210.target(e,c)
return c:IsFaceup() and not c:IsRace(RACE_FAIRY)
end
function c5645210.effectfilter(e,ct)
local p=e:GetHandler():GetControler()
local te,tp,loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
return p==tp and te:IsActiveType(TYPE_SPELL+TYPE_TRAP) and bit.band(loc,LOCATION_ONFIELD)~=0
end
function c5645210.distarget(e,c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
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