Commit 82bf9f75 authored by mercury233's avatar mercury233

update scripts

parent e26a1c9f
--モーターバイオレンス
--
--Script by Trishula9
function c100200212.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100200212)
e1:SetTarget(c100200212.atktg)
e1:SetOperation(c100200212.atkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,100200212+100)
e3:SetCondition(c100200212.spcon)
e3:SetTarget(c100200212.sptg)
e3:SetOperation(c100200212.spop)
c:RegisterEffect(e3)
end
function c100200212.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsRace(RACE_MACHINE) and c:GetBaseDefense()>0
end
function c100200212.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c100200212.filter,1,nil,tp) end
local g=eg:Filter(c100200212.filter,nil,tp)
Duel.SetTargetCard(g)
end
function c100200212.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e):Filter(Card.IsFaceup,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(math.floor(tc:GetBaseDefense()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
function c100200212.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_ADVANCE)
end
function c100200212.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,100200312,0,TYPES_TOKEN_MONSTER,200,200,1,RACE_MACHINE,ATTRIBUTE_EARTH,POS_FACEUP_ATTACK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
function c100200212.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,100200312,0,TYPES_TOKEN_MONSTER,200,200,1,RACE_MACHINE,ATTRIBUTE_EARTH,POS_FACEUP_ATTACK) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,100200312)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
Duel.SpecialSummonComplete()
end
--ボティス
--
--Script by Trishula9
function c100200213.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c100200213.thtg)
e1:SetOperation(c100200213.thop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c100200213.regcon)
e2:SetOperation(c100200213.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1)
e3:SetCondition(c100200213.seqcon)
e3:SetTarget(c100200213.seqtg)
e3:SetOperation(c100200213.seqop)
c:RegisterEffect(e3)
end
function c100200213.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 and Duel.IsPlayerCanRemove(tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c100200213.rmfilter(c,g)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and g:IsExists(c100200213.thfilter,1,c,c:GetCode())
end
function c100200213.thfilter(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function c100200213.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return end
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
local dg=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local sg=g:Filter(c100200213.rmfilter,nil,dg)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(100200213,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rc=sg:Select(tp,1,1,nil):GetFirst()
Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=dg:FilterSelect(tp,c100200213.thfilter,1,1,rc,rc:GetCode())
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
function c100200213.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_NORMAL)
end
function c100200213.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(100200213,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c100200213.seqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(100200213)>0
end
function c100200213.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>2 end
end
function c100200213.seqop(e,tp,eg,ep,ev,re,r,rp)
Duel.SortDecktop(tp,tp,3)
end
--カシモラル
--
--Script by Trishula9
function c100200214.initial_effect(c)
--atk change
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c100200214.atktg)
e1:SetOperation(c100200214.atkop)
c:RegisterEffect(e1)
--atk limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c100200214.limcon)
e2:SetCost(c100200214.limcost)
e2:SetOperation(c100200214.limop)
c:RegisterEffect(e2)
end
function c100200214.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c100200214.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetBaseAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local fid=c:GetFieldID()
tc:RegisterFlagEffect(100200214,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetReset(RESET_PHASE+PHASE_END,2)
e2:SetCountLimit(1)
e2:SetLabel(fid,Duel.GetTurnCount())
e2:SetLabelObject(tc)
e2:SetCondition(c100200214.descon)
e2:SetOperation(c100200214.desop)
Duel.RegisterEffect(e2,tp)
end
end
function c100200214.descon(e,tp,eg,ep,ev,re,r,rp)
local fid,ct=e:GetLabel()
local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=ct and tc:GetFlagEffectLabel(100200214)==fid
end
function c100200214.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.Damage(1-tp,math.floor(tc:GetBaseAttack()/2),REASON_EFFECT)
end
end
function c100200214.limcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function c100200214.limcost(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 c100200214.limop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--魔鍵憑神-アシュタルトゥ
--Script by mercury233
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,8,2)
c:EnableReviveLimit()
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(s.damcon)
e1:SetCost(s.damcost)
e1:SetTarget(s.damtg)
e1:SetOperation(s.damop)
c:RegisterEffect(e1)
--banish
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.condition)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
local bc=ec:GetBattleTarget()
e:SetLabelObject(bc)
return bc and bc:GetBaseAttack()>0 and ec:IsControler(tp) and (ec:IsType(TYPE_NORMAL) or ec:IsSetCard(0x165))
and ec:IsRelateToBattle() and ec:IsStatus(STATUS_OPPO_BATTLE)
end
function s.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local bc=e:GetLabelObject()
Duel.SetTargetCard(bc)
local dam=bc:GetBaseAttack()
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=tc:GetBaseAttack()
if dam<0 then dam=0 end
Duel.Damage(p,dam,REASON_EFFECT)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.gfilter(c,att)
return c:IsAttribute(att) and (c:IsType(TYPE_NORMAL) or c:IsSetCard(0x165))
end
function s.filter(c,tp)
return c:IsFaceup() and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(s.gfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,c:GetAttribute())
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)>0 and tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
......@@ -30,7 +30,7 @@ function c100418011.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100418011.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM)
return c:IsFaceup() and c:GetOriginalType()&TYPE_PENDULUM~=0
end
function c100418011.sfilter(c)
return c:IsCode(63394872) and c:IsAbleToHand()
......
......@@ -28,11 +28,15 @@ function c100418019.initial_effect(c)
e2:SetOperation(c100418019.spop)
c:RegisterEffect(e2)
end
function c100418019.costfilter(c,tp)
return c:IsDiscardable() and Duel.IsExistingMatchingCard(c100418019.stfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,c)
end
function c100418019.stcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,c) end
if chk==0 then return c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c100418019.costfilter,tp,LOCATION_HAND,0,1,c,tp) end
Duel.SendtoGrave(c,REASON_COST)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
Duel.DiscardHand(tp,c100418019.costfilter,1,1,REASON_COST+REASON_DISCARD,nil,tp)
end
function c100418019.stfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x280) and c:IsSSetable()
......
......@@ -19,6 +19,7 @@ function c100418023.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100418023+100)
e2:SetCondition(c100418023.setcon)
e2:SetTarget(c100418023.settg)
......
......@@ -74,8 +74,10 @@ function c100418204.thop(e,tp,eg,ep,ev,re,r,rp)
end
function c100418204.mvcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsLocation(LOCATION_MZONE)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=tp)
and ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL
end
function c100418204.ffilter0(c,e)
return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
......
......@@ -110,7 +110,7 @@ function c100418209.stop(e,tp,eg,ep,ev,re,r,rp)
if not (tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and not tc:IsImmuneToEffect(e)) then return end
local zone=1<<tc:GetSequence()
local oc=Duel.GetMatchingGroup(c100418209.seqfilter,tp,0,LOCATION_SZONE,nil,tc:GetSequence()):GetFirst()
if oc and Duel.Destroy(oc,REASON_EFFECT)>0 and oc:IsType(TYPE_MONSTER) then
if oc and Duel.Destroy(oc,REASON_RULE)>0 and oc:IsType(TYPE_MONSTER) then
Duel.SetLP(1-tp,Duel.GetLP(1-tp)-oc:GetAttack())
end
if Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true,zone) then
......
......@@ -64,7 +64,7 @@ function c100418212.stop(e,tp,eg,ep,ev,re,r,rp)
local zone=1<<tc:GetSequence()
local oc=Duel.GetMatchingGroup(c100418212.seqfilter,tp,0,LOCATION_SZONE,nil,tc:GetSequence()):GetFirst()
if oc then
Duel.Destroy(oc,REASON_EFFECT)
Duel.Destroy(oc,REASON_RULE)
end
if Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true,zone) then
local e1=Effect.CreateEffect(e:GetHandler())
......
--アマゾネスの金鞭使い
--
--Script by Trishula9
function c100427030.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x4))
e1:SetValue(c100427030.atkval)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,100427030)
e2:SetCondition(c100427030.descon)
e2:SetTarget(c100427030.destg)
e2:SetOperation(c100427030.desop)
c:RegisterEffect(e2)
--pendulum
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,100427030+100)
e3:SetCondition(c100427030.pencon)
e3:SetTarget(c100427030.pentg)
e3:SetOperation(c100427030.penop)
c:RegisterEffect(e3)
--pendulem
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_LEAVE_GRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,100427030+200)
e4:SetCondition(c100427030.pencon2)
e4:SetTarget(c100427030.pentg2)
e4:SetOperation(c100427030.penop)
c:RegisterEffect(e4)
end
function c100427030.atkval(e,c)
return c:GetLevel()*100
end
function c100427030.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetBattleMonster(tp)
return tc and tc:IsSetCard(0x4) and tc:IsFaceup()
end
function c100427030.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c100427030.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c100427030.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100427030.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c100427030.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100427030.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c100427030.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c100427030.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c100427030.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function c100427030.penfilter(c,tp)
return c:IsSetCard(0x4) and c:IsControler(tp)
end
function c100427030.pencon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100427030.penfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c100427030.pentg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
\ No newline at end of file
--アマゾネスの銀剣使い
--
--Script by Trishula9
function c100427031.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x4))
e1:SetValue(c100427031.atkval)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,100427031)
e2:SetCondition(c100427031.thcon)
e2:SetTarget(c100427031.thtg)
e2:SetOperation(c100427031.thop)
c:RegisterEffect(e2)
--pendulum
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,100427031+100)
e3:SetCondition(c100427031.pencon)
e3:SetTarget(c100427031.pentg)
e3:SetOperation(c100427031.penop)
c:RegisterEffect(e3)
--pendulem
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_LEAVE_GRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,100427031+200)
e4:SetCondition(c100427031.pencon2)
e4:SetTarget(c100427031.pentg2)
e4:SetOperation(c100427031.penop)
c:RegisterEffect(e4)
end
function c100427031.atkval(e,c)
return c:GetLevel()*100
end
function c100427031.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetBattleMonster(tp)
return tc and tc:IsSetCard(0x4) and tc:IsFaceup()
end
function c100427031.thfilter(c)
return c:IsSetCard(0x4) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100427031.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100427031.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100427031.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100427031.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100427031.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
function c100427031.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c100427031.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c100427031.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function c100427031.penfilter(c,tp)
return c:IsSetCard(0x4) and c:IsControler(tp)
end
function c100427031.pencon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100427031.penfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c100427031.pentg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
--アマゾネス霊術師
--
--Script by Trishula9
function c100427033.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100427033)
e1:SetTarget(c100427033.sptg)
e1:SetOperation(c100427033.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100427033+100)
e2:SetTarget(c100427033.thtg)
e2:SetOperation(c100427033.thop)
c:RegisterEffect(e2)
end
function c100427033.filter(c,tp)
return c:IsSetCard(0x4) and not c:IsCode(100427033) and c:IsFaceup() and c:IsAbleToHand() and Duel.GetMZoneCount(tp,c)>0
end
function c100427033.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and c100427033.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c100427033.filter,tp,LOCATION_ONFIELD,0,1,nil,tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100427033.filter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100427033.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND)
and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100427033.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100427033.splimit(e,c)
return not c:IsSetCard(0x4) and c:IsLocation(LOCATION_EXTRA)
end
function c100427033.thfilter(c)
return c:IsCode(24094653) and c:IsAbleToHand()
end
function c100427033.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100427033.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100427033.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100427033.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
\ No newline at end of file
--アマゾネス女帝王
--
--Script by Trishula9
function c100427034.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,c100427034.matfilter,aux.FilterBoolFunction(Card.IsFusionSetCard,0x4),true)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c100427034.spcon)
e1:SetTarget(c100427034.sptg)
e1:SetOperation(c100427034.spop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(c100427034.indtg)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(c100427034.indtg)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--multi attack
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(c100427034.condition)
e4:SetOperation(c100427034.operation)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetValue(c100427034.valcheck)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
end
function c100427034.matfilter(c)
return c:IsFusionType(TYPE_FUSION) and c:IsFusionSetCard(0x4)
end
function c100427034.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c100427034.spfilter(c,e,tp)
return c:IsSetCard(0x4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100427034.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100427034.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100427034.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,c100427034.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
function c100427034.indtg(e,c)
return c:IsSetCard(0x4) and c~=e:GetHandler()
end
function c100427034.valcheck(e,c)
e:GetLabelObject():SetLabel(c:GetMaterial():FilterCount(Card.IsCode,nil,4591250,15951532))
end
function c100427034.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c100427034.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if ct>=1 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100427034,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
--アマゾネスペット虎獅王
--
--Script by Trishula9
function c100427035.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,c100427035.matfilter,aux.FilterBoolFunction(Card.IsFusionSetCard,0x4),true)
--atk limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(c100427035.atlimit)
c:RegisterEffect(e1)
--destroy and spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100427035)
e2:SetCost(c100427035.cost)
e2:SetTarget(c100427035.target)
e2:SetOperation(c100427035.operation)
c:RegisterEffect(e2)
end
function c100427035.matfilter(c)
return c:IsLevelAbove(5) and c:IsFusionSetCard(0x4)
end
function c100427035.atlimit(e,c)
return c~=e:GetHandler()
end
function c100427035.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1,true)
end
function c100427035.desfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x4) and Duel.GetMZoneCount(tp,c)>0
end
function c100427035.spfilter(c,e,tp)
return c:IsSetCard(0x4) and c:IsRace(RACE_WARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100427035.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c100427035.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
and Duel.IsExistingTarget(c100427035.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c100427035.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c100427035.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0)
e:SetLabelObject(g1:GetFirst())
end
function c100427035.operation(e,tp,eg,ep,ev,re,r,rp)
local tc1,tc2=Duel.GetFirstTarget()
if tc1~=e:GetLabelObject() then tc1,tc2=tc2,tc1 end
if tc1:IsRelateToEffect(e) and Duel.Destroy(tc1,REASON_EFFECT)>0 and tc2:IsRelateToEffect(e) then
Duel.SpecialSummon(tc2,0,tp,tp,false,false,POS_FACEUP)
end
end
--アマゾネスの秘術
--Script by mercury233
--not fully implemented
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(aux.bfgcost)
e2:SetOperation(s.fusop)
c:RegisterEffect(e2)
--workaround
if not aux.fus_mat_hack_check2 then
aux.fus_mat_hack_check2=true
function aux.fus_mat_hack_exmat_filter(c)
return c:IsHasEffect(EFFECT_EXTRA_FUSION_MATERIAL,c:GetControler())
end
_GetFusionMaterial=Duel.GetFusionMaterial
function Duel.GetFusionMaterial(tp,loc)
if loc==nil then loc=LOCATION_HAND+LOCATION_MZONE end
local g=_GetFusionMaterial(tp,loc)
local exg=Duel.GetMatchingGroup(aux.fus_mat_hack_exmat_filter,tp,LOCATION_EXTRA,0,nil)
return g+exg
end
_SendtoGrave=Duel.SendtoGrave
function Duel.SendtoGrave(tg,reason)
if reason~=REASON_EFFECT+REASON_MATERIAL+REASON_FUSION or aux.GetValueType(tg)~="Group" then
return _SendtoGrave(tg,reason)
end
local rg=tg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
local tc=rg:Filter(aux.fus_mat_hack_exmat_filter,nil):GetFirst()
if tc then
local te=tc:IsHasEffect(EFFECT_EXTRA_FUSION_MATERIAL,tc:GetControler())
te:UseCountLimit(tc:GetControler())
end
return _SendtoGrave(tg,reason)
end
end
end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x4) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function s.fusop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_FUSION_MATERIAL)
e1:SetTargetRange(LOCATION_EXTRA,0)
e1:SetCountLimit(1)
e1:SetTarget(s.mttg)
e1:SetValue(s.mtval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.mttg(e,c)
return c:IsSetCard(0x4) and c:IsAbleToGrave()
end
function s.mtval(e,c)
if not c then return true end
return c:IsSetCard(0x4)
end
--ジェムナイト・クォーツ
--
--Script by Trishula9
function c101109020.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101109020)
e1:SetCondition(c101109020.stcon)
e1:SetCost(c101109020.stcost)
e1:SetTarget(c101109020.sttg)
e1:SetOperation(c101109020.stop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101109020+100)
e2:SetCondition(c101109020.thcon)
e2:SetTarget(c101109020.thtg)
e2:SetOperation(c101109020.thop)
c:RegisterEffect(e2)
end
function c101109020.stcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c101109020.stcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c101109020.stfilter(c)
return c:IsSetCard(0x46) and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsSSetable()
end
function c101109020.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101109020.stfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c101109020.stop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c101109020.stfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
end
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(c101109020.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101109020.splimit(e,c)
return not c:IsSetCard(0x1047) and c:IsLocation(LOCATION_EXTRA)
end
function c101109020.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED) and c:IsFaceup()) and r==REASON_FUSION
end
function c101109020.thfilter(c)
return not c:IsCode(101109020) and c:IsSetCard(0x1047) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101109020.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101109020.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c101109020.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101109020.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--ブリリアント・ローズ
--
--Script by Trishula9
function c101109021.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101109021)
e1:SetCost(c101109021.spcost)
e1:SetTarget(c101109021.sptg)
e1:SetOperation(c101109021.spop)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c101109021.cpcost)
e2:SetOperation(c101109021.cpop)
c:RegisterEffect(e2)
end
function c101109021.cfilter(c)
return c:IsSetCard(0x1047,0x9b) and c:IsDiscardable()
end
function c101109021.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101109021.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c101109021.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c101109021.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 c101109021.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 c101109021.cpfilter(c)
return c:IsSetCard(0x1047,0x9b) and c:IsAbleToGraveAsCost()
end
function c101109021.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101109021.cpfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101109021.cpfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
Duel.SendtoGrave(g,REASON_COST)
e:SetLabelObject(tc)
end
function c101109021.cpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=e:GetLabelObject()
local code=tc:GetOriginalCodeRule()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(code)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(tc:GetOriginalRace())
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e3:SetValue(tc:GetOriginalAttribute())
c:RegisterEffect(e3)
end
--クローラー・ソゥマ
--Script by mercury233
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetTarget(s.hsptg)
e1:SetOperation(s.hspop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,id+o)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function s.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
end
function s.spfilter(c,e,tp)
return c:IsLevelAbove(0) and c:IsLevelBelow(4) and c:IsSetCard(0x104) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_DEFENSE)
end
function s.gselect(sg,lv)
return sg:GetSum(Card.GetLevel)==lv
end
function s.gcheck(lv)
return function(sg)
return aux.dncheck(sg) and sg:GetSum(Card.GetLevel)<=lv
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then
local c=e:GetHandler()
local clv=c:GetLevel()
if clv<=2 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
aux.GCheckAdditional=s.gcheck(2)
local b2=clv>2 and g:CheckSubGroup(s.gselect,1,ft,2)
aux.GCheckAdditional=s.gcheck(4)
local b4=clv>4 and g:CheckSubGroup(s.gselect,1,ft,4)
aux.GCheckAdditional=nil
return b2 or b4
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local clv=c:GetLevel()
if clv<=2 or not c:IsRelateToEffect(e) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
aux.GCheckAdditional=s.gcheck(2)
local b2=clv>2 and g:CheckSubGroup(s.gselect,1,ft,2)
aux.GCheckAdditional=s.gcheck(4)
local b4=clv>4 and g:CheckSubGroup(s.gselect,1,ft,4)
aux.GCheckAdditional=nil
local off=1
local ops={}
local opval={}
if b2 then
ops[off]=aux.Stringid(id,2)
opval[off-1]=2
off=off+1
end
if b4 then
ops[off]=aux.Stringid(id,3)
opval[off-1]=4
off=off+1
end
if off==1 then return end
local lv=opval[Duel.SelectOption(tp,table.unpack(ops))]
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(-lv)
c:RegisterEffect(e1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
aux.GCheckAdditional=s.gcheck(lv)
local sg=g:SelectSubGroup(tp,s.gselect,false,1,ft,lv)
aux.GCheckAdditional=nil
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_DEFENSE)
end
--お代狸様の代算様
--Script by mercury233
--not fully implemented
local s,id,o=GetID()
function s.initial_effect(c)
--cannot release
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e2)
--extra ritual material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id)
e3:SetTargetRange(LOCATION_EXTRA,0)
e3:SetValue(1)
c:RegisterEffect(e3)
--workaround
if not aux.rit_mat_hack_check then
aux.rit_mat_hack_check=true
function aux.rit_mat_hack_exmat_filter(c)
return c:IsHasEffect(EFFECT_EXTRA_RITUAL_MATERIAL,c:GetControler()) and c:IsLocation(LOCATION_EXTRA)
and (c:IsLevelAbove(0) or c22398665~=nil)
end
function aux.RitualCheckGreater(g,c,lv)
if g:FilterCount(aux.rit_mat_hack_exmat_filter,nil)>1 then return false end
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c)
end
function aux.RitualCheckEqual(g,c,lv)
if g:FilterCount(aux.rit_mat_hack_exmat_filter,nil)>1 then return false end
return g:CheckWithSumEqual(Card.GetRitualLevel,lv,#g,#g,c)
end
_GetRitualMaterial=Duel.GetRitualMaterial
function Duel.GetRitualMaterial(tp)
local g=_GetRitualMaterial(tp)
local exg=Duel.GetMatchingGroup(aux.rit_mat_hack_exmat_filter,tp,LOCATION_EXTRA,0,nil)
return g+exg
end
_GetRitualMaterialEx=Duel.GetRitualMaterialEx
function Duel.GetRitualMaterialEx(tp)
local g=_GetRitualMaterialEx(tp)
local exg=Duel.GetMatchingGroup(aux.rit_mat_hack_exmat_filter,tp,LOCATION_EXTRA,0,nil)
return g+exg
end
_ReleaseRitualMaterial=Duel.ReleaseRitualMaterial
function Duel.ReleaseRitualMaterial(mat)
local rg=mat:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
mat:Sub(rg)
local tc=rg:Filter(aux.rit_mat_hack_exmat_filter,nil):GetFirst()
if tc then
local te=tc:IsHasEffect(EFFECT_EXTRA_RITUAL_MATERIAL,tc:GetControler())
te:UseCountLimit(tc:GetControler())
end
Duel.SendtoGrave(rg,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
return _ReleaseRitualMaterial(mat)
end
end
end
--ジェムナイトレディ・ローズ・ダイヤ
--
--Script by Trishula9
function c101109044.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1047),aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),true)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(c101109044.indcon)
e1:SetTarget(c101109044.indtg)
e1:SetCountLimit(1)
e1:SetValue(c101109044.valcon)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c101109044.descon)
e2:SetCost(c101109044.descost)
e2:SetTarget(c101109044.destg)
e2:SetOperation(c101109044.desop)
c:RegisterEffect(e2)
end
function c101109044.indcon(e)
return Duel.GetTurnPlayer()~=e:GetHandlerPlayer()
end
function c101109044.indtg(e,c)
return c:IsSetCard(0x1047) and c:IsFaceup()
end
function c101109044.valcon(e,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0
end
function c101109044.descon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER)
and Duel.GetTurnPlayer()==tp
end
function c101109044.cfilter(c)
return c:IsSetCard(0x1047) and c:IsAbleToRemoveAsCost()
end
function c101109044.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101109044.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101109044.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101109044.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101109044.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--スキャッター・フュージョン
--
--Script by Trishula9
function c101109062.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--fusion
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,101109062)
e2:SetCondition(c101109062.condition)
e2:SetTarget(c101109062.target)
e2:SetOperation(c101109062.operation)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetOperation(c101109062.desop)
c:RegisterEffect(e3)
end
function c101109062.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c101109062.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c101109062.filter1(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave() and not c:IsImmuneToEffect(e)
end
function c101109062.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x1047) and not c:IsRace(RACE_ROCK) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c101109062.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c101109062.filter0,tp,LOCATION_DECK,0,nil)
local res=Duel.IsExistingMatchingCard(c101109062.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c101109062.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101109062.operation(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(c101109062.filter1,tp,LOCATION_DECK,0,nil,e)
local sg1=Duel.GetMatchingGroup(c101109062.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c101109062.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
e:GetHandler():SetCardTarget(tc)
end
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(c101109062.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101109062.splimit(e,c)
return not c:IsSetCard(0x1047) and c:IsLocation(LOCATION_EXTRA)
end
function c101109062.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
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