Commit 163f089e authored by sidschingis's avatar sidschingis

lval tcg exclusives

parent 5fe80e78
--Bujingi Pavo
function c10860121.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10860121,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c10860121.condition)
e1:SetCost(c10860121.cost)
e1:SetTarget(c10860121.target)
e1:SetOperation(c10860121.operation)
c:RegisterEffect(e1)
end
function c10860121.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsSetCard(0x88) and c:IsRace(RACE_BEASTWARRIOR) and c:IsReason(REASON_BATTLE)
end
function c10860121.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10860121.cfilter,1,nil,tp)
end
function c10860121.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,10860121)==0 and e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,10860121,RESET_PHASE+PHASE_END,0,1)
end
function c10860121.filter(c,e,tp)
return c:IsSetCard(0x88) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c10860121.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c10860121.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
end
function c10860121.operation(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,c10860121.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--Sylvan Bladefender
function c11682713.initial_effect(c)
--deck check
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11682713,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c11682713.condition)
e1:SetTarget(c11682713.target)
e1:SetOperation(c11682713.operation)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11682713,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCondition(c11682713.tdcon)
e2:SetTarget(c11682713.tdtg)
e2:SetOperation(c11682713.tdop)
c:RegisterEffect(e2)
if not c11682713.global_check then
c11682713.global_check=true
c11682713[0]=Group.CreateGroup()
c11682713[0]:KeepAlive()
c11682713[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c11682713.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c11682713.checkop(e,tp,eg,ep,ev,re,r,rp)
c11682713[0]:Clear()
c11682713[0]:Merge(eg)
c11682713[1]=re
end
function c11682713.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a~=c then d=a end
return c:IsRelateToBattle() and c:IsFaceup()
and d and d:GetLocation()==LOCATION_GRAVE and d:IsType(TYPE_MONSTER)
end
function c11682713.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c11682713.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT)
else
Duel.MoveSequence(tc,1)
end
end
function c11682713.tdcon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c11682713[0]:IsContains(e:GetHandler()) and c11682713[1]==re
end
function c11682713.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c11682713.tdop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
end
\ No newline at end of file
--Gwenhwyfar, Queen of Noble Arms
function c19748583.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19748583,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCost(c19748583.eqcost)
e1:SetTarget(c19748583.eqtg)
e1:SetOperation(c19748583.eqop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(300)
c:RegisterEffect(e2)
--destroy sub
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetTarget(c19748583.reptg)
e3:SetOperation(c19748583.repop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_BATTLE_START)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c19748583.descon)
e4:SetTarget(c19748583.destg)
e4:SetOperation(c19748583.desop)
c:RegisterEffect(e4)
end
function c19748583.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19748583)==0 end
Duel.RegisterFlagEffect(tp,19748583,RESET_PHASE+PHASE_END,0,1)
end
function c19748583.filter(c)
return c:IsFaceup() and c:IsSetCard(0x107a)
end
function c19748583.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c19748583.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c19748583.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c19748583.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c19748583.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c19748583.eqlimit)
c:RegisterEffect(e1)
end
function c19748583.eqlimit(e,c)
return c:IsSetCard(0x107a)
end
function c19748583.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return bit.band(r,REASON_EFFECT)~=0 and c:GetEquipTarget():IsAttribute(ATTRIBUTE_LIGHT) end
return Duel.SelectYesNo(e:GetOwnerPlayer(),aux.Stringid(19748583,0))
end
function c19748583.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
end
function c19748583.descon(e,re,r,rp)
local tg=e:GetHandler():GetEquipTarget()
return tg:IsAttribute(ATTRIBUTE_DARK) and (Duel.GetAttacker()==tg or Duel.GetAttackTarget()==tg)
end
function c19748583.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if tc==c:GetEquipTarget() then tc=Duel.GetAttackTarget() end
if chk==0 then return tc and tc:IsControler(1-tp) end
local g=Group.FromCards(tc,c:GetEquipTarget())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c19748583.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if tc==c:GetEquipTarget() then tc=Duel.GetAttackTarget() end
if tc:IsRelateToBattle() and Duel.Destroy(tc,REASON_EFFECT) then
Duel.BreakEffect()
Duel.Destroy(c,REASON_EFFECT)
end
end
\ No newline at end of file
--Powered Insektron
function c46132282.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(46132282,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c46132282.descon)
e1:SetOperation(c46132282.effop)
c:RegisterEffect(e1)
end
function c46132282.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end
function c46132282.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
c:RegisterEffect(e2)
end
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetValue(1)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
\ No newline at end of file
--Gravekeepers Heretic
function c46955770.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetCondition(c46955770.con)
e1:SetValue(1)
c:RegisterEffect(e1)
end
function c46955770.filter(c)
return c:IsFaceup() and c:IsCode(47355498)
end
function c46955770.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c46955770.filter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
or Duel.GetEnvironment()==47355498
end
\ No newline at end of file
--Sylvan Mikorange
function c47077318.initial_effect(c)
--deck check
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47077318,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c47077318.condition)
e1:SetTarget(c47077318.target)
e1:SetOperation(c47077318.operation)
c:RegisterEffect(e1)
--boost
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47077318,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c47077318.tdcon)
e2:SetOperation(c47077318.tdop)
c:RegisterEffect(e2)
if not c47077318.global_check then
c47077318.global_check=true
c47077318[0]=Group.CreateGroup()
c47077318[0]:KeepAlive()
c47077318[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c47077318.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c47077318.checkop(e,tp,eg,ep,ev,re,r,rp)
c47077318[0]:Clear()
c47077318[0]:Merge(eg)
c47077318[1]=re
end
function c47077318.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:GetReasonPlayer()~=tp
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c47077318.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c47077318.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT)
else
Duel.MoveSequence(tc,1)
end
end
function c47077318.tdcon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c47077318[0]:IsContains(e:GetHandler()) and c47077318[1]==re
end
function c47077318.filter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT)
end
function c47077318.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c47077318.filter,tp,LOCATION_MZONE,0,nil)
tc=g:GetFirst()
if not tc then return end
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
\ No newline at end of file
--Obedience Schooled
function c72537897.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c72537897.condition)
e1:SetCost(c72537897.cost)
e1:SetTarget(c72537897.target)
e1:SetOperation(c72537897.activate)
c:RegisterEffect(e1)
end
function c72537897.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c72537897.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c72537897.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c72537897.splimit(e,c)
return not c:IsRace(RACE_BEAST)
end
function c72537897.spfilter(c,e,tp)
return c:IsRace(RACE_BEAST) and c:IsLevelBelow(2) and c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c72537897.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c72537897.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0,nil)==0 and
Duel.GetLocationCount(tp,LOCATION_MZONE)>2 and
g:GetClassCount(Card.GetCode)>=3 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_DECK)
end
function c72537897.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=2 then return end
local g=Duel.GetMatchingGroup(c72537897.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetClassCount(Card.GetCode)>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg2:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg3=g:Select(tp,1,1,nil)
sg1:Merge(sg2)
sg1:Merge(sg3)
local tc=sg1:GetFirst()
local c=e:GetHandler()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(72537897,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=sg1:GetNext()
end
sg1:KeepAlive()
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetLabelObject(sg1)
e3:SetOperation(c72537897.desop)
Duel.RegisterEffect(e3,tp)
Duel.SpecialSummonComplete()
end
end
function c72537897.desfilter(c)
return c:GetFlagEffect(72537897)>0
end
function c72537897.desop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c72537897.desfilter,nil)
g:DeleteGroup()
Duel.Destroy(tg,REASON_EFFECT)
end
\ No newline at end of file
--Noble Knight Peredur
function c73359475.initial_effect(c)
--Normal monster
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c73359475.eqcon1)
e1:SetValue(TYPE_NORMAL+TYPE_MONSTER)
c:RegisterEffect(e1)
--Attribute Dark
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c73359475.eqcon2)
e2:SetValue(ATTRIBUTE_DARK)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_LEVEL)
e3:SetValue(1)
c:RegisterEffect(e3)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(73359475,0))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(c73359475.thcon)
e4:SetTarget(c73359475.thtg)
e4:SetOperation(c73359475.thop)
c:RegisterEffect(e4)
end
function c73359475.eqcon1(e)
return not e:GetHandler():GetEquipGroup():IsExists(Card.IsSetCard,1,nil,0x207a)
end
function c73359475.eqcon2(e)
return e:GetHandler():GetEquipGroup():IsExists(Card.IsSetCard,1,nil,0x207a)
end
function c73359475.cfilter(c,tc)
return c:IsSetCard(0x207a) and c:GetPreviousEquipTarget()==tc and c:IsReason(REASON_LOST_TARGET)
end
function c73359475.thcon(e,tp,eg,ep,ev,re,r,rp)
return c73359475.eqcon2(e) and e:GetHandler():IsLocation(LOCATION_GRAVE)
end
function c73359475.thfilter(c)
return c:IsSetCard(0x207a) and c:IsAbleToHand()
end
function c73359475.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c73359475.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c73359475.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c73359475.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c73359475.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--Ghostrick Yeti
function c84472026.initial_effect(c)
--summon limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetCondition(c84472026.sumcon)
c:RegisterEffect(e1)
--turn set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(84472026,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c84472026.postg)
e2:SetOperation(c84472026.posop)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(84472026,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_FLIP)
e3:SetTarget(c84472026.indestg)
e3:SetOperation(c84472026.indesop)
c:RegisterEffect(e3)
end
function c84472026.sfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8d)
end
function c84472026.sumcon(e)
return not Duel.IsExistingMatchingCard(c84472026.sfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c84472026.postg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanTurnSet() and c:GetFlagEffect(84472026)==0 end
c:RegisterFlagEffect(84472026,RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function c84472026.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENCE)
end
end
function c84472026.indestg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and c84472026.sfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c84472026.sfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c84472026.sfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c84472026.indesop(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_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--The First Monarch
function c8522996.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c8522996.target)
e1:SetOperation(c8522996.activate)
c:RegisterEffect(e1)
--change attribute
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(8522996,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCost(c8522996.cost)
e2:SetCondition(c8522996.con)
e2:SetTarget(c8522996.tg)
e2:SetOperation(c8522996.op)
c:RegisterEffect(e2)
--sum limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c8522996.splimit)
c:RegisterEffect(e3)
end
function c8522996.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,8522996,0,0x11,0,0,2,1000,2400,6,RACE_FIEND,ATTRIBUTE_DARKNESS) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c8522996.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,8522996,0,0x11,1000,2400,6,RACE_FIEND,ATTRIBUTE_DARKNESS) then return end
c:AddTrapMonsterAttribute(TYPE_EFFECT,ATTRIBUTE_DARKNESS,RACE_FIEND,6,1000,2400)
Duel.SpecialSummon(c,1,tp,tp,true,false,POS_FACEUP)
c:TrapMonsterBlock()
end
function c8522996.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c8522996.cost(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 c8522996.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,0)
local aat=Duel.AnnounceAttribute(tp,1,0x7f)
e:SetLabel(aat)
end
function c8522996.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local att=e:GetLabel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(att)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
--double tribute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DOUBLE_TRIBUTE)
e2:SetValue(c8522996.condition)
c:RegisterEffect(e2)
end
function c8522996.condition(e,c)
return c:IsAttribute(e:GetHandler():GetAttribute())
end
function c8522996.splimit(e,c,tp,sumtp,sumpos)
return not c8522996.condition(e,c)
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment