Commit 7150a9dd authored by mercury233's avatar mercury233

add scripts PGB1

parent ff9ffe8e
--予見者ゾルガ
function c31525442.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31525442,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,31525442)
e1:SetCondition(c31525442.spcon)
e1:SetTarget(c31525442.sptg)
e1:SetOperation(c31525442.spop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(31525442,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1,31525443)
e2:SetCondition(c31525442.dmcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c31525442.dmtg)
e2:SetOperation(c31525442.dmop)
c:RegisterEffect(e2)
--effect reg
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(c31525442.regcon)
e3:SetOperation(c31525442.regop)
c:RegisterEffect(e3)
end
function c31525442.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_FAIRY)
and not c:IsCode(31525442)
end
function c31525442.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c31525442.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c31525442.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 c31525442.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.BreakEffect()
for p=tp,1-tp,1-tp-tp do
local g=Duel.GetFieldGroup(p,LOCATION_DECK,0)
local ct={}
for i=5,1,-1 do
if #g>=i then
table.insert(ct,i)
end
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(31525442,(p==tp and 2 or 3)))
local ac=Duel.AnnounceNumber(tp,table.unpack(ct))
local sg=Duel.GetDecktopGroup(p,ac)
Duel.ConfirmCards(tp,sg)
end
end
end
function c31525442.dmcon(e,tp,eg,ev,ep,re,r,rp)
local c=e:GetHandler()
local at=Duel.GetAttacker()
return at:GetFlagEffectLabel(31525442)==c:GetFieldID()
end
function c31525442.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local at=Duel.GetAttacker()
Duel.SetTargetCard(at)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,at,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,2000)
end
function c31525442.dmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,2000,REASON_EFFECT)
end
end
end
function c31525442.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
return r==REASON_SUMMON and rc:IsFaceup()
end
function c31525442.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if r==REASON_SUMMON and rc:IsFaceup() and c:IsLocation(LOCATION_GRAVE) then
rc:RegisterFlagEffect(31525442,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,c:GetFieldID(),aux.Stringid(31525442,4))
end
end
--絶対なる幻神獣
function c32247099.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32247099,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,32247099)
e2:SetCondition(c32247099.spcon)
e2:SetCost(c32247099.spcost)
e2:SetTarget(c32247099.sptg)
e2:SetOperation(c32247099.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(32247099,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,32247100)
e3:SetCondition(c32247099.descon)
e3:SetTarget(c32247099.destg)
e3:SetOperation(c32247099.desop)
c:RegisterEffect(e3)
if not c32247099.global_check then
c32247099.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c32247099.checkop1)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_CHAIN_NEGATED)
ge2:SetOperation(c32247099.checkop2)
Duel.RegisterEffect(ge2,0)
end
end
function c32247099.checkop1(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsRelateToEffect(re) then
local ct=rc:GetFlagEffectLabel(32247099)
if not ct then
rc:RegisterFlagEffect(32247099,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,1)
else
rc:SetFlagEffectLabel(32247099,ct+1)
end
end
end
function c32247099.checkop2(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local ct=rc:GetFlagEffectLabel(32247099)
if ct==1 then
rc:ResetFlagEffect(32247099)
elseif ct then
rc:SetFlagEffectLabel(32247099,ct-1)
end
end
function c32247099.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c32247099.cfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDiscardable()
end
function c32247099.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c32247099.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c32247099.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c32247099.spfilter(c,e,tp)
return c:IsRace(RACE_DIVINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c32247099.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c32247099.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c32247099.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c32247099.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c32247099.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0
and not Duel.GetAttacker():IsImmuneToEffect(e) then
Duel.BreakEffect()
Duel.ChangeAttackTarget(tc)
end
end
function c32247099.descfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DIVINE)
end
function c32247099.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c32247099.descfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c32247099.desfilter(c)
return c:IsFaceup() and c:GetFlagEffect(32247099)>0
end
function c32247099.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c32247099.desfilter,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function c32247099.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c32247099.desfilter,tp,0,LOCATION_ONFIELD,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--超電導波サンダーフォース
function c42469671.initial_effect(c)
aux.AddCodeList(c,10000020)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(42469671,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
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:SetCountLimit(1,42469671+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c42469671.descon)
e1:SetTarget(c42469671.destg)
e1:SetOperation(c42469671.desop)
c:RegisterEffect(e1)
end
function c42469671.actfilter(c)
return c:IsFaceup() and c:IsOriginalCodeRule(10000020)
end
function c42469671.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c42469671.actfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c42469671.desfilter(c)
return c:IsFaceup()
end
function c42469671.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c42469671.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
if g:GetCount()~=0 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,g:GetCount())
end
end
function c42469671.sgfilter(c,p)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(p)
end
function c42469671.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c42469671.desfilter,tp,0,LOCATION_MZONE,nil)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
local dc=Duel.GetOperatedGroup():FilterCount(c42469671.sgfilter,nil,1-tp)
if dc~=0 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and Duel.SelectYesNo(tp,aux.Stringid(42469671,0)) then
Duel.BreakEffect()
Duel.Draw(tp,dc,REASON_EFFECT)
--cannot attack
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(c42469671.atkcon)
e1:SetTarget(c42469671.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--check
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetOperation(c42469671.checkop)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end
end
end
function c42469671.checkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,42469671)~=0 then return end
local fid=eg:GetFirst():GetFieldID()
Duel.RegisterFlagEffect(tp,42469671,RESET_PHASE+PHASE_END,0,1)
e:GetLabelObject():SetLabel(fid)
end
function c42469671.atkcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),42469671)~=0
end
function c42469671.atktg(e,c)
return c:GetFieldID()~=e:GetLabel()
end
--千年の血族
function c5130393.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(5130393,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_DAMAGE)
e1:SetCountLimit(1,5130393)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c5130393.spcon)
e1:SetTarget(c5130393.sptg)
e1:SetOperation(c5130393.spop)
c:RegisterEffect(e1)
--special summon or todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(5130393,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,5130394)
e2:SetTarget(c5130393.tdtg)
e2:SetOperation(c5130393.tdop)
c:RegisterEffect(e2)
end
function c5130393.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and ev>=1000 and bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
function c5130393.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 c5130393.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 c5130393.filter(c,e,tp)
return c:GetTextAttack()>=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c5130393.thfilter(c)
return c:GetTextAttack()>=0 and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c5130393.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c5130393.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c5130393.filter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c5130393.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c5130393.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local vc=tc:GetTextAttack()
local sel=1
local g=Duel.GetMatchingGroup(c5130393.thfilter,tp,0,LOCATION_DECK,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(5130393,2))
if g:GetCount()>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_CONFIRM)
local sg=Duel.SelectMatchingCard(1-tp,c5130393.thfilter,tp,0,LOCATION_DECK,1,1,nil)
Duel.ConfirmCards(tp,sg)
if sg:GetFirst():GetTextAttack()<vc then
Duel.ShuffleDeck(1-tp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--交差する魂
function c5253985.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(5253985,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,5253985+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c5253985.sumcon)
e1:SetTarget(c5253985.sumtg)
e1:SetOperation(c5253985.sumop)
c:RegisterEffect(e1)
end
function c5253985.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function c5253985.sumfilter(c,ec)
if not c:IsRace(RACE_DIVINE) then return false end
local e1=Effect.CreateEffect(ec)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local res=c:IsSummonable(true,nil,1)
e1:Reset()
return res
end
function c5253985.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c5253985.sumfilter,tp,LOCATION_HAND,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c5253985.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local tc=Duel.SelectMatchingCard(tp,c5253985.sumfilter,tp,LOCATION_HAND,0,1,1,nil,c):GetFirst()
if tc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.Summon(tp,tc,true,nil,1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_END)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c5253985.limitop)
e2:SetLabelObject(tc)
Duel.RegisterEffect(e2,tp)
end
end
function c5253985.cfilter(c,tp)
return c:GetPreviousControler()==1-tp
end
function c5253985.limitop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
local g=tc:GetMaterial()
if g and g:IsExists(c5253985.cfilter,1,nil,tp) then
--can't activate effects
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c5253985.regcon)
e2:SetOperation(c5253985.regop)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(1,0)
e3:SetCondition(c5253985.actcon)
e3:SetValue(c5253985.aclimit)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
end
e:Reset()
end
function c5253985.regcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and not re:GetHandler():IsRace(RACE_DIVINE)
end
function c5253985.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,5253985,RESET_PHASE+PHASE_END,2,0,1)
end
function c5253985.actcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetFlagEffect(tp,5253985)>0
end
function c5253985.aclimit(e,re,tp)
return not re:GetHandler():IsRace(RACE_DIVINE)
end
--黄金の邪教神
function c78642798.initial_effect(c)
--Change the Name
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(78642798,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c78642798.rntg)
e1:SetOperation(c78642798.rnop)
c:RegisterEffect(e1)
--Equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(78642798,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,78642798)
e2:SetTarget(c78642798.eqtg)
e2:SetOperation(c78642798.eqop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c78642798.eqcon)
c:RegisterEffect(e3)
end
function c78642798.rntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(aux.NOT(Card.IsPublic),tp,0,LOCATION_HAND,nil)>0 end
end
function c78642798.rnop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.NOT(Card.IsPublic),tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.ShuffleHand(1-tp)
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(27125110)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
end
function c78642798.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c78642798.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsAbleToChangeControler()
end
function c78642798.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x110) and not c:IsSummonableCard()
end
function c78642798.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c78642798.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c78642798.filter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c78642798.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c78642798.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c78642798.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc1=Duel.GetFirstTarget()
if tc1:IsRelateToEffect(e) and tc1:IsAbleToChangeControler() then
local atk=tc1:GetTextAttack()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local sg=Duel.SelectMatchingCard(tp,c78642798.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
local tc2=sg:GetFirst()
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2 then
Duel.Equip(tp,tc1,tc2,atk)
--Gains ATK
local e1=Effect.CreateEffect(tc1)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc1:RegisterEffect(e1)
--Equip Limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c78642798.eqlimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetLabelObject(tc2)
tc1:RegisterEffect(e2)
end
end
end
end
function c78642798.eqlimit(e,c)
return c==e:GetLabelObject()
end
--ゴッド・ハンド・クラッシャー
function c79868386.initial_effect(c)
aux.AddCodeList(c,10000030)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DISABLE)
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:SetCountLimit(1,79868386+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c79868386.condition)
e1:SetTarget(c79868386.target)
e1:SetOperation(c79868386.activate)
c:RegisterEffect(e1)
end
function c79868386.actfilter(c)
return c:IsFaceup() and c:IsOriginalCodeRule(10000000)
end
function c79868386.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c79868386.actfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c79868386.filter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT)
end
function c79868386.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79868386.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
end
function c79868386.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c79868386.filter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
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(e:GetHandler())
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 Duel.Destroy(tc,REASON_EFFECT)~=0 then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c79868386.distg)
e3:SetLabelObject(tc)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetCondition(c79868386.discon)
e4:SetOperation(c79868386.disop)
e4:SetLabelObject(tc)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
local sg=Duel.GetMatchingGroup(c79868386.desfilter,tp,0,LOCATION_ONFIELD,nil)
if #sg>0 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and Duel.SelectYesNo(tp,aux.Stringid(79868386,0)) then
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
end
function c79868386.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c79868386.distg(e,c)
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function c79868386.discon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function c79868386.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
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