Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 45 additions & 43 deletions card_counter_constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CARD_BLACK_ROSE_DRAGON = 73580471
CARD_BLACK_WINGED_DRAGON = 9012916
CARD_BLUEEYES_SPIRIT = 59822133
CARD_BLUEEYES_W_DRAGON = 89631139
CARD_BOX_OF_FRIENDS = 81587028
CARD_BUSTER_BLADER = 78193831
CARD_CHIMERA_FUSION = 63136489
CARD_CHIMERA_MYTHICAL_BEAST = 4796100
Expand Down Expand Up @@ -40,6 +41,7 @@ CARD_FOSSIL_FUSION = 59419719
CARD_GAIA_CHAMPION = 66889139
CARD_GALAXYEYES_P_DRAGON = 93717133
CARD_GOLDEN_LORD = 95440946
CARD_GRANDPA_DEMETTO = 44190146
CARD_HARMONIC_OSCILLATION = 31531170
CARD_HARPIE_LADY = 76812113
CARD_HARPIE_LADY_SISTERS = 12206212
Expand All @@ -54,6 +56,7 @@ CARD_KING_SARCOPHAGUS = 16528181
CARD_KURIBOH = 40640057
CARD_LABRYNTH_LABYRINTH = 33407125
CARD_LIGHT_BARRIER = 73206827
CARD_MACRO_COSMOS = 30241314
CARD_MAGICAL_MIDBREAKER = 71650854
CARD_MAX_METALMORPH = 89812483
CARD_MEDIUS_THE_PURE = 97556336
Expand All @@ -73,6 +76,7 @@ CARD_OBSIDIM_ASHENED_CITY = 3055018
CARD_ORCUSTRATED_BABEL = 90351981
CARD_POLYMERIZATION = 24094653
CARD_PRANKKIDS_MEOWMU = 25725326
CARD_PRINCESS_COLOGNE = 75574498
CARD_PSYFRAME_DRIVER = 49036338
CARD_PSYFRAME_LAMBDA = 8802510
CARD_QUEEN_KNIGHT = 25652259
Expand All @@ -91,6 +95,7 @@ CARD_SHINING_SARCOPHAGUS = 79791878
CARD_SKULL_SERVANT = 32274490
CARD_SLIFER = 10000020
CARD_SPIRIT_ELIMINATION = 69832741
CARD_SPYRAL_SUPER_AGENT = 41091257
CARD_STARDUST_DRAGON = 44508094
CARD_STROMBERG = 72283691
CARD_SUIJIN = 98434877
Expand Down Expand Up @@ -119,45 +124,49 @@ CARDS_SANGA_KAZEJIN_SUIJIN = {25955164,62340868,98434877}
CARDS_SPIRIT_MESSAGE = {31893528,67287533,94772232,30170981}

--Commonly used Tokens
TOKEN_ADVENTURER = 3285552
TOKEN_BOMB = 22411610
TOKEN_DUAL_AVATAR_SPIRIT = 87669905
TOKEN_ENGINE = 82556059
TOKEN_FIREBALL = 23116809
TOKEN_HIPPO = 11050416
TOKEN_IGNISTER = 11738490
TOKEN_INSECT_MONSTER = 91512836
TOKEN_KURIBOH = 40703223
TOKEN_LINK = 48068379
TOKEN_MECHA_PHANTOM_BEAST = 31533705
TOKEN_MECHA_PHANTOM_BEAST_DRACOSSACK= 22110648
TOKEN_MECHA_PHANTOM_BEAST_HARRLIARD = 20368764
TOKEN_MECHA_PHANTOM_BEAST_TETHERWOLF= 67922703
TOKEN_OJAMA = 29843092
TOKEN_OJAMA_DUO = 14470846
TOKEN_OPTION = 93130022
TOKEN_REPTILIANNE = 21179144
TOKEN_ROSE = 71645243
TOKEN_SHINOBIRD = 52900001
TOKEN_SLIME = 21770261
TOKEN_SWORDSOUL = 20001444
TOKEN_TRICKSTAR = 51208047
TOKEN_WORLD_LEGACY = 46647145
TOKEN_ADVENTURER = 3285552
TOKEN_BOMB = 22411610
TOKEN_DUAL_AVATAR_SPIRIT = 87669905
TOKEN_ENGINE = 82556059
TOKEN_FIREBALL = 23116809
TOKEN_HIPPO = 11050416
TOKEN_IGNISTER = 11738490
TOKEN_INSECT_MONSTER = 91512836
TOKEN_KURIBOH = 40703223
TOKEN_LINK = 48068379
TOKEN_MECHA_PHANTOM_BEAST = 31533705
TOKEN_MECHA_PHANTOM_BEAST_DRACOSSACK = 22110648
TOKEN_MECHA_PHANTOM_BEAST_HARRLIARD = 20368764
TOKEN_MECHA_PHANTOM_BEAST_TETHERWOLF = 67922703
TOKEN_OJAMA = 29843092
TOKEN_OJAMA_DUO = 14470846
TOKEN_OPTION = 93130022
TOKEN_REPTILIANNE = 21179144
TOKEN_ROSE = 71645243
TOKEN_SHINOBIRD = 52900001
TOKEN_SLIME = 21770261
TOKEN_SWORDSOUL = 20001444
TOKEN_TRICKSTAR = 51208047
TOKEN_WORLD_LEGACY = 46647145

