YGOPRO Forum

Welcome Guest! To enable all features please try to register or login.
Options
Go to last post Go to first unread
BananaPhone42  
#1 Posted : Sunday, July 08, 2018 9:29:35 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 174
United States

Thanks: 11 times
Was thanked: 7 time(s) in 7 post(s)
I've made Slifer the Sky Dragon into a Pendulum God Card. I'm not sure about Pendulum Ra and Obelisk, but I'll try my best.


Slifer the Pendulum Sky Dragon

Slifer the Pendulum Sky Dragon

Effect:
Quote:

Pendulum Scale = 10
[ Pendulum Effect ]
This card's pendulum effect cannot be negated. The number of cards in your hand is unlimited. All monsters you control gain 300 ATK and DEF for each card in your hand. If your life points are attacked directly, you may send this card face-up to the top of your Extra Deck to negate the attack and change all monsters your opponent controls to Defense Position.

[ Monster Effect ]
Requires 3 Tributes to Normal Summon (cannot be Normal Set). This card's Normal Summon cannot be negated. When Normal Summoned, cards and effects cannot be activated. Once per turn, during the End Phase, if this card was Special Summoned: Send it to the Graveyard. This card gains 1000 ATK and DEF for each card in your hand. If a monster(s) is Normal or Special Summoned to your opponent's field in face-up Attack Position: That monster(s) loses 2000 ATK, then if its ATK has been reduced to 0 as a result, destroy it.


Admittedly, it's not quite perfect; I can't get Pendulum Slifer to send/destroy itself to the Extra Deck. Next up are Ra and Obelisk. Wish me luck.

Code:

--Slifer the Pendulum Sky Dragon
function c20000002.initial_effect(c)
    aux.EnablePendulumAttribute(c)
    --Cannot be Negated or Disabled
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISABLE)
e1:SetRange(LOCATION_PZONE)
c:RegisterEffect(e1)
    --Unlimited hand
    local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_HAND_LIMIT)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(1,0)
e2:SetValue(100)
c:RegisterEffect(e2)
    --Negate attack and Change to DEF Position
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetDescription(aux.Stringid(20000002,0))
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
    e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e3:SetRange(LOCATION_PZONE)
e3:SetCondition(c20000002.condition)
e3:SetOperation(c20000002.activate)
c:RegisterEffect(e3)
    --Monsters gain ATK and DEF for each Card in Hand
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
    e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e4:SetRange(LOCATION_PZONE)
    e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetValue(c20000002.adval)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e5)
    --summon with 3 tribute
