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 : Wednesday, October 23, 2019 7:18:35 AM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 177

Thanks: 13 times
Was thanked: 7 time(s) in 7 post(s)
I bring to you, at last, "Dexter, Gent of the Burning Abyss". His gimmick is quite different from his "Burning Abyss" kin in that he's got an insanely high DEF, like "Superheavy Samurai Steam Train King", and uses that value for battle damage. His secondary gimmick involves negation of Spells/Traps/Effect Monsters, with one being more powerful than the other.

But, I'm curious... I wanna make Dexter's second negation effect continuous, the one that requires 2 Xyz Material to activate, kinda like Jinzo or Skill Drain. Can anyone help me with that?

Dexter, Gent of the Burning Abyss
DARK
Rank 6
1000/4500
Fiend/Xyz/Effect

Quote:
3+ Level 6 Monsters
You can also Xyz Summon "Dexter, Gent of the Burning Abyss" by using up to 4 "Burning Abyss" monster(s) in your GY or field, except "Dexter, Gent of the Burning Abyss". This card can attack while in face-up Defense Position. If it does, apply its DEF for damage calculation. If this card attacks, your opponent cannot activate any Spell/Trap Cards until the end of the Damage Step. Once per turn, during either player's turn, you can activate 1 of these effects.
● You can detach 1 Xyz Material from this card; negate the effects of 1 card your opponent controls.
● You can detach 2 Xyz Materials from this card; negate the effects of all cards your opponent currently controls, and if you do, this card gains 300 ATK for each card currently on the field, except this card (these effects are applied until your next Standby Phase). Cards and effects cannot be activated in response to this effect's activation.


Code:
--Dexter, Gent of the Burning Abyss
function c84764053.initial_effect(c)
	c:SetUniqueOnField(1,0,84764053)
	--xyz summon
	aux.AddXyzProcedure(c,nil,6,3,nil,nil,5)
	c:EnableReviveLimit()
	--xyz summon (alt)
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
	e1:SetRange(LOCATION_EXTRA)
	e1:SetCondition(c84764053.xyzcon)
	e1:SetTarget(c84764053.xyztg)
	e1:SetOperation(c84764053.xyzop)
	e1:SetValue(SUMMON_TYPE_XYZ)
	c:RegisterEffect(e1)
	--defense attack
	local e2=Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_DEFENSE_ATTACK)
	e2:SetValue(1)
	c:RegisterEffect(e2)
	--disable
	local e3=Effect.CreateEffect(c)
	e3:SetCategory(CATEGORY_DISABLE)
	e3:SetDescription(aux.Stringid(84764053,1))
	e3:SetType(EFFECT_TYPE_QUICK_O)
	e3:SetCode(EVENT_FREE_CHAIN)
	e3:SetProperty(EFFECT_FLAG2_XMDETACH+EFFECT_FLAG_CARD_TARGET)
	e3:SetRange(LOCATION_MZONE)	
	e3:SetHintTiming(0,0x1e0)
	e3:SetCountLimit(1)
	e3:SetCost(c84764053.cost)
	e3:SetTarget(c84764053.target)
	e3:SetOperation(c84764053.operation)
	c:RegisterEffect(e3)
	--actlimit
	local e4=Effect.CreateEffect(c)
	e4:SetType(EFFECT_TYPE_FIELD)
	e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e4:SetCode(EFFECT_CANNOT_ACTIVATE)
	e4:SetRange(LOCATION_MZONE)
	e4:SetTargetRange(0,1)
	e4:SetValue(c84764053.aclimit)
	e4:SetCondition(c84764053.actcon)
	c:RegisterEffect(e4)
	--disable
	local e5=Effect.CreateEffect(c)
	e5:SetDescription(aux.Stringid(84764053,2))
	e5:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE)
	e5:SetType(EFFECT_TYPE_QUICK_O)
	e5:SetCode(EVENT_FREE_CHAIN)
	e5:SetHintTiming(0,0x1e0)
	e5:SetProperty(EFFECT_FLAG2_XMDETACH)
	e5:SetRange(LOCATION_MZONE)
	e5:SetCost(c84764053.negcost)
	e5:SetOperation(c84764053.negop)
	c:RegisterEffect(e5)
