diff --git a/card_counter_constants.lua b/card_counter_constants.lua index acb95319e4..fad24714ea 100644 --- a/card_counter_constants.lua +++ b/card_counter_constants.lua @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/official/c15001940.lua b/official/c15001940.lua index 4b65ee13de..4cd7b14e5f 100644 --- a/official/c15001940.lua +++ b/official/c15001940.lua @@ -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) @@ -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 \ No newline at end of file diff --git a/official/c17484499.lua b/official/c17484499.lua index ed5ac88c81..56521837d0 100644 --- a/official/c17484499.lua +++ b/official/c17484499.lua @@ -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 \ No newline at end of file diff --git a/official/c24434049.lua b/official/c24434049.lua index 56ff42d44f..5479c78a79 100644 --- a/official/c24434049.lua +++ b/official/c24434049.lua @@ -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 diff --git a/official/c26223582.lua b/official/c26223582.lua index 98c19a2d27..89c76c7066 100644 --- a/official/c26223582.lua +++ b/official/c26223582.lua @@ -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()) @@ -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 \ No newline at end of file diff --git a/official/c30241314.lua b/official/c30241314.lua index 68582aea69..cc86cb558b 100644 --- a/official/c30241314.lua +++ b/official/c30241314.lua @@ -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 diff --git a/official/c38430673.lua b/official/c38430673.lua index fa1370a3e5..1b5c3a74e8 100644 --- a/official/c38430673.lua +++ b/official/c38430673.lua @@ -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 diff --git a/official/c40230018.lua b/official/c40230018.lua index d797a6dba1..c55701ad03 100644 --- a/official/c40230018.lua +++ b/official/c40230018.lua @@ -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 \ No newline at end of file diff --git a/official/c44190146.lua b/official/c44190146.lua index 1bbfd7f5d1..80d84cd031 100644 --- a/official/c44190146.lua +++ b/official/c44190146.lua @@ -1,11 +1,10 @@ --デメット爺さん --Grandpa Demetto --Logical Nonsense ---Substitute ID local s,id=GetID() function s.initial_effect(c) Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT) - --Special summon up to 2 normal monsters from GY + --Special Summon up to 2 Normal Monsters with 0 ATK or DEF from your GY, each as a Level 8 DARK monster in Defense Position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -16,15 +15,15 @@ function s.initial_effect(c) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Destroy 1 monster your opponent controls, inflict damage + --Destroy 1 monster your opponent controls and inflict damageto your opponent equal to the Xyz Monster's Rank x 300 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_DESTROY) + e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_CHAINING) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) - e2:SetCountLimit(1,{id,1}) e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.descon) e2:SetTarget(s.destg) e2:SetOperation(s.desop) @@ -33,118 +32,94 @@ function s.initial_effect(c) aux.GlobalCheck(s,function() s[0]=nil s[1]=Group.CreateGroup() - local tempG=Group.CreateGroup() - tempG:KeepAlive() + local tmp_g=Group.CreateGroup() + --Keep track of an Xyz Monster activating its effect by detaching a Normal Monster local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_DETACH_MATERIAL) - ge1:SetLabelObject(tempG) - ge1:SetOperation(s.checkop) + ge1:SetLabelObject(tmp_g) + ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) + local cid=Duel.GetCurrentChain() + if cid>0 and #tmp_g>0 then + s[0]=Duel.GetChainInfo(cid,CHAININFO_CHAIN_ID) + s[1]=tmp_g-eg:GetFirst():GetOverlayGroup() + tmp_g:Clear() + end + end) Duel.RegisterEffect(ge1,0) local ge2=Effect.CreateEffect(c) - ge2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) + ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge2:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE) ge2:SetLabelObject(ge1) - ge2:SetCondition(s.rcon) + ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) + tmp_g:Merge(re:GetHandler():GetOverlayGroup()) + return false + end) Duel.RegisterEffect(ge2,0) end) end - --Specifically lists "Princess Cologne" -s.listed_names={75574498} - --Check for "Princess Cologne" -function s.cfilter(c) - return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsCode(75574498) -end - --Detach 1 material from "Princess Cologne" as cost +s.listed_names={CARD_PRINCESS_COLOGNE} function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local g=Group.CreateGroup() - local mg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,0,nil) - for tc in aux.Next(mg) do - g:Merge(tc:GetOverlayGroup()) - end - if chk==0 then return #g>0 end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ) - local sg=g:Select(tp,1,1,nil) - Duel.SendtoGrave(sg,REASON_COST) + local xyzg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsCode,CARD_PRINCESS_COLOGNE),tp,LOCATION_MZONE,0,nil) + if chk==0 then return #xyzg>0 and Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST,xyzg) end + Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST,xyzg) end - --Check for a normal monster with 0 ATK or DEF function s.spfilter(c,e,tp) + c:AssumeProperty(ASSUME_LEVEL,8) + c:AssumeProperty(ASSUME_ATTRIBUTE,ATTRIBUTE_DARK) return c:IsType(TYPE_NORMAL) and (c:IsAttack(0) or c:IsDefense(0)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end - --Activation legality function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end - --Special summon 2 normal monsters from GY function s.spop(e,tp,eg,ep,ev,re,r,rp) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if ft<=0 then return end - local c=e:GetHandler() - if ft>2 then ft=2 end + local ct=Duel.GetLocationCount(tp,LOCATION_MZONE) + if ct<=0 then return end + ct=math.min(ct,2) + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ct=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,ft,nil,e,tp) - if #g>0 then - local tc=g:GetFirst() - for tc in aux.Next(g) do - --They become level 8 DARK monsters - Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,ct,nil,e,tp) + if #g==0 then return end + local c=e:GetHandler() + for sc in g:Iter() do + if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then + --Special Summon each one as a Level 8 DARK monster local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_CHANGE_ATTRIBUTE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_CHANGE_ATTRIBUTE) e1:SetValue(ATTRIBUTE_DARK) e1:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e1,true) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_CHANGE_LEVEL) - e1:SetValue(8) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e1,true) + sc:RegisterEffect(e1) + local e2=e1:Clone() + e2:SetCode(EFFECT_CHANGE_LEVEL) + e2:SetValue(8) + sc:RegisterEffect(e2) end - Duel.SpecialSummonComplete() - end -end -function s.rcon(e,tp,eg,ep,ev,re,r,rp) - e:GetLabelObject():GetLabelObject():Merge(re:GetHandler():GetOverlayGroup()) - return false -end -function s.checkop(e,tp,eg,ep,ev,re,r,rp) - local cid=Duel.GetCurrentChain() - if cid>0 and #e:GetLabelObject()>0 then - s[0]=Duel.GetChainInfo(cid,CHAININFO_CHAIN_ID) - s[1]=e:GetLabelObject()-eg:GetFirst():GetOverlayGroup() - s[1]:KeepAlive() - e:GetLabelObject():Clear() end + Duel.SpecialSummonComplete() end function s.descon(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==s[0] - and re:GetHandler():IsCanBeEffectTarget(e) and re:GetHandler():IsControler(tp) - and re:IsActiveType(TYPE_XYZ) and s[1] and s[1]:IsExists(Card.IsOriginalType,1,nil,TYPE_NORMAL) + return Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==s[0] and re:GetHandler():IsControler(tp) and re:IsActiveType(TYPE_XYZ) + and s[1] and s[1]:IsExists(Card.IsOriginalType,1,nil,TYPE_NORMAL) end - --Activation legality function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return false end - if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end - Duel.SetTargetCard(re:GetHandler()) + local rc=re:GetHandler() + if chk==0 then return rc:IsCanBeEffectTarget(e) and Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,rc) end + Duel.SetTargetCard(rc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil) - Duel.SetTargetPlayer(1-tp) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) - Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) + local tc=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,rc):GetFirst() + e:SetLabelObject({tc,rc}) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,rc:GetRank()*300) end - --Destroy 1 monster your opponent controls, inflict damage function s.desop(e,tp,eg,ep,ev,re,r,rp) - local ex,g=Duel.GetOperationInfo(0,CATEGORY_DESTROY) - if g:GetFirst():IsRelateToEffect(e) then - if Duel.Destroy(g,REASON_EFFECT)>0 then - local tc=(Duel.GetTargetCards(e)-g):GetFirst() - if not (tc and tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end - local dam=tc:GetRank()*300 - Duel.Damage(1-tp,dam,REASON_EFFECT) - end + local opp_c,xyz_c=table.unpack(e:GetLabelObject()) + if opp_c:IsRelateToEffect(e) and opp_c:IsControler(1-tp) and Duel.Destroy(opp_c,REASON_EFFECT)>0 + and xyz_c:IsRelateToEffect(e) and xyz_c:IsFaceup() then + Duel.Damage(1-tp,xyz_c:GetRank()*300,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c52495649.lua b/official/c52495649.lua index 4d6e867334..39b12114d5 100644 --- a/official/c52495649.lua +++ b/official/c52495649.lua @@ -74,7 +74,7 @@ function s.cfilter(c) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_NOUVELLES) and c:IsRitualMonster() and c:IsLevel(6) - and c:IsCanBeSpecialSummoned(e,SUMMON_BY_NOUVELLES,tp,false,true) + and c:IsCanBeSpecialSummoned(e,0,tp,false,true) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.cfilter(chkc) end @@ -92,7 +92,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 \ No newline at end of file diff --git a/official/c52645235.lua b/official/c52645235.lua index 8be294f017..f624299298 100644 --- a/official/c52645235.lua +++ b/official/c52645235.lua @@ -76,7 +76,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 diff --git a/official/c53618197.lua b/official/c53618197.lua index b36eb485cf..118695411c 100644 --- a/official/c53618197.lua +++ b/official/c53618197.lua @@ -69,7 +69,7 @@ function s.cfilter(c) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_NOUVELLES) and c:IsRitualMonster() and c:IsLevel(3,4) - 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()) @@ -95,7 +95,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 \ No newline at end of file diff --git a/official/c54719828.lua b/official/c54719828.lua index 5c8c2dcb26..6136f5d5bf 100644 --- a/official/c54719828.lua +++ b/official/c54719828.lua @@ -1,53 +1,51 @@ ---No.16 色の支配者ショック・ルーラー +--No.16 色の支配者ショック・ルーラー --Number 16: Shock Master local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon Procedure: 3 Level 4 monsters + --Xyz Summon procedure: 3 Level 4 monsters Xyz.AddProcedure(c,nil,4,3) - --Players cannot activate cards with the declared type + --Declare 1 card type (Monster, Spell, or Trap); that type of card (if Spell or Trap) cannot be activated, or (if Monster) cannot activate its effects, until the end of your opponent's next turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(Cost.DetachFromSelf(1)) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) + e1:SetTarget(s.efftg) + e1:SetOperation(s.effop) c:RegisterEffect(e1) end s.xyz_number=16 -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end - Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) - e:SetLabel(Duel.SelectOption(tp,DECLTYPE_MONSTER,DECLTYPE_SPELL,DECLTYPE_TRAP)) +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) + local b1=not Duel.HasFlagEffect(tp,id+1) + local b2=not Duel.HasFlagEffect(tp,id+2) + local b3=not Duel.HasFlagEffect(tp,id+3) + if chk==0 then return b1 or b2 or b3 end + local op=Duel.SelectEffect(tp, + {b1,DECLTYPE_MONSTER}, + {b2,DECLTYPE_SPELL}, + {b3,DECLTYPE_TRAP}) + e:SetLabel(op) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local e1=Effect.CreateEffect(c) +function s.effop(e,tp,eg,ep,ev,re,r,rp) + local op=e:GetLabel() + if Duel.HasFlagEffect(tp,id+op) then return end + Duel.RegisterFlagEffect(tp,id+op,RESET_PHASE|PHASE_END,0,1) + --That type of card (if Spell or Trap) cannot be activated, or (if Monster) cannot activate its effects, until the end of your opponent's next turn + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,op)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(1,1) - if e:GetLabel()==0 then - e1:SetDescription(aux.Stringid(id,2)) - e1:SetValue(s.aclimit1) - elseif e:GetLabel()==1 then - e1:SetDescription(aux.Stringid(id,3)) - e1:SetValue(s.aclimit2) - else - e1:SetDescription(aux.Stringid(id,4)) - e1:SetValue(s.aclimit3) + if op==1 then + e1:SetValue(function(e,re,tp) return re:IsMonsterEffect() end) + elseif op==2 then + e1:SetValue(function(e,re,tp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() end) + elseif op==3 then + e1:SetValue(function(e,re,tp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsTrapEffect() end) end e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,1) Duel.RegisterEffect(e1,tp) -end -function s.aclimit1(e,re,tp) - return re:IsMonsterEffect() -end -function s.aclimit2(e,re,tp) - return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() -end -function s.aclimit3(e,re,tp) - return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsTrapEffect() end \ No newline at end of file diff --git a/official/c5609226.lua b/official/c5609226.lua index 493f6989c2..994fb35d74 100644 --- a/official/c5609226.lua +++ b/official/c5609226.lua @@ -2,42 +2,41 @@ --Tuner's Barrier local s,id=GetID() function s.initial_effect(c) - --Targeted tuner monster cannot be destroyed by battle or card effect + --Make 1 Tuner you control unable to be destroyed by battle or card effects until the end of the next turn local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) - e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_BATTLE_START) + e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_BATTLE_START) c:RegisterEffect(e1) end -function s.filter(c) - return c:IsFaceup() and c:IsType(TYPE_TUNER) +function s.tgfilter(c) + return c:IsType(TYPE_TUNER) and c:IsFaceup() and not c:HasFlagEffect(id) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) - Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO) + Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) then - --Cannot be destroyed by battle or card effect + if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_TUNER) then + tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,2) + --That Tuner cannot be destroyed by battle or card effects until the end of the next turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3008) - e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(1) e1:SetReset(RESETS_STANDARD_PHASE_END,2) tc:RegisterEffect(e1) - local e2=Effect.CreateEffect(e:GetHandler()) - e2:SetType(EFFECT_TYPE_SINGLE) + local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) - e2:SetValue(1) - e2:SetReset(RESETS_STANDARD_PHASE_END,2) tc:RegisterEffect(e2) end end \ No newline at end of file diff --git a/official/c62592805.lua b/official/c62592805.lua index ea884d428c..fd62a5ccfe 100644 --- a/official/c62592805.lua +++ b/official/c62592805.lua @@ -53,7 +53,7 @@ function s.attachcond(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:IsCanBeXyzMaterial(e:GetHandler(),tp,REASON_EFFECT) end function s.setfilter(c) return c:IsSetCard(SET_PURRELY) and c:IsTrap() and c:IsSSetable() diff --git a/official/c67331360.lua b/official/c67331360.lua index 85468d688f..e9d3c5e335 100644 --- a/official/c67331360.lua +++ b/official/c67331360.lua @@ -4,33 +4,33 @@ local s,id=GetID() function s.initial_effect(c) --Activate + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_ACTIVATE) + e0:SetCode(EVENT_FREE_CHAIN) + c:RegisterEffect(e0) + --Special Summon 1 monster from your Deck with the same name as each target, as a Level 6 DARK monster local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_ACTIVATE) - e1:SetCode(EVENT_FREE_CHAIN) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetRange(LOCATION_FZONE) + e1:SetCountLimit(1,id) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Special Summon 1 monster from your Deck as a Level 6 DARK monster + --Attach 1 "Grandpa Demetto" you control to "Princess Cologne" you control as material, then end the Battle Phase local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_SPECIAL_SUMMON) - e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_FZONE) - e2:SetCountLimit(1,id) - e2:SetTarget(s.sptg) - e2:SetOperation(s.spop) + e2:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end) + e2:SetTarget(s.attachtg) + e2:SetOperation(s.attachop) c:RegisterEffect(e2) - --Attach material and end battle phase - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e3:SetCode(EVENT_ATTACK_ANNOUNCE) - e3:SetRange(LOCATION_FZONE) - e3:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end) - e3:SetTarget(s.bptg) - e3:SetOperation(s.bpop) - c:RegisterEffect(e3) end -s.listed_names={75574498,44190146} --Princess Cologne, Grandpa Demetto +s.listed_names={CARD_PRINCESS_COLOGNE,CARD_GRANDPA_DEMETTO} function s.tgfilter(c,e) return c:IsType(TYPE_NORMAL) and (c:IsAttack(0) or c:IsDefense(0)) and c:IsCanBeEffectTarget(e) end @@ -39,13 +39,13 @@ function s.resconfunc(cg) --that will ensure cards in sg will have at least one card in cg with the same name. --It also ensures that each card has one exclusive pair. return function (sg,e,tp,mg) - local code1=sg:GetFirst():GetCode() - local f1=cg:Filter(Card.IsCode,nil,code1) + local code0=sg:GetFirst():GetCode() + local f1=cg:Filter(Card.IsCode,nil,code0) if #f1<1 then return end if #sg>1 then - local code2=sg:GetNext():GetCode() - return (code1==code2 and #f1>1) - or (cg-f1):IsExists(Card.IsCode,1,nil,code2) + local code1=sg:GetNext():GetCode() + return (code0==code1 and #f1>1) + or (cg-f1):IsExists(Card.IsCode,1,nil,code1) end return true end @@ -61,7 +61,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local tg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_GRAVE,0,nil,e) local rescon=s.resconfunc(Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp)) if chk==0 then return ft>0 and aux.SelectUnselectGroup(tg,e,tp,1,1,rescon,0) end - if Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,75574498),tp,LOCATION_ONFIELD,0,1,nil) + if Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_PRINCESS_COLOGNE),tp,LOCATION_ONFIELD,0,1,nil) and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and aux.SelectUnselectGroup(tg,e,tp,1,2,rescon,0) then ft=math.min(2,ft) @@ -101,24 +101,26 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummonComplete() end end -function s.bptg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,75574498),tp,LOCATION_MZONE,0,1,nil) - and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,44190146),tp,LOCATION_MZONE,0,1,nil) - end +function s.attachfilter(c,tp) + return c:IsCode(CARD_GRANDPA_DEMETTO) and c:IsFaceup() and Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil,c,tp) +end +function s.xyzfilter(c,mc,tp) + return c:IsCode(CARD_PRINCESS_COLOGNE) and c:IsFaceup() and mc:IsCanBeXyzMaterial(c,tp,REASON_EFFECT) end -function s.colfilter(c,e) - return c:IsFaceup() and c:IsCode(75574498) and not c:IsImmuneToEffect(e) +function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_MZONE,0,1,nil,tp) end end -function s.bpop(e,tp,eg,ep,ev,re,r,rp) - local mg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsCode,44190146),tp,LOCATION_MZONE,0,nil) - local tg=Duel.GetMatchingGroup(s.colfilter,tp,LOCATION_MZONE,0,nil,e) - if #mg>0 and #tg>0 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) - local mc=mg:Select(tp,1,1,false):GetFirst() - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT) - local tc=tg:Select(tp,1,1,false):GetFirst() - if mc and tc then - Duel.Overlay(tc,mc) +function s.attachop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) + local attach_c=Duel.SelectMatchingCard(tp,s.attachfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst() + if not attach_c then return end + Duel.HintSelection(attach_c) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) + local xyz_c=Duel.SelectMatchingCard(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,attach_c,tp):GetFirst() + if xyz_c then + Duel.HintSelection(xyz_c) + if not attach_c:IsImmuneToEffect(e) and not xyz_c:IsImmuneToEffect(e) then + Duel.Overlay(xyz_c,attach_c,true) Duel.BreakEffect() Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE|PHASE_BATTLE_STEP,1) end diff --git a/official/c71595845.lua b/official/c71595845.lua index 2326d04a66..09b8e1b259 100644 --- a/official/c71595845.lua +++ b/official/c71595845.lua @@ -1,10 +1,9 @@ --人形の幸福 --Doll Happiness --Logical Nonsense ---Substitute ID local s,id=GetID() function s.initial_effect(c) - --Add 1 "Box of Friends" or "Grandpa Demetto" from deck + --When this card is Activated: Add 1 "Grandpa Demetto" or "Box of Friends" from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) @@ -14,19 +13,18 @@ function s.initial_effect(c) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --Opponent cannot target your monsters with 0 ATK or DEF for attacks + --While you control "Princess Cologne", your opponent's monsters cannot target monsters with 0 ATK or DEF for attacks local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD) + e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(0,LOCATION_MZONE) - e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) - e2:SetCondition(s.atcon) - e2:SetValue(s.atlimit) + e2:SetCondition(function(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_PRINCESS_COLOGNE),e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) end) + e2:SetValue(function(e,c) return (c:IsAttack(0) or c:IsDefense(0)) and c:IsFaceup() end) c:RegisterEffect(e2) - --Destroy 1 monster from hand/field, send 1 "Doll Monster" card from deck to GY + --Destroy 1 monster in your hand or field, and if you do, send 1 "Doll Monster" card from your Deck to the GY local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,2)) + e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_TOGRAVE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_SZONE) @@ -35,87 +33,53 @@ function s.initial_effect(c) e3:SetOperation(s.desop) c:RegisterEffect(e3) end - --Lists "Doll Monster" archetype s.listed_series={SET_DOLL_MONSTER} - --Specifically lists "Princess Cologne", "Box of Friends", and "Grandpa Demetto" -s.listed_names={75574498,81587028,44190146} - --Check for "Box of Friends" or "Grandpa Demetto" -function s.filter(c) - return c:IsCode(81587028,44190146) and c:IsAbleToHand() +s.listed_names={CARD_GRANDPA_DEMETTO,CARD_BOX_OF_FRIENDS,CARD_PRINCESS_COLOGNE} +function s.thfilter(c) + return c:IsCode(CARD_GRANDPA_DEMETTO,CARD_BOX_OF_FRIENDS) and c:IsAbleToHand() end - --Activation legality function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end - --Add 1 "Box of Friends" or "Grandpa Demetto" from deck function s.activate(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end - --Check for "Princess Cologne" -function s.atcon(e) - return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,75574498),e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) -end - --Check if the monster has 0 ATK or DEF -function s.atlimit(e,c) - return c:IsFaceup() and (c:IsAttack(0) or c:IsDefense(0)) -end - --Check for a "Doll Monster" card function s.tgfilter(c) return c:IsSetCard(SET_DOLL_MONSTER) and c:IsAbleToGrave() end - --Activation legality function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsMonster,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end - local dg=Duel.GetMatchingGroup(Card.IsMonster,tp,LOCATION_HAND|LOCATION_MZONE,0,nil) - if not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil) then - Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,tp,LOCATION_HAND|LOCATION_MZONE) - else - Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND|LOCATION_MZONE) - end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND|LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end - --Destroy 1 monster from hand/field, send 1 "Doll Monster" card from deck to GY function s.desop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if not c:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g1=Duel.SelectMatchingCard(tp,Card.IsMonster,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil) - if #g1>0 and Duel.Destroy(g1,REASON_EFFECT)~=0 then + local desg=Duel.SelectMatchingCard(tp,Card.IsMonster,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil) + if #desg>0 and Duel.Destroy(desg,REASON_EFFECT)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g2=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) - if #g2>0 then - Duel.SendtoGrave(g2,REASON_EFFECT) + local gyg=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) + if #gyg>0 then + Duel.SendtoGrave(gyg,REASON_EFFECT) end end + local c=e:GetHandler() + --You cannot Special Summon from the Extra Deck for the rest of this turn, except Xyz Monsters local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function (e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_XYZ) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - --Clock Lizard check - aux.addTempLizardCheck(c,tp,s.lizfilter) - local e2=Effect.CreateEffect(c) - e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_OATH) - e2:SetDescription(aux.Stringid(id,3)) - e2:SetReset(RESET_PHASE|PHASE_END) - e2:SetTargetRange(1,0) - Duel.RegisterEffect(e2,tp) -end - --Restricted to Xyz monsters for extra deck -function s.splimit(e,c) - return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA) -end -function s.lizfilter(e,c) - return not c:IsOriginalType(TYPE_XYZ) + --"Clock Lizard" check + aux.addTempLizardCheck(c,tp,function(e,c) return not c:IsOriginalType(TYPE_XYZ) end) end \ No newline at end of file diff --git a/official/c75574498.lua b/official/c75574498.lua index 955cf04a79..2f07f41cfa 100644 --- a/official/c75574498.lua +++ b/official/c75574498.lua @@ -2,91 +2,86 @@ --Princess Cologne local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,4,2) c:EnableReviveLimit() - --spsummon1 + --Xyz Summon procedure: 2 Level 4 monsters + Xyz.AddProcedure(c,nil,4,2) + --Special Summon 1 "Box of Friends" from your GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) - e1:SetCondition(s.spcon) - e1:SetTarget(s.sptg) - e1:SetOperation(s.spop) + e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) + e1:SetTarget(s.boxsptg) + e1:SetOperation(s.boxspop) c:RegisterEffect(e1) - --cannot be target - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e2:SetRange(LOCATION_MZONE) - e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) - e2:SetCondition(s.tgcon) - e2:SetValue(aux.imval1) - c:RegisterEffect(e2) - local e3=e2:Clone() - e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) - e3:SetValue(aux.tgoval) + --If you control another monster, your opponent's monsters cannot target this card for attacks, also your opponent cannot target this card with card effects + local e2a=Effect.CreateEffect(c) + e2a:SetType(EFFECT_TYPE_SINGLE) + e2a:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e2a:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) + e2a:SetRange(LOCATION_MZONE) + e2a:SetCondition(function(e) return Duel.IsExistingMatchingCard(nil,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) end) + e2a:SetValue(aux.imval1) + c:RegisterEffect(e2a) + local e2b=e2a:Clone() + e2b:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) + e2b:SetValue(aux.tgoval) + c:RegisterEffect(e2b) + --Special Summon 1 Normal Monster from your Deck or GY in Defense Position + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) + e3:SetCode(EVENT_TO_GRAVE) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) + e3:SetCondition(s.normalspcon) + e3:SetCost(Cost.DetachFromSelf(1)) + e3:SetTarget(s.normalsptg) + e3:SetOperation(s.normalspop) c:RegisterEffect(e3) - --spsummon - local e4=Effect.CreateEffect(c) - e4:SetDescription(aux.Stringid(id,1)) - e4:SetCategory(CATEGORY_SPECIAL_SUMMON) - e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) - e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e4:SetRange(LOCATION_MZONE) - e4:SetCode(EVENT_TO_GRAVE) - e4:SetCondition(s.spcon2) - e4:SetCost(Cost.DetachFromSelf(1)) - e4:SetTarget(s.sptg2) - e4:SetOperation(s.spop2) - c:RegisterEffect(e4) end -s.listed_names={81587028} --"Box of Friends" -function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsXyzSummoned() +s.listed_names={CARD_BOX_OF_FRIENDS} +function s.boxspfilter(c,e,tp) + return c:IsCode(CARD_BOX_OF_FRIENDS) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function s.spfilter1(c,e,tp) - return c:IsCode(81587028) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) -end -function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter1(chkc,e,tp) end +function s.boxsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.boxspfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingTarget(s.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end + and Duel.IsExistingTarget(s.boxspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectTarget(tp,s.spfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) + local g=Duel.SelectTarget(tp,s.boxspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) end -function s.spop(e,tp,eg,ep,ev,re,r,rp) +function s.boxspop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end -function s.tgcon(e) - return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)>=2 -end -function s.cfilter(c,tp) - return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY) - and (c:GetPreviousTypeOnField()&TYPE_NORMAL)~=0 +function s.normalspconfilter(c,tp) + return c:IsPreviousTypeOnField(TYPE_NORMAL) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) + and c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsType(TYPE_NORMAL) end -function s.spcon2(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.cfilter,1,nil,tp) +function s.normalspcon(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.normalspconfilter,1,nil,tp) end -function s.spfilter2(c,e,tp) +function s.normalspfilter(c,e,tp) return c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end -function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) +function s.normalsptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_GRAVE|LOCATION_DECK,0,1,nil,e,tp) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_DECK) + and Duel.IsExistingMatchingCard(s.normalspfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) end -function s.spop2(e,tp,eg,ep,ev,re,r,rp) +function s.normalspop(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,aux.NecroValleyFilter(s.spfilter2),tp,LOCATION_GRAVE|LOCATION_DECK,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.normalspfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end -end +end \ No newline at end of file diff --git a/official/c76833149.lua b/official/c76833149.lua index a731f53a1a..9a5d6d750b 100644 --- a/official/c76833149.lua +++ b/official/c76833149.lua @@ -3,87 +3,79 @@ --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) - --Xyz Summon c:EnableReviveLimit() + --Xyz Summon procedure: 2+ Level 2 Beast monsters Xyz.AddProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_BEAST),2,2,nil,nil,Xyz.InfiniteMats) - --Attach material + --Attach 1 Beast monster from your hand or face-up field to this card as material local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) - e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCountLimit(1) - e1:SetTarget(s.mttg) - e1:SetOperation(s.mtop) + e1:SetTarget(s.attachtg) + e1:SetOperation(s.attachop) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) c:RegisterEffect(e1) - --Cannot be destroyed by battle + --● 3+: Cannot be destroyed by battle local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetRange(LOCATION_MZONE) - e2:SetCondition(s.bpcon) + e2:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>=3 end) e2:SetValue(1) c:RegisterEffect(e2) - --No battle damage + --● 4+: You take no damage from battles involving this card local e3=e2:Clone() e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) - e3:SetCondition(s.nodmgcon) + e3:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>=4 end) c:RegisterEffect(e3) - --Burn + --● 5+: When an attack is declared involving this card and an Attack Position monster: You can inflict damage to your opponent equal to that Attack Position monster's ATK local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_DAMAGE) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_ATTACK_ANNOUNCE) e4:SetRange(LOCATION_MZONE) - e4:SetCondition(s.dmgcon) - e4:SetTarget(s.dmgtg) - e4:SetOperation(s.dmgop) + e4:SetCondition(s.damcon) + e4:SetTarget(s.damtg) + e4:SetOperation(s.damop) c:RegisterEffect(e4) end -function s.mtfilter(c,e) - return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and not c:IsType(TYPE_TOKEN) and c:IsRace(RACE_BEAST) and not c:IsImmuneToEffect(e) +function s.attachfilter(c,xyzc,tp) + return c:IsRace(RACE_BEAST) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsCanBeXyzMaterial(xyzc,tp,REASON_EFFECT) end -function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) - and Duel.IsExistingMatchingCard(s.mtfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,e:GetHandler(),e) end +function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then + local c=e:GetHandler() + return Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,c,tp) + end end -function s.mtop(e,tp,eg,ep,ev,re,r,rp) +function s.attachop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) - local g=Duel.SelectMatchingCard(tp,s.mtfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,e:GetHandler(),e) - local tc=g:GetFirst() - if tc then - Duel.Overlay(c,tc,true) - end + local sc=Duel.SelectMatchingCard(tp,s.attachfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,c,tp):GetFirst() + if not sc then return end + if sc:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,sc) else Duel.HintSelection(sc) end + Duel.Overlay(c,sc,true) end -function s.bpcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetOverlayCount()>=3 -end -function s.nodmgcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetOverlayCount()>=4 -end -function s.dmgcon(e,tp,eg,ep,ev,re,r,rp) +function s.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - local tc=c:GetBattleTarget() - e:SetLabelObject(tc) - return e:GetHandler():GetOverlayCount()>=5 and tc and tc:IsPosition(POS_FACEUP_ATTACK) + local bc1,bc2=Duel.GetBattleMonster(tp) + return c:GetOverlayCount()>=5 and bc1 and bc1==c and bc2 and bc2:IsAttackPos() and bc2:HasNonZeroAttack() end -function s.dmgtg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end - e:GetLabelObject():CreateEffectRelation(e) - Duel.SetTargetPlayer(1-tp) - Duel.SetTargetParam(e:GetLabelObject():GetAttack()) - Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800) + local _,bc=Duel.GetBattleMonster(tp) + e:SetLabelObject(bc) + bc:CreateEffectRelation(e) + Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,bc:GetAttack()) end -function s.dmgop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local tc=e:GetLabelObject() - if tc and tc:IsRelateToEffect(e) and tc:IsPosition(POS_FACEUP_ATTACK) then - local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - Duel.Damage(p,e:GetLabelObject():GetAttack(),REASON_EFFECT) +function s.damop(e,tp,eg,ep,ev,re,r,rp) + local bc=e:GetLabelObject() + if bc:IsRelateToEffect(e) and bc:IsFaceup() and bc:IsAttackPos() then + Duel.Damage(1-tp,bc:GetAttack(),REASON_EFFECT) end end \ No newline at end of file diff --git a/official/c88890658.lua b/official/c88890658.lua index cd99b91e64..312780235c 100644 --- a/official/c88890658.lua +++ b/official/c88890658.lua @@ -90,7 +90,7 @@ function s.cfilter(c) return c:IsAttackPos() and c:IsReleasableByEffect() end function s.spfilter(c,e,tp) - return c:IsCode(30243636) and c:IsCanBeSpecialSummoned(e,SUMMON_BY_NOUVELLES,tp,false,true) + return c:IsCode(30243636) and c:IsCanBeSpecialSummoned(e,0,tp,false,true) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.cfilter(chkc) end @@ -108,7 +108,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 \ No newline at end of file diff --git a/official/c89016236.lua b/official/c89016236.lua index 1f8138fe1b..c23b4c6fa0 100644 --- a/official/c89016236.lua +++ b/official/c89016236.lua @@ -69,7 +69,7 @@ function s.selfnouvfilter(c,tp) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_NOUVELLES) and c:IsRitualMonster() and c:IsLevel(4,5) - 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) @@ -92,7 +92,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 \ No newline at end of file diff --git a/official/c94096018.lua b/official/c94096018.lua index a45b845d1e..28913f8912 100644 --- a/official/c94096018.lua +++ b/official/c94096018.lua @@ -2,71 +2,67 @@ --SPYGAL Misty local s,id=GetID() function s.initial_effect(c) - --Reveal the top card of your opponent's Deck, and if you do, draw 1 card if it is a card of a declared type - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_DRAW) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetTarget(s.drtg) - e1:SetOperation(s.drop) - c:RegisterEffect(e1) - local e2=e1:Clone() - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e2) + --Reveal the top card of your opponent's Deck, and if you do, draw 1 card if it is a card of the declared type + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_DRAW) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetTarget(s.drtg) + e1a:SetOperation(s.drop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1b) --Return 1 "SPYRAL Super Agent" you control and 1 monster your opponent controls to the hand - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetCategory(CATEGORY_TOHAND) - e3:SetType(EFFECT_TYPE_QUICK_O) - e3:SetProperty(EFFECT_FLAG_CARD_TARGET) - e3:SetCode(EVENT_FREE_CHAIN) - e3:SetRange(LOCATION_MZONE) - e3:SetCountLimit(1) - e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) - e3:SetTarget(s.thtg) - e3:SetOperation(s.thop) - c:RegisterEffect(e3) + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TOHAND) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1) + e2:SetTarget(s.rthtg) + e2:SetOperation(s.rthop) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + c:RegisterEffect(e2) end -s.listed_names={41091257} --"SPYRAL Super Agent" +s.listed_names={CARD_SPYRAL_SUPER_AGENT} function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsPlayerCanDraw(tp,1) - and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE) - e:SetLabel(Duel.SelectOption(tp,DECLTYPE_MONSTER,DECLTYPE_SPELL,DECLTYPE_TRAP)) + if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE) + e:SetLabel(Duel.SelectOption(tp,DECLTYPE_MONSTER,DECLTYPE_SPELL,DECLTYPE_TRAP)) + Duel.SetPossibleOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end - local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - Duel.ConfirmDecktop(1-tp,1) - local g=Duel.GetDecktopGroup(1-tp,1) - local tc=g:GetFirst() local opt=e:GetLabel() - if (opt==0 and tc:IsMonster()) or (opt==1 and tc:IsSpell()) or (opt==2 and tc:IsTrap()) then + Duel.ConfirmDecktop(1-tp,1) + local top_c=Duel.GetDecktopGroup(1-tp,1):GetFirst() + if (opt==0 and top_c:IsMonster()) or (opt==1 and top_c:IsSpell()) or (opt==2 and top_c:IsTrap()) then + local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end end -function s.thfilter(c,e,tp) - return (c:IsControler(1-tp) or (c:IsCode(41091257) and c:IsFaceup())) - and c:IsAbleToHand() and c:IsCanBeEffectTarget(e) -end -function s.rescon(sg,e,tp,mg) - return sg:FilterCount(Card.GetControler,nil)==#sg +function s.rthfilter(c,e,tp) + return ((c:IsCode(CARD_SPYRAL_SUPER_AGENT) and c:IsFaceup()) or c:IsControler(1-tp)) and c:IsAbleToHand() + and c:IsCanBeEffectTarget(e) end -function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end - local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp) - if chk==0 then return #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end - local rg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_TARGET) - Duel.SetTargetCard(rg) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,rg,#rg,0,0) + local g=Duel.GetMatchingGroup(s.rthfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp) + if chk==0 then return #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetControler),0) end + local tg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetControler),1,tp,HINTMSG_RTOHAND) + Duel.SetTargetCard(tg) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,2,tp,0) end -function s.thop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetTargetCards(e) - if #g==2 then - Duel.SendtoHand(g,nil,REASON_EFFECT) +function s.rthop(e,tp,eg,ep,ev,re,r,rp) + local tg=Duel.GetTargetCards(e) + if #tg==2 and tg:FilterCount(Card.IsMonster,nil)==2 then + Duel.SendtoHand(tg,nil,REASON_EFFECT) end end \ No newline at end of file diff --git a/official/c98049934.lua b/official/c98049934.lua index 40461f5abf..ba760cabf6 100644 --- a/official/c98049934.lua +++ b/official/c98049934.lua @@ -72,7 +72,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 diff --git a/pre-release/c100348032.lua b/pre-release/c100348032.lua index eccd2eb38e..8af1adf8f5 100644 --- a/pre-release/c100348032.lua +++ b/pre-release/c100348032.lua @@ -106,7 +106,9 @@ end function s.exspop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,s.exspfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() - if sc and Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then + if not sc then return end + sc:SetMaterial(nil) + if Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then sc:CompleteProcedure() end end \ No newline at end of file diff --git a/pre-release/c100443102.lua b/pre-release/c100443102.lua index 8341e1eb8a..6ed9b65020 100644 --- a/pre-release/c100443102.lua +++ b/pre-release/c100443102.lua @@ -29,7 +29,6 @@ function s.initial_effect(c) e2:SetOperation(s.effop) c:RegisterEffect(e2) end -local CARD_MACRO_COSMOS=30241314 s.listed_names={CARD_MACRO_COSMOS,id} function s.macrofilter(c) return (c:IsCode(CARD_MACRO_COSMOS) or c:ListsCode(CARD_MACRO_COSMOS)) and not c:IsCode(id) and c:IsAbleToHand() @@ -60,4 +59,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end +end \ No newline at end of file diff --git a/pre-release/c101302047.lua b/pre-release/c101302047.lua index 1419bbc7f7..4457917691 100644 --- a/pre-release/c101302047.lua +++ b/pre-release/c101302047.lua @@ -34,6 +34,7 @@ function s.initial_effect(c) e2:SetCondition(s.doubledamcon) e2:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE)) c:RegisterEffect(e2) + --Keep track of monster effects activated in the hand or GY Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter) end s.listed_series={SET_K9} @@ -53,7 +54,7 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) then + if tc:IsRelateToEffect(e) and tc:IsMonster() then Duel.Destroy(tc,REASON_EFFECT) end end diff --git a/pre-release/c101302055.lua b/pre-release/c101302055.lua index cca6ecce09..eb82a866af 100644 --- a/pre-release/c101302055.lua +++ b/pre-release/c101302055.lua @@ -52,12 +52,15 @@ function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) local dam=100*Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_PLANT),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,nil) if e:GetHandler():IsReason(REASON_EFFECT) and re:GetHandler():IsCode(CARD_BLACK_ROSE_DRAGON) then e:SetLabel(1) - dam=dam+2400 + if dam>0 then dam=dam+2400 end else e:SetLabel(0) end Duel.SetTargetPlayer(1-tp) - Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) + if dam>0 then + Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) + end + Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) diff --git a/pre-release/c101302104.lua b/pre-release/c101302104.lua index 054419d926..d5735c5b62 100644 --- a/pre-release/c101302104.lua +++ b/pre-release/c101302104.lua @@ -8,9 +8,9 @@ function s.initial_effect(c) Pendulum.AddProcedure(c,false) --Fusion Materials: 4 Fiend monsters (1 Fusion, 1 Synchro, 1 Xyz, 1 Pendulum) Fusion.AddProcMix(c,true,true,s.matfilter(TYPE_FUSION),s.matfilter(TYPE_SYNCHRO),s.matfilter(TYPE_XYZ),s.matfilter(TYPE_PENDULUM)) + c:AddMustBeFusionSummoned() --Special Summon this card (from your Extra Deck) by banishing the above materials from your field and/or GY Fusion.AddContactProc(c,s.contactfil,s.contactop,false,nil,1) - c:AddMustBeFusionSummoned() --You can only Fusion Summon or Special Summon by its alternate procedure "D/D/D/D Great Dimension King Arc Crisis" once per turn local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) @@ -79,7 +79,7 @@ function s.regcon(e) return c:IsFusionSummoned() or c:IsSummonType(SUMMON_TYPE_SPECIAL+1) end function s.regop(e,tp,eg,ep,ev,re,r,rp) - --Prevent another Fusion Summon or Special Summon by its alternate procedure of "Dark Magician of Destruction" that turn + --Prevent another Fusion Summon or Special Summon by its alternate procedure of "D/D/D/D Great Dimension King Arc Crisis" that turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) @@ -168,4 +168,4 @@ function s.penop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end -end +end \ No newline at end of file diff --git a/proc_workaround.lua b/proc_workaround.lua index 682a426e10..1d99fe4d88 100644 --- a/proc_workaround.lua +++ b/proc_workaround.lua @@ -1,29 +1,19 @@ --Utilities to be added to the core --[[ - If called while an effect isn't resolving (e.g. a regular Xyz Summon or through an effect like "Wonder Xyz") then proceed as usual with the attaching. - If called while an effect is resolving treat it as attaching by card effect and handle the relevant rulings. - Attaching by card effect is ruled to affect both the Xyz Monster and the cards that are to be attached. - Return early if the Xyz Monster is unaffected by the currently resolving effect. - Remove any cards that are unaffected by the currently resolving effect from the group of cards to be attached. - If all the cards to be attached are unaffected by the currently resolving effect then return early. - Proceed as usual with the attaching otherwise. -Duel.Overlay=(function() - local oldfunc=Duel.Overlay - return function(xyz_monster,xyz_mats,send_to_grave) - if not Duel.IsChainSolving() then return oldfunc(xyz_monster,xyz_mats,send_to_grave) end - local trig_eff=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT) - if xyz_monster:IsImmuneToEffect(trig_eff) then return end - if type(xyz_mats)=="Group" then - xyz_mats:Match(aux.NOT(Card.IsImmuneToEffect),nil,trig_eff) - if #xyz_mats==0 then return end - elseif type(xyz_mats)=="Card" and xyz_mats:IsImmuneToEffect(trig_eff) then - return + Return false by default if the card to attach and the Xyz Monster to attach the card to are the same card +--]] +Card.IsCanBeXyzMaterial=(function() + local oldfunc=Card.IsCanBeXyzMaterial + return function(card,xyz_monster,player,reason) + if xyz_monster and card==xyz_monster then + return false end - return oldfunc(xyz_monster,xyz_mats,send_to_grave) + player=player or Duel.GetReasonPlayer() + reason=reason or REASON_XYZ|REASON_MATERIAL + return oldfunc(card,xyz_monster,player,reason) end end)() ---]] function Auxiliary.ReleaseNonSumCheck(c,tp,e) if c:IsControler(tp) then return false end diff --git a/skill/c300309005.lua b/skill/c300309005.lua index fa1c4cf4b0..3fed6d55e4 100644 --- a/skill/c300309005.lua +++ b/skill/c300309005.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetOperation(s.flipop) c:RegisterEffect(e1) end -s.listed_names={31829185,CARD_DESTINY_BOARD } --"Dark Necrofear","Destiny Board" +s.listed_names={31829185,CARD_DESTINY_BOARD} --"Dark Necrofear" s.listed_series={SET_SPIRIT_MESSAGE} function s.flipop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SKILL_FLIP,tp,id|(1<<32)) @@ -22,10 +22,9 @@ function s.flipop(e,tp,eg,ep,ev,re,r,rp) --"Destiny Board" and "Spirit Message" cards you control are unaffected by your opponent's card effects local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE) + e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetCode(EFFECT_IMMUNE_EFFECT) - e1:SetRange(0x5f) - e1:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,31829185),tp,LOCATION_ONFIELD,0,1,nil) end) + e1:SetCondition(function(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,31829185),e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) end) e1:SetTargetRange(LOCATION_ONFIELD,0) e1:SetTarget(function(e,c) return c:IsFaceup() and (c:IsCode(CARD_DESTINY_BOARD) or c:IsSetCard(SET_SPIRIT_MESSAGE)) end) e1:SetValue(function(e,re) return e:GetOwnerPlayer()~=re:GetOwnerPlayer() end) @@ -38,6 +37,11 @@ function s.flipop(e,tp,eg,ep,ev,re,r,rp) e2:SetRange(0x5f) e2:SetTargetRange(1,0) Duel.RegisterEffect(e2,tp) + local e2b=Effect.CreateEffect(c) + e2b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e2b:SetCode(EVENT_ADJUST) + e2b:SetOperation(s.altdboardop) + Duel.RegisterEffect(e2b,tp) --Reveal "Spirit Message" card to draw 1 card local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -49,6 +53,104 @@ function s.flipop(e,tp,eg,ep,ev,re,r,rp) e3:SetOperation(s.drawop) Duel.RegisterEffect(e3,tp) end +function s.altdboardop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_ALL,LOCATION_ALL,nil,CARD_DESTINY_BOARD) + for tc in g:Iter() do + if not tc:HasFlagEffect(id) then + tc:RegisterFlagEffect(id,0,0,0) + local effs={tc:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:GetType()&(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)==EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F then + eff:SetOperation(s.plop) + eff:SetValue(s.extraop) + end + end + end + end +end +function s.plfilter(c,code) + return c:IsCode(code) and not c:IsForbidden() +end +function s.plop(e,tp,eg,ep,ev,re,r,rp) + if Duel.IsPlayerAffectedByEffect(tp,CARD_DARK_SANCTUARY) + or Duel.IsPlayerAffectedByEffect(tp,id) then + return s.extraop(e,tp,eg,ep,ev,re,r,rp) + end + local c=e:GetHandler() + local code=c:GetOriginalCode() + if not c:IsRelateToEffect(e) then return end + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + local passcode=CARDS_SPIRIT_MESSAGE[c:GetFlagEffect(code)+1] + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(code,1)) + local g=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,passcode) + if #g>0 and Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true) then + c:RegisterFlagEffect(code,RESET_EVENT|RESETS_STANDARD,0,0) + end +end +function s.extraop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end + local code=c:GetOriginalCode() + local cid=CARDS_SPIRIT_MESSAGE[c:GetFlagEffect(code)+1] + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(code,1)) + local sc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,cid):GetFirst() + if not sc then return end + local stzone_chk=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + local dark_sanctuary_chk=Duel.IsPlayerAffectedByEffect(tp,CARD_DARK_SANCTUARY) + local fear_of_the_dark_chk=Duel.IsPlayerAffectedByEffect(tp,id) + local can_sp_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsPlayerCanSpecialSummonMonster(tp,cid,0,TYPE_MONSTER|TYPE_NORMAL,0,0,1,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,tp,181) + if not (dark_sanctuary_chk or fear_of_the_dark_chk) and stzone_chk then + Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) + c:RegisterFlagEffect(code,RESET_EVENT|RESETS_STANDARD,0,0) + elseif can_sp_chk and (dark_sanctuary_chk or fear_of_the_dark_chk) then + local op=3 + if dark_sanctuary_chk and not fear_of_the_dark_chk then + op=(not stzone_chk or Duel.SelectYesNo(tp,aux.Stringid(CARD_DARK_SANCTUARY,0))) and 1 or 3 + elseif fear_of_the_dark_chk and not dark_sanctuary_chk then + op=(not stzone_chk or Duel.SelectYesNo(tp,aux.Stringid(id,0))) and 2 or 3 + elseif dark_sanctuary_chk and fear_of_the_dark_chk then + --select either or nothing + local b1=dark_sanctuary_chk + local b2=fear_of_the_dark_chk + local b3=stzone_chk + op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,1)}, + {b2,aux.Stringid(id,2)}, + {b3,aux.Stringid(id,3)}) + end + if op==3 then + Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) + c:RegisterFlagEffect(code,RESET_EVENT|RESETS_STANDARD,0,0) + elseif op==1 or op==2 then + sc:AddMonsterAttribute(TYPE_NORMAL,ATTRIBUTE_DARK,RACE_FIEND,1,0,0) + local hint_code=op==1 and CARD_DARK_SANCTUARY or id + Duel.Hint(HINT_CARD,0,hint_code) + Duel.SpecialSummonStep(sc,181,tp,tp,true,false,POS_FACEUP) + sc:AddMonsterAttributeComplete() + if op==1 then + --immune + 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:SetValue(function(e,te) return not te:GetHandler():IsCode(CARD_DESTINY_BOARD) end) + e1:SetReset(RESET_EVENT|RESET_TODECK|RESET_TOHAND|RESET_TOGRAVE|RESET_REMOVE) + sc:RegisterEffect(e1) + end + --cannot be target + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_IGNORE_BATTLE_TARGET) + e2:SetValue(1) + e2:SetReset(RESET_EVENT|RESET_TODECK|RESET_TOHAND|RESET_TOGRAVE|RESET_REMOVE) + sc:RegisterEffect(e2) + Duel.SpecialSummonComplete() + c:RegisterFlagEffect(code,RESET_EVENT|RESETS_STANDARD,0,0) + end + end +end --Draw functions function s.smtdfilter(c) return c:IsSetCard(SET_SPIRIT_MESSAGE) and c:IsAbleToDeckAsCost() and not c:IsPublic() diff --git a/skill/c300309006.lua b/skill/c300309006.lua index 931df06666..c7fa4e3d8b 100644 --- a/skill/c300309006.lua +++ b/skill/c300309006.lua @@ -28,7 +28,9 @@ function s.flipop(e,tp,eg,ep,ev,re,r,rp) e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) and Duel.GetDrawCount(tp)>0 and Duel.GetTurnCount(tp)>1 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 end) e1:SetOperation(s.drawop) Duel.RegisterEffect(e1,tp) - --Only you need to have 15 or more cards in the GY to activate "Exchange of the Spirit" + --Apply the following Skills: + --● Only you need 15 or more cards in your GY to activate "Exchange of the Spirit". + --● If you have 15 or more cards in your GY, you can banish 1 "Exchange of the Spirit" from your GY to activate its effect. local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) @@ -36,17 +38,11 @@ function s.flipop(e,tp,eg,ep,ev,re,r,rp) e2:SetRange(0x5f) e2:SetTargetRange(1,0) Duel.RegisterEffect(e2,tp) - --Banish 1 "Exchange of the Spirit" to activate its effect - local e3=Effect.CreateEffect(c) - e3:SetCategory(CATEGORY_REMOVE) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e3:SetCode(EVENT_FREE_CHAIN) - e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e3:SetRange(0x5f) - e3:SetCondition(s.exchcon) - e3:SetTarget(s.exchtg) - e3:SetOperation(s.exchop) - Duel.RegisterEffect(e3,tp) + local e2b=Effect.CreateEffect(c) + e2b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e2b:SetCode(EVENT_ADJUST) + e2b:SetOperation(s.altexchangeop) + Duel.RegisterEffect(e2b,tp) end --Draw functions function s.drawop(e,tp,eg,ep,ev,re,r,rp) @@ -93,33 +89,23 @@ function s.drawop(e,tp,eg,ep,ev,re,r,rp) end end end ---"Exchange of the Spirit" banish functions -function s.exchrmvfilter(c) - return c:IsCode(CARD_EXCHANGE_SPIRIT) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil -end -function s.exchcon(e,tp,eg,ep,ev,re,r,rp) - return aux.CanActivateSkill(tp) and Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=15 -end -function s.exchtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.exchfilter,tp,LOCATION_GRAVE,0,1,nil) end - Duel.Hint(HINT_CARD,tp,id) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local rg=Duel.SelectMatchingCard(tp,s.exchrmvfilter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.HintSelection(rg,true) - rg:KeepAlive() - e:SetLabelObject(rg) - Duel.Remove(rg,POS_FACEUP,REASON_COST) -end -function s.exchop(e,tp,eg,ep,ev,re,r,rp) - local g=e:GetLabelObject() - local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true) - local tg=te:GetTarget() - e:SetProperty(te:GetProperty()) - if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end - if not te then return end - local op=te:GetOperation() - if op then - op(e,tp,eg,ep,ev,re,r,rp) - g:DeleteGroup() +function s.altexchangeop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_ALL,LOCATION_ALL,nil,CARD_EXCHANGE_SPIRIT) + for tc in g:Iter() do + if not tc:HasFlagEffect(id) then + tc:RegisterFlagEffect(id,0,0,0) + --Only you need 15 or more cards in your GY to activate "Exchange of the Spirit" + local eff=tc:GetActivateEffect() + eff:SetCondition(function(e,tp) + return Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=15 and (Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE)>=15 or Duel.IsPlayerAffectedByEffect(tp,id)) + end) + --If you have 15 or more cards in your GY, you can banish 1 "Exchange of the Spirit" from your GY to activate its effect + local gy_eff=eff:Clone() + gy_eff:SetType(EFFECT_TYPE_QUICK_O) + gy_eff:SetRange(LOCATION_GRAVE) + gy_eff:SetCountLimit(1) + gy_eff:SetCost(Cost.SelfBanish) + tc:RegisterEffect(gy_eff) + end end end \ No newline at end of file