local e6=Effect.CreateEffect(c)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e6:SetCondition(c20000002.ttcon)
e6:SetOperation(c20000002.ttop)
e6:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_LIMIT_SET_PROC)
e7:SetCondition(c20000002.setcon)
c:RegisterEffect(e7)
--summon
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e8:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e8)
--summon success
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_SUMMON_SUCCESS)
e9:SetOperation(c20000002.sumsuc)
c:RegisterEffect(e9)
--to grave
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(20000002,0))
e10:SetCategory(CATEGORY_TOGRAVE)
e10:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e10:SetRange(LOCATION_MZONE)
e10:SetCountLimit(1)
e10:SetCode(EVENT_PHASE+PHASE_END)
e10:SetCondition(c20000002.tgcon)
e10:SetTarget(c20000002.tgtg)
e10:SetOperation(c20000002.tgop)
c:RegisterEffect(e10)
    --atk/def
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_UPDATE_ATTACK)
e11:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e11:SetRange(LOCATION_MZONE)
e11:SetValue(c20000002.adval2)
c:RegisterEffect(e11)
local e12=e11:Clone()
e12:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e12)
--atkdown
local e13=Effect.CreateEffect(c)
e13:SetDescription(aux.Stringid(20000002,1))
e13:SetCategory(CATEGORY_ATKCHANGE)
e13:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e13:SetRange(LOCATION_MZONE)
e13:SetCode(EVENT_SUMMON_SUCCESS)
e13:SetCondition(c20000002.atkcon)
e13:SetTarget(c20000002.atktg)
e13:SetOperation(c20000002.atkop)
c:RegisterEffect(e13)
local e14=e13:Clone()
e14:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e14)
end
function c20000002.adval(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*300
end
function c20000002.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetAttackTarget()==nil
end
function c20000002.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c20000002.filter,tp,0,LOCATION_MZONE,nil)
if Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
local og=Duel.GetOperatedGroup()
local tc=og:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=og:GetNext()
end
end
end
function c20000002.filter(c)
return c:IsAttackPos() and c:IsCanTurnSet()
end
function c20000002.ttcon(e,c,minc)
if c==nil then return true end
return minc<=3 and Duel.CheckTribute(c,3)
end
function c20000002.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c20000002.setcon(e,c,minc)
if not c then return true end
return false
end
function c20000002.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(aux.FALSE)
end
function c20000002.tgcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c20000002.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c20000002.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
function c20000002.adval2(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*1000
end
function c20000002.atkfilter(c,e,tp)
return c:IsControler(tp) and c:IsPosition(POS_FACEUP_ATTACK) and (not e or c:IsRelateToEffect(e))
end
function c20000002.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c20000002.atkfilter,1,nil,nil,1-tp)
end
function c20000002.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetTargetCard(eg)
end
function c20000002.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c20000002.atkfilter,nil,e,1-tp)
local dg=Group.CreateGroup()
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2000)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
if preatk~=0 and tc:GetAttack()==0 then dg:AddCard(tc) end
tc=g:GetNext()
end
Duel.Destroy(dg,REASON_EFFECT)
end

Edited by user Wednesday, October 23, 2019 5:19:59 PM(UTC)  | Reason: Updated the Script to prevent Slifer's effect in the Pendulum Zone from disabling.

SotheY  
#2 Posted : Sunday, July 08, 2018 10:45:37 PM(UTC)
SotheY

Rank: Advanced Member

Joined: 3/18/2016(UTC)
Posts: 572

Thanks: 44 times
Was thanked: 109 time(s) in 69 post(s)
Originally Posted by: BananaPhone42 Go to Quoted Post
Slifer the Pendulum Sky Dragon

Effect:
Quote:

Pendulum Scale = 10
[ Pendulum Effect ]
This card's pendulum effect cannot be negated. The number of cards in your hand is unlimited. All monsters you control gain 300 ATK and DEF for each card in your hand. If your life points are attacked directly, you may send this card face-up to the top of your Extra Deck to negate the attack and change all monsters your opponent controls to Defense Position.

[ Monster Effect ]
.Requires 3 Tributes to Normal Summon (cannot be Normal Set). This card's Normal Summon cannot be negated. When Normal Summoned, cards and effects cannot be activated. Once per turn, during the End Phase, if this card was Special Summoned: Send it to the Graveyard. This card gains 1000 ATK and DEF for each card in your hand. If a monster(s) is Normal or Special Summoned to your opponent's field in face-up Attack Position: That monster(s) loses 2000 ATK, then if its ATK has been reduced to 0 as a result, destroy it.


Admittedly, it's not quite perfect; I can't get Pendulum Slifer to send/destroy itself to the Extra Deck. Next up are Ra and Obelisk. Wish me luck.


You mean the highlighted part is what you cannot get to work? That's probably game mechanis, since Pendulum Monsters cannot be send from the field to the graveyard.
thanks 1 user thanked SotheY for this useful post.
BananaPhone42  
#3 Posted : Sunday, July 08, 2018 11:29:57 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 174
United States

Thanks: 11 times
Was thanked: 7 time(s) in 7 post(s)
Originally Posted by: SotheY Go to Quoted Post
Originally Posted by: BananaPhone42 Go to Quoted Post
Slifer the Pendulum Sky Dragon

Effect:
Quote:

