Here's a Lua script for your custom Quick-Play Spell Card "Super XYZ Summon" for EDOPro. This script allows you to Xyz Summon an Xyz Monster using monsters from either field as material, similar to how "Super Polymerization" works for Fusion Monsters.
Card Effect:
- Discard 1 card; Xyz Summon 1 Xyz Monster from your Extra Deck, using monsters from either field as material. Neither player can activate cards or effects in response to this card's activation.
Lua Script:
--Super XYZ Summon
local s,id=GetID()
function s.initial_effect(c)
--Cannot be responded to
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetHintTiming(0,TIMING_DRAW_PHASE+TIMING_CHAIN_END+TIMING_END_PHASE)
e0:SetCost(s.cost)
e0:SetTarget(s.target)
e0:SetOperation(s.activate)
c:RegisterEffect(e0)
--Cannot respond to this card's activation
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(s.chainop)
e1:SetRange(LOCATION_SZONE)
c:RegisterEffect(e1)
end
function s.chainop(e,tp,eg,ep,ev,re,r,rp)
if re==e:GetHandler() then
Duel.SetChainLimitTillChainEnd(aux.FALSE)
end
end
--Discard 1 card as cost
function s.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
--Filter for face-up monsters on the field
function s.mfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
--Filter for Xyz Monsters that can be Summoned
function s.xyzfilter(c,e,tp,mg)
return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and mg:CheckSubGroup(s.xyzmaterialcheck,c.minxyzct,c.maxxyzct,c)
end
--Check if the selected materials can Xyz Summon the selected Xyz Monster
function s.xyzmaterialcheck(g,xyz)
return xyz:XyzCheck(g)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg)
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) then return end
local mg=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyzg=Duel.SelectMatchingCard(tp,s.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg)
local xyz=xyzg:GetFirst()
if not xyz then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mat=mg:SelectSubGroup(tp,s.xyzmaterialcheck,false,xyz.minxyzct,xyz.maxxyzct,xyz)
if not mat or mat:GetCount()==0 then return end
Duel.Overlay(xyz,mat)
Duel.SpecialSummon(xyz,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
xyz:CompleteProcedure()
end
Instructions to Use the Script:
-
Save the Script: Save the above code into a new Lua file named c100000000.lua (you can choose any unused ID in place of 100000000).
-
Place the Script: Put the Lua file into your EDOPro expansions scripts folder.
-
Create the Card in the Database:
- Open your EDOPro card editor.
- Create a new card with the following details:
- Name: Super XYZ Summon
- Card Type: Spell
- Spell Type: Quick-Play
- Effect: Discard 1 card; Xyz Summon 1 Xyz Monster from your Extra Deck, using monsters from either field as material. Neither player can activate cards or effects in response to this card's activation.
- Card ID: Use the same ID you used in the Lua script (e.g.,
100000000).
- Save the card.
-
Test the Card: Launch a duel in EDOPro and add "Super XYZ Summon" to your deck to test its functionality.
Note: This script allows you to select face-up monsters from both players' fields as Xyz Materials and Xyz Summon an appropriate Xyz Monster from your Extra Deck. The script ensures that the summoning conditions are met and mimics the effect of "Super Polymerization" for Xyz Summoning.
Disclaimer: Custom cards might cause unexpected interactions. Always test thoroughly to ensure it works as intended within the game mechanics.