--Specific Special Summons
SUMMON_WITH_MONSTER_REBORN = 1010
SUMMON_BY_NOUVELLES = 181

--Commonly used Rush Cards
CARD_AMALILITH = 160428037
CARD_BIG_UMI = 160003050
CARD_BLUETOOTH_B_DRAGON = 160010101
CARD_CAN_D = 160005002
CARD_CELEB_ROSE_MAGICIAN = 160013012
CARD_CELEB_ROSE_WITCH = 160013011
CARD_FUSION = 160204050
CARD_GALACTICA_OBLIVION = 160009002
CARD_IMAGINARY_ACTOR = 160204006
CARD_JELLYPLUG = 160008006
CARD_KURIBOT = 160001017
CARD_LIGHTNING_VOLTCONDOR = 160002017
CARD_MEEEG_CHAN = 160009006
CARD_NEEDLKYRIE = 160007001
CARD_PRIMA_GUITARNA = 160001028
CARD_PRINTING_PRESSER = 160003032
CARD_REDBOOT_B_DRAGON = 160315001
Expand All @@ -166,32 +175,25 @@ CARD_SEVENS_ROAD_MAGICIAN = 160301001
CARD_SKYSAVIOR_LUA = 160012021
CARD_SKYSAVIOR_SOLEIL = 160012020
CARD_SPIRIT_STADIUM = 160007047
CARD_STRAYNGE_CAT = 160301010
CARD_TAMABOT = 160312023
CARD_TASTE_INSPECTOR = 160007008
CARD_TRANSAMU_RAINAC = 160425001
CARD_UNIFORM_39 = 160007028
CARD_UNIFORM_99 = 160007027
CARD_UPSTART_GOBLIN = 70368879
CARD_NEEDLKYRIE = 160007001
CARD_STRAYNGE_CAT = 160301010
CARD_GALACTICA_OBLIVION = 160009002
CARD_CELEB_ROSE_MAGICIAN = 160013012
CARD_CELEB_ROSE_WITCH = 160013011
CARD_LIGHTNING_VOLTCONDOR = 160002017

--Commonly used Skill Cards
SKILL_DARK_UNITY = 300306009
SKILL_FEAR_OF_THE_DARK = 300309005
SKILL_AS_I_PREDICTED = 300309006