end
function c84764053.ovfilter(c,tp,xyzc)
	return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and not c:IsCode(84764053)
end
function c84764053.xyzcon(e,c,og,min,max)
	if c==nil then return true end
	local tp=c:GetControler()
	local ft=Duel.GetLocationCount(tp,LOCATION_MZONE+LOCATION_GRAVE)
	local ct=-ft
	if 2<=ct then return false end
	if min and (min>2 or max<2) then return false end
	local mg=nil
	if og then
		mg=og
	else
		mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+LOCATION_GRAVE,0)
	end
	if ct<1 and (not min or min<=1) and mg:IsExists(c84764053.ovfilter,1,nil,tp,c) then
		return true
	end
	return Duel.CheckXyzMaterial(c,nil,lv,1,4,og)
end
function c84764053.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
	if og and not min then
		return true
	end
	local ft=Duel.GetLocationCount(tp,LOCATION_MZONE+LOCATION_GRAVE)
	local ct=-ft
	local mg=nil
	if og then
		mg=og
	else
		mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+LOCATION_GRAVE,0)
	end
	local b1=Duel.CheckXyzMaterial(c,nil,lv,1,4,og)
	local b2=ct<1 and (not min or min<=1) and mg:IsExists(c84764053.ovfilter,1,nil,tp,c)
	local g=nil
	if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(84764053,0))) then
		e:SetLabel(1)
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
		g=mg:FilterSelect(tp,c84764053.ovfilter,1,4,nil,tp,c)
	else
		e:SetLabel(0)
		g=Duel.SelectXyzMaterial(tp,c,nil,lv,1,4,og)
	end
	if g then
		g:KeepAlive()
		e:SetLabelObject(g)
		return true
	else return false end
end
function c84764053.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
	if og and not min then
		c:SetMaterial(og)
		Duel.Overlay(c,og)
	else
		local mg=e:GetLabelObject()
		if e:GetLabel()==1 then
			local mg2=mg:GetFirst():GetOverlayGroup()
			if mg2:GetCount()~=0 then
				Duel.Overlay(c,mg2)
			end
		end
		c:SetMaterial(mg)
		Duel.Overlay(c,mg)
		mg:DeleteGroup()
	end
end
function c84764053.cost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
	e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c84764053.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
	if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsOnField() end
	if chk==0 then return Duel.IsExistingTarget(Card.IsOnField,tp,0,LOCATION_ONFIELD,1,nil) end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
	local g=Duel.SelectTarget(tp,Card.IsOnField,tp,0,LOCATION_ONFIELD,1,1,nil)
	Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c84764053.operation(e,tp,eg,ep,ev,re,r,rp,chk)
	local tc=Duel.GetFirstTarget()
	if tc:IsOnField() and tc:IsRelateToEffect(e) then
		local e1=Effect.CreateEffect(e:GetHandler())
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_DISABLE)
		e1:SetReset(RESET_EVENT+0x1fe0000)
		tc:RegisterEffect(e1)
		local e2=Effect.CreateEffect(e:GetHandler())
		e2:SetType(EFFECT_TYPE_SINGLE)
		e2:SetCode(EFFECT_DISABLE_EFFECT)
		e2:SetReset(RESET_EVENT+0x1fe0000)
		tc:RegisterEffect(e2)
	end
end
function c84764053.aclimit(e,re,tp)
	return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c84764053.actcon(e)
	return Duel.GetAttacker()==e:GetHandler()
end
function c84764053.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
	local c=e:GetHandler()
	if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(84764053)==0 end
	c:RemoveOverlayCard(tp,2,2,REASON_COST)
	c:RegisterFlagEffect(84764053,RESET_CHAIN,0,1)
