Commit e03d37ba authored by mercury233's avatar mercury233

updates scripts

parent 7caf4ad1
--始原竜プライマル・ドラゴン
--
--Script by mercury233
function c100200172.initial_effect(c)
--no battle damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_NO_BATTLE_DAMAGE)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetDescription(aux.Stringid(100200172,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100200172)
e2:SetCost(c100200172.atkcost)
e2:SetOperation(c100200172.atkop)
c:RegisterEffect(e2)
--double attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100200172,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_RELEASE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,100200172+100)
e3:SetCondition(c100200172.condition)
e3:SetTarget(c100200172.target)
e3:SetOperation(c100200172.operation)
c:RegisterEffect(e3)
end
function c100200172.cfilter(c)
return c:IsRace(RACE_DRAGON) and c:GetAttack()>0 and c:IsAbleToRemoveAsCost()
end
function c100200172.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100200172.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100200172.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetFirst():GetAttack())
end
function c100200172.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
end
function c100200172.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c100200172.filter(c)
return c:IsFaceup() and not c:IsHasEffect(EFFECT_EXTRA_ATTACK)
end
function c100200172.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100200172.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100200172.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100200172.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100200172.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
--リングリボー
--
--Script by mercury233
function c100204008.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c100204008.mfilter,1,1)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100204008,0))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100204008)
e1:SetCondition(c100204008.discon)
e1:SetCost(c100204008.discost)
e1:SetTarget(c100204008.distg)
e1:SetOperation(c100204008.disop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100204008,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100204008+100)
e2:SetCost(c100204008.spcost)
e2:SetTarget(c100204008.sptg)
e2:SetOperation(c100204008.spop)
c:RegisterEffect(e2)
end
function c100204008.mfilter(c)
return c:IsLevelBelow(4) and c:IsLinkRace(RACE_CYBERSE)
end
function c100204008.discon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c100204008.discost(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 c100204008.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.nbcon(tp,re) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function c100204008.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
function c100204008.cfilter(c,tp)
return c:IsSetCard(0x235) and c:GetSummonLocation()==LOCATION_EXTRA and Duel.GetMZoneCount(tp,c)>0
end
function c100204008.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100204008.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100204008.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100204008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100204008.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
--激動の未界域
--
--Script by mercury233
function c100258037.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100258037,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(c100258037.bdcon)
e2:SetTarget(c100258037.bdtg)
e2:SetOperation(c100258037.bdop)
c:RegisterEffect(e2)
--destroy all
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100258037,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,100258037)
e3:SetCost(c100258037.descost)
e3:SetTarget(c100258037.destg)
e3:SetOperation(c100258037.desop)
c:RegisterEffect(e3)
end
function c100258037.cfilter(c,tp)
local rc=c:GetReasonCard()
return c:IsReason(REASON_BATTLE) and c:GetPreviousControler()==tp and c:IsSetCard(0x11e)
and rc and rc:IsControler(1-tp) and rc:IsRelateToBattle()
end
function c100258037.bdcon(e,tp,eg,ep,ev,re,r,rp)
local dc=eg:Filter(c100258037.cfilter,nil,tp):GetFirst()
if dc then
e:SetLabelObject(dc:GetReasonCard())
return true
else return false end
end
function c100258037.bdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetLabelObject(),1,0,0)
end
function c100258037.bdop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc and tc:IsRelateToBattle() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c100258037.costfilter(c)
return c:IsSetCard(0x11e) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost()
end
function c100258037.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100258037.costfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,aux.dncheck,false,3,3)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c100258037.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c100258037.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100258037.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100258037.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x11e)
end
--クロス・オーバー
--
--Script by mercury233
--Effect not fully confirmed
function c100309042.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:SetCountLimit(1,100309042+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100309042.target)
e1:SetOperation(c100309042.activate)
c:RegisterEffect(e1)
end
function c100309042.eqfilter(c)
return c:IsFaceup() and c:IsAbleToChangeControler()
end
function c100309042.tgfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end
function c100309042.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c100309042.eqfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingTarget(c100309042.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local g=Duel.SelectTarget(tp,c100309042.eqfilter,tp,0,LOCATION_MZONE,1,1,nil)
e:SetLabelObject(g:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
Duel.SelectTarget(tp,c100309042.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c100309042.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local hc=g:GetFirst()
if hc==tc then hc=g:GetNext() end
if hc:IsFaceup() and hc:IsRelateToEffect(e) and hc:IsControler(tp)
and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then
if not Duel.Equip(tp,tc,hc,false) then return end
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetLabelObject(hc)
e1:SetValue(c100309042.eqlimit)
tc:RegisterEffect(e1)
--substitute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetTarget(c100309042.desreptg)
e2:SetOperation(c100309042.desrepop)
tc:RegisterEffect(e2)
--damage 0
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
hc:RegisterEffect(e3)
end
end
function c100309042.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c100309042.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=c:GetEquipTarget()
if chk==0 then return c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
and tg and tg:IsReason(REASON_BATTLE+REASON_EFFECT) and not tg:IsReason(REASON_REPLACE) end
return Duel.SelectEffectYesNo(tp,c,aux.Stringid(100309042,0))
end
function c100309042.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
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