Pendulum Scale = 10
[ Pendulum Effect ]
This card's pendulum effect cannot be negated. The number of cards in your hand is unlimited. All monsters you control gain 300 ATK and DEF for each card in your hand. If your life points are attacked directly, you may send this card face-up to the top of your Extra Deck to negate the attack and change all monsters your opponent controls to Defense Position.

[ Monster Effect ]
.Requires 3 Tributes to Normal Summon (cannot be Normal Set). This card's Normal Summon cannot be negated. When Normal Summoned, cards and effects cannot be activated. Once per turn, during the End Phase, if this card was Special Summoned: Send it to the Graveyard. This card gains 1000 ATK and DEF for each card in your hand. If a monster(s) is Normal or Special Summoned to your opponent's field in face-up Attack Position: That monster(s) loses 2000 ATK, then if its ATK has been reduced to 0 as a result, destroy it.


Admittedly, it's not quite perfect; I can't get Pendulum Slifer to send/destroy itself to the Extra Deck. Next up are Ra and Obelisk. Wish me luck.


You mean the highlighted part is what you cannot get to work? That's probably game mechanis, since Pendulum Monsters cannot be send from the field to the graveyard.


Oh... that would probably explain things. But, uh, I'm having trouble preventing other cards from disabling Pendulum Slifer's effect, such as Ice Beast Zerofyne. See, once Zerofyne activates its' ability, Pendulum Slifer's ability is still negated, even with "EFFECT_CANNOT_DISABLE". Can you give me a hand with that, or is it "game mechanics"?
BananaPhone42  
#4 Posted : Monday, July 09, 2018 1:59:39 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 174
United States

Thanks: 11 times
Was thanked: 7 time(s) in 7 post(s)
I've figured out how to have Pendulum Slifer's effect work, even if monsters in the Pendulum Zone are disabled.

I'm working on Pendulum Ra as my next Pendulum Egyptian God, and while the Monster Effect half can be done with good ol' Copy-and-Paste and renaming some values here and there and I now know how to do the whole "Pendulum Effect cannot be disabled" thing... here's where I'm stumped.

