Commit b9b7106c authored by argon.sun's avatar argon.sun

new

parent d7d5e246
--二重魔法
function c24096228.initial_effect(c)
--copy spell
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c24096228.cost)
e1:SetTarget(c24096228.target)
e1:SetOperation(c24096228.operation)
c:RegisterEffect(e1)
end
function c24096228.cfilter(c)
return c:IsDiscardable() and c:IsType(TYPE_SPELL)
end
function c24096228.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24096228.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c24096228.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c24096228.filter1(c,e,tp,eg,ep,ev,re,r,rp)
return c:IsType(TYPE_SPELL) and c:CheckActivateEffect(false,false,false)~=nil
end
function c24096228.filter2(c,e,tp,eg,ep,ev,re,r,rp)
return c:IsType(TYPE_SPELL) and not c:IsType(TYPE_EQUIP+TYPE_CONTINUOUS) and c:CheckActivateEffect(false,false,false)~=nil
end
function c24096228.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then
local b=e:GetHandler():IsLocation(LOCATION_HAND)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if (b and ft>1) or (not b and ft>0) then
return Duel.IsExistingTarget(c24096228.filter1,tp,0,LOCATION_GRAVE,1,nil)
else
return Duel.IsExistingTarget(c24096228.filter2,tp,0,LOCATION_GRAVE,1,nil)
end
end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetCategory(0)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.SelectTarget(tp,c24096228.filter1,tp,0,LOCATION_GRAVE,1,1,nil)
else
Duel.SelectTarget(tp,c24096228.filter2,tp,0,LOCATION_GRAVE,1,1,nil)
end
end
function c24096228.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local tpe=tc:GetType()
local te=tc:GetActivateEffect()
local tg=te:GetTarget()
local co=te:GetCost()
local op=te:GetOperation()
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
Duel.ClearTargetCard()
if bit.band(tpe,TYPE_EQUIP+TYPE_CONTINUOUS)~=0 then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
tc:CreateEffectRelation(te)
if co then co(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
Duel.BreakEffect()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local etc=g:GetFirst()
while etc do
etc:CreateEffectRelation(te)
etc=g:GetNext()
end
if op then op(te,tp,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(te)
etc=g:GetFirst()
while etc do
etc:ReleaseEffectRelation(te)
etc=g:GetNext()
end
else
if bit.band(tpe,TYPE_FIELD)~=0 then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
if co then tg(e,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
Duel.BreakEffect()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
--フォーメーション·ユニオン
function c26931058.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:SetTarget(c26931058.eftg)
e1:SetOperation(c26931058.efop)
c:RegisterEffect(e1)
end
function c26931058.filter1(c,tp)
return c:IsFaceup() and c:IsType(TYPE_UNION)
and Duel.IsExistingTarget(c26931058.filter2,tp,LOCATION_MZONE,0,1,c,c)
end
function c26931058.filter2(c,ec)
return c:IsFaceup() and ec:CheckEquipTarget(c)
end
function c26931058.filter3(c,e,tp)
return c:IsFaceup() and c:IsStatus(STATUS_UNION) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c26931058.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local b1=Duel.IsExistingMatchingCard(c26931058.filter1,tp,LOCATION_MZONE,0,2,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
local b2=Duel.IsExistingMatchingCard(c26931058.filter3,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(26931058,0),aux.Stringid(26931058,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(26931058,0))
else op=Duel.SelectOption(tp,aux.Stringid(26931058,1))+1 end
e:SetLabel(op)
if op==0 then
e:SetCategory(CATEGORY_EQUIP)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(26931058,2))
local g1=Duel.SelectTarget(tp,c26931058.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g2=Duel.SelectTarget(tp,c26931058.filter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst(),g1:GetFirst())
e:SetLabelObject(g1:GetFirst())
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c26931058.filter3,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
end
function c26931058.efop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then
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 tc2:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e) and Duel.Equip(tp,tc1,tc2,false) then
tc1:SetStatus(STATUS_UNION,true)
end
else
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
end
end
--メタルシルバー·アーマー
--Effect is not fully implemented
function c33114323.initial_effect(c)
--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(c33114323.target)
e1:SetOperation(c33114323.operation)
c:RegisterEffect(e1)
--atk target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_RANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c33114323.efftg)
e2:SetValue(c33114323.effval)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function c33114323.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 c33114323.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 c33114323.efftg(e,c)
return c~=e:GetHandler():GetEquipTarget() and c:IsType(TYPE_MONSTER)
end
function c33114323.effval(e,re,rp)
return e:GetHandlerPlayer()~=rp
end
--クイズ
--Effect is not fully implemented
function c38723936.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c38723936.target)
e1:SetOperation(c38723936.activate)
c:RegisterEffect(e1)
end
function c38723936.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c38723936.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c38723936.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
function c38723936.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c38723936.filter,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()==0 then return end
local last=g:GetFirst()
local tc=g:GetNext()
while tc do
if tc:GetSequence()<last:GetSequence() then last=tc end
tc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,1-tp,564)
local ac=Duel.AnnounceCard(1-tp)
if ac~=last:GetCode() then
Duel.SpecialSummon(last,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Remove(last,POS_FACEUP,REASON_EFFECT)
end
end
--ルーレットボマー
function c46303688.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(46303688,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DICE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c46303688.target)
e1:SetOperation(c46303688.activate)
c:RegisterEffect(e1)
end
function c46303688.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,2)
end
function c46303688.dfilter(c,lv)
return c:IsFaceup() and c:GetLevel()==lv and c:IsDestructable()
end
function c46303688.activate(e,tp,eg,ep,ev,re,r,rp)
local d1,d2=Duel.TossDice(tp,2)
local sel=d1
if d1>d2 then d1,d2=d2,d1 end
if d1~=d2 then
sel=Duel.AnnounceNumber(tp,d1,d2)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,c46303688.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,sel)
if dg:GetCount()>0 then
Duel.Destroy(dg,REASON_EFFECT)
end
end
--地獄詩人ヘルポエマー
function c76052811.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetRange(LOCATION_GRAVE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--reg
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetOperation(c76052811.regop)
c:RegisterEffect(e2)
--handes
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(76052811,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCategory(CATEGORY_HANDES)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1)
e3:SetCondition(c76052811.hdcon)
e3:SetTarget(c76052811.hdtg)
e3:SetOperation(c76052811.hdop)
c:RegisterEffect(e3)
end
function c76052811.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) then
c:RegisterFlagEffect(76052811,RESET_EVENT+0x1fe0000,0,0)
end
end
function c76052811.hdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and e:GetHandler():GetFlagEffect(76052811)~=0
end
function c76052811.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():ResetFlagEffect(76052811)
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c76052811.hdop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():RegisterFlagEffect(76052811,RESET_EVENT+0x1fe0000,0,0)
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end
end
--コンビネーション·アタック
function c8964854.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c8964854.condition)
e1:SetTarget(c8964854.target)
e1:SetOperation(c8964854.operation)
c:RegisterEffect(e1)
end
function c8964854.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_BATTLE
end
function c8964854.filter(c,e,tp)
return c:GetAttackAnnouncedCount()>0 and Duel.IsExistingMatchingCard(c8964854.eqfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,c)
end
function c8964854.eqfilter(c,e,tp,ec)
return c:IsStatus(STATUS_UNION) and c:GetEquipTarget()==ec and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c8964854.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c8964854.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c8964854.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c8964854.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end
function c8964854.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local g=Duel.GetMatchingGroup(c8964854.eqfilter,tp,LOCATION_SZONE,0,nil,e,tp,tc)
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(tc:GetAttackAnnouncedCount())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
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