end
function c84764053.negop(e,tp,eg,ep,ev,re,r,rp)
	local g=Duel.GetMatchingGroup(aux.disfilter1,tp,0,LOCATION_ONFIELD,nil)
	local tc=g:GetFirst()
	if not tc then return end
	local c=e:GetHandler()
	while tc do
		local e1=Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_DISABLE)
		e1:SetTarget(c84764053.disable)
		e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,2)
		tc:RegisterEffect(e1)
		local e2=Effect.CreateEffect(c)
		e2:SetType(EFFECT_TYPE_SINGLE)
		e2:SetCode(EFFECT_DISABLE_EFFECT)
		e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,2)
		e2:SetTarget(c84764053.disable)
		tc:RegisterEffect(e2)
		if tc:IsType(TYPE_TRAPMONSTER) then
			local e3=Effect.CreateEffect(c)
			e3:SetType(EFFECT_TYPE_SINGLE)
			e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
			e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,2)
			e3:SetTarget(c84764053.disable)
			tc:RegisterEffect(e3)
		end
		tc=g:GetNext()
	end
	if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
	local atk=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)*300
	if atk>0 then
		local e1=Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_UPDATE_ATTACK)
		e1:SetValue(atk)
		e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_STANDBY,2)
		c:RegisterEffect(e1)
	Duel.SetChainLimit(aux.FALSE)
	end
end
function c84764053.disable(e,c)
	return c:IsType(0x7) or bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER or bit.band(c:GetOriginalType(),TYPE_SPELL)==TYPE_SPELL or bit.band(c:GetOriginalType(),TYPE_TRAP)==TYPE_TRAP
end

Edited by user Wednesday, October 23, 2019 7:45:06 AM(UTC)  | Reason: Not specified

kvanir  
#2 Posted : Friday, January 10, 2020 1:56:10 PM(UTC)
kvanir

Rank: Newbie

Joined: 12/16/2017(UTC)
Posts: 14

Was thanked: 2 time(s) in 2 post(s)
Still need help? It's been months since I've done anything ygo. Why not get rid of the reset timing? Or if that doesn't work, change the effect to "as long as this card has 2 xyz mats" then that effect is continuous.

There are other cards that are similar to this effect. I'll post some scripts if you can't find any. I've a ton of custom cards, so I usually find effects through those.
BananaPhone42  
#3 Posted : Friday, January 10, 2020 8:36:14 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 177

Thanks: 13 times
Was thanked: 7 time(s) in 7 post(s)
Originally Posted by: kvanir Go to Quoted Post
Still need help? It's been months since I've done anything ygo. Why not get rid of the reset timing? Or if that doesn't work, change the effect to "as long as this card has 2 xyz mats" then that effect is continuous.

There are other cards that are similar to this effect. I'll post some scripts if you can't find any. I've a ton of custom cards, so I usually find effects through those.


Yeah, some help with that would be appreciated. It's been a some time ago for me, too. Could you make it so Dexter works like that, "As long as this card has 2 Xyz Materials"?

Edited by user Friday, January 10, 2020 8:37:05 PM(UTC)  | Reason: Not specified

kvanir  
#4 Posted : Saturday, January 11, 2020 6:05:20 PM(UTC)
kvanir

Rank: Newbie

Joined: 12/16/2017(UTC)
Posts: 14

Was thanked: 2 time(s) in 2 post(s)
fuuuuu... didn't think you were gonna give me homework. But ok, my brain could use a workout.

Anyways worked on it for a bit, got the disable effect working after detaching 2 cards. Now the issue is how to reset it... Cards stay disabled even after it leaves the field. Give me another day and I should have it working.

Update like 10mins later: got it to reset after leaving the field but if it comes back then the previous disabling effect continues. Plus side is that the code is much simpler now. Tmrw or later, I will try changing the effect to if this card has 2 xyz mats, then all of OP's face-up cards are disabled.

Code:
Changed:
● You can detach 2 Xyz Materials from this card: for rest of the duel, as long as this card is face-up on the field, negate the effects of all face-up cards on your opponent's side of the field.
● This card gains 500atk per xyz material attached to it.


