Commit 452fa93d authored by mercury233's avatar mercury233

archive

parent dd6192f3
#created by ...
#main
100424002
100424003
100424004
100424005
100424006
100424007
100424016
100424017
100424018
100424019
100424020
100424021
100424022
100424031
100424032
100424033
100424034
100424035
100424036
100424037
#extra
100424001
!side
#The first line is used for comment
!setname 0x5013 机皇神
!setname 0x248 化石
!setname 0x24a 源数
!setname 0x124a 源数之门
......
--神・スライム
--
--Script by mercury233
--not fully implemented
function c100424001.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_AQUA),c100424001.ffilter,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c100424001.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c100424001.hspcon)
e2:SetOperation(c100424001.hspop)
c:RegisterEffect(e2)
--triple tribute
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424001,0))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_HAND,0)
e3:SetCondition(c100424001.ttcon)
e3:SetTarget(c100424001.tttg)
e3:SetOperation(c100424001.ttop)
e3:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_LIMIT_SET_PROC)
c:RegisterEffect(e4)
--battle indestructable
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e5:SetValue(1)
c:RegisterEffect(e5)
--cannot be target
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e6:SetRange(LOCATION_MZONE)
e6:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e6:SetTargetRange(LOCATION_MZONE,0)
e6:SetTarget(c100424001.tgtg)
e6:SetValue(aux.tgoval)
c:RegisterEffect(e6)
--atk limit
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e7:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(0,LOCATION_MZONE)
e7:SetValue(c100424001.tgtg)
c:RegisterEffect(e7)
end
function c100424001.ffilter(c)
return c:IsFusionAttribute(ATTRIBUTE_WATER) and c:IsLevel(10)
end
function c100424001.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA) or aux.fuslimit(e,se,sp,st)
end
function c100424001.hspfilter(c,tp,sc)
return c:IsAttack(0) and c:IsRace(RACE_AQUA) and c:IsLevel(10)
and c:IsControler(tp) and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
end
function c100424001.hspcon(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),c100424001.hspfilter,1,nil,c:GetControler(),c)
end
function c100424001.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,c100424001.hspfilter,1,1,nil,tp,c)
c:SetMaterial(g)
Duel.Release(g,REASON_COST)
end
function c100424001.ttfilter(c)
return c:GetOriginalCode()==100424001 and c:IsReleasable()
end
function c100424001.ttcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return minc<=3 and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c100424001.ttfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100424001.tttg(e,c)
return c:IsCode(10000000,10000010,10000020,10000080,3912064,21208154,25524823,33022867,36354007,57793869,57761191,62180201,78651105)
end
function c100424001.ttop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c100424001.ttfilter,tp,LOCATION_MZONE,0,1,1,nil)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c100424001.tgtg(e,c)
return not (c:IsCode(100424001) and c:IsFaceup())
end
--リアクター・スライム
--Scripted by mallu11
function c100424002.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424002,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100424002)
e1:SetTarget(c100424002.sptg)
e1:SetOperation(c100424002.spop)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424002,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_ATTACK+TIMING_BATTLE_END)
e2:SetCountLimit(1,100424102)
e2:SetCondition(c100424002.setcon)
e2:SetCost(c100424002.setcost)
e2:SetTarget(c100424002.settg)
e2:SetOperation(c100424002.setop)
c:RegisterEffect(e2)
end
function c100424002.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,21770261,0,0x4011,500,500,1,RACE_AQUA,ATTRIBUTE_WATER) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
function c100424002.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsPlayerCanSpecialSummonMonster(tp,21770261,0,0x4011,500,500,1,RACE_AQUA,ATTRIBUTE_WATER) then
local ct=2
while ct>0 do
local token=Duel.CreateToken(tp,100424102)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
ct=ct-1
end
Duel.SpecialSummonComplete()
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(c100424002.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c100424002.splimit(e,c,tp,sumtp,sumpos)
return not c:IsRace(RACE_DIVINE)
end
function c100424002.setcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c100424002.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() end
Duel.Release(c,REASON_COST)
end
function c100424002.setfilter(c)
return c:IsCode(26905245) and c:IsSSetable()
end
function c100424002.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424002.setfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c100424002.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100424002.setfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
if tc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if tc:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
--ガーディアン・スライム
--Scripted by mallu11
function c100424003.initial_effect(c)
aux.AddCodeList(c,10000010)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100424003)
e1:SetCondition(c100424003.spcon)
e1:SetTarget(c100424003.sptg)
e1:SetOperation(c100424003.spop)
c:RegisterEffect(e1)
--def up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424003,1))
e2:SetCategory(CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100424103)
e2:SetCondition(c100424003.defcon)
e2:SetOperation(c100424003.defop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424003,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,100424203)
e3:SetCondition(c100424003.thcon)
e3:SetTarget(c100424003.thtg)
e3:SetOperation(c100424003.thop)
c:RegisterEffect(e3)
end
function c100424003.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
function c100424003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100424003.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 c100424003.defcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsControler(1-tp) and bc:IsFaceup() and bc:GetAttack()>0
end
function c100424003.defop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if c:IsRelateToBattle() and c:IsFaceup() and bc:IsRelateToBattle() and bc:IsFaceup() and bc:IsControler(1-tp) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(bc:GetAttack())
c:RegisterEffect(e1)
end
end
function c100424003.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD)
end
function c100424003.thfilter(c)
return aux.IsCodeListed(c,10000010) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100424003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424003.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100424003.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100424003.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
--古の呪文
--Scripted by mallu11
function c100424004.initial_effect(c)
aux.AddCodeList(c,10000010)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424004,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100424004+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100424004.target)
e1:SetOperation(c100424004.activate)
c:RegisterEffect(e1)
--gain atk/def
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424004,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100424004.gaintg)
e2:SetOperation(c100424004.gainop)
c:RegisterEffect(e2)
end
function c100424004.filter(c)
return c:IsCode(10000010) and c:IsAbleToHand()
end
function c100424004.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424004.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c100424004.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100424004.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsLocation(LOCATION_HAND) then
if Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,100424004)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(100424004,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetValue(0x1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_EXTRA_SET_COUNT)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,100424004,RESET_PHASE+PHASE_END,0,1)
end
end
end
end
function c100424004.gaintg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,100424104)==0 end
end
function c100424004.gainop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,100424104)~=0 then return end
local c=e:GetHandler()
--tribute check
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e1:SetValue(c100424004.valcheck)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--give atk effect only when summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SUMMON_COST)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetTarget(c100424004.tgchk)
e2:SetOperation(c100424004.facechk)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,100424104,RESET_PHASE+PHASE_END,0,1)
end
function c100424004.valcheck(e,c)
if e:GetLabel()==1 then
e:SetLabel(0)
local g=c:GetMaterial()
local tc=g:GetFirst()
local atk=0
local def=0
while tc do
atk=atk+math.max(tc:GetTextAttack(),0)
def=def+math.max(tc:GetTextDefense(),0)
tc=g:GetNext()
end
--atk continuous effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
c:RegisterEffect(e1)
--def continuous effect
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(def)
c:RegisterEffect(e2)
end
end
function c100424004.tgchk(e,c)
return c:IsCode(10000010)
end
function c100424004.facechk(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(1)
end
--ゴッド・ブレイズ・キャノン
--Scripted by mallu11
function c100424005.initial_effect(c)
aux.AddCodeList(c,10000010)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(c100424005.target)
e1:SetOperation(c100424005.activate)
c:RegisterEffect(e1)
end
function c100424005.filter(c)
return c:IsFaceup() and c:IsCode(10000010) and c:GetFlagEffect(100424005)==0
end
function c100424005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424005.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c100424005.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c100424005.filter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c100424005.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(tc)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetCondition(c100424005.atkcon)
e2:SetCost(c100424005.atkcost)
e2:SetTarget(c100424005.atktg)
e2:SetOperation(c100424005.atkop)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(tc)
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLED)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetCondition(c100424005.tgcon)
e3:SetTarget(c100424005.tgtg)
e3:SetOperation(c100424005.tgop)
tc:RegisterEffect(e3)
if not tc:IsType(TYPE_EFFECT) then
local e4=Effect.CreateEffect(tc)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ADD_TYPE)
e4:SetValue(TYPE_EFFECT)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
end
tc:RegisterFlagEffect(100424005,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(100424005,0))
end
end
function c100424005.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer()
end
function c100424005.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c)
end
function c100424005.atkfilter(c,tp)
return c:GetAttackAnnouncedCount()==0 and c:GetTextAttack()>0 and (c:IsControler(tp) or c:IsFaceup())
end
function c100424005.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100,0)
local g=Duel.GetReleaseGroup(tp):Filter(c100424005.atkfilter,e:GetHandler(),tp)
if chk==0 then return g:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:Select(tp,1,g:GetCount(),nil)
Duel.Release(rg,REASON_COST)
local atk=rg:GetSum(Card.GetTextAttack)
e:SetLabel(100,atk)
end
function c100424005.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local label,atk=e:GetLabel()
if chk==0 then
e:SetLabel(0,0)
if label~=100 then return false end
return true
end
e:SetLabel(0,0)
Duel.SetTargetParam(atk)
end
function c100424005.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c100424005.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler()
end
function c100424005.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c100424005.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--千年の啓示
--Scripted by mallu11
function c100424006.initial_effect(c)
aux.AddCodeList(c,10000010)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424006,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,100424006)
e1:SetCost(c100424006.thcost)
e1:SetTarget(c100424006.thtg)
e1:SetOperation(c100424006.thop)
c:RegisterEffect(e1)
--Reborn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424006,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100424106)
e2:SetCondition(c100424006.rbcon)
e2:SetCost(c100424006.rbcost)
e2:SetTarget(c100424006.rbtg)
e2:SetOperation(c100424006.rbop)
c:RegisterEffect(e2)
end
function c100424006.costfilter(c)
return c:IsRace(RACE_DIVINE) and c:IsAbleToGraveAsCost()
end
function c100424006.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424006.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100424006.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c100424006.thfilter(c)
return c:IsCode(83764718) and c:IsAbleToHand()
end
function c100424006.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424006.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c100424006.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100424006.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100424006.rbcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
end
function c100424006.rbcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
end
function c100424006.rbtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,100424006)==0 end
end
function c100424006.rbop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,100424006)~=0 then return end
local c=e:GetHandler()
--rebirth
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(41044418)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(c100424006.tgcon)
e2:SetOperation(c100424006.tgop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,100424006,RESET_PHASE+PHASE_END,0,1)
end
function c100424006.tgfilter(c)
return c:IsFaceup() and c:IsCode(10000010) and c:IsSummonType(SUMMON_TYPE_SPECIAL+200)
end
function c100424006.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100424006.tgfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100424006.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100424006.tgfilter,tp,LOCATION_MZONE,0,nil)
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_RULE)
end
--太陽神合一
--Scripted by mallu11
function c100424007.initial_effect(c)
aux.AddCodeList(c,10000010)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--act in set turn
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCondition(c100424007.actcon)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424007,0))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCondition(c100424007.atkcon)
e2:SetCost(c100424007.atkcost)
e2:SetTarget(c100424007.atktg)
e2:SetOperation(c100424007.atkop)
c:RegisterEffect(e2)
--recover
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424007,1))
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1)
e3:SetCost(c100424007.reccost)
e3:SetTarget(c100424007.rectg)
e3:SetOperation(c100424007.recop)
c:RegisterEffect(e3)
end
function c100424007.actfilter(c)
return c:IsFaceup() and c:IsOriginalCodeRule(10000010)
end
function c100424007.actcon(e)
return Duel.IsExistingMatchingCard(c100424007.actfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c100424007.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100424007.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100,0)
local c=e:GetHandler()
if chk==0 then return Duel.GetLP(tp)>100 and c:GetFlagEffect(100424107)==0 end
local lp=Duel.GetLP(tp)
e:SetLabel(100,lp-100)
Duel.PayLPCost(tp,lp-100)
c:RegisterFlagEffect(100424007,RESET_CHAIN,0,1)
end
function c100424007.atkfilter(c)
return c:IsFaceup() and c:IsCode(10000010) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c100424007.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local label,atk=e:GetLabel()
if chk==0 then
e:SetLabel(0,0)
if label~=100 then return false end
return Duel.IsExistingMatchingCard(c100424007.atkfilter,tp,LOCATION_MZONE,0,1,nil)
end
e:SetLabel(0,0)
Duel.SetTargetParam(atk)
end
function c100424007.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c100424007.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
local atk=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
function c100424007.recfilter(c)
return c:IsCode(10000010) and c:GetAttack()>0
end
function c100424007.reccost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100,0)
local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(tp,c100424007.recfilter,1,nil) and c:GetFlagEffect(100424007)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100424007.recfilter,1,1,nil)
e:SetLabel(100,g:GetFirst():GetAttack())
Duel.Release(g,REASON_COST)
c:RegisterFlagEffect(100424107,RESET_CHAIN,0,1)
end
function c100424007.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
local label,rec=e:GetLabel()
if chk==0 then
e:SetLabel(0,0)
if label~=100 then return false end
return true
end
e:SetLabel(0,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function c100424007.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--機皇神龍トリスケリア
--Meklord Astro Dragon Triskelia
--by Sk00ps
function c100424016.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c100424016.spcon)
e2:SetOperation(c100424016.spop)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424016,0))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCountLimit(1)
e3:SetTarget(c100424016.eqtg)
e3:SetOperation(c100424016.eqop)
c:RegisterEffect(e3)
--attack thrice
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c100424016.pcon)
e4:SetValue(2)
c:RegisterEffect(e4)
end
function c100424016.spfilter(c)
return c:IsSetCard(0x13) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c100424016.spcon(e,c)
if c==nil then return true end
if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)<=0 then return false end
local g=Duel.GetMatchingGroup(c100424016.spfilter,c:GetControler(),LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
return ct>=3
end
function c100424016.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c100424016.spfilter,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=aux.dncheck
local rg=g:SelectSubGroup(tp,aux.TRUE,false,3,3)
aux.GCheckAdditional=nil
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c100424016.eqfilter(c,tp)
return not c:IsForbidden() and c:CheckUniqueOnField(tp,LOCATION_SZONE)
end
function c100424016.filter(c,tp)
return c:IsFacedown() or c100424016.eqfilter(c,tp)
end
function c100424016.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and g:GetCount()>0
and g:IsExists(c100424016.filter,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,1-tp,LOCATION_EXTRA)
end
function c100424016.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local sg=g:FilterSelect(tp,c100424016.eqfilter,1,1,nil,tp)
local tc=sg:GetFirst()
if tc then
if Duel.Equip(tp,tc,c) then
local atk=tc:GetTextAttack()
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c100424016.eqlimit)
tc:RegisterEffect(e1)
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk)
tc:RegisterEffect(e2)
end
end
end
Duel.ShuffleExtra(1-tp)
end
function c100424016.eqlimit(e,c)
return e:GetOwner()==c
end
function c100424016.xatkfilter(c)
return c:IsFaceup() and c:GetOriginalType()&TYPE_SYNCHRO~=0
end
function c100424016.pcon(e)
return e:GetHandler():GetEquipGroup():IsExists(c100424016.xatkfilter,1,nil)
end
--機皇帝ワイゼル∞-S・アブソープション
--
--Script by 龙骑
function c100424017.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424017,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,100424017)
e2:SetCost(c100424017.spcost)
e2:SetCondition(c100424017.spcon)
e2:SetTarget(c100424017.sptg)
e2:SetOperation(c100424017.spop)
c:RegisterEffect(e2)
--atk limit
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424017,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c100424017.atktg)
e3:SetOperation(c100424017.atkop)
c:RegisterEffect(e3)
--Negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100424017,2))
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c100424017.negcon)
e4:SetCost(c100424017.negcost)
e4:SetTarget(c100424017.negtg)
e4:SetOperation(c100424017.negop)
c:RegisterEffect(e4)
end
function c100424017.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x13) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c100424017.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424017.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100424017.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function c100424017.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c100424017.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100424017.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)~=0 then
c:CompleteProcedure()
end
end
function c100424017.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_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c100424017.atkop(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:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c100424017.negcon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
if re:IsHasCategory(CATEGORY_NEGATE)
and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and tg~=nil and tc+tg:FilterCount(Card.IsOnField,nil)-tg:GetCount()>0
end
function c100424017.negcost(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 c100424017.negtg(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 c100424017.negop(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
--機皇枢インフィニティ・コア
--
--Script by JoyJ
function c100424018.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424018,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100424018)
e1:SetTarget(c100424018.thtg)
e1:SetOperation(c100424018.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e3:SetCountLimit(1)
e3:SetValue(c100424018.valcon)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100424018,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,100424018+100)
e4:SetCondition(c100424018.spcon2)
e4:SetTarget(c100424018.sptg2)
e4:SetOperation(c100424018.spop2)
c:RegisterEffect(e4)
end
function c100424018.thfilter(c)
return c:IsSetCard(0x13) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100424018.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424018.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100424018.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100424018.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100424018.valcon(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c100424018.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c100424018.filter(c,att)
return c:IsFaceup() and c:IsAttribute(att)
end
function c100424018.spfilter(c,e,tp)
return c:IsSetCard(0x3013) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and not Duel.IsExistingMatchingCard(c100424018.filter,tp,LOCATION_MZONE,0,1,nil,c:GetAttribute())
end
function c100424018.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100424018.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c100424018.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100424018.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
local c=e:GetHandler()
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c100424018.atkcon)
e2:SetTarget(c100424018.atktg)
Duel.RegisterEffect(e2,tp)
--check
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetOperation(c100424018.checkop)
e3:SetLabelObject(e2)
Duel.RegisterEffect(e3,tp)
end
function c100424018.atkcon(e)
return e:GetLabel()~=0
end
function c100424018.atktg(e,c)
return c:GetFieldID()~=e:GetLabel()
end
function c100424018.checkop(e,tp,eg,ep,ev,re,r,rp)
local fid=eg:GetFirst():GetFieldID()
e:GetLabelObject():SetLabel(fid)
end
--機皇兵廠オブリガード
--
--Script by JoyJ
function c100424019.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424019,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,100424019)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c100424019.sptg)
e1:SetOperation(c100424019.spop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424019,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100424019+100)
e2:SetOperation(c100424019.regop)
c:RegisterEffect(e2)
end
function c100424019.spfilter(c,e,tp)
return c:IsSetCard(0x6013) and not c:IsCode(100424019) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100424019.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>1
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingMatchingCard(c100424019.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c100424019.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100424019.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
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(c100424019.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100424019.splimit(e,c)
return not c:IsRace(RACE_MACHINE)
end
function c100424019.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c100424019.damop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100424019.damfilter(c)
return c:IsSetCard(0x13) and c:IsFaceup()
end
function c100424019.damop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c100424019.damfilter,tp,LOCATION_MZONE,0,nil)
if ct==0 then return end
Duel.Hint(HINT_CARD,0,100424019)
Duel.Damage(1-tp,ct*100,REASON_EFFECT)
end
--機皇創出
--
--Script by JoyJ
function c100424020.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100424020+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c100424020.activate)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424020,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,100424020+100)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(c100424020.descost)
e2:SetTarget(c100424020.destg)
e2:SetOperation(c100424020.desop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424020,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,100424020+200)
e3:SetCondition(c100424020.descon2)
e3:SetTarget(c100424020.destg2)
e3:SetOperation(c100424020.desop)
c:RegisterEffect(e3)
end
function c100424020.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x13) and c:IsAbleToHand()
end
function c100424020.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c100424020.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(100424020,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c100424020.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c100424020.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100424020.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 c100424020.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousSetCard(0x13) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c100424020.descon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100424020.cfilter,1,nil,tp)
end
function c100424020.desfilter2(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsFaceup()
end
function c100424020.destg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() and c100424020.desfilter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100424020.desfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c100424020.desfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
--機皇統制
--Scripted by mallu11
function c100424021.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424021,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,100424021+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(aux.dscon)
e1:SetTarget(c100424021.target)
e1:SetOperation(c100424021.activate)
c:RegisterEffect(e1)
--Destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(c100424021.reptg)
e2:SetValue(c100424021.repval)
c:RegisterEffect(e2)
end
function c100424021.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x13)
end
function c100424021.filter(c,atk)
return c100424021.atkfilter(c) and not c:IsAttack(atk)
end
function c100424021.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c100424021.atkfilter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()<=0 then return false end
local atk=g:GetSum(Card.GetBaseAttack)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100424021.filter(chkc,atk) end
if chk==0 then return Duel.IsExistingTarget(c100424021.filter,tp,LOCATION_MZONE,0,1,nil,atk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100424021.filter,tp,LOCATION_MZONE,0,1,1,nil,atk)
end
function c100424021.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=0
local g=Duel.GetMatchingGroup(c100424021.atkfilter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>0 then atk=g:GetSum(Card.GetBaseAttack) end
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
--damage 0
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e2:SetCondition(c100424021.damcon)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetOwnerPlayer(tp)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetCondition(c100424021.damcon2)
e3:SetValue(1)
tc:RegisterEffect(e3,true)
end
end
function c100424021.damcon(e)
return e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
function c100424021.damcon2(e)
return 1-e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
function c100424021.repfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup() and c:IsSetCard(0x13)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c100424021.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c100424021.repfilter,1,nil,tp) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
return true
else return false end
end
function c100424021.repval(e,c)
return c100424021.repfilter(c,e:GetHandlerPlayer())
end
--根絶の機皇神
--Scripted by mallu11
function c100424022.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424022,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,100424022)
e1:SetTarget(c100424022.target)
e1:SetOperation(c100424022.activate)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424022,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,100424122)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c100424022.descon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100424022.destg)
e2:SetOperation(c100424022.desop)
c:RegisterEffect(e2)
end
function c100424022.filter(c,e,tp)
return c:IsSetCard(0x13) and c:IsType(TYPE_MONSTER) and c:IsCanBeEffectTarget(e)
and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,true,false))
end
function c100424022.fselect(g,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct1=g:FilterCount(Card.IsAbleToHand,nil)
local ct2=g:FilterCount(Card.IsCanBeSpecialSummoned,nil,e,0,tp,true,false)
return (ct1==#g or ct2==#g and ct2<=ft and not Duel.IsPlayerAffectedByEffect(tp,59822133)) and aux.dncheck(g)
end
function c100424022.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c100424022.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chkc then return false end
if chk==0 then return g:CheckSubGroup(c100424022.fselect,3,3,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tg=g:SelectSubGroup(tp,c100424022.fselect,false,3,3,e,tp)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,0,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,0,0,0)
end
function c100424022.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local b1=tg:IsExists(Card.IsAbleToHand,1,nil)
local ct=tg:FilterCount(Card.IsCanBeSpecialSummoned,nil,e,0,tp,true,false)
local b2=ct>0 and ft>0 and (ct==1 or not Duel.IsPlayerAffectedByEffect(tp,59822133))
local opt=0
if b1 and not b2 then
opt=Duel.SelectOption(tp,1190)
elseif not b1 and b2 then
opt=Duel.SelectOption(tp,1152)+1
elseif b1 and b2 then
opt=Duel.SelectOption(tp,1190,1152)
end
if opt==0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
else
local sg=tg:Filter(Card.IsCanBeSpecialSummoned,nil,e,0,tp,true,false)
if sg:GetCount()<=ft then
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local pg=sg:Select(tp,ft,ft,nil)
Duel.SpecialSummon(pg,0,tp,tp,true,false,POS_FACEUP)
sg:Sub(pg)
Duel.SendtoGrave(sg,REASON_RULE)
end
end
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
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(c100424022.splimit)
if Duel.GetTurnPlayer()==tp then
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end
end
function c100424022.splimit(e,c)
return not c:IsRace(RACE_MACHINE)
end
function c100424022.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x5013)
end
function c100424022.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100424022.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100424022.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
end
function c100424022.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100424022.desfilter,tp,0,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c100424022.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c100424022.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
local atk=tc:GetBaseAttack()
if atk>0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
end
--脅威の人造人間-サイコ・ショッカー
--Scripted by mallu11
function c100424031.initial_effect(c)
aux.AddCodeList(c,77585513)
--spsummon1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424031,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100424031)
e1:SetCondition(c100424031.spcon1)
e1:SetTarget(c100424031.sptg1)
e1:SetOperation(c100424031.spop1)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424031,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_SSET+TIMING_MAIN_END)
e2:SetCountLimit(1,100424131)
e2:SetCondition(c100424031.spcon2)
e2:SetCost(c100424031.spcost2)
e2:SetTarget(c100424031.sptg2)
e2:SetOperation(c100424031.spop2)
c:RegisterEffect(e2)
end
function c100424031.cfilter(c)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsType(TYPE_TRAP)
end
function c100424031.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100424031.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
end
function c100424031.sptg1(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 c100424031.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(6)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
function c100424031.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100424031.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0 end
Duel.Release(c,REASON_COST)
end
function c100424031.spfilter(c,e,tp)
return c:IsCode(77585513) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100424031.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local res=e:GetLabel()==100 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c100424031.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c100424031.desfilter(c)
return c:IsType(TYPE_TRAP) or c100424031.cffilter(c)
end
function c100424031.cffilter(c)
return c:IsFacedown() and c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5
end
function c100424031.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100424031.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsExistingMatchingCard(c100424031.desfilter,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(100424031,2)) then
local sg=Duel.GetMatchingGroup(c100424031.cffilter,tp,0,LOCATION_ONFIELD,nil)
if sg:GetCount()>0 then Duel.ConfirmCards(tp,sg) end
local dg=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_TRAP)
if dg:GetCount()>0 then
Duel.BreakEffect()
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
--魔鏡導士サイコ・バウンダー
--Scripted by mallu11
function c100424032.initial_effect(c)
aux.AddCodeList(c,77585513)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424032,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100424032)
e1:SetTarget(c100424032.thtg)
e1:SetOperation(c100424032.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424032,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_CONFIRM)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100424132)
e3:SetCondition(c100424032.descon)
e3:SetTarget(c100424032.destg)
e3:SetOperation(c100424032.desop)
c:RegisterEffect(e3)
end
function c100424032.thfilter(c)
return (c:IsCode(77585513) or aux.IsCodeListed(c,77585513) and c:IsType(TYPE_SPELL+TYPE_TRAP)) and c:IsAbleToHand()
end
function c100424032.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424032.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100424032.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100424032.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
function c100424032.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
return bc and bc:IsControler(tp) and bc~=c and ac:IsControler(1-tp)
end
function c100424032.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local dc=Duel.GetAttacker()
local g=Group.FromCards(c,dc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function c100424032.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=Duel.GetAttacker()
if c:IsRelateToEffect(e) and dc:IsRelateToBattle() then
local g=Group.FromCards(c,dc)
Duel.Destroy(g,REASON_EFFECT)
end
end
--サイコ・ギガサイバー
--Scripted by mallu11
function c100424033.initial_effect(c)
aux.AddCodeList(c,77585513)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100424033)
e1:SetCondition(c100424033.spcon)
c:RegisterEffect(e1)
--place to szone
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424033,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100424133)
e2:SetCondition(c100424033.plcon)
e2:SetCost(c100424033.plcost)
e2:SetOperation(c100424033.plop)
c:RegisterEffect(e2)
end
function c100424033.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return (Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_ONFIELD,0,nil,TYPE_SPELL+TYPE_TRAP)<Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP))
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function c100424033.confilter(c)
return c:IsFaceup() and c:IsCode(77585513)
end
function c100424033.plcon(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c100424033.confilter,tp,LOCATION_ONFIELD,0,1,nil) then return false end
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsControler(1-tp) and bc:IsFaceup() and bc:IsType(TYPE_EFFECT)
end
function c100424033.plcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() end
Duel.Release(c,REASON_COST)
end
function c100424033.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp)>0 end
end
function c100424033.plop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsRelateToBattle() and bc:IsControler(1-tp) then
if Duel.MoveToField(bc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
bc:RegisterEffect(e1)
end
end
end
--電脳エナジーショック
--
--Script by mercury233
function c100424034.initial_effect(c)
aux.AddCodeList(c,77585513)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100424034+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCondition(c100424034.condition)
e1:SetTarget(c100424034.target)
e1:SetOperation(c100424034.activate)
c:RegisterEffect(e1)
end
function c100424034.cfilter(c)
return c:IsCode(77585513) and c:IsFaceup()
end
function c100424034.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100424034.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c100424034.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100424034.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and tc:IsType(TYPE_TRAP) then
local g1=Duel.GetMatchingGroup(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
local g2=Duel.GetMatchingGroup(c100424034.cfilter,tp,LOCATION_MZONE,0,nil)
local off=1
local ops={}
local opval={}
ops[off]=aux.Stringid(100424034,0)
opval[off-1]=0
off=off+1
if #g1>0 then
ops[off]=aux.Stringid(100424034,1)
opval[off-1]=1
off=off+1
end
if #g2>0 then
ops[off]=aux.Stringid(100424034,2)
opval[off-1]=2
off=off+1
end
local op=0
if #ops>1 then
op=Duel.SelectOption(tp,table.unpack(ops))
end
if op==1 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100424034,3))
local sg=g1:Select(tp,1,1,nil)
local tc=sg:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
if op==2 then
Duel.BreakEffect()
local tc=g2:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(800)
tc:RegisterEffect(e1)
tc=g2:GetNext()
end
end
end
end
--宇宙の法則
--Scripted by mallu11
function c100424035.initial_effect(c)
aux.AddCodeList(c,77585513)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424035,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100424035+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100424035.target)
e1:SetOperation(c100424035.activate)
c:RegisterEffect(e1)
end
function c100424035.spfilter(c,e,tp)
return c:IsCode(77585513) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100424035.thfilter(c)
return (c:IsCode(77585513) or aux.IsCodeListed(c,77585513) and c:IsType(TYPE_MONSTER)) and c:IsAbleToHand()
end
function c100424035.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c100424035.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) or Duel.IsExistingMatchingCard(c100424035.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK)
end
function c100424035.setfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSSetable(true)
end
function c100424035.activate(e,tp,eg,ep,ev,re,r,rp)
local sel=1
local g=Duel.GetMatchingGroup(c100424035.setfilter,tp,0,LOCATION_HAND+LOCATION_DECK,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(100424035,0))
if g:GetCount()>0 and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0 then
sel=Duel.SelectOption(1-tp,1213,1214)
else
sel=Duel.SelectOption(1-tp,1214)+1
end
if sel==0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SET)
local sg=g:Select(1-tp,1,1,nil)
if Duel.SSet(1-tp,sg)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local pg=Duel.SelectMatchingCard(tp,c100424035.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if pg:GetCount()>0 then
Duel.SpecialSummon(pg,0,tp,tp,false,false,POS_FACEUP)
end
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=Duel.SelectMatchingCard(tp,c100424035.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if hg:GetCount()>0 then
Duel.SendtoHand(hg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hg)
end
end
end
--宇宙との交信
--Scripted by mallu11
function c100424036.initial_effect(c)
aux.AddCodeList(c,77585513)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424036,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,100424036)
e1:SetCost(c100424036.spcost)
e1:SetTarget(c100424036.sptg)
e1:SetOperation(c100424036.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424036,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DRAW)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100424136)
e2:SetCondition(c100424036.drcon)
e2:SetTarget(c100424036.drtg)
e2:SetOperation(c100424036.drop)
c:RegisterEffect(e2)
end
function c100424036.tgfilter(c,tp)
return c:GetOwner()~=tp and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c100424036.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return Duel.IsExistingMatchingCard(c100424036.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100424036.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function c100424036.spfilter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100424036.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local res=e:GetLabel()==100 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c100424036.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c100424036.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,aux.NecroValleyFilter(c100424036.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100424036.confilter(c)
return c:IsFaceup() and c:IsCode(77585513)
end
function c100424036.drcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_RULE and Duel.IsExistingMatchingCard(c100424036.confilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c100424036.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGrave() and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
e:SetLabel(Duel.AnnounceType(tp))
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),0,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,0)
end
function c100424036.drop(e,tp,eg,ep,ev,re,r,rp)
if not eg:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then return end
local opt=e:GetLabel()
local g=eg:Filter(Card.IsLocation,nil,LOCATION_HAND)
Duel.ConfirmCards(tp,g)
Duel.ShuffleHand(1-tp)
local res=false
local tc=g:GetFirst()
while tc do
if (opt==0 and tc:IsType(TYPE_MONSTER)) or (opt==1 and tc:IsType(TYPE_SPELL)) or (opt==2 and tc:IsType(TYPE_TRAP)) then
res=true
end
tc=g:GetNext()
end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if res and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_GRAVE) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--不朽の特殊合金
--
--Script by JoyJ
function c100424037.initial_effect(c)
aux.AddCodeList(c,77585513)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424037,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c100424037.condition1)
e1:SetCost(c100424037.target1)
e1:SetOperation(c100424037.activate1)
c:RegisterEffect(e1)
--Activate2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424037,1))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c100424037.condition2)
e2:SetTarget(c100424037.target2)
e2:SetOperation(c100424037.activate2)
c:RegisterEffect(e2)
end
function c100424037.cfilter(c)
return c:IsCode(77585513) and c:IsFaceup()
end
function c100424037.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100424037.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c100424037.filter1(c)
return c:IsRace(RACE_MACHINE) and c:IsFaceup()
end
function c100424037.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424037.filter1,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c100424037.activate1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100424037.filter1,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(c100424037.indoval)
e1:SetOwnerPlayer(tp)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c100424037.indoval(e,re,rp)
return rp==1-e:GetOwnerPlayer()
end
function c100424037.filter2(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_MACHINE)
end
function c100424037.condition2(e,tp,eg,ep,ev,re,r,rp)
if not c100424037.condition1(e,tp,eg,ep,ev,re,r,rp) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and Duel.IsChainDisablable(ev) and tg:IsExists(c100424037.filter2,1,nil,tp)
end
function c100424037.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c100424037.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--死者蘇生
function c83764718.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:SetTarget(c83764718.target)
e1:SetOperation(c83764718.activate)
c:RegisterEffect(e1)
end
function c83764718.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
or (Duel.IsPlayerAffectedByEffect(tp,41044418) and c:IsControler(tp)
and c:IsCode(10000010) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SPECIAL+200,tp,true,false))
end
function c83764718.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c83764718.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c83764718.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c83764718.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c83764718.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.IsPlayerAffectedByEffect(tp,41044418) and tc:IsCode(10000010) and tc:IsControler(tp) then
Duel.SpecialSummon(tc,SUMMON_TYPE_SPECIAL+200,tp,tp,true,false,POS_FACEUP)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
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