--Commonly used counters
COUNTER_A = 0x100e
COUNTER_BUSHIDO = 0x3
COUNTER_FEATHER = 0x10
COUNTER_FOG = 0x1019
COUNTER_KAIJU = 0x37
COUNTER_PREDATOR = 0x1041
COUNTER_RESONANCE= 0x211
COUNTER_SIGNAL = 0x1148
COUNTER_SPELL = 0x1
COUNTER_VENOM = 0x1009
COUNTER_A = 0x100e
COUNTER_BUSHIDO = 0x3
COUNTER_FEATHER = 0x10
COUNTER_FOG = 0x1019
COUNTER_KAIJU = 0x37
COUNTER_PREDATOR = 0x1041
COUNTER_RESONANCE = 0x211
COUNTER_SIGNAL = 0x1148
COUNTER_SPELL = 0x1
COUNTER_VENOM = 0x1009
4 changes: 2 additions & 2 deletions official/c15001940.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function s.selfnouvfilter(c,tp)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_NOUVELLES) and c:IsRitualMonster() and c:IsLevel(5,6)
and c:IsCanBeSpecialSummoned(e,SUMMON_BY_NOUVELLES,tp,false,true)
and c:IsCanBeSpecialSummoned(e,0,tp,false,true)
end
function s.rescon(sg,e,tp,mg)
return Duel.GetMZoneCount(tp,sg)>0 and sg:IsExists(s.atkposchk,1,nil,sg,tp)
Expand All @@ -94,7 +94,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,SUMMON_BY_NOUVELLES,tp,tp,false,true,POS_FACEUP)
Duel.SpecialSummon(g,0,tp,tp,false,true,POS_FACEUP)
end
end
end
26 changes: 11 additions & 15 deletions official/c17484499.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@
--Exchange of the Spirit
local s,id=GetID()
function s.initial_effect(c)
--Activate
--Each player swaps the cards in their GY with the cards in their Deck, then shuffles their Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_DRAW_PHASE)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(s.condition)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(function(e,tp) return Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=15 and Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE)>=15 end)
e1:SetCost(Cost.PayLP(1000))
e1:SetOperation(s.activate)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local turn_player=Duel.GetTurnPlayer()
Duel.SwapDeckAndGrave(turn_player)
Duel.SwapDeckAndGrave(1-turn_player)
end)
e1:SetHintTiming(0,TIMING_DRAW_PHASE|TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMING_BATTLE_START|TIMING_BATTLE_END|TIMINGS_CHECK_MONSTER_E|TIMING_CHAIN_END)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=15 and Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE)>=15
local b2=Duel.IsPlayerAffectedByEffect(tp,SKILL_AS_I_PREDICTED) and Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=15
return (b1 or b2)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SwapDeckAndGrave(tp)
Duel.SwapDeckAndGrave(1-tp)
end
end
2 changes: 1 addition & 1 deletion official/c24434049.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function s.qpovcon(e,tp,eg,ep,ev,re,r,rp)
if rp==1-tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local rc=re:GetHandler()
return rc:IsSetCard(SET_PURRELY) and rc:IsQuickPlaySpell()
and rc:IsOnField() and rc:IsCanBeXyzMaterial(e:GetHandler(),tc,REASON_EFFECT)
and rc:IsOnField() and rc:IsCanBeXyzMaterial(e:GetHandler(),tp,REASON_EFFECT)
end
function s.qpovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Expand Down
4 changes: 2 additions & 2 deletions official/c26223582.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function s.cfilter(c)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_NOUVELLES) and c:IsRitualMonster() and c:IsLevel(2,3)
and c:IsCanBeSpecialSummoned(e,SUMMON_BY_NOUVELLES,tp,false,true)
and c:IsCanBeSpecialSummoned(e,0,tp,false,true)
end
function s.rescon(sg,e,tp,mg)
return Duel.GetMZoneCount(tp,sg)>0 and sg:IsContains(e:GetHandler())
Expand All @@ -103,7 +103,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,SUMMON_BY_NOUVELLES,tp,tp,false,true,POS_FACEUP)
Duel.SpecialSummon(g,0,tp,tp,false,true,POS_FACEUP)
end
end
end
26 changes: 14 additions & 12 deletions official/c30241314.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,41 @@
--Macro Cosmos
local s,id=GetID()
function s.initial_effect(c)
--Activate
--When this card is activated: You can Special Summon 1 "Helios - The Primordial Sun" from your hand or Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMING_BATTLE_START|TIMINGS_CHECK_MONSTER_E)
c:RegisterEffect(e1)
--remove
--While this card is face-up on the field, any card sent to the GY is banished instead
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0xff,0xff)
e2:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2)
end
s.listed_names={54493213}
s.listed_names={54493213} --"Helios - The Primordial Sun"
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
end
function s.filter(c,e,sp)
return c:IsCode(54493213) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
function s.spfilter(c,e,tp)
return c:IsCode(54493213) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local cg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK|LOCATION_HAND,0,nil,e,tp)
if #cg>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if Duel.SelectYesNo(tp, aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=cg:Select(tp,1,1,nil)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,nil,e,tp)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
Expand Down
10 changes: 6 additions & 4 deletions official/c38430673.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
--Grand Convergence
local s,id=GetID()
function s.initial_effect(c)
--Activate
--Inflict 300 damage to your opponent, and if you do, destroy all monsters on the field (if any)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,30241314),tp,LOCATION_ONFIELD,0,1,nil) end)
e1:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_MACRO_COSMOS),tp,LOCATION_ONFIELD,0,1,nil) end)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMING_BATTLE_START|TIMINGS_CHECK_MONSTER_E)
c:RegisterEffect(e1)
end
s.listed_names={30241314}
s.listed_names={CARD_MACRO_COSMOS}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_MZONE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.Damage(1-tp,300,REASON_EFFECT)==0 then return end
Expand Down
26 changes: 13 additions & 13 deletions official/c40230018.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,45 @@ s.listed_series={SET_SPELLBOOK}
function s.chainfilter(re,tp,cid)
return not (re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() and not re:GetHandler():IsSetCard(SET_SPELLBOOK))
end
function s.cfilter(c)
function s.confilter(c)
return c:IsSetCard(SET_SPELLBOOK) and c:IsSpell()
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil)
return not Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_GRAVE,0,1,nil)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
--You cannot activate any Spells the turn you activate this card, except "Spellbook" Spells
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetValue(function(e,re,tp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() and not re:GetHandler():IsSetCard(SET_SPELLBOOK) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() and not re:GetHandler():IsSetCard(SET_SPELLBOOK)
end
function s.filter(c)
function s.thfilter(c)
return c:IsSetCard(SET_SPELLBOOK) and c:IsSpell() and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
return g:GetClassCount(Card.GetCode)>=3
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetClassCount(Card.GetCode)>=3 then
local sg=aux.SelectUnselectGroup(g,e,tp,3,3,aux.dncheck,1,tp,HINTMSG_CONFIRM)
Duel.ConfirmCards(1-tp,sg)
local revg=aux.SelectUnselectGroup(g,e,tp,3,3,aux.dncheck,1,tp,HINTMSG_CONFIRM)
Duel.ConfirmCards(1-tp,revg)
Duel.ShuffleDeck(tp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tc=sg:Select(1-tp,1,1,nil)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
local sg=revg:Select(1-tp,1,1,nil)
if #sg>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
end
Loading