Code:
--Dexter, Gent of the Burning Abyss
function c84764053.initial_effect(c)
c:SetUniqueOnField(1,0,84764053)
--xyz summon
aux.AddXyzProcedure(c,nil,6,3,nil,nil,5)
c:EnableReviveLimit()
--xyz summon (alt)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c84764053.xyzcon)
e1:SetTarget(c84764053.xyztg)
e1:SetOperation(c84764053.xyzop)
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
--defense attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DEFENSE_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetDescription(aux.Stringid(84764053,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG2_XMDETACH+EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,0x1e0)
e3:SetCountLimit(1)
e3:SetCost(c84764053.cost)
e3:SetTarget(c84764053.target)
e3:SetOperation(c84764053.operation)
c:RegisterEffect(e3)
--actlimit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetValue(c84764053.aclimit)
e4:SetCondition(c84764053.actcon)
c:RegisterEffect(e4)
--disable 2x mats
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(84764053,2))
e5:SetCategory(CATEGORY_DISABLE)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,0x1e0)
e5:SetProperty(EFFECT_FLAG2_XMDETACH)
e5:SetRange(LOCATION_MZONE)
e5:SetCost(c84764053.negcost)
e5:SetOperation(c84764053.negop)
c:RegisterEffect(e5)
--atk up
local e6=Effect.CreateEffect(c)
    e6:SetType(EFFECT_TYPE_SINGLE)
    e6:SetCode(EFFECT_UPDATE_ATTACK)
    e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
    e6:SetRange(LOCATION_MZONE)
    e6:SetValue(c84764053.atkval)
    c:RegisterEffect(e6)
end
function c84764053.ovfilter(c,tp,xyzc)
return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and not c:IsCode(84764053)
end
function c84764053.xyzcon(e,c,og,min,max)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE+LOCATION_GRAVE)
local ct=-ft
if 2<=ct then return false end
if min and (min>2 or max<2) then return false end
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+LOCATION_GRAVE,0)
end
if ct<1 and (not min or min<=1) and mg:IsExists(c84764053.ovfilter,1,nil,tp,c) then
return true
end
return Duel.CheckXyzMaterial(c,nil,lv,1,4,og)
end
function c84764053.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE+LOCATION_GRAVE)
local ct=-ft
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+LOCATION_GRAVE,0)
end
local b1=Duel.CheckXyzMaterial(c,nil,lv,1,4,og)
local b2=ct<1 and (not min or min<=1) and mg:IsExists(c84764053.ovfilter,1,nil,tp,c)
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(84764053,0))) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,c84764053.ovfilter,1,4,nil,tp,c)
else
e:SetLabel(0)
g=Duel.SelectXyzMaterial(tp,c,nil,lv,1,4,og)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
function c84764053.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
function c84764053.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c84764053.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(Card.IsOnField,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsOnField,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c84764053.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if tc:IsOnField() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
end
function c84764053.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c84764053.actcon(e)
return Duel.GetAttacker()==e:GetHandler()
end
--disable 2x mats
function c84764053.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(84764053)==0 end
c:RemoveOverlayCard(tp,2,2,REASON_COST)
c:RegisterFlagEffect(84764053,RESET_CHAIN,0,1)
end

function c84764053.negop(e,tp,eg,ep,ev,re,r,rp)
    local c=e:GetHandler()
    local e9=Effect.CreateEffect(c)
    e9:SetType(EFFECT_TYPE_FIELD)
e9:SetCode(EFFECT_DISABLE)
e9:SetRange(LOCATION_MZONE)
    e9:SetTargetRange(0,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA)
e9:SetTarget(c84764053.distarget)
    c:RegisterEffect(e9)
end
function c84764053.distarget(e,c)
    return c~=e:GetHandler() and c:IsType(TYPE_TRAP+TYPE_SPELL+TYPE_MONSTER)
end
--atk up
function c84764053.atkval(e,c)
    return c:GetOverlayCount()*500
end

Edited by user Saturday, January 11, 2020 6:59:49 PM(UTC)  | Reason: Not specified

thanks 1 user thanked kvanir for this useful post.
kvanir  
#5 Posted : Sunday, January 12, 2020 8:43:14 PM(UTC)
kvanir

Rank: Newbie

Joined: 12/16/2017(UTC)
Posts: 14

Was thanked: 2 time(s) in 2 post(s)
Ooh boy I delivered. This time took only 10 mins to c/p and test it out -wasn't expecting that. Code is even simpler now... Here you go:

As long as Dexter has 2 or more xyz mats, all of OP's face-up cards on the field will be negated. I kept the +500 atk per mat as is, now that the 2nd effect is passive. But mostly because I didn't understand all that code from the original...

Now you gonna need a new first effect. It's too easy to spam BA monsters, and this card even enables xyz mats from the GY.

Code:
--Dexter, Gent of the Burning Abyss
function c84764053.initial_effect(c)
c:SetUniqueOnField(1,0,84764053)
--xyz summon
aux.AddXyzProcedure(c,nil,6,3,nil,nil,5)
c:EnableReviveLimit()
--xyz summon (alt)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c84764053.xyzcon)
e1:SetTarget(c84764053.xyztg)
e1:SetOperation(c84764053.xyzop)
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
--defense attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DEFENSE_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetDescription(aux.Stringid(84764053,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG2_XMDETACH+EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,0x1e0)
e3:SetCountLimit(1)
e3:SetCost(c84764053.cost)
e3:SetTarget(c84764053.target)
e3:SetOperation(c84764053.operation)
c:RegisterEffect(e3)
--actlimit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetValue(c84764053.aclimit)
e4:SetCondition(c84764053.actcon)
c:RegisterEffect(e4)
--disable if 2x mats
local e5=Effect.CreateEffect(c)
    e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_DISABLE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA)