Pendulum Ra's Pendulum Effect is that like Pendulum Slifer's effect can't be negated if in the Pendulum Zone and if you're in danger of a direct attack, you can flip any ATK Position monsters your foe controls to face-down Defense (yeah, I used Quaking Mirror's effect to help me out) and they're stuck that way. But, here's where things get complicated because I dunno of a Monster/Spell/Trap that has this effect:

Quote:
You can release (Tribute) up to 2 of your Monsters and add the combined total of half of their original ATK to another monster you control. This effect can only be used once per turn.


Layman's terms: Let's say you sacrifice two Blue-Eyes White Dragons after activating this effect, and throw that 6000 ATK (3000 since it's halved) onto Elemental HERO Burstinatrix. Now, her ATK is a whopping 4200.

Here's the Pendulum Ra image: The Pendulum Winged Dragon of Ra
BananaPhone42  
#5 Posted : Tuesday, July 10, 2018 7:21:22 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 174
United States

Thanks: 11 times
Was thanked: 7 time(s) in 7 post(s)
Guess what? I just used "Gift of the Martyr" to complete Pendulum Ra. Here's the script... (Note: Pendulum Ra cannot be destroyed in the P-Zone).

Code:

--The Pendulum Winged Dragon of Ra
function c20000003.initial_effect(c)
    aux.EnablePendulumAttribute(c)
    --Cannot be Destroyed
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE)
e1:SetRange(LOCATION_PZONE)
    e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
    e1:SetValue(1)
c:RegisterEffect(e1)
    --Add 2 Monster's combined base ATK to other Monster
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetCode(EVENT_FREE_CHAIN)
    e2:SetRange(LOCATION_PZONE)
e2:SetLabel(0)
e2:SetCost(c20000003.cost)
e2:SetTarget(c20000003.target)
e2:SetOperation(c20000003.activate)
c:RegisterEffect(e2)
    --Negate attack and Change to DEF Position
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetDescription(aux.Stringid(20000003,0))
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
    e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e3:SetRange(LOCATION_PZONE)
e3:SetCondition(c20000003.condition)
e3:SetOperation(c20000003.activate2)
c:RegisterEffect(e3)
--summon with 3 tribute
local e11=Effect.CreateEffect(c)
e11:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e11:SetCondition(c20000003.ttcon)
e11:SetOperation(c20000003.ttop)
e11:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e11)
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_SINGLE)
e12:SetCode(EFFECT_LIMIT_SET_PROC)
e12:SetCondition(c20000003.setcon)
c:RegisterEffect(e12)
--summon
local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_SINGLE)
e13:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e13:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e13)
--summon success
local e14=Effect.CreateEffect(c)
e14:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e14:SetCode(EVENT_SUMMON_SUCCESS)
e14:SetOperation(c20000003.sumsuc)
c:RegisterEffect(e14)
--cannot special summon
local e15=Effect.CreateEffect(c)
e15:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e15:SetType(EFFECT_TYPE_SINGLE)
e15:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e15)
--One Turn Kill
local e16=Effect.CreateEffect(c)
e16:SetDescription(aux.Stringid(20000003,0))
e16:SetCategory(CATEGORY_ATKCHANGE)
e16:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e16:SetCode(EVENT_SUMMON_SUCCESS)
e16:SetCost(c20000003.atkcost)
e16:SetOperation(c20000003.atkop)
c:RegisterEffect(e16)
--destroy
local e17=Effect.CreateEffect(c)
e17:SetDescription(aux.Stringid(20000003,1))
e17:SetCategory(CATEGORY_DESTROY)
e17:SetType(EFFECT_TYPE_IGNITION)
e17:SetProperty(EFFECT_FLAG_CARD_TARGET)
e17:SetRange(LOCATION_MZONE)
e17:SetCost(c20000003.descost)
e17:SetTarget(c20000003.destg)
e17:SetOperation(c20000003.desop)
c:RegisterEffect(e17)
end
function c20000003.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c20000003.cfilter(c,e,tp)
return c:GetTextAttack()>0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,c)
end
function c20000003.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c20000003.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c20000003.cfilter,tp,LOCATION_MZONE,0,1,2,nil,e,tp)
Duel.SendtoGrave(g,REASON_COST)
Duel.SetTargetParam(g:GetSum(Card.GetTextAttack))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c20000003.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM))
e1:SetReset(RESET_EVENT+0xff0000)
tc:RegisterEffect(e1)
end
end
function c20000003.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetAttackTarget()==nil
end
function c20000003.activate2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c20000003.filter,tp,0,LOCATION_MZONE,nil)
if Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
local og=Duel.GetOperatedGroup()
local tc=og:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=og:GetNext()
end
end
end
function c20000003.filter(c)
return c:IsAttackPos() and c:IsCanTurnSet()
end
function c20000003.ttcon(e,c,minc)
if c==nil then return true end
return minc<=3 and Duel.CheckTribute(c,3)
end
function c20000003.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c20000003.setcon(e,c,minc)
if not c then return true end
return false
end
function c20000003.genchainlm(c)
return function (e,rp,tp)
return e:GetHandler()==c
end
end
function c20000003.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c20000003.genchainlm(e:GetHandler()))
end
function c20000003.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>100 end
local lp=Duel.GetLP(tp)
e:SetLabel(lp-100)
Duel.PayLPCost(tp,lp-100)
end
function c20000003.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
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(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
end
function c20000003.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c20000003.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c20000003.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
BananaPhone42  
#6 Posted : Wednesday, October 23, 2019 5:53:51 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 174
United States

Thanks: 11 times
Was thanked: 7 time(s) in 7 post(s)
And to end the P-Gods trilogy, after a year's wait, I bring you... Pendulum Obelisk.

Effect:
Quote:
Pendulum Scale = 10
[ Pendulum Effect ]
This card's Pendulum effect cannot be negated. This card cannot be destroyed. During either player's turn, You can Tribute up to 2 monsters you control; add the combined total of their original ATK and DEF to another monster you control. This effect can only be used once per turn. When an opponent's monster declares an attack: Change all your opponent's Attack Position monsters to face-down Defense Position. Monsters changed to face-down Defense Position by this effect cannot change their battle positions.

[ Monster Effect ]
Requires 3 Tributes to Normal Summon (cannot be Normal Set). This card's Normal Summon cannot be negated. When Normal Summoned, cards and effects cannot be activated. Cannot be targeted by Spells, Traps, or card effects. Once per turn, during the End Phase, if this card was Special Summoned: Send it to the Graveyard. You can Tribute 2 monsters; destroy all monsters your opponent controls. This card cannot declare an attack the turn this effect is activated.


Code:
--Obelisk the Pendulum Tormentor
function c20000004.initial_effect(c)
    aux.EnablePendulumAttribute(c)
    --Cannot be Destroyed
	local e8=Effect.CreateEffect(c)
	e8:SetType(EFFECT_TYPE_SINGLE)
	e8:SetCode(EFFECT_INDESTRUCTABLE)
	e8:SetRange(LOCATION_PZONE)
    e8:SetProperty(0x600)
    e8:SetValue(1)
	c:RegisterEffect(e8)
    --Add 2 Monster's combined base ATK to other Monster
	local e9=Effect.CreateEffect(c)
	e9:SetType(EFFECT_TYPE_IGNITION)
	e9:SetProperty(EFFECT_FLAG_CARD_TARGET+0x600)
	e9:SetCode(EVENT_FREE_CHAIN)
    e9:SetRange(LOCATION_PZONE)
	e9:SetLabel(0)
	e9:SetCost(c20000004.cost)
	e9:SetTarget(c20000004.target)
	e9:SetOperation(c20000004.activate)
	c:RegisterEffect(e9)
    --Negate attack and Change to DEF Position
	local e10=Effect.CreateEffect(c)
	e10:SetType(EFFECT_TYPE_QUICK_O)
	e10:SetDescription(aux.Stringid(20000004,0))
	e10:SetCode(EVENT_ATTACK_ANNOUNCE)
    e10:SetProperty(0x600)
	e10:SetRange(LOCATION_PZONE)
	e10:SetCondition(c20000004.condition)
	e10:SetOperation(c20000004.activate2)
	c:RegisterEffect(e10)
	--summon with 3 tribute
	local e1=Effect.CreateEffect(c)
	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
	e1:SetCondition(c20000004.ttcon)
	e1:SetOperation(c20000004.ttop)
	e1:SetValue(SUMMON_TYPE_ADVANCE)
	c:RegisterEffect(e1)
	local e2=Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_LIMIT_SET_PROC)
	e2:SetCondition(c20000004.setcon)
	c:RegisterEffect(e2)
	--summon
	local e3=Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_SINGLE)
	e3:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
	c:RegisterEffect(e3)
	--summon success
	local e4=Effect.CreateEffect(c)
	e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
	e4:SetCode(EVENT_SUMMON_SUCCESS)
	e4:SetOperation(c20000004.sumsuc)
	c:RegisterEffect(e4)
	--cannot be target
	local e5=Effect.CreateEffect(c)
	e5:SetType(EFFECT_TYPE_SINGLE)
	e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e5:SetRange(LOCATION_MZONE)
	e5:SetValue(1)
	c:RegisterEffect(e5)
	--to grave
	local e6=Effect.CreateEffect(c)
	e6:SetDescription(aux.Stringid(20000004,1))
	e6:SetCategory(CATEGORY_TOGRAVE)
	e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
	e6:SetRange(LOCATION_MZONE)
	e6:SetCountLimit(1)
	e6:SetCode(EVENT_PHASE+PHASE_END)
	e6:SetCondition(c20000004.tgcon)
	e6:SetTarget(c20000004.tgtg)
	e6:SetOperation(c20000004.tgop)
	c:RegisterEffect(e6)
	--destroy
	local e7=Effect.CreateEffect(c)
	e7:SetDescription(aux.Stringid(20000004,2))
	e7:SetCategory(CATEGORY_DESTROY)
	e7:SetType(EFFECT_TYPE_IGNITION)
	e7:SetRange(LOCATION_MZONE)
	e7:SetCost(c20000004.descost)
	e7:SetTarget(c20000004.destg)
	e7:SetOperation(c20000004.desop)
	c:RegisterEffect(e7)