e5:SetCondition(c84764053.effcon)
e5:SetLabel(2)
e5:SetTarget(c84764053.distarget)
    c:RegisterEffect(e5)

--atk up
local e6=Effect.CreateEffect(c)
    e6:SetType(EFFECT_TYPE_SINGLE)
    e6:SetCode(EFFECT_UPDATE_ATTACK)
    e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
    e6:SetRange(LOCATION_MZONE)
    e6:SetValue(c84764053.atkval)
    c:RegisterEffect(e6)
end
function c84764053.ovfilter(c,tp,xyzc)
return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and not c:IsCode(84764053)
end
function c84764053.xyzcon(e,c,og,min,max)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE+LOCATION_GRAVE)
local ct=-ft
if 2<=ct then return false end
if min and (min>2 or max<2) then return false end
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+LOCATION_GRAVE,0)
end
if ct<1 and (not min or min<=1) and mg:IsExists(c84764053.ovfilter,1,nil,tp,c) then
return true
end
return Duel.CheckXyzMaterial(c,nil,lv,1,4,og)
end
function c84764053.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE+LOCATION_GRAVE)
local ct=-ft
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+LOCATION_GRAVE,0)
end
local b1=Duel.CheckXyzMaterial(c,nil,lv,1,4,og)
local b2=ct<1 and (not min or min<=1) and mg:IsExists(c84764053.ovfilter,1,nil,tp,c)
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(84764053,0))) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,c84764053.ovfilter,1,4,nil,tp,c)
else
e:SetLabel(0)
g=Duel.SelectXyzMaterial(tp,c,nil,lv,1,4,og)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
function c84764053.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
function c84764053.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c84764053.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(Card.IsOnField,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsOnField,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c84764053.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if tc:IsOnField() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
end
function c84764053.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c84764053.actcon(e)
return Duel.GetAttacker()==e:GetHandler()
end
--disable if 2x mats
function c84764053.effcon(e,tp,eg,ep,ev,re,r,rp)
    return e:GetHandler():GetOverlayCount()>=e:GetLabel()
end

function c84764053.distarget(e,c)
    return c~=e:GetHandler() and c:IsType(TYPE_TRAP+TYPE_SPELL+TYPE_MONSTER)
end
--atk up
function c84764053.atkval(e,c)
    return c:GetOverlayCount()*500
end

Edited by user Sunday, January 12, 2020 8:44:12 PM(UTC)  | Reason: Not specified

File Attachment(s):
c84764053.lua (6kb) downloaded 0 time(s).

You cannot view/download attachments. Try to login or register.
thanks 1 user thanked kvanir for this useful post.
BananaPhone42  
#6 Posted : Monday, January 13, 2020 10:20:57 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 177

Thanks: 13 times
Was thanked: 7 time(s) in 7 post(s)
Originally Posted by: kvanir Go to Quoted Post
Ooh boy I delivered. This time took only 10 mins to c/p and test it out -wasn't expecting that. Code is even simpler now... Here you go:

As long as Dexter has 2 or more xyz mats, all of OP's face-up cards on the field will be negated. I kept the +500 atk per mat as is, now that the 2nd effect is passive. But mostly because I didn't understand all that code from the original...

Now you gonna need a new first effect. It's too easy to spam BA monsters, and this card even enables xyz mats from the GY.

Code:
--Dexter, Gent of the Burning Abyss
function c84764053.initial_effect(c)
c:SetUniqueOnField(1,0,84764053)
--xyz summon
aux.AddXyzProcedure(c,nil,6,3,nil,nil,5)
c:EnableReviveLimit()
--xyz summon (alt)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c84764053.xyzcon)
e1:SetTarget(c84764053.xyztg)
e1:SetOperation(c84764053.xyzop)
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
--defense attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DEFENSE_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetDescription(aux.Stringid(84764053,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG2_XMDETACH+EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,0x1e0)
e3:SetCountLimit(1)
e3:SetCost(c84764053.cost)
e3:SetTarget(c84764053.target)
e3:SetOperation(c84764053.operation)
c:RegisterEffect(e3)
--actlimit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetValue(c84764053.aclimit)
e4:SetCondition(c84764053.actcon)
c:RegisterEffect(e4)
--disable if 2x mats
local e5=Effect.CreateEffect(c)
    e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_DISABLE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA)
e5:SetCondition(c84764053.effcon)
e5:SetLabel(2)
e5:SetTarget(c84764053.distarget)
    c:RegisterEffect(e5)

--atk up
local e6=Effect.CreateEffect(c)
    e6:SetType(EFFECT_TYPE_SINGLE)
    e6:SetCode(EFFECT_UPDATE_ATTACK)
    e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
    e6:SetRange(LOCATION_MZONE)
    e6:SetValue(c84764053.atkval)
    c:RegisterEffect(e6)
end
function c84764053.ovfilter(c,tp,xyzc)
return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and not c:IsCode(84764053)
end
function c84764053.xyzcon(e,c,og,min,max)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE+LOCATION_GRAVE)
local ct=-ft
if 2<=ct then return false end
if min and (min>2 or max<2) then return false end
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+LOCATION_GRAVE,0)
end
if ct<1 and (not min or min<=1) and mg:IsExists(c84764053.ovfilter,1,nil,tp,c) then
return true
end
return Duel.CheckXyzMaterial(c,nil,lv,1,4,og)
end
function c84764053.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE+LOCATION_GRAVE)
local ct=-ft
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+LOCATION_GRAVE,0)
end
local b1=Duel.CheckXyzMaterial(c,nil,lv,1,4,og)
local b2=ct<1 and (not min or min<=1) and mg:IsExists(c84764053.ovfilter,1,nil,tp,c)
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(84764053,0))) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,c84764053.ovfilter,1,4,nil,tp,c)
else
e:SetLabel(0)
g=Duel.SelectXyzMaterial(tp,c,nil,lv,1,4,og)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
function c84764053.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
function c84764053.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c84764053.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(Card.IsOnField,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsOnField,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c84764053.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if tc:IsOnField() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
end
function c84764053.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c84764053.actcon(e)
return Duel.GetAttacker()==e:GetHandler()
end
--disable if 2x mats
function c84764053.effcon(e,tp,eg,ep,ev,re,r,rp)
    return e:GetHandler():GetOverlayCount()>=e:GetLabel()
end

function c84764053.distarget(e,c)
    return c~=e:GetHandler() and c:IsType(TYPE_TRAP+TYPE_SPELL+TYPE_MONSTER)
end
--atk up
function c84764053.atkval(e,c)
    return c:GetOverlayCount()*500
end


Hey, thanks for your help with Dexter, man. It was tough, even for me, to get working.
kvanir  
#7 Posted : Thursday, January 16, 2020 4:52:28 PM(UTC)
kvanir

Rank: Newbie

Joined: 12/16/2017(UTC)
Posts: 14

Was thanked: 2 time(s) in 2 post(s)
ah np. it was fun.
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