end
function c20000004.ttcon(e,c,minc)
	if c==nil then return true end
	return minc<=3 and Duel.CheckTribute(c,3)
end
function c20000004.ttop(e,tp,eg,ep,ev,re,r,rp,c)
	local g=Duel.SelectTribute(tp,c,3,3)
	c:SetMaterial(g)
	Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c20000004.setcon(e,c,minc)
	if not c then return true end
	return false
end
function c20000004.sumsuc(e,tp,eg,ep,ev,re,r,rp)
	Duel.SetChainLimitTillChainEnd(aux.FALSE)
end
function c20000004.tgcon(e,tp,eg,ep,ev,re,r,rp)
	return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c20000004.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return true end
	Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c20000004.tgop(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	if c:IsRelateToEffect(e) and c:IsFaceup() then
		Duel.SendtoGrave(c,REASON_EFFECT)
	end
end
function c20000004.descost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 and Duel.CheckReleaseGroup(tp,nil,2,nil) end
	local e1=Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetProperty(EFFECT_FLAG_OATH)
	e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
	e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
	e:GetHandler():RegisterEffect(e1)
	local g=Duel.SelectReleaseGroup(tp,nil,2,2,nil)
	Duel.Release(g,REASON_COST)
end
function c20000004.destg(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
	local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
	Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c20000004.desop(e,tp,eg,ep,ev,re,r,rp)
	local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
	Duel.Destroy(g,REASON_EFFECT)
end
function c20000004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
	e:SetLabel(1)
	return true
end
function c20000004.cfilter(c,e,tp)
	return c:GetTextAttack()>0 and c:GetTextDefense()>0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,c)
end
function c20000004.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
	if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
	if chk==0 then
	if e:GetLabel()~=1 then return false end
	e:SetLabel(0)
	return Duel.IsExistingMatchingCard(c20000004.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
end
	e:SetLabel(0)
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
	local g=Duel.SelectMatchingCard(tp,c20000004.cfilter,tp,LOCATION_MZONE,0,1,2,nil,e,tp)
	Duel.SendtoGrave(g,REASON_COST)
	Duel.SetTargetParam(g:GetSum(Card.GetTextAttack))
	Duel.SetTargetParam(g:GetSum(Card.GetTextDefense))
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
	Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c20000004.activate(e,tp,eg,ep,ev,re,r,rp)
	local tc=Duel.GetFirstTarget()
	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
	local e1=Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_UPDATE_ATTACK)
	e1:SetValue(Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM))
	e1:SetReset(RESET_EVENT+0xff0000)
	tc:RegisterEffect(e1)
	local e2=Effect.CreateEffect(e:GetHandler())
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_UPDATE_DEFENSE)
	e2:SetValue(Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM))
	e2:SetReset(RESET_EVENT+0xff0000)
	tc:RegisterEffect(e2)
	end
end
function c20000004.condition(e,tp,eg,ep,ev,re,r,rp)
	local at=Duel.GetAttacker()
	return at:GetControler()~=tp and Duel.GetAttackTarget()==nil
end
function c20000004.activate2(e,tp,eg,ep,ev,re,r,rp)
	local g=Duel.GetMatchingGroup(c20000004.filter,tp,0,LOCATION_MZONE,nil)
	if Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
	local og=Duel.GetOperatedGroup()
	local tc=og:GetFirst()
	while tc do
	local e1=Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
	e1:SetReset(RESET_EVENT+0x1fe0000)
	tc:RegisterEffect(e1)
	tc=og:GetNext()
		end
	end
end
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error