diff --git a/archetype_setcode_constants.lua b/archetype_setcode_constants.lua index 6cc7fd3a60..b7c2fb54da 100644 --- a/archetype_setcode_constants.lua +++ b/archetype_setcode_constants.lua @@ -596,3 +596,5 @@ SET_ARTMEGIA = 0x1c7 SET_DOOM_KING = 0x1c8 SET_MAGNIFISTORM = 0x1c9 SET_RB = 0x1ca +SET_DOOM_Z = 0x1cb +SET_HECATONCHEIRE = 0x1cc diff --git a/card_counter_constants.lua b/card_counter_constants.lua index 3faece4255..19f4d7f9dc 100644 --- a/card_counter_constants.lua +++ b/card_counter_constants.lua @@ -46,6 +46,8 @@ CARD_HARPIE_LADY_SISTERS = 12206212 CARD_INFERNOBLE_CHARLES = 77656797 CARD_JACK_KNIGHT = 90876561 CARD_JINZO = 77585513 +CARD_JUNK_SYNCHRON = 63977008 +CARD_JUNK_WARRIOR = 60800381 CARD_KAZEJIN = 62340868 CARD_KING_KNIGHT = 64788463 CARD_KING_SARCOPHAGUS = 16528181 diff --git a/cards_specific_functions.lua b/cards_specific_functions.lua index 4f11526299..fe9950a261 100644 --- a/cards_specific_functions.lua +++ b/cards_specific_functions.lua @@ -1239,3 +1239,30 @@ function Infernoid.RegisterSummonProcedure(c,monstersToBanish) e2:SetOperation(InfernoidInt.summonOperation) c:RegisterEffect(e2) end + +DragonRuler={} +do + local function discard_with_other_cost(filter) + return function(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return Duel.IsExistingMatchingCard(filter,tp,LOCATION_HAND,0,1,c) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) + local g=Duel.SelectMatchingCard(tp,filter,tp,LOCATION_HAND,0,1,1,c) + Duel.SendtoGrave(g+c,REASON_COST|REASON_DISCARD) + end + end + --For Level 7 monsters (can only discard to GY, and does not allow Dragons) + function DragonRuler.SelfDiscardToGraveCost(attr) + local function other_discard_to_grave_filter(c) + return c:IsAttribute(attr) and c:IsDiscardable() and c:IsAbleToGraveAsCost() + end + return Cost.AND(discard_with_other_cost(other_discard_to_grave_filter),Cost.SelfDiscardToGrave) + end + --For lower Level monsters (not limited to discarding to GY, and allows Dragons) + function DragonRuler.SelfDiscardCost(attr) + local function other_discard_filter(c) + return (c:IsAttribute(attr) or c:IsRace(RACE_DRAGON)) and c:IsDiscardable() + end + return Cost.AND(discard_with_other_cost(other_discard_filter),Cost.SelfDiscard) + end +end diff --git a/deprecated_functions.lua b/deprecated_functions.lua index 04ee204068..80dc0ae50e 100644 --- a/deprecated_functions.lua +++ b/deprecated_functions.lua @@ -37,7 +37,7 @@ make_deprecated_function_no_replacement("Duel.GetTributeCount", "You should use make_deprecated_function_alias("Auxiliary.selfbanishcost","Cost.SelfBanish") make_deprecated_function_alias("Auxiliary.SelfBanishCost","Cost.SelfBanish") make_deprecated_function_alias("Auxiliary.DiscardCost","Cost.Discard") -make_deprecated_function_alias("Auxiliary.dxmcostgen","Cost.Detach") +make_deprecated_function_alias("Auxiliary.dxmcostgen","Cost.DetachFromSelf") make_deprecated_function_alias("Auxiliary.selfreleasecost","Cost.SelfRelease") make_deprecated_function_alias("Auxiliary.SelfReleaseCost","Cost.SelfRelease") make_deprecated_function_alias("Auxiliary.SelfTributeCost","Cost.SelfRelease") diff --git a/goat/c504700054.lua b/goat/c504700054.lua index d2803998cd..206a321bf6 100644 --- a/goat/c504700054.lua +++ b/goat/c504700054.lua @@ -3,37 +3,32 @@ --"“Thunder Dragon” may be discarded to search for 0 “Thunder Dragons” in the player’s deck." netrep ruling local s,id=GetID() function s.initial_effect(c) - --search + --Add up to 2 "Thunder Dragon" cards from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_THUNDRA) + e1:SetCost(Cost.SelfDiscard) + e1:SetTarget(s.thtg) + e1:SetOperation(s.thop) + c:RegisterEffect(e1) end s.listed_names={31786629} -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() end - Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) -end -function s.filter(c) +function s.thfilter(c) return c:IsCode(31786629) and c:IsAbleToHand() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK) end -function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) +function s.thop(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,0,2,nil) + local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,0,2,nil) if g and #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) - else - if not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) then Duel.GoatConfirm(tp,LOCATION_DECK) end + elseif not Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) then + Duel.GoatConfirm(tp,LOCATION_DECK) end end diff --git a/official/c10000030.lua b/official/c10000030.lua index cd5e1ddec8..56fce531ff 100644 --- a/official/c10000030.lua +++ b/official/c10000030.lua @@ -3,7 +3,7 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon procedure + --Xyz Summon procedure: 2 Level 6 Spellcaster monsters Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_SPELLCASTER),6,2) --Activate 1 of these effects local e1=Effect.CreateEffect(c) @@ -12,23 +12,17 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.effcost) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.effcost)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) - and Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,nil) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) + if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end -function s.spfilter(c,e,tp) - return c:IsCanBeSpecialSummoned(e,0,tp,false,false) -end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then if not chkc:IsControler(1-tp) then return false end @@ -36,12 +30,12 @@ function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if op==1 then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControlerCanBeChanged() elseif op==2 then - return chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) + return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) end end local b1=Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingTarget(s.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) + and Duel.IsExistingTarget(Card.IsCanBeSpecialSummoned,tp,0,LOCATION_GRAVE,1,nil,e,0,tp,false,false) if chk==0 then return b1 or b2 end local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,1)}, @@ -55,7 +49,7 @@ function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) elseif op==2 then e:SetCategory(CATEGORY_SPECIAL_SUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectTarget(tp,s.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp) + local g=Duel.SelectTarget(tp,Card.IsCanBeSpecialSummoned,tp,0,LOCATION_GRAVE,1,1,nil,e,0,tp,false,false) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) end end @@ -70,4 +64,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) --Special Summon 1 monster from your opponent's GY Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c10389142.lua b/official/c10389142.lua index a1676abb80..5fda7831ef 100644 --- a/official/c10389142.lua +++ b/official/c10389142.lua @@ -1,84 +1,52 @@ ---No.42 スターシップ・ギャラクシー・トマホーク +--No.42 スターシップ・ギャラクシー・トマホーク --Number 42: Galaxy Tomahawk local s,id=GetID() +local TOKEN_BATTLE_EAGLE=id+1 function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,7,2) c:EnableReviveLimit() - --token + --Xyz Summon procedure: 2 Level 7 monsters + Xyz.AddProcedure(c,nil,7,2) + --Special Summon as many "Battle Eagle Tokens" (Machine-Type/WIND/Level 6/ATK 2000/DEF 0) as possible, but destroy them during the End Phase of this turn, also your opponent takes no further battle damage this turn local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.spcost) + e1:SetCountLimit(1) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end -s.listed_names={10389143} s.xyz_number=42 -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e1:SetTargetRange(0,1) - e1:SetValue(1) - e1:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(e1,tp) -end +s.listed_names={TOKEN_BATTLE_EAGLE} 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.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) end - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end - Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ft,0,0) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ft,tp,0) + and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_BATTLE_EAGLE,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) end + Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) then return end + if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_BATTLE_EAGLE,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) then return end if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end - local fid=e:GetHandler():GetFieldID() - local g=Group.CreateGroup() + local sg=Group.CreateGroup() for i=1,ft do - local token=Duel.CreateToken(tp,id+1) + local token=Duel.CreateToken(tp,TOKEN_BATTLE_EAGLE) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) - token:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1,fid) - g:AddCard(token) + sg:AddCard(token) end + --Destroy them during the End Phase of this turn + aux.DelayedOperation(sg,PHASE_END,id,e,tp,function(ag) Duel.Destroy(ag,REASON_EFFECT) end,nil,nil,1,aux.Stringid(id,1)) Duel.SpecialSummonComplete() - g:KeepAlive() + --Your opponent takes no further battle damage this turn local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e1:SetCode(EVENT_PHASE+PHASE_END) - e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e1:SetDescription(aux.Stringid(id,2)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) + e1:SetTargetRange(0,1) + e1:SetValue(1) e1:SetReset(RESET_PHASE|PHASE_END) - e1:SetCountLimit(1) - e1:SetLabel(fid) - e1:SetLabelObject(g) - e1:SetCondition(s.descon) - e1:SetOperation(s.desop) Duel.RegisterEffect(e1,tp) end -function s.desfilter(c,fid) - return c:GetFlagEffectLabel(id)==fid -end -function s.descon(e,tp,eg,ep,ev,re,r,rp) - local g=e:GetLabelObject() - if not g:IsExists(s.desfilter,1,nil,e:GetLabel()) then - g:DeleteGroup() - e:Reset() - return false - else return true end -end -function s.desop(e,tp,eg,ep,ev,re,r,rp) - local g=e:GetLabelObject() - local tg=g:Filter(s.desfilter,nil,e:GetLabel()) - g:DeleteGroup() - Duel.Destroy(tg,REASON_EFFECT) -end \ No newline at end of file diff --git a/official/c10406322.lua b/official/c10406322.lua index 5801e1519c..2882be8a82 100644 --- a/official/c10406322.lua +++ b/official/c10406322.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.tdcon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end @@ -75,4 +75,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) else Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c10443957.lua b/official/c10443957.lua index 3c7f0b50fa..077bf9ff78 100644 --- a/official/c10443957.lua +++ b/official/c10443957.lua @@ -31,10 +31,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.discon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.distg) e3:SetOperation(s.disop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_names={58069384} function s.mfilter(c,xyz,sumtype,tp) @@ -83,4 +83,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c1050186.lua b/official/c1050186.lua index 39891e0234..fc327aa1a0 100644 --- a/official/c1050186.lua +++ b/official/c1050186.lua @@ -2,36 +2,36 @@ --Satellarknight Unukalhai local s,id=GetID() function s.initial_effect(c) - --Send 1 "tellarknight" card to the GY - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOGRAVE) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Send 1 "tellarknight" card from your Deck to the GY, except "Satellarknight Unukalhai" + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_TOGRAVE) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.tgtg) + e1a:SetOperation(s.tgop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) end s.listed_series={SET_TELLARKNIGHT} s.listed_names={id} -function s.filter(c) +function s.tgfilter(c) return c:IsSetCard(SET_TELLARKNIGHT) and not c:IsCode(id) and c:IsAbleToGrave() end -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 +function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end diff --git a/official/c10613952.lua b/official/c10613952.lua index b919c4f2c7..d95a2c76f4 100644 --- a/official/c10613952.lua +++ b/official/c10613952.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -102,4 +102,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c10666000.lua b/official/c10666000.lua index 22c67568e9..c6ba870a3d 100644 --- a/official/c10666000.lua +++ b/official/c10666000.lua @@ -38,10 +38,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.xyz_number=1 function s.mattg(e,tp,eg,ep,ev,re,r,rp,chk) diff --git a/official/c10678778.lua b/official/c10678778.lua index 87c7bafbeb..a506740a61 100644 --- a/official/c10678778.lua +++ b/official/c10678778.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.rmfilter(c) return c:IsFacedown() and c:IsAbleToRemove() @@ -76,4 +76,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsType,ctype),tp,0,LOCATION_MZONE,1,1,nil) Duel.Destroy(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c11398059.lua b/official/c11398059.lua index 1317112bbb..8a24680748 100644 --- a/official/c11398059.lua +++ b/official/c11398059.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsRace(RACE_REPTILE) and c:IsAbleToHand() diff --git a/official/c11411223.lua b/official/c11411223.lua index 1b54a70ac9..8721985b4c 100644 --- a/official/c11411223.lua +++ b/official/c11411223.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=10 function s.target(e,tp,eg,ep,ev,re,r,rp,chk) @@ -31,4 +31,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if g:GetFirst():IsLocation(LOCATION_GRAVE) then Duel.Draw(tp,1,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c11441009.lua b/official/c11441009.lua index aff52a33e6..11438b2f50 100644 --- a/official/c11441009.lua +++ b/official/c11441009.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.AND(Cost.PayLP(600),Cost.Detach(1))) + e1:SetCost(Cost.AND(Cost.PayLP(600),Cost.DetachFromSelf(1))) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Negate the activation of another monster's effect, and if you do, destroy that monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -28,7 +28,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.negcon) - e2:SetCost(Cost.Detach(1,1)) + e2:SetCost(Cost.DetachFromSelf(1,1)) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) c:RegisterEffect(e2) @@ -73,4 +73,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c11510448.lua b/official/c11510448.lua index 991536a6e5..615ac50097 100644 --- a/official/c11510448.lua +++ b/official/c11510448.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_ZOODIAC} function s.ovfilter(c,tp,lc) @@ -73,4 +73,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc1 and tc1:IsFaceup() and not tc1:IsImmuneToEffect(e) and #g2>0 then Duel.Overlay(tc1,g2) end -end \ No newline at end of file +end diff --git a/official/c11522979.lua b/official/c11522979.lua index e7118052d6..1847354329 100644 --- a/official/c11522979.lua +++ b/official/c11522979.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.condition) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=69 s.listed_names={2407234} @@ -77,4 +77,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e2) c:CopyEffect(code,RESETS_STANDARD_PHASE_END,1) end -end \ No newline at end of file +end diff --git a/official/c11646785.lua b/official/c11646785.lua index 4268f64f82..95ab83277d 100644 --- a/official/c11646785.lua +++ b/official/c11646785.lua @@ -20,10 +20,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) e2:SetCondition(aux.NOT(s.quickeffcond)) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.settg) e2:SetOperation(s.setop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --This is a Quick effect if this card has "Super Quantum Green Layer" as Xyz Material local e3=e2:Clone() e3:SetType(EFFECT_TYPE_QUICK_O) @@ -76,4 +76,4 @@ function s.attachop(e,tp,eg,ep,ev,re,r,rp) if tc and not tc:IsImmuneToEffect(e) then Duel.Overlay(c,tc,true) end -end \ No newline at end of file +end diff --git a/official/c1174075.lua b/official/c1174075.lua index a8686af1a5..2cd985fed1 100644 --- a/official/c1174075.lua +++ b/official/c1174075.lua @@ -35,7 +35,7 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.negcon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.negtg) e3:SetOperation(s.negop) c:RegisterEffect(e3) @@ -79,4 +79,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c12014404.lua b/official/c12014404.lua index 324e5e60e8..67095c1ef4 100644 --- a/official/c12014404.lua +++ b/official/c12014404.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end @@ -60,4 +60,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE) bc:RegisterEffect(e2) c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE,0,1) -end \ No newline at end of file +end diff --git a/official/c12081875.lua b/official/c12081875.lua index dbd9dcb1ff..4f8734bdbb 100644 --- a/official/c12081875.lua +++ b/official/c12081875.lua @@ -33,59 +33,74 @@ function s.runfn(fn,eff,tp,chk) end function s.applyfilter(c,e,tp) if not (c:IsSetCard(SET_THUNDER_DRAGON) and c:IsMonster() - and (c:IsFaceup() or not c:IsLocation(LOCATION_REMOVED)) - and c:IsHasEffect(EFFECT_MARKER_THUNDRA) and c:IsCanBeEffectTarget(e) and c:IsAbleToDeck()) then - return false - end - for _,eff in ipairs(c:GetMarkedEffects(EFFECT_MARKER_THUNDRA)) do - if s.runfn(eff:GetCondition(),eff,tp,0) and s.runfn(eff:GetTarget(),eff,tp,0) then return true end + and c:IsAbleToDeck() and c:IsFaceup()) then return false end + for _,eff in ipairs({c:GetOwnEffects()}) do + if eff:HasSelfDiscardCost() and s.runfn(eff:GetCondition(),eff,tp,0) and s.runfn(eff:GetTarget(),eff,tp,0) then return true end end end function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and chkc:IsControler(tp) and s.applyfilter(chkc,e,tp) end + if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.applyfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) - local g=Duel.SelectTarget(tp,s.applyfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp) - Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0) -end -function s.applyop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - if not tc:IsRelateToEffect(e) then return end - local effs=tc:GetMarkedEffects(EFFECT_MARKER_THUNDRA) + local tc=Duel.SelectTarget(tp,s.applyfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst() + local effs={} local options={} - for _,eff in ipairs(effs) do - local eff_chk=s.runfn(eff:GetCondition(),eff,tp,0) and s.runfn(eff:GetTarget(),eff,tp,0) - table.insert(options,{eff_chk,eff:GetDescription()}) + for _,eff in ipairs({tc:GetOwnEffects()}) do + if eff:HasSelfDiscardCost() then + table.insert(effs,eff) + local eff_chk=s.runfn(eff:GetCondition(),eff,tp,0) and s.runfn(eff:GetTarget(),eff,tp,0) + table.insert(options,{eff_chk,eff:GetDescription()}) + end end local op=#options==1 and 1 or Duel.SelectEffect(tp,table.unpack(options)) - if not op then return end local te=effs[op] - if not te then return end + Duel.Hint(HINT_OPSELECTED,1-tp,te:GetDescription()) Duel.ClearTargetCard() - s.runfn(te:GetTarget(),te,tp) - Duel.BreakEffect() - tc:CreateEffectRelation(te) - Duel.BreakEffect() - local tg=Duel.GetTargetCards(te) - tg:ForEach(Card.CreateEffectRelation,te) - s.runfn(te:GetOperation(),te,tp,1) - tg:ForEach(Card.ReleaseEffectRelation,te) - local opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2)) - Duel.SendtoDeck(tc,nil,opt,REASON_EFFECT) + tc:CreateEffectRelation(e) + e:SetLabel(te:GetLabel()) + e:SetLabelObject(te:GetLabelObject()) + local targ_fn=te:GetTarget() + if targ_fn then + s.runfn(targ_fn,e,tp,1) + te:SetLabel(e:GetLabel()) + te:SetLabelObject(e:GetLabelObject()) + Duel.ClearOperationInfo(0) + end + e:SetLabelObject(te) + Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,tp,0) +end +function s.applyop(e,tp,eg,ep,ev,re,r,rp) + local te=e:GetLabelObject() + if not te then return end + local tc=te:GetHandler() + if not tc:IsRelateToEffect(e) then return end + local op=te:GetOperation() + if op then + e:SetLabel(te:GetLabel()) + e:SetLabelObject(te:GetLabelObject()) + op(e,tp,eg,ep,ev,re,r,rp) + end + if tc:IsAbleToDeck() then + local opt=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2)) or 0 + Duel.BreakEffect() + Duel.SendtoDeck(tc,nil,opt,REASON_EFFECT) + end + e:SetLabel(0) + e:SetLabelObject(nil) end function s.repfilter(c,tp) - return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_THUNDER) - and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT|REASON_BATTLE) + return c:IsRace(RACE_THUNDER) and c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) + and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_BATTLE|REASON_EFFECT) end function s.repcostfilter(c) return c:IsAbleToRemove() and aux.SpElimFilter(c,true) end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) and Duel.IsExistingMatchingCard(s.repcostfilter,tp,LOCATION_GRAVE,0,3,nil) end + if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) and Duel.IsExistingMatchingCard(s.repcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,3,nil) end if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) - local g=Duel.SelectMatchingCard(tp,s.repcfilter,tp,LOCATION_GRAVE,0,3,3,nil) + local g=Duel.SelectMatchingCard(tp,s.repcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,3,3,nil) Duel.Remove(g,POS_FACEUP,REASON_EFFECT) return true else return false end -end \ No newline at end of file +end diff --git a/official/c12219047.lua b/official/c12219047.lua index b5f1d58bce..1ed1b8329c 100644 --- a/official/c12219047.lua +++ b/official/c12219047.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetCondition(s.condition1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) local e2=e1:Clone() e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) @@ -75,4 +75,4 @@ end function s.condition2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,SET_THE_PHANTOM_KNIGHTS) and aux.StatChangeDamageStepCondition() -end \ No newline at end of file +end diff --git a/official/c1249315.lua b/official/c1249315.lua index 4c633897ee..277716ff1e 100644 --- a/official/c1249315.lua +++ b/official/c1249315.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.thfilter(c) return c:IsMonster() and c:IsAbleToHand() diff --git a/official/c12533811.lua b/official/c12533811.lua index fdb636bb14..0d4301e01a 100644 --- a/official/c12533811.lua +++ b/official/c12533811.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsPhase(PHASE_MAIN1) @@ -38,4 +38,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c12615446.lua b/official/c12615446.lua index cfb7f0c852..5cc75abedb 100644 --- a/official/c12615446.lua +++ b/official/c12615446.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCategory(CATEGORY_POSITION+CATEGORY_DISABLE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.postg) e1:SetOperation(s.posop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Attach local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -83,4 +83,4 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then Duel.Overlay(c,tc) end -end \ No newline at end of file +end diff --git a/official/c12632096.lua b/official/c12632096.lua index 1de8c0513e..6f565c892b 100644 --- a/official/c12632096.lua +++ b/official/c12632096.lua @@ -3,74 +3,66 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon Procedure + --Xyz Summon procedure: 3 Level 9 monsters Xyz.AddProcedure(c,nil,9,3) - --Take control of the opponent's monsters + --Monsters you control cannot attack your opponent directly for the rest of this turn, except this card, also for each Material detached, take control of 1 opponent's face-up monster until the End Phase local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_CONTROL) e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCondition(s.ctcon) - e1:SetCost(s.ctcost) + e1:SetCountLimit(1) + e1:SetCondition(function(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,SET_CIPHER) end) + e1:SetCost(Cost.DetachFromSelf(1,s.ctcostmax,function(e,og) e:SetLabel(#og) end)) e1:SetTarget(s.cttg) e1:SetOperation(s.ctop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_CIPHER} s.listed_names={id} -function s.ctcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,SET_CIPHER) -end -function s.ctcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local rt=math.min(Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsAbleToChangeControler),tp,0,LOCATION_MZONE,nil),Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL),c:GetOverlayCount(),3) - if chk==0 then return rt>0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - local ct=c:RemoveOverlayCard(tp,1,rt,REASON_COST) - e:SetLabel(ct) +function s.ctcostmax(e,tp) + local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsAbleToChangeControler),tp,0,LOCATION_MZONE,nil) + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL) + return math.min(ct,ft,3) end function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end - Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,e:GetLabel(),tp,0) end function s.ctop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - --Other monsters cannot attack directly + local fid=c:IsRelateToEffect(e) and c:GetFieldID() or -1 + --Monsters you control cannot attack your opponent directly for the rest of this turn, except this card local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetTargetRange(LOCATION_MZONE,0) - e1:SetTarget(s.atktg) - e1:SetLabel(c:GetFieldID()) + e1:SetTarget(function(e,c) return fid~=c:GetFieldID() end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - --Take control of the opponent's monsters + --For each Material detached, take control of 1 opponent's face-up monster until the End Phase local ct=math.min(e:GetLabel(),Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsAbleToChangeControler),tp,0,LOCATION_MZONE,ct,ct,nil) - Duel.GetControl(g,tp,PHASE_END,1) - local og=Duel.GetOperatedGroup() - if #og==0 then return end - for tc in og:Iter() do - ---Negate their effects - tc:NegateEffects(c,RESET_PHASE|PHASE_END) - --Their ATK's become 4500 - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_SET_ATTACK_FINAL) - e1:SetValue(4500) - e1:SetReset(RESETS_STANDARD_PHASE_END) - tc:RegisterEffect(e1) - --Their names become "Neo Galaxy-Eyes Cipher Dragon" - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_CHANGE_CODE) - e2:SetValue(id) - e2:SetReset(RESETS_STANDARD_PHASE_END) - tc:RegisterEffect(e2) + if #g==ct and Duel.GetControl(g,tp,PHASE_END,1) then + local og=Duel.GetOperatedGroup() + if #og==0 then return end + for tc in og:Iter() do + ---Their effects are negated + tc:NegateEffects(c,RESET_CONTROL) + --Their ATK's become 4500 + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_SET_ATTACK_FINAL) + e1:SetValue(4500) + e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_CONTROL) + tc:RegisterEffect(e1) + --Their names become "Neo Galaxy-Eyes Cipher Dragon" + local e2=e1:Clone() + e2:SetCode(EFFECT_CHANGE_CODE) + e2:SetValue(id) + tc:RegisterEffect(e2) + end end end -function s.atktg(e,c) - return e:GetLabel()~=c:GetFieldID() -end \ No newline at end of file diff --git a/official/c1269512.lua b/official/c1269512.lua index 9bddcb5720..d802aa6baf 100644 --- a/official/c1269512.lua +++ b/official/c1269512.lua @@ -31,9 +31,9 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLE_DESTROYING) e3:SetCondition(s.exatkcon) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetOperation(function() Duel.ChainAttack() end) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listes_names={id} function s.ovfilter(c,tp,xyzc) @@ -71,4 +71,4 @@ end function s.exatkcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return Duel.GetAttacker()==c and c:CanChainAttack() and aux.bdocon(e,tp,eg,ep,ev,re,r,rp) -end \ No newline at end of file +end diff --git a/official/c13030280.lua b/official/c13030280.lua index 02493d8074..b5594b6dc3 100644 --- a/official/c13030280.lua +++ b/official/c13030280.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCondition(s.damcon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_names={77631175} --"Comics Hero King Arthur" function s.valcon(e,re,r,rp) @@ -48,4 +48,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) if bc and bc:IsRelateToEffect(e) and Duel.Remove(bc,POS_FACEUP,REASON_EFFECT)>0 then Duel.Damage(1-tp,bc:GetBaseAttack(),REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c13183454.lua b/official/c13183454.lua index 3b740e4ad4..3b23ba3216 100644 --- a/official/c13183454.lua +++ b/official/c13183454.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:GetAttack()>0 @@ -36,4 +36,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c13851202.lua b/official/c13851202.lua index cf7ecbb31c..cf6f2a946b 100644 --- a/official/c13851202.lua +++ b/official/c13851202.lua @@ -2,53 +2,47 @@ --Satellarknight Rigel local s,id=GetID() function s.initial_effect(c) - --Increase the ATK of a "tellarknight" monster by 500 - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Make 1 "tellarknight" monster on the field gain 500 ATK, but send it to the GY during the End Phase + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.atktg) + e1a:SetOperation(s.atkop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) end s.listed_series={SET_TELLARKNIGHT} -function s.filter(c) - return c:IsFaceup() and c:IsSetCard(SET_TELLARKNIGHT) +function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsSetCard(SET_TELLARKNIGHT) and chkc:IsFaceup() end + if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsSetCard,SET_TELLARKNIGHT),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) + Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsSetCard,SET_TELLARKNIGHT),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) - Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsFaceup() and tc:IsRelateToEffect(e) then - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(500) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e1) - local e2=Effect.CreateEffect(e:GetHandler()) - e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e2:SetCode(EVENT_PHASE+PHASE_END) - e2:SetRange(LOCATION_MZONE) - e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) - e2:SetCountLimit(1) - e2:SetOperation(s.tgop) - e2:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e2) + if tc:IsRelateToEffect(e) then + if tc:IsFaceup() then + --It gains 500 ATK + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetValue(500) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + tc:RegisterEffect(e1) + end + --Send it to the GY during the End Phase + aux.DelayedOperation(tc,PHASE_END,id,e,tp, + function(dg) Duel.SendtoGrave(dg,REASON_EFFECT) end, + nil,0,1,aux.Stringid(id,1),aux.Stringid(id,2) + ) end -end -function s.tgop(e,tp,eg,ep,ev,re,r,rp) - Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT) end \ No newline at end of file diff --git a/official/c14152862.lua b/official/c14152862.lua index bb00dc29a3..ad76dee694 100644 --- a/official/c14152862.lua +++ b/official/c14152862.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.discon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.discon(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end @@ -35,4 +35,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c1426714.lua b/official/c1426714.lua index 273edf2086..260562eac0 100644 --- a/official/c1426714.lua +++ b/official/c1426714.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMING_BATTLE_START|TIMING_END_PHASE) e1:SetCondition(s.spcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --cannot be battle target local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -60,4 +60,4 @@ function s.atkcon(e) end function s.atkval(e,c) return Duel.GetMatchingGroupCount(Card.IsCode,c:GetControler(),LOCATION_ONFIELD,0,nil,id+1)*500 -end \ No newline at end of file +end diff --git a/official/c14283055.lua b/official/c14283055.lua index 51852e7003..6eca467310 100644 --- a/official/c14283055.lua +++ b/official/c14283055.lua @@ -52,10 +52,13 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local g1=Duel.GetMatchingGroup(s.cfilter,tp,locs,0,nil,SET_NOUVELLES) local g2=Duel.GetMatchingGroup(s.cfilter,tp,locs,0,nil,SET_PATISSCIEL) local g=g1+g2 - if chk==0 then return #g1>0 and #g2>0 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end + if chk==0 then return #g1>0 and #g2>0 + and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) + and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,locs) end function s.operation(e,tp,eg,ep,ev,re,r,rp) + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end local c=e:GetHandler() --You cannot use monsters as material for a Fusion, Synchro, Xyz, or Link Summon, except "Nouvelles" and "Patissciel" monsters local e1=Effect.CreateEffect(c) diff --git a/official/c14301396.lua b/official/c14301396.lua index dcf07f08ba..8043b9d919 100644 --- a/official/c14301396.lua +++ b/official/c14301396.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) e1:SetCondition(s.atkcon) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Equip this card to another monster you control local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -116,4 +116,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(g) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c14306092.lua b/official/c14306092.lua index 9afb4d0f7b..90a6a49915 100644 --- a/official/c14306092.lua +++ b/official/c14306092.lua @@ -13,9 +13,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.ctop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --atkup local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -39,4 +39,4 @@ function s.atkcon(e) end function s.atkval(e,c) return c:GetCounter(0x2e)*1000 -end \ No newline at end of file +end diff --git a/official/c14759024.lua b/official/c14759024.lua index 2c282b6f3d..22e1f9a61c 100644 --- a/official/c14759024.lua +++ b/official/c14759024.lua @@ -2,29 +2,29 @@ --Constellar Zubeneschamali local s,id=GetID() function s.initial_effect(c) - --Add 1 "Constellar" monster from the Deck to the hand - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e2) + --Add 1 "Constellar" monster from your Deck to your hand + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetTarget(s.thtg) + e1a:SetOperation(s.thop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1b) end s.listed_series={SET_CONSTELLAR} function s.thfilter(c) return c:IsSetCard(SET_CONSTELLAR) and c:IsMonster() and c:IsAbleToHand() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) --Excluding itself for a proper interaction with "Tellarknight Constellar Caduceus" [58858807] if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then diff --git a/official/c15001940.lua b/official/c15001940.lua index d92ee2a7e9..4b65ee13de 100644 --- a/official/c15001940.lua +++ b/official/c15001940.lua @@ -4,6 +4,14 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() + --Register that it was Special Summoned by the effect of a "Nouvelles" monster + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EVENT_SPSUMMON_SUCCESS) + e0:SetCondition(s.regcon) + e0:SetOperation(function(e) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD&~RESET_TEMP_REMOVE,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) end) + c:RegisterEffect(e0) --Shuffle cards from the GY into the Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) @@ -32,6 +40,17 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_RECIPE,SET_NOUVELLES} +function s.regcon(e,tp,eg,ep,ev,re,r,rp) + if not (re and re:IsMonsterEffect()) then return false end + local rc=re:GetHandler() + local trig_loc,trig_setcodes=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SETCODES) + if not Duel.IsChainSolving() or (rc:IsRelateToEffect(re) and rc:IsFaceup() and rc:IsLocation(trig_loc)) then + return rc:IsSetCard(SET_NOUVELLES) + end + for _,set in ipairs(trig_setcodes) do + if (SET_NOUVELLES&0xfff)==(set&0xfff) and (SET_NOUVELLES&set)==SET_NOUVELLES then return true end + end +end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end diff --git a/official/c15092394.lua b/official/c15092394.lua index 11d42c0c8c..ed0689c46b 100644 --- a/official/c15092394.lua +++ b/official/c15092394.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.descon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -73,4 +73,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end end Duel.SpecialSummonComplete() -end \ No newline at end of file +end diff --git a/official/c15232745.lua b/official/c15232745.lua index 8a3a228670..0ac40dc1fe 100644 --- a/official/c15232745.lua +++ b/official/c15232745.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.condition) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMERON} s.xyz_number=1 @@ -44,4 +44,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END,1) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c15561463.lua b/official/c15561463.lua index 0a387e7f90..aa33c9cb7e 100644 --- a/official/c15561463.lua +++ b/official/c15561463.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end @@ -29,4 +29,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c15862758.lua b/official/c15862758.lua index 0c5baa5cb0..d8573a9cd3 100644 --- a/official/c15862758.lua +++ b/official/c15862758.lua @@ -48,10 +48,10 @@ function s.initial_effect(c) e7:SetCode(EVENT_ATTACK_ANNOUNCE) e7:SetRange(LOCATION_MZONE) e7:SetCondition(s.nacon) - e7:SetCost(Cost.Detach(1)) + e7:SetCost(Cost.DetachFromSelf(1)) e7:SetTarget(s.natg) e7:SetOperation(s.naop) - c:RegisterEffect(e7,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e7) end s.listed_names={89477759} s.xyz_number=1000 @@ -81,4 +81,4 @@ function s.naop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateAttack() then Duel.Recover(tp,Duel.GetAttacker():GetAttack(),REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c15871676.lua b/official/c15871676.lua index 009c80f4da..847ad7eada 100644 --- a/official/c15871676.lua +++ b/official/c15871676.lua @@ -2,7 +2,7 @@ --Constellar Aldebaran local s,id=GetID() function s.initial_effect(c) - --Special Summon 1 Level 3 "Constellar" monster from the hand + --Special Summon 1 Level 3 "Constellar" monster from your hand in face-up Defense Position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -10,22 +10,22 @@ function s.initial_effect(c) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) + c:RegisterEffect(e1) end s.listed_series={SET_CONSTELLAR} -function s.filter(c,e,tp) - return c:IsSetCard(SET_CONSTELLAR) and c:IsLevel(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +function s.spfilter(c,e,tp) + return c:IsLevel(3) and c:IsSetCard(SET_CONSTELLAR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) --Excluding itself for a proper interaction with "Tellarknight Constellar Caduceus" [58858807] if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(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,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end diff --git a/official/c15914410.lua b/official/c15914410.lua index b297f28065..1324794984 100644 --- a/official/c15914410.lua +++ b/official/c15914410.lua @@ -14,11 +14,11 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.postg) e1:SetOperation(s.posop) e1:SetHintTiming(0,TIMING_BATTLE_START|TIMING_END_PHASE) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition() @@ -46,4 +46,4 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c15939229.lua b/official/c15939229.lua index 2fe18afc19..5781335ac7 100644 --- a/official/c15939229.lua +++ b/official/c15939229.lua @@ -20,20 +20,20 @@ function s.initial_effect(c) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCountLimit(1) e2:SetHintTiming(0,TIMING_SSET|TIMINGS_CHECK_MONSTER_E) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Set local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.settg) e3:SetOperation(s.setop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) aux.DoubleSnareValidity(c,LOCATION_MZONE) end s.listed_series={SET_DARK_CONTRACT,SET_DD} @@ -87,4 +87,4 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and tc:IsSSetable() then Duel.SSet(tp,tc) end -end \ No newline at end of file +end diff --git a/official/c16024176.lua b/official/c16024176.lua index e1e01ed00f..f4a9eb5cec 100644 --- a/official/c16024176.lua +++ b/official/c16024176.lua @@ -3,88 +3,90 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --special summon itself from hand + --Must first be Special Summoned (from your hand) by Tributing 1 Level 1 "Flower Cardian" monster, except "Flower Cardian Pine with Crane" + local e0=Effect.CreateEffect(c) + e0:SetDescription(aux.Stringid(id,0)) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EFFECT_SPSUMMON_PROC) + e0:SetRange(LOCATION_HAND) + e0:SetCondition(s.selfspcon) + e0:SetTarget(s.selfsptg) + e0:SetOperation(s.selfspop) + c:RegisterEffect(e0) + --Draw 1 card, and if you do, show it, then you can Special Summon it if it is a "Flower Cardian" monster local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetRange(LOCATION_HAND) - e1:SetCode(EFFECT_SPSUMMON_PROC) - e1:SetCondition(s.hspcon) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --draw and special summon + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetTarget(s.drsptg) + e1:SetOperation(s.drspop) + c:RegisterEffect(e1) + --Draw 1 card local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) + e2:SetDescription(aux.Stringid(id,2)) + e2:SetCategory(CATEGORY_DRAW) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetCode(EVENT_PHASE+PHASE_BATTLE) + e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1) + e2:SetCondition(function(e) return e:GetHandler():GetBattledGroupCount()>0 end) + e2:SetTarget(s.drtg) + e2:SetOperation(s.drop) c:RegisterEffect(e2) - --draw during battle - local e3=Effect.CreateEffect(c) - e3:SetCategory(CATEGORY_DRAW) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e3:SetCode(EVENT_PHASE|PHASE_BATTLE) - e3:SetRange(LOCATION_MZONE) - e3:SetCountLimit(1) - e3:SetCondition(s.drcon) - e3:SetTarget(s.drtg) - e3:SetOperation(s.drop) - c:RegisterEffect(e3) end s.listed_series={SET_FLOWER_CARDIAN} s.listed_names={id} -function s.hspfilter(c,ft,tp) - return c:IsSetCard(SET_FLOWER_CARDIAN) and c:GetLevel()==1 and not c:IsCode(id) +function s.selfspfilter(c) + return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsLevel(1) and not c:IsCode(id) end -function s.hspcon(e,c) +function s.selfspcon(e,c) if c==nil then return true end - return Duel.CheckReleaseGroup(c:GetControler(),s.hspfilter,1,false,1,true,c,c:GetControler(),nil,false,nil) + local tp=c:GetControler() + return Duel.CheckReleaseGroup(tp,s.selfspfilter,1,false,1,true,c,tp,nil,false,nil) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,c) - local g=Duel.SelectReleaseGroup(tp,s.hspfilter,1,1,false,true,true,c,nil,nil,false,nil) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) + local g=Duel.SelectReleaseGroup(tp,s.selfspfilter,1,1,false,true,true,c,nil,nil,false,nil) if g then g:KeepAlive() e:SetLabelObject(g) - return true + return true end return false end -function s.hspop(e,tp,eg,ep,ev,re,r,rp,c) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drsptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.drspop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 then - local tc=Duel.GetOperatedGroup():GetFirst() - Duel.ConfirmCards(1-tp,tc) - Duel.BreakEffect() - if tc:IsMonster() and tc:IsSetCard(SET_FLOWER_CARDIAN) then - if tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) + if Duel.Draw(p,d,REASON_EFFECT)>0 then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and dc:IsCanBeSpecialSummoned(e,0,tp,false,false) + and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + Duel.BreakEffect() + Duel.SpecialSummon(dc,0,tp,tp,false,false,POS_FACEUP) end else - Duel.SendtoGrave(tc,REASON_EFFECT) + Duel.BreakEffect() + Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end end -function s.drcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetBattledGroupCount()>0 -end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) diff --git a/official/c16037007.lua b/official/c16037007.lua index ace2180c33..2944a630ed 100644 --- a/official/c16037007.lua +++ b/official/c16037007.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.discon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=74 function s.discon(e,tp,eg,ep,ev,re,r,rp) @@ -44,4 +44,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(g,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c16110708.lua b/official/c16110708.lua index 8826431760..f62b99759d 100644 --- a/official/c16110708.lua +++ b/official/c16110708.lua @@ -31,9 +31,9 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCondition(function(e) return not e:GetHandler():IsBaseAttack(1500) end) - e3:SetCost(Cost.Detach(1,1)) + e3:SetCost(Cost.DetachFromSelf(1,1)) e3:SetOperation(s.atkop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_names={63767246} --"Number 38: Hope Harbinger Dragon Titanic Galaxy" s.xyz_number=38 @@ -81,4 +81,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c16195942.lua b/official/c16195942.lua index 35bf65a1b6..7886aeb66a 100644 --- a/official/c16195942.lua +++ b/official/c16195942.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(2,2,nil)) + e1:SetCost(Cost.DetachFromSelf(2,2,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) 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(1-tp) and chkc:HasNonZeroAttack() end @@ -46,4 +46,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e2) end end -end \ No newline at end of file +end diff --git a/official/c1621413.lua b/official/c1621413.lua index cb50bd1ada..e1f4e29f91 100644 --- a/official/c1621413.lua +++ b/official/c1621413.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetCondition(s.atkcon) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Negate monster effect activation and special summon 1 Xyz monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -27,10 +27,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_names={16195942} function s.atkcon(e,tp,eg,ep,ev,re,r,rp) @@ -90,4 +90,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end -end \ No newline at end of file +end diff --git a/official/c1639384.lua b/official/c1639384.lua index b1f24d9901..34d5a4d0a3 100644 --- a/official/c1639384.lua +++ b/official/c1639384.lua @@ -14,11 +14,11 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end @@ -59,4 +59,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.efilter(e,te) return te:GetOwner()~=e:GetOwner() and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) -end \ No newline at end of file +end diff --git a/official/c16643334.lua b/official/c16643334.lua index 6f241c8f24..c5a0503772 100644 --- a/official/c16643334.lua +++ b/official/c16643334.lua @@ -46,10 +46,10 @@ function s.initial_effect(c) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCountLimit(1) e4:SetCondition(s.spcon2) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.sptg2) e4:SetOperation(s.spop2) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_series={SET_PHOTON} s.listed_names={CARD_GALAXYEYES_P_DRAGON} @@ -94,4 +94,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c16691074.lua b/official/c16691074.lua index f038719211..b2bec637ad 100644 --- a/official/c16691074.lua +++ b/official/c16691074.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special summon 1 "Odd-Eyes" monster from the Extra Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -68,4 +68,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c16699558.lua b/official/c16699558.lua index f2ccf1d2de..588998d835 100644 --- a/official/c16699558.lua +++ b/official/c16699558.lua @@ -32,10 +32,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(Cost.Detach(1,1)) + e3:SetCost(Cost.DetachFromSelf(1,1)) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,nil) end @@ -68,4 +68,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) --It gains 1000 ATK tc:UpdateAttack(1000,RESET_EVENT|RESETS_STANDARD,e:GetHandler()) end -end \ No newline at end of file +end diff --git a/official/c16802689.lua b/official/c16802689.lua index 1bd90cfa06..8646f0c813 100644 --- a/official/c16802689.lua +++ b/official/c16802689.lua @@ -3,87 +3,89 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --special summon summon from hand + --Must first be Special Summoned (from your hand) by Tributing 1 Level 12 "Flower Cardian" monster, except "Flower Cardian Paulownia with Phoenix" + local e0=Effect.CreateEffect(c) + e0:SetDescription(aux.Stringid(id,0)) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EFFECT_SPSUMMON_PROC) + e0:SetRange(LOCATION_HAND) + e0:SetCondition(s.selfspcon) + e0:SetTarget(s.selfsptg) + e0:SetOperation(s.selfspop) + c:RegisterEffect(e0) + --Draw 1 card, and if you do, show it, then you can Special Summon it if it is a "Flower Cardian" monster local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetRange(LOCATION_HAND) - e1:SetCode(EFFECT_SPSUMMON_PROC) - e1:SetCondition(s.hspcon) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --draw and special summon + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetTarget(s.drsptg) + e1:SetOperation(s.drspop) + c:RegisterEffect(e1) + --Draw 1 card local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) + e2:SetDescription(aux.Stringid(id,2)) + e2:SetCategory(CATEGORY_DRAW) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetCode(EVENT_BATTLE_DAMAGE) + e2:SetCountLimit(1) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp end) + e2:SetTarget(s.drtg) + e2:SetOperation(s.drop) c:RegisterEffect(e2) - --draw during battle - local e3=Effect.CreateEffect(c) - e3:SetCategory(CATEGORY_DRAW) - e3:SetDescription(aux.Stringid(id,2)) - e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e3:SetCode(EVENT_BATTLE_DAMAGE) - e3:SetCountLimit(1) - e3:SetCondition(s.drcon) - e3:SetTarget(s.drtg) - e3:SetOperation(s.drop) - c:RegisterEffect(e3) end s.listed_series={SET_FLOWER_CARDIAN} s.listed_names={id} -function s.hspfilter(c,tp) - return c:IsSetCard(SET_FLOWER_CARDIAN) and c:GetLevel()==12 and not c:IsCode(id) +function s.selfspfilter(c) + return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsLevel(12) and not c:IsCode(id) end -function s.hspcon(e,c) +function s.selfspcon(e,c) if c==nil then return true end - return Duel.CheckReleaseGroup(c:GetControler(),s.hspfilter,1,false,1,true,c,c:GetControler(),nil,false,nil) + local tp=c:GetControler() + return Duel.CheckReleaseGroup(tp,s.selfspfilter,1,false,1,true,c,tp,nil,false,nil) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,c) - local g=Duel.SelectReleaseGroup(tp,s.hspfilter,1,1,false,true,true,c,nil,nil,false,nil) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) + local g=Duel.SelectReleaseGroup(tp,s.selfspfilter,1,1,false,true,true,c,nil,nil,false,nil) if g then g:KeepAlive() e:SetLabelObject(g) - return true + return true end return false end -function s.hspop(e,tp,eg,ep,ev,re,r,rp,c) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drsptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.drspop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 then - local tc=Duel.GetOperatedGroup():GetFirst() - Duel.ConfirmCards(1-tp,tc) - Duel.BreakEffect() - if tc:IsMonster() and tc:IsSetCard(SET_FLOWER_CARDIAN) then - if tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) + if Duel.Draw(p,d,REASON_EFFECT)>0 then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and dc:IsCanBeSpecialSummoned(e,0,tp,false,false) + and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + Duel.BreakEffect() + Duel.SpecialSummon(dc,0,tp,tp,false,false,POS_FACEUP) end else - Duel.SendtoGrave(tc,REASON_EFFECT) + Duel.BreakEffect() + Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end end -function s.drcon(e,tp,eg,ep,ev,re,r,rp) - return ep==1-tp -end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) diff --git a/official/c1688285.lua b/official/c1688285.lua index ed9baabfc2..c8e2bcf556 100644 --- a/official/c1688285.lua +++ b/official/c1688285.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1,1)) + e2:SetCost(Cost.DetachFromSelf(1,1)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Attach 1 monster to this card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -88,4 +88,4 @@ function s.ovop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.Overlay(c,g) end -end \ No newline at end of file +end diff --git a/official/c16906241.lua b/official/c16906241.lua index 8ee72dd27f..75e85f7db0 100644 --- a/official/c16906241.lua +++ b/official/c16906241.lua @@ -2,7 +2,7 @@ --Constellar Alrescha local s,id=GetID() function s.initial_effect(c) - --Special Summon 1 "Constellar" monster from the hand + --Special Summon 1 "Constellar" monster from your hand in face-up Defense Position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -10,22 +10,22 @@ function s.initial_effect(c) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) + c:RegisterEffect(e1) end s.listed_series={SET_CONSTELLAR} -function s.filter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsSetCard(SET_CONSTELLAR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) --Excluding itself for a proper interaction with "Tellarknight Constellar Caduceus" [58858807] if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(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,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end diff --git a/official/c16955631.lua b/official/c16955631.lua index b9cb961e9e..284e13132f 100644 --- a/official/c16955631.lua +++ b/official/c16955631.lua @@ -35,10 +35,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_MIMIGHOUL} function s.thfilter(c) @@ -71,4 +71,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetOperatedGroup():GetCount() Duel.Damage(1-tp,ct*1000,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c17016362.lua b/official/c17016362.lua index 939ac0eebb..d4e32968d8 100644 --- a/official/c17016362.lua +++ b/official/c17016362.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetCountLimit(1) e2:SetHintTiming(0,TIMING_MAIN_END) e2:SetCondition(s.mtcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.mttg) e2:SetOperation(s.mtop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Special summon "Performage" monster from deck local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -114,4 +114,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c17141718.lua b/official/c17141718.lua index 340fa9ec26..f479532997 100644 --- a/official/c17141718.lua +++ b/official/c17141718.lua @@ -2,82 +2,83 @@ --Flower Cardian Zebra Grass local s,id=GetID() function s.initial_effect(c) - --spsummon + --Special Summon this card from your hand local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) - e1:SetDescription(aux.Stringid(id,0)) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --shuffle - local e2=Effect.CreateEffect(c) - e2:SetCategory(CATEGORY_DRAW) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetDescription(aux.Stringid(id,1)) - e2:SetProperty(EFFECT_FLAG_DELAY) - e2:SetCode(EVENT_SUMMON_SUCCESS) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) - c:RegisterEffect(e2) - local e3=e2:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + c:RegisterEffect(e1) + --Reveal any number of "Flower Cardian" monsters in your hand, shuffle them into the Deck, then draw the same number of cards + local e2a=Effect.CreateEffect(c) + e2a:SetDescription(aux.Stringid(id,1)) + e2a:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) + e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2a:SetProperty(EFFECT_FLAG_DELAY) + e2a:SetCode(EVENT_SUMMON_SUCCESS) + e2a:SetTarget(s.drtg) + e2a:SetOperation(s.drop) + c:RegisterEffect(e2a) + local e2b=e2a:Clone() + e2b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e2b) end s.listed_series={SET_FLOWER_CARDIAN} -function s.cfilter(c) - return c:IsFaceup() and c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsLevelBelow(7) +function s.spconfilter(c) + return c:IsLevelBelow(7) and c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsFaceup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) + return Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end + --You cannot Normal or Special Summon monsters for the rest of this turn, except "Flower Cardian" monsters local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c) return not c:IsSetCard(SET_FLOWER_CARDIAN) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() - e2:SetCode(EFFECT_CANNOT_SUMMON) + e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) Duel.RegisterEffect(e2,tp) - aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,2),nil) -end -function s.splimit(e,c) - return not c:IsSetCard(SET_FLOWER_CARDIAN) end -function s.filter(c) - return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsAbleToDeck() and not c:IsPublic() +function s.tdfilter(c) + return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsMonster() and c:IsAbleToDeck() and not c:IsPublic() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp) - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil) end - Duel.SetTargetPlayer(tp) + and Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_HAND,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) + Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) - Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK) - local g=Duel.SelectMatchingCard(p,s.filter,p,LOCATION_HAND,0,1,99,nil) +function s.drop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) + local g=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_HAND,0,1,99,nil) if #g>0 then - Duel.ConfirmCards(1-p,g) + Duel.ConfirmCards(1-tp,g) local ct=Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) - Duel.ShuffleDeck(p) - Duel.BreakEffect() - Duel.Draw(p,ct,REASON_EFFECT) - Duel.ShuffleHand(p) + if ct>0 then + Duel.ShuffleDeck(tp) + if Duel.IsPlayerCanDraw(tp) then + Duel.BreakEffect() + Duel.Draw(tp,ct,REASON_EFFECT) + end + end end end \ No newline at end of file diff --git a/official/c1828513.lua b/official/c1828513.lua index 17ca930212..eedb84c36d 100644 --- a/official/c1828513.lua +++ b/official/c1828513.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_DAMAGE_STEP) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_SIX_SAMURAI} function s.filter(c) @@ -41,4 +41,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c18326736.lua b/official/c18326736.lua index 5c0c76b7ef..46b41230cd 100644 --- a/official/c18326736.lua +++ b/official/c18326736.lua @@ -2,108 +2,92 @@ --Tellarknight Ptolemaeus local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,4,2,nil,nil,Xyz.InfiniteMats) c:EnableReviveLimit() - --spsummon + --Xyz Summon procedure: 2+ Level 4 monsters + Xyz.AddProcedure(c,nil,4,2,nil,nil,Xyz.InfiniteMats) + --Special Summon from your Extra Deck, 1 Xyz Monster that is 1 Rank higher than this card, except a "Number" monster, by using this face-up card you control as material local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) - e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetCost(s.spcost) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(3),Cost.HintSelectedEffect)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - e1:SetHintTiming(0,TIMING_END_PHASE) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --turn skip + c:RegisterEffect(e1) + --Skip your opponent's next turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) - e2:SetCost(s.skipcost) - e2:SetTarget(s.skiptg) + e2:SetCost(Cost.AND(Cost.DetachFromSelf(7),Cost.HintSelectedEffect)) + e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_SKIP_TURN) end end) e2:SetOperation(s.skipop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) - --material + c:RegisterEffect(e2) + --Attach 1 "Stellarknight" card from your Extra Deck to this card as material local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetTarget(s.mttg) - e3:SetOperation(s.mtop) + e3:SetTarget(s.attachtg) + e3:SetOperation(s.attachop) c:RegisterEffect(e3) end s.listed_series={SET_NUMBER,SET_STELLARKNIGHT} -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,3,REASON_COST) and c:GetFlagEffect(id)==0 end - c:RemoveOverlayCard(tp,3,3,REASON_COST) - c:RegisterFlagEffect(id,RESET_CHAIN,0,1) -end -function s.filter(c,e,tp,rk,pg) - return c:IsRank(rk+1) and not c:IsSetCard(SET_NUMBER) and e:GetHandler():IsCanBeXyzMaterial(c,tp) - and (#pg<=0 or pg:IsContains(e:GetHandler())) and Duel.GetLocationCountFromEx(tp,tp,e:GetHandler(),c)>0 +function s.spfilter(c,e,tp,mc,rk) + return c:IsRank(rk+1) and not c:IsSetCard(SET_NUMBER) and mc:IsCanBeXyzMaterial(c,tp) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then - local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(e:GetHandler()),tp,nil,nil,REASON_XYZ) - return #pg<=1 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler():GetRank(),pg) + local c=e:GetHandler() + local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) + return (#pg<=0 or (#pg==1 and pg:IsContains(c))) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank()) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end + if not (c:IsRelateToEffect(e) and c:IsFaceup() and c:IsControler(tp)) then return end local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) + if not (#pg<=0 or (#pg==1 and pg:IsContains(c))) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c:GetRank(),pg) - local sc=g:GetFirst() + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c,c:GetRank()):GetFirst() if sc then sc:SetMaterial(c) Duel.Overlay(sc,c) - Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) + if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)==0 then return end sc:CompleteProcedure() end end -function s.skipcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,7,REASON_COST) end - c:RemoveOverlayCard(tp,7,7,REASON_COST) -end -function s.skiptg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_SKIP_TURN) end -end function s.skipop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,3)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_SKIP_TURN) e1:SetTargetRange(0,1) + e1:SetCondition(function(e) return Duel.GetTurnPlayer()~=e:GetHandlerPlayer() end) e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN) - e1:SetCondition(s.skipcon) Duel.RegisterEffect(e1,tp) end -function s.skipcon(e) - return Duel.GetTurnPlayer()~=e:GetHandlerPlayer() +function s.attachfilter(c,xyz,tp) + return c:IsSetCard(SET_STELLARKNIGHT) and c:IsCanBeXyzMaterial(xyzc,tp,REASON_EFFECT) end -function s.mtfilter(c) - return c:IsSetCard(SET_STELLARKNIGHT) +function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler(),tp) end 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_EXTRA,0,1,nil) 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_EXTRA,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.attachfilter,tp,LOCATION_EXTRA,0,1,1,nil) if #g>0 then Duel.Overlay(c,g) end -end \ No newline at end of file +end diff --git a/official/c18511599.lua b/official/c18511599.lua index 648d1562db..ec451b89be 100644 --- a/official/c18511599.lua +++ b/official/c18511599.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.indcon(e) return e:GetHandler():GetOverlayCount()~=0 @@ -41,4 +41,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=eg:Filter(s.filter,nil,e,tp) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c18897163.lua b/official/c18897163.lua index 514c5d4103..7765641655 100644 --- a/official/c18897163.lua +++ b/official/c18897163.lua @@ -42,10 +42,10 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCountLimit(1) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.destg) e4:SetOperation(s.desop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) --move to the pendulum zone local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,3)) @@ -124,4 +124,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 \ No newline at end of file +end diff --git a/official/c18963306.lua b/official/c18963306.lua index 5dd1d029c3..9e8964d8cf 100644 --- a/official/c18963306.lua +++ b/official/c18963306.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsControlerCanBeChanged() @@ -77,4 +77,4 @@ function s.concon(e) end function s.atktg(e,c) return e:GetLabel()~=c:GetFieldID() -end \ No newline at end of file +end diff --git a/official/c19333131.lua b/official/c19333131.lua index 9c2ced525b..02233341e5 100644 --- a/official/c19333131.lua +++ b/official/c19333131.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_NINJA} s.xyz_number=12 @@ -34,4 +34,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.etarget(e,c) return c:IsFaceup() and c:IsSetCard(SET_NINJA) -end \ No newline at end of file +end diff --git a/official/c19369609.lua b/official/c19369609.lua index 1fcbfe0dbe..3b54c683b5 100644 --- a/official/c19369609.lua +++ b/official/c19369609.lua @@ -4,27 +4,27 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon Procedure + --Xyz Summon procedure: 2+ Level 1 monsters Xyz.AddProcedure(c,nil,1,2,nil,nil,Xyz.InfiniteMats) --Gains 500 ATK for each material attached to it local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(s.atkval) + e1:SetValue(function(e) return e:GetHandler():GetOverlayCount()*500 end) c:RegisterEffect(e1) - --Shuffle 1 Spell/Trap into the Deck + --Shuffle 1 Spell/Trap your opponent controls into the Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TODECK) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) - --ATK gain on battle + c:RegisterEffect(e2) + --Make 1 monster you control gain 300 ATK for each material detached local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_ATKCHANGE) @@ -32,24 +32,16 @@ function s.initial_effect(c) e3:SetCode(EVENT_BATTLE_START) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.atkcon) - e3:SetCost(s.atkcost) + e3:SetCost(Cost.DetachFromSelf(1,function(e) return e:GetHandler():GetOverlayCount() end,function(e,og) e:SetLabel(#og) end)) e3:SetOperation(s.atkop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) -end ---ATK gain -function s.atkval(e,c) - return e:GetHandler():GetOverlayCount()*500 -end ---To Deck -function s.filter(c) - return c:IsSpellTrap() and c:IsAbleToDeck() + c:RegisterEffect(e3) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return s.filter(chkc) and chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_ONFIELD,1,nil) end + if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsSpellTrap() and chkc:IsAbleToDeck() end + if chk==0 then return Duel.IsExistingTarget(aux.AND(Card.IsSpellTrap,Card.IsAbleToDeck),tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) - local tc=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,1-tp,tc:GetFirst():GetLocation()) + local g=Duel.SelectTarget(tp,aux.AND(Card.IsSpellTrap,Card.IsAbleToDeck),tp,0,LOCATION_ONFIELD,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() @@ -57,31 +49,14 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end ---ATK gain on battle -function s.atkcon(e,tp,eg,ep,ev,re,r,rp,chk) - local tc=Duel.GetAttacker() - if Duel.GetAttackTarget() and Duel.GetAttackTarget():IsControler(tp) then - tc=Duel.GetAttackTarget() - end - return not e:GetHandler():IsRelateToBattle() and tc:IsFaceup() -end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - local ct=c:RemoveOverlayCard(tp,1,c:GetOverlayCount(),REASON_COST) - e:SetLabel(ct) +function s.atkcon(e,tp,eg,ep,ev,re,r,rp) + local bc=Duel.GetBattleMonster(tp) + return bc and bc:IsFaceup() and bc~=e:GetHandler() end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetAttackTarget() - if Duel.GetAttacker():IsControler(tp) then - tc=Duel.GetAttacker() - end - if tc and tc:IsFaceup() and tc:IsRelateToBattle() then - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(e:GetLabel()*300) - e1:SetReset(RESET_PHASE|PHASE_END|RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e1) + local bc=Duel.GetBattleMonster(tp) + if bc and bc:IsFaceup() and bc:IsControler(tp) and bc:IsRelateToBattle() then + --That monster you control gains 300 ATK for each material detached, until the end of this turn + bc:UpdateAttack(e:GetLabel()*300,RESETS_STANDARD_PHASE_END,e:GetHandler()) end end diff --git a/official/c19684740.lua b/official/c19684740.lua index 6c73c99583..9a933675a0 100644 --- a/official/c19684740.lua +++ b/official/c19684740.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end @@ -29,4 +29,4 @@ end function s.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) Duel.SendtoHand(g,nil,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c19891310.lua b/official/c19891310.lua index c1d929d61a..eab67e21e8 100644 --- a/official/c19891310.lua +++ b/official/c19891310.lua @@ -1,80 +1,70 @@ ---ギアギアギア XG +--ギアギアギア XG --Geargiagear Gigant XG local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,3,3) c:EnableReviveLimit() - --negate + --Xyz Summon procedure: 3 Level 3 monsters + Xyz.AddProcedure(c,nil,3,3) + --Until the end of the Damage Step, negate the effects of all face-up cards your opponent currently controls, also your opponent cannot activate cards or effects local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetHintTiming(TIMING_BATTLE_PHASE) e1:SetRange(LOCATION_MZONE) - e1:SetCondition(s.condition) - e1:SetCost(s.cost) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --add to hand + e1:SetHintTiming(TIMING_ATTACK|TIMING_BATTLE_PHASE) + e1:SetCondition(s.discon) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),Cost.SoftOncePerBattle)) + e1:SetOperation(s.disop) + c:RegisterEffect(e1) + --Add 1 other "Geargia" card from your GY to your hand local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_LEAVE_FIELD) - e2:SetCondition(s.thcon) + e2:SetCondition(function(e) return e:GetHandler():IsPreviousPosition(POS_FACEUP) end) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_GEARGIA} -function s.condition(e,tp,eg,ep,ev,re,r,rp) - local bt=Duel.GetAttacker() - if bt and bt:IsControler(tp) then return bt:IsRace(RACE_MACHINE) end - bt=Duel.GetAttackTarget() - return bt and bt:IsControler(tp) and bt:IsRace(RACE_MACHINE) +function s.discon(e,tp,eg,ep,ev,re,r,rp) + local bc=Duel.GetBattleMonster(tp) + return bc and bc:IsRace(RACE_MACHINE) and bc:IsFaceup() end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(id)==0 end - c:RemoveOverlayCard(tp,1,1,REASON_COST) - c:RegisterFlagEffect(id,RESET_CHAIN,0,1) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local e1=Effect.CreateEffect(e:GetHandler()) + local g=Duel.GetMatchingGroup(Card.IsNegatable,tp,0,LOCATION_ONFIELD,nil) + for nc in g:Iter() do + --Negate the effects of all face-up cards your opponent currently controls until the end of the Damage Step + nc:NegateEffects(c,RESET_PHASE|PHASE_DAMAGE,true) + end + --Also, your opponent cannot activate cards or effects until the end of the Damage Step + local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_DISABLE) - e1:SetTargetRange(0,LOCATION_ONFIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetCode(EFFECT_CANNOT_ACTIVATE) + e1:SetTargetRange(0,1) + e1:SetValue(1) e1:SetReset(RESET_PHASE|PHASE_DAMAGE) Duel.RegisterEffect(e1,tp) - local e2=Effect.CreateEffect(e:GetHandler()) - e2:SetType(EFFECT_TYPE_FIELD) - e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetCode(EFFECT_CANNOT_ACTIVATE) - e2:SetTargetRange(0,1) - e2:SetValue(s.aclimit) - e2:SetReset(RESET_PHASE|PHASE_DAMAGE) - Duel.RegisterEffect(e2,tp) -end -function s.aclimit(e,re,tp) - return re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:IsMonsterEffect() -end -function s.thcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.thfilter(c) return c:IsSetCard(SET_GEARGIA) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) and chkc~=e:GetHandler() end - if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end + local c=e:GetHandler() + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc~=c and s.thfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) + local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,c) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then + if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,tc) end -end \ No newline at end of file +end diff --git a/official/c1992816.lua b/official/c1992816.lua index 380b4c963e..0fb82f3c68 100644 --- a/official/c1992816.lua +++ b/official/c1992816.lua @@ -33,9 +33,9 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.dacon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetOperation(s.daop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.xyz_number=9 function s.atkcon(e,tp,eg,ep,ev,re,r,rp) @@ -90,4 +90,4 @@ function s.daop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c20145685.lua b/official/c20145685.lua index 4edd87dc32..792065cbae 100644 --- a/official/c20145685.lua +++ b/official/c20145685.lua @@ -4,56 +4,49 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon Procedure + --Xyz Summon procedure: 2 Level 5 monsters OR 1 Rank 3 or 4 Xyz Monster you control Xyz.AddProcedure(c,nil,5,2,s.xyzfilter,aux.Stringid(id,0),2,s.xyzop) - --Cannot be used as material for an Xyz Summon + --Cannot be used as material for an Xyz Summon while it has material + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_SINGLE) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) + e0:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) + e0:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>0 end) + e0:SetValue(1) + c:RegisterEffect(e0) + --Add "Armored Xyz" cards with different names from your Deck to your hand, equal to the number of materials detached local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) - e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) - e1:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>0 end) - e1:SetValue(1) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1) + e1:SetCost(Cost.DetachFromSelf(1,s.thmaxcost,function(e,og) e:SetLabel(#og) end)) + e1:SetTarget(s.thtg) + e1:SetOperation(s.thop) c:RegisterEffect(e1) - --Add "Armored Xyz" cards with different names from your Deck to your hand + --If a monster equipped with this card battles a monster, any battle damage it inflicts to your opponent is doubled local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) - e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetRange(LOCATION_MZONE) - e2:SetCountLimit(1) - e2:SetCost(s.thcost) - e2:SetTarget(s.thtg) - e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) - --Double battle damage - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_EQUIP) - e3:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) - e3:SetCondition(function(e) return e:GetHandler():GetEquipTarget():GetBattleTarget() end) - e3:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE)) - c:RegisterEffect(e3) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) + e2:SetCondition(function(e) return e:GetHandler():GetEquipTarget():GetBattleTarget() end) + e2:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE)) + c:RegisterEffect(e2) end s.listed_names={id} s.listed_series={SET_ARMORED_XYZ} function s.xyzfilter(c,tp,xyzc) - return c:IsFaceup() and c:IsRank(3,4) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) + return c:IsRank(3,4) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsFaceup() end function s.xyzop(e,tp,chk) if chk==0 then return not Duel.HasFlagEffect(tp,id) end - Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) - return true + return Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,EFFECT_FLAG_OATH,1) end function s.thfilter(c) return c:IsSetCard(SET_ARMORED_XYZ) and c:IsAbleToHand() end -function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) - local ct=g:GetClassCount(Card.GetCode) - local rt=math.min(ct,c:GetOverlayCount(),2) - if chk==0 then return rt>0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - local ct=c:RemoveOverlayCard(tp,1,rt,REASON_COST) - e:SetLabel(ct) +function s.thmaxcost(e,tp) + return math.min(2,Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil):GetClassCount(Card.GetCode)) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end @@ -68,4 +61,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(thg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,thg) end -end \ No newline at end of file +end diff --git a/official/c20155904.lua b/official/c20155904.lua index 680772c1eb..6cbb5d710d 100644 --- a/official/c20155904.lua +++ b/official/c20155904.lua @@ -21,7 +21,7 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetCode(EVENT_CHAINING) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) @@ -62,4 +62,4 @@ function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) -end \ No newline at end of file +end diff --git a/official/c20318029.lua b/official/c20318029.lua index 6c0a56f37d..30c2d5a5d4 100644 --- a/official/c20318029.lua +++ b/official/c20318029.lua @@ -3,12 +3,12 @@ --scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --atk + --Make 1 Thunder monster you control gain 500 ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND) e1:SetHintTiming(TIMING_DAMAGE_STEP) @@ -16,8 +16,8 @@ function s.initial_effect(c) e1:SetCost(Cost.SelfDiscard) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_THUNDRA) - --to hand + c:RegisterEffect(e1) + --You can add 1 "Thunder Dragonmatrix" from your Deck to your hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) @@ -30,28 +30,20 @@ function s.initial_effect(c) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_TO_GRAVE) - e3:SetCondition(s.thcon) + e3:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end) c:RegisterEffect(e3) end -s.listed_names={20318029} -function s.atkfilter(c) - return c:IsFaceup() and c:IsRace(RACE_THUNDER) -end +s.listed_names={id} function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.atkfilter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) end + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsRace(RACE_THUNDER) end + if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsRace,RACE_THUNDER),tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) - Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsRace,RACE_THUNDER),tp,LOCATION_MZONE,0,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - e1:SetValue(500) - tc:RegisterEffect(e1) + tc:UpdateAttack(500,nil,e:GetHandler()) end end function s.thfilter(c) @@ -59,15 +51,13 @@ function s.thfilter(c) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) 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) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end -function s.thop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstMatchingCard(s.thfilter,tp,LOCATION_DECK,0,nil) - if tc then - Duel.SendtoHand(tc,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,tc) +function s.thop(e,tp,eg,ep,ev,re,r,rp,chk) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + 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 -function s.thcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) -end \ No newline at end of file diff --git a/official/c20343502.lua b/official/c20343502.lua index 43aafd38bb..830225e341 100644 --- a/official/c20343502.lua +++ b/official/c20343502.lua @@ -15,11 +15,11 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.immtg) e1:SetOperation(s.immop) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Shuffle up to 2 cards from either GY into deck local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TODECK) @@ -77,4 +77,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c20563387.lua b/official/c20563387.lua index b90558032a..62b800365e 100644 --- a/official/c20563387.lua +++ b/official/c20563387.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.rmcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=80 s.listed_names={93568288} @@ -90,4 +90,4 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c2061963.lua b/official/c2061963.lua index 8f6e881edd..3f4d149af0 100644 --- a/official/c2061963.lua +++ b/official/c2061963.lua @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) @@ -27,7 +27,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetTarget(s.decktg) e2:SetOperation(s.deckop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=104 function s.condition(e,tp,eg,ep,ev,re,r,rp,chk) @@ -54,4 +54,4 @@ end function s.deckop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.DiscardDeck(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c20785975.lua b/official/c20785975.lua index eb3909e518..75ff22f1b0 100644 --- a/official/c20785975.lua +++ b/official/c20785975.lua @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) @@ -28,7 +28,7 @@ function s.initial_effect(c) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=103 s.listed_names={94380860} @@ -67,4 +67,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c2091298.lua b/official/c2091298.lua index fb423447de..3b3b5fb018 100644 --- a/official/c2091298.lua +++ b/official/c2091298.lua @@ -16,9 +16,9 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_CONSTELLAR} function s.condition(e,tp,eg,ep,ev,re,r,rp) @@ -39,4 +39,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(1000) tc:RegisterEffect(e1) -end \ No newline at end of file +end diff --git a/official/c21044178.lua b/official/c21044178.lua index ad21f6c984..0190107688 100644 --- a/official/c21044178.lua +++ b/official/c21044178.lua @@ -23,9 +23,9 @@ function s.initial_effect(c) e2:SetHintTiming(0,TIMING_DRAW_PHASE) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.atkcon(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WATER) @@ -43,4 +43,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.aclimit(e,re,tp) return re:GetActivateLocation()==LOCATION_GRAVE -end \ No newline at end of file +end diff --git a/official/c21065189.lua b/official/c21065189.lua index f3e6388329..7de7595a05 100644 --- a/official/c21065189.lua +++ b/official/c21065189.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(2)) + e2:SetCost(Cost.DetachFromSelf(2)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsXyzSummoned() @@ -73,4 +73,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) -end \ No newline at end of file +end diff --git a/official/c21223277.lua b/official/c21223277.lua index fb44ec6e86..50080b36fb 100644 --- a/official/c21223277.lua +++ b/official/c21223277.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NOBLE_ARMS,SET_NOBLE_KNIGHT} function s.condition(e,tp,eg,ep,ev,re,r,rp) @@ -74,4 +74,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c21313376.lua b/official/c21313376.lua index 973bcf6fed..05f4d12f33 100644 --- a/official/c21313376.lua +++ b/official/c21313376.lua @@ -20,10 +20,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(aux.bdogcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=14 function s.refcon(e,re,val,r,rp,rc) @@ -39,4 +39,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) local atk=e:GetHandler():GetBattleTarget():GetBaseAttack() local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttackBelow,atk),tp,LOCATION_MZONE,LOCATION_MZONE,nil) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c21501505.lua b/official/c21501505.lua index 5ee053979f..94906045eb 100644 --- a/official/c21501505.lua +++ b/official/c21501505.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) if e==re or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end @@ -51,4 +51,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.ChangeTargetCard(ev,Group.FromCards(tc)) end -end \ No newline at end of file +end diff --git a/official/c21521304.lua b/official/c21521304.lua index 9ab2fc862c..48abe842d2 100644 --- a/official/c21521304.lua +++ b/official/c21521304.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_UTOPIA} s.xyz_number=39 @@ -74,4 +74,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if not tc2:IsRelateToEffect(e) or Duel.SpecialSummon(tc2,0,tp,tp,false,false,POS_FACEUP)==0 then return end Duel.BreakEffect() Duel.Recover(tp,1250,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c21772453.lua b/official/c21772453.lua index 6ecc1aea61..7b0a515e47 100644 --- a/official/c21772453.lua +++ b/official/c21772453.lua @@ -3,75 +3,79 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --special summon rule + --Must first be Special Summoned (from your hand) by Tributing 1 "Flower Cardian" monster, except "Flower Cardian Maple with Deer" + local e0=Effect.CreateEffect(c) + e0:SetDescription(aux.Stringid(id,0)) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EFFECT_SPSUMMON_PROC) + e0:SetRange(LOCATION_HAND) + e0:SetCondition(s.selfspcon) + e0:SetTarget(s.selfsptg) + e0:SetOperation(s.selfspop) + c:RegisterEffect(e0) + --Draw 1 card, and if you do, show it, then, if it is a "Flower Cardian" monster, you can destroy 1 Spell/Trap Card your opponent controls local e1=Effect.CreateEffect(c) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetRange(LOCATION_HAND) - e1:SetCode(EFFECT_SPSUMMON_PROC) - e1:SetCondition(s.hspcon) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --draw - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) - c:RegisterEffect(e2) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY+CATEGORY_TOGRAVE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetTarget(s.drtg) + e1:SetOperation(s.drop) + c:RegisterEffect(e1) end s.listed_series={SET_FLOWER_CARDIAN} s.listed_names={id} -function s.hspfilter(c,tp) +function s.selfspfilter(c) return c:IsSetCard(SET_FLOWER_CARDIAN) and not c:IsCode(id) end -function s.hspcon(e,c) +function s.selfspcon(e,c) if c==nil then return true end - return Duel.CheckReleaseGroup(c:GetControler(),s.hspfilter,1,false,1,true,c,c:GetControler(),nil,false,nil) + local tp=c:GetControler() + return Duel.CheckReleaseGroup(tp,s.selfspfilter,1,false,1,true,c,tp,nil,false,nil) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,c) - local g=Duel.SelectReleaseGroup(tp,s.hspfilter,1,1,false,true,true,c,nil,nil,false,nil) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) + local g=Duel.SelectReleaseGroup(tp,s.selfspfilter,1,1,false,true,true,c,nil,nil,false,nil) if g then g:KeepAlive() e:SetLabelObject(g) - return true + return true end return false end -function s.hspop(e,tp,eg,ep,ev,re,r,rp,c) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_ONFIELD) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end -function s.desfilter(c) - return c:IsSpellTrap() -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 then - local tc=Duel.GetOperatedGroup():GetFirst() - Duel.ConfirmCards(1-tp,tc) - if tc:IsMonster() and tc:IsSetCard(SET_FLOWER_CARDIAN) then - local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_ONFIELD,nil) - if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then - Duel.BreakEffect() - local sg=g:Select(tp,1,1,nil) - Duel.HintSelection(sg) - Duel.Destroy(sg,REASON_EFFECT) + if Duel.Draw(p,d,REASON_EFFECT)>0 then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then + if Duel.IsExistingMatchingCard(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,nil) + and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectMatchingCard(tp,Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.BreakEffect() + Duel.Destroy(g,REASON_EFFECT) + end end else Duel.BreakEffect() - Duel.SendtoGrave(tc,REASON_EFFECT) + Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end diff --git a/official/c21858819.lua b/official/c21858819.lua index 3230ceffc3..44c89fcbbd 100644 --- a/official/c21858819.lua +++ b/official/c21858819.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --recover local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_RECOVER) @@ -62,4 +62,4 @@ function s.recop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then Duel.Recover(tp,tc:GetBaseAttack(),REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c2191144.lua b/official/c2191144.lua index 8677a347ca..3ae2b89539 100644 --- a/official/c2191144.lua +++ b/official/c2191144.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetOverlayCount(tp,1,1)>1 end @@ -33,4 +33,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/official/c22110647.lua b/official/c22110647.lua index f94e5ff2a9..daa3bb1930 100644 --- a/official/c22110647.lua +++ b/official/c22110647.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --Destroy 1 card on the field local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) @@ -99,4 +99,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c22617205.lua b/official/c22617205.lua index 1b798c0a71..aa7d423f96 100644 --- a/official/c22617205.lua +++ b/official/c22617205.lua @@ -2,58 +2,51 @@ --Stellarknight Zefraxciton local s,id=GetID() function s.initial_effect(c) - --Pendulum Summon procedure Pendulum.AddProcedure(c) - --You cannot Pendulum Summon, except "tellarknight" and "Zefra" monsters + --You cannot Pendulum Summon monsters, except "tellarknight" and "Zefra" monsters local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetRange(LOCATION_PZONE) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetRange(LOCATION_PZONE) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c,sump,sumtype) return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM and not c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) end) c:RegisterEffect(e1) - --Destroy 1 card you control and 1 Set card your opponent controls - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_DESTROY) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) - e2:SetCode(EVENT_SUMMON_SUCCESS) - e2:SetCountLimit(1,id) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_TELLAR) - local e3=e2:Clone() - e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e3) - local e4=e2:Clone() - e4:SetCode(EVENT_SPSUMMON_SUCCESS) - e4:SetCondition(function(e) return e:GetHandler():IsPendulumSummoned() end) - c:RegisterEffect(e4) + --Destroy 1 other "tellarknight" or "Zefra" card in your Monster Zone or Pendulum Zone and 1 Set card your opponent controls + local e2a=Effect.CreateEffect(c) + e2a:SetDescription(aux.Stringid(id,0)) + e2a:SetCategory(CATEGORY_DESTROY) + e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e2a:SetCode(EVENT_SUMMON_SUCCESS) + e2a:SetCountLimit(1,id) + e2a:SetTarget(s.destg) + e2a:SetOperation(s.desop) + c:RegisterEffect(e2a) + local e2b=e2a:Clone() + e2b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e2b) + local e2c=e2a:Clone() + e2c:SetCode(EVENT_SPSUMMON_SUCCESS) + e2c:SetCondition(function(e) return e:GetHandler():IsPendulumSummoned() end) + c:RegisterEffect(e2c) end s.listed_series={SET_TELLARKNIGHT,SET_ZEFRA} -function s.splimit(e,c,sump,sumtype,sumpos,targetp) - if c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) then return false end - return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM -end -function s.filter1(c) - return c:IsFaceup() and c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) +function s.desfilter(c,e,tp) + return ((c:IsControler(tp) and c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) and c:IsFaceup()) or (c:IsControler(1-tp) and c:IsFacedown())) + and c:IsCanBeEffectTarget(e) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end - if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE|LOCATION_PZONE,0,1,e:GetHandler()) - and Duel.IsExistingTarget(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g1=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE|LOCATION_PZONE,0,1,1,e:GetHandler()) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g2=Duel.SelectTarget(tp,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil) - g1:Merge(g2) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,#g1,0,0) + local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE|LOCATION_PZONE,LOCATION_ONFIELD,e:GetHandler(),e,tp) + if chk==0 then return 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_DESTROY) + Duel.SetTargetCard(tg) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,2,tp,0) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetTargetCards(e) - if #g>0 then - Duel.Destroy(g,REASON_EFFECT) +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local tg=Duel.GetTargetCards(e) + if #tg>0 then + Duel.Destroy(tg,REASON_EFFECT) end end \ No newline at end of file diff --git a/official/c22653490.lua b/official/c22653490.lua index 2fa33afe9d..05314cdd25 100644 --- a/official/c22653490.lua +++ b/official/c22653490.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.tdtg2) e2:SetOperation(s.tdop2) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.tdcon1(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsXyzSummoned() @@ -62,4 +62,4 @@ function s.tdop2(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and tc:IsFaceup() then Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c2273734.lua b/official/c2273734.lua index 15b0e1dd49..7632a489ec 100644 --- a/official/c2273734.lua +++ b/official/c2273734.lua @@ -2,52 +2,50 @@ --Satellarknight Altair local s,id=GetID() function s.initial_effect(c) - --Special Summon 1 "tellarknight" monster from the GY - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetTarget(s.sptg) - e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Special Summon 1 "tellarknight" monster from your GY in Defense Position, except "Satellarknight Altair" + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.sptg) + e1a:SetOperation(s.spop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) end -s.listed_names={id} s.listed_series={SET_TELLARKNIGHT} -function s.filter(c,e,tp) - return c:IsSetCard(SET_TELLARKNIGHT) and not c:IsCode(id) - and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) +s.listed_names={id} +function s.spfilter(c,e,tp) + return c:IsSetCard(SET_TELLARKNIGHT) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end + and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectTarget(tp,s.filter,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.spfilter,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) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end - local e1=Effect.CreateEffect(e:GetHandler()) + local c=e:GetHandler() + aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,1),nil) + --Monsters you control cannot attack for the rest of this turn, except "tellarknight" monsters + local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetTargetRange(LOCATION_MZONE,0) - e1:SetTarget(s.atktg) + e1:SetTarget(function(e,c) return not c:IsSetCard(SET_TELLARKNIGHT) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,1),nil) -end -function s.atktg(e,c) - return not c:IsSetCard(SET_TELLARKNIGHT) end \ No newline at end of file diff --git a/official/c23085002.lua b/official/c23085002.lua index b14da367b3..073c624564 100644 --- a/official/c23085002.lua +++ b/official/c23085002.lua @@ -23,7 +23,7 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetOperation(s.operation) c:RegisterEffect(e3) end @@ -58,4 +58,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.splimit(e,c) return c:IsLocation(LOCATION_GRAVE) -end \ No newline at end of file +end diff --git a/official/c23454876.lua b/official/c23454876.lua index 77dea5d2cd..d5114442b6 100644 --- a/official/c23454876.lua +++ b/official/c23454876.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCondition(s.damcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_names={51960178} function s.drcon(e,tp,eg,ep,ev,re,r,rp) @@ -57,4 +57,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local dam=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)*400 Duel.Damage(p,dam,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c23603403.lua b/official/c23603403.lua index 6f24d5affb..870b5e8476 100644 --- a/official/c23603403.lua +++ b/official/c23603403.lua @@ -31,10 +31,10 @@ function s.initial_effect(c) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetCondition(aux.StatChangeDamageStepCondition) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_RAIDRAPTOR} function s.descon(e,tp,eg,ep,ev,re,r,rp) @@ -87,4 +87,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(ct*-800) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c23649496.lua b/official/c23649496.lua index fd48c45fb6..39ba4d443f 100644 --- a/official/c23649496.lua +++ b/official/c23649496.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Send 2 "Heraldic Beast" monsters from your Deck to the Graveyard. local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -78,4 +78,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) local sg=g:Select(tp,2,2,nil) Duel.SendtoGrave(sg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c23756165.lua b/official/c23756165.lua index 77906be217..f7554355aa 100644 --- a/official/c23756165.lua +++ b/official/c23756165.lua @@ -44,7 +44,7 @@ function s.initial_effect(c) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) e3:SetLabelObject(e1) - c:RegisterEffect(e3,false,EFFECT_MARKER_ALLURE_LVUP) + c:RegisterEffect(e3) end s.listed_names={87257460,50140163} --"Allure Queen LV3", "Allure Queen LV7" s.LVnum=5 diff --git a/official/c23776077.lua b/official/c23776077.lua index 1d62ce87ef..2b4ab90dc1 100644 --- a/official/c23776077.lua +++ b/official/c23776077.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --atk/def local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -75,4 +75,4 @@ function s.tgcon(e) end function s.indcon(e) return e:GetHandler():GetOverlayCount()==5 -end \ No newline at end of file +end diff --git a/official/c23848752.lua b/official/c23848752.lua index 987a4b77fd..4c93f2839e 100644 --- a/official/c23848752.lua +++ b/official/c23848752.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,0}) - e2:SetCost(Cost.Detach(2,2,nil)) + e2:SetCost(Cost.DetachFromSelf(2,2,nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Gain LP equal to the ATK of a battling monster local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -88,4 +88,4 @@ function s.rcop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local d=tc:GetAttack()/2 Duel.Recover(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c24701066.lua b/official/c24701066.lua index bfb159598c..455931abe4 100644 --- a/official/c24701066.lua +++ b/official/c24701066.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.thtgtg) e2:SetOperation(s.thtgop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Special Summon this card from the GY in Defense Position local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -89,4 +89,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end -end \ No newline at end of file +end diff --git a/official/c2530830.lua b/official/c2530830.lua index a152cb6806..6d811e5abb 100644 --- a/official/c2530830.lua +++ b/official/c2530830.lua @@ -20,10 +20,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -76,4 +76,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c25341652.lua b/official/c25341652.lua index 29f1951f73..6efd4ccc28 100644 --- a/official/c25341652.lua +++ b/official/c25341652.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.postg) e1:SetOperation(s.posop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destruction replacement for a "Djinn" monster local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -63,4 +63,4 @@ function s.repop(e,tp,eg,ep,ev,re,r,rp) tc:RemoveOverlayCard(tp,1,1,REASON_EFFECT) end g:DeleteGroup() -end \ No newline at end of file +end diff --git a/official/c26057276.lua b/official/c26057276.lua index 10868e1e29..e2012421e1 100644 --- a/official/c26057276.lua +++ b/official/c26057276.lua @@ -2,42 +2,43 @@ --Satellarknight Betelgeuse local s,id=GetID() function s.initial_effect(c) - --Send itself to the GY and add 1 "tellarknight" monster from the GY to the hand - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Send this card to the GY, and if you do, add 1 "tellarknight" card from your GY to your hand, except "Satellarknight Betelgeuse" + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.thtg) + e1a:SetOperation(s.thop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) end s.listed_series={SET_TELLARKNIGHT} s.listed_names={id} -function s.filter(c) +function s.thfilter(c) return c:IsSetCard(SET_TELLARKNIGHT) and not c:IsCode(id) and c:IsAbleToHand() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end + local c=e:GetHandler() + if chk==0 then return c:IsAbleToGrave() and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) + local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,c,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_GRAVE) then - local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) then - Duel.SendtoHand(tc,nil,REASON_EFFECT) - end + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)>0 and c:IsLocation(LOCATION_GRAVE) + and tc:IsRelateToEffect(e) then + Duel.SendtoHand(tc,nil,REASON_EFFECT) end end \ No newline at end of file diff --git a/official/c2609443.lua b/official/c2609443.lua index 01f3621c08..7e0bf2fdeb 100644 --- a/official/c2609443.lua +++ b/official/c2609443.lua @@ -30,7 +30,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(2)) + e2:SetCost(Cost.DetachFromSelf(2)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) @@ -82,4 +82,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then Duel.SendtoGrave(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c26096328.lua b/official/c26096328.lua index cdffc8e8ef..669389ea13 100644 --- a/official/c26096328.lua +++ b/official/c26096328.lua @@ -13,9 +13,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --multi attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -61,4 +61,4 @@ end function s.raval(e,c) local oc=e:GetHandler():GetOverlayCount() return math.max(0,oc) -end \ No newline at end of file +end diff --git a/official/c26211048.lua b/official/c26211048.lua index 6c796b9e72..5f152efbaf 100644 --- a/official/c26211048.lua +++ b/official/c26211048.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) aux.AddEREquipLimit(c,nil,function(ec,_,tp) return ec:IsControler(1-tp) end,s.equipop,e1) end function s.eqfilter(c) @@ -58,4 +58,4 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc or not tc:IsMonster() then return end if not s.equipop(c,e,tp,tc) then return end -end \ No newline at end of file +end diff --git a/official/c26223582.lua b/official/c26223582.lua index e5a40e53da..98c19a2d27 100644 --- a/official/c26223582.lua +++ b/official/c26223582.lua @@ -4,6 +4,14 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() + --Register that it was Special Summoned by the effect of a "Nouvelles" monster + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EVENT_SPSUMMON_SUCCESS) + e0:SetCondition(s.regcon) + e0:SetOperation(function(e) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD&~RESET_TEMP_REMOVE,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3)) end) + c:RegisterEffect(e0) --Excavate the top 5 cards of your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) @@ -32,6 +40,17 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_NOUVELLES,SET_RECIPE} +function s.regcon(e,tp,eg,ep,ev,re,r,rp) + if not (re and re:IsMonsterEffect()) then return false end + local rc=re:GetHandler() + local trig_loc,trig_setcodes=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SETCODES) + if not Duel.IsChainSolving() or (rc:IsRelateToEffect(re) and rc:IsFaceup() and rc:IsLocation(trig_loc)) then + return rc:IsSetCard(SET_NOUVELLES) + end + for _,set in ipairs(trig_setcodes) do + if (SET_NOUVELLES&0xfff)==(set&0xfff) and (SET_NOUVELLES&set)==SET_NOUVELLES then return true end + end +end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end Duel.SetTargetPlayer(tp) diff --git a/official/c26329679.lua b/official/c26329679.lua index d43fcd4bd6..6039d35fc0 100644 --- a/official/c26329679.lua +++ b/official/c26329679.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) e1:SetHintTiming(TIMING_STANDBY_PHASE|TIMING_END_PHASE) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_CONSTELLAR} function s.operation(e,tp,eg,ep,ev,re,r,rp) @@ -37,4 +37,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.efilter(e,te) return te:IsSpellTrapEffect() -end \ No newline at end of file +end diff --git a/official/c26400609.lua b/official/c26400609.lua index 9b0d63a5b0..d37cc9c166 100644 --- a/official/c26400609.lua +++ b/official/c26400609.lua @@ -2,41 +2,41 @@ --Tidal, Dragon Ruler of Waterfalls local s,id=GetID() function s.initial_effect(c) - --Special Summon this card from the hand or GY + --Special Summon this card from your hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCountLimit(1,id) - e1:SetCost(s.hspcost) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) + e1:SetCost(s.selfspcost) + e1:SetTarget(s.selfsptg) + e1:SetOperation(s.selfspop) c:RegisterEffect(e1) --Return this card to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e2:SetCode(EVENT_PHASE|PHASE_END) e2:SetRange(LOCATION_MZONE) - e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1,id) - e2:SetCondition(s.retcon) - e2:SetTarget(s.rettg) - e2:SetOperation(s.retop) + e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSpecialSummoned() end) + e2:SetTarget(s.rthtg) + e2:SetOperation(s.rthop) c:RegisterEffect(e2) - --Send 1 monster from your Deck to the Graveyard + --Send 1 monster from your Deck to the GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOGRAVE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_HAND) e3:SetCountLimit(1,id) - e3:SetCost(s.tgcost) + e3:SetCost(DragonRuler.SelfDiscardToGraveCost(ATTRIBUTE_WATER)) e3:SetTarget(s.tgtg) e3:SetOperation(s.tgop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DRAGON_RULER) - --Add 1 WATER Dragon-Type monster from your Deck to your hand + c:RegisterEffect(e3) + --Add 1 WATER Dragon monster from your Deck to your hand local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,3)) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) @@ -48,62 +48,45 @@ function s.initial_effect(c) e4:SetOperation(s.thop) c:RegisterEffect(e4) end -function s.rfilter(c) - return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WATER)) and c:IsAbleToRemoveAsCost() +function s.spcostfilter(c) + return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WATER)) and c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true)) end -function s.hspcost(e,tp,eg,ep,ev,re,r,rp,chk) - local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) +function s.selfspcost(e,tp,eg,ep,ev,re,r,rp,chk) + local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) if chk==0 then return #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE) Duel.Remove(g,POS_FACEUP,REASON_COST) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end -function s.hspop(e,tp,eg,ep,ev,re,r,rp) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end -function s.retcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSpecialSummoned() -end -function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,0) end -function s.retop(e,tp,eg,ep,ev,re,r,rp) +function s.rthop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then Duel.SendtoHand(c,nil,REASON_EFFECT) end end -function s.dfilter(c) - return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() and c:IsAbleToGraveAsCost() -end -function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsDiscardable() and e:GetHandler():IsAbleToGraveAsCost() - and Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler()) - g:AddCard(e:GetHandler()) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) -end -function s.tgfilter(c) - return c:IsMonster() and c:IsAbleToGrave() -end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) - --Excluding itself for a correct interaction with "Chasmatis, Dragon Ruler of Poles" - if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,e:GetHandler()) end + --Excluding itself for a correct interaction with "Chasma, Dragon Ruler of Auroras" [04965193] + if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(Card.IsMonster,Card.IsAbleToGrave),tp,LOCATION_DECK,0,1,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,aux.AND(Card.IsMonster,Card.IsAbleToGrave),tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end diff --git a/official/c26556950.lua b/official/c26556950.lua index bf632a412d..e7f8a8a94f 100644 --- a/official/c26556950.lua +++ b/official/c26556950.lua @@ -35,10 +35,10 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) - e4:SetCost(Cost.Detach(1,1,nil)) + e4:SetCost(Cost.DetachFromSelf(1,1,nil)) e4:SetTarget(s.destg) e4:SetOperation(s.desop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.xyz_number=84 function s.ovfilter(c,tp,xyzc) @@ -75,4 +75,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if not c:IsRelateToEffect(e) or c:IsFacedown() then return end local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil,c:GetDefense()) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c26563200.lua b/official/c26563200.lua index 6f502f56f9..e23e69c736 100644 --- a/official/c26563200.lua +++ b/official/c26563200.lua @@ -16,9 +16,9 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.atkcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_DJINN} function s.atkcon(e,tp,eg,ep,ev,re,r,rp) @@ -38,4 +38,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(tc:GetAttack()*2) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c2665273.lua b/official/c2665273.lua index 12cbcb2267..646544de1c 100644 --- a/official/c2665273.lua +++ b/official/c2665273.lua @@ -26,10 +26,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e3:SetCountLimit(1,id) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.atkval(e,c) return c:GetOverlayCount()*1000 @@ -60,4 +60,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Overlay(c,tc,true) end end -end \ No newline at end of file +end diff --git a/official/c26973555.lua b/official/c26973555.lua index 195ddbf9c5..12319fe04f 100644 --- a/official/c26973555.lua +++ b/official/c26973555.lua @@ -28,7 +28,7 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCondition(s.discon) - e4:SetCost(Cost.Detach(1,1,nil)) + e4:SetCost(Cost.DetachFromSelf(1,1,nil)) e4:SetTarget(s.distg) e4:SetOperation(s.disop) c:RegisterEffect(e4) @@ -62,4 +62,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.BreakEffect() Duel.GetControl(rc,tp) end -end \ No newline at end of file +end diff --git a/official/c26988374.lua b/official/c26988374.lua index 4fcb3d9b43..aac509a418 100644 --- a/official/c26988374.lua +++ b/official/c26988374.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.damcon) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Detach 1 material and banish local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -75,4 +75,4 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) and c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)>0 and tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c27069566.lua b/official/c27069566.lua index 419c87e0b1..18fc767d4a 100644 --- a/official/c27069566.lua +++ b/official/c27069566.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.rmvtg) e1:SetOperation(s.rmvop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special Summon 2 "Datascape" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -76,4 +76,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if sg and #sg==2 then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c27240101.lua b/official/c27240101.lua index e7f1f8fb39..0bc75742f7 100644 --- a/official/c27240101.lua +++ b/official/c27240101.lua @@ -21,7 +21,7 @@ function s.initial_effect(c) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(2)) + e2:SetCost(Cost.DetachFromSelf(2)) e2:SetOperation(s.indop) e2:SetHintTiming(0,TIMING_BATTLE_START) c:RegisterEffect(e2) @@ -47,4 +47,4 @@ function s.indop(e,tp,eg,ep,ev,re,r,rp) e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) c:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c27337596.lua b/official/c27337596.lua index 5c610efe1e..e04e1e76ba 100644 --- a/official/c27337596.lua +++ b/official/c27337596.lua @@ -2,34 +2,32 @@ --Hieratic Dragon King of Atum local s,id=GetID() function s.initial_effect(c) - --Must be properly summoned before reviving c:EnableReviveLimit() - --Xyz summon procedure + --Xyz Summon procedure: 2 Level 6 Dragon monsters Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),6,2) - --Special summon 1 dragon monster from deck + --Special Summon 1 Dragon monster from your Deck, and make its ATK/DEF 0 local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.spcost) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.spcost)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return c:GetAttackAnnouncedCount()==0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - --Cannot attack this turn + if chk==0 then return c:GetAttackAnnouncedCount()==0 end + --This card cannot attack during the turn you activate this effect local e1=Effect.CreateEffect(c) e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) - c:RemoveOverlayCard(tp,1,1,REASON_COST) end function s.spfilter(c,e,tp) return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) @@ -42,18 +40,19 @@ end function s.spop(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 tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() - if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then - --ATK/DEF becomes 0 + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then + --Make its ATK/DEF 0 local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_SET_ATTACK) e1:SetValue(0) e1:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e1) + sc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE) - tc:RegisterEffect(e2) + sc:RegisterEffect(e2) end Duel.SpecialSummonComplete() -end \ No newline at end of file +end diff --git a/official/c27415516.lua b/official/c27415516.lua index c0b8cdd6b5..3f3482c665 100644 --- a/official/c27415516.lua +++ b/official/c27415516.lua @@ -2,31 +2,19 @@ --Stream, Dragon Ruler of Droplets local s,id=GetID() function s.initial_effect(c) - --Special summon 1 "Tidal, Dragon Ruler of Waterfalls" from deck + --Special Summon 1 "Tidal, Dragon Ruler of Waterfalls" from your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) - e1:SetCost(s.spcost) + e1:SetCost(DragonRuler.SelfDiscardCost(ATTRIBUTE_WATER)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DRAGON_RULER) + c:RegisterEffect(e1) end s.listed_names={26400609} --"Tidal, Dragon Ruler of Waterfalls" -function s.costfilter(c) - return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WATER)) and c:IsDiscardable() -end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() - and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c) - g:AddCard(c) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) -end function s.spfilter(c,e,tp) return c:IsCode(26400609) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end @@ -37,16 +25,16 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - local tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) + local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then --Cannot attack this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) - e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end Duel.SpecialSummonComplete() -end \ No newline at end of file +end diff --git a/official/c27420823.lua b/official/c27420823.lua index e7480d8eee..17e1b4935a 100644 --- a/official/c27420823.lua +++ b/official/c27420823.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,function(re,tp,cid) return not re:IsMonsterEffect() end) --Negate an opponent's monster effect activated in the hand or GY local e2=Effect.CreateEffect(c) @@ -27,10 +27,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.distg) e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_K9} function s.thfilter(c) @@ -68,4 +68,4 @@ end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,tp,0) -end \ No newline at end of file +end diff --git a/official/c27552504.lua b/official/c27552504.lua index c136a357b1..0fc34c02f1 100644 --- a/official/c27552504.lua +++ b/official/c27552504.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.tgtg) e1:SetOperation(s.tgop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -74,4 +74,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c2766877.lua b/official/c2766877.lua index 1529cb2d99..1ffddf1431 100644 --- a/official/c2766877.lua +++ b/official/c2766877.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() @@ -41,4 +41,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(1) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c28150174.lua b/official/c28150174.lua index a517e2f3cc..2c9e5371cd 100644 --- a/official/c28150174.lua +++ b/official/c28150174.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.postg) e1:SetOperation(s.posop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDefensePos() end @@ -38,4 +38,4 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/official/c28290705.lua b/official/c28290705.lua index ebecc15b7d..b1292341df 100644 --- a/official/c28290705.lua +++ b/official/c28290705.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.adtg) e1:SetOperation(s.adop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.adtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttributeExcept,ATTRIBUTE_EARTH),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end @@ -37,4 +37,4 @@ function s.adop(e,tp,eg,ep,ev,re,r,rp) e2:SetCode(EFFECT_UPDATE_DEFENSE) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c28346136.lua b/official/c28346136.lua index 8fd0d48cca..5b6770532c 100644 --- a/official/c28346136.lua +++ b/official/c28346136.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(2,2,nil)) + e1:SetCost(Cost.DetachFromSelf(2,2,nil)) e1:SetTarget(s.cannottgtg) e1:SetOperation(s.cannottgop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Return 1 Rank 9 or lower Dragon Xyz Monster from your GY to the Extra Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) @@ -90,4 +90,4 @@ function s.texspop(e,tp,eg,ep,ev,re,r,rp) sc:CompleteProcedure() end end -end \ No newline at end of file +end diff --git a/official/c28400508.lua b/official/c28400508.lua index 1ae792bf80..0c2e367044 100644 --- a/official/c28400508.lua +++ b/official/c28400508.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMBER} s.listed_names={id} @@ -81,4 +81,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end function s.atktg(e,c) return e:GetLabelObject()~=c -end \ No newline at end of file +end diff --git a/official/c28781003.lua b/official/c28781003.lua index e031a866d9..a286954238 100644 --- a/official/c28781003.lua +++ b/official/c28781003.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_THE_PHANTOM_KNIGHTS,SET_RAIDRAPTOR,SET_XYZ_DRAGON} function s.spfilter(c,e,tp,mc,rk,pg) @@ -69,4 +69,4 @@ end function s.desop(e,tp,eg,ep,ev,re,r,rp) local sc=e:GetLabelObject() Duel.Destroy(sc,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c28912357.lua b/official/c28912357.lua index ecc5b58e71..d9e7212579 100644 --- a/official/c28912357.lua +++ b/official/c28912357.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -64,4 +64,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c2896663.lua b/official/c2896663.lua index d311bb39b6..8c2d798b48 100644 --- a/official/c2896663.lua +++ b/official/c2896663.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Equip this card on the field to 1 Utopia monster local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -120,4 +120,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,chk) if #spg>0 then Duel.SpecialSummon(spg,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c28981598.lua b/official/c28981598.lua index 74f8686edb..c8453c1e37 100644 --- a/official/c28981598.lua +++ b/official/c28981598.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.tgfilter(e,c) return c:IsSummonLocation(LOCATION_GRAVE) and c~=e:GetHandler() @@ -48,4 +48,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c29085954.lua b/official/c29085954.lua index f102b67401..1ebf1d582d 100644 --- a/official/c29085954.lua +++ b/official/c29085954.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_NUMBER} s.xyz_number=78 @@ -80,4 +80,4 @@ end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c29208536.lua b/official/c29208536.lua index eab76183a1..11d3e466e0 100644 --- a/official/c29208536.lua +++ b/official/c29208536.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --cannnot activate local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) diff --git a/official/c29423048.lua b/official/c29423048.lua index 1380b47d2c..071297ee8f 100644 --- a/official/c29423048.lua +++ b/official/c29423048.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.thtgtg) e1:SetOperation(s.thtgop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special Summon this card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -59,4 +59,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end end Duel.SpecialSummonComplete() -end \ No newline at end of file +end diff --git a/official/c29510428.lua b/official/c29510428.lua index 088d585ce9..707c2b847d 100644 --- a/official/c29510428.lua +++ b/official/c29510428.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Add to hand or Special Summon 1 Level 5 monster from the Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -86,4 +86,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end, aux.Stringid(id,5) ) -end \ No newline at end of file +end diff --git a/official/c29515122.lua b/official/c29515122.lua index 654de8c80d..22eafb4fda 100644 --- a/official/c29515122.lua +++ b/official/c29515122.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeck(1-tp,3) end @@ -33,4 +33,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,ct,nil) Duel.HintSelection(dg) Duel.Destroy(dg,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c29596581.lua b/official/c29596581.lua index e0cd66ebe8..3007c9ab40 100644 --- a/official/c29596581.lua +++ b/official/c29596581.lua @@ -3,7 +3,7 @@ --scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --Add 1 "Thunder Dragon" card to hand + --Add to your hand, 1 of your "Thunder Dragon" cards that is banished or in your GY, except "Thunder Dragonroar" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) @@ -13,8 +13,8 @@ function s.initial_effect(c) e1:SetCost(Cost.SelfDiscard) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_THUNDRA) - --Special summon 1 "Thunder Dragon" monster + c:RegisterEffect(e1) + --Special Summon 1 "Thunder Dragon" monster from your Deck in Defense Position, but return it to the hand during the End Phase local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -33,7 +33,8 @@ end s.listed_series={SET_THUNDER_DRAGON} s.listed_names={id} function s.thfilter(c) - return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(SET_THUNDER_DRAGON) and c:IsAbleToHand() and not c:IsCode(id) + return c:IsSetCard(SET_THUNDER_DRAGON) and c:IsAbleToHand() and not c:IsCode(id) + and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil) end @@ -41,10 +42,10 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil) - if #tc>0 then - Duel.SendtoHand(tc,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,tc) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil) + if #g>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) end end function s.spfilter(c,e,tp) @@ -56,33 +57,11 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then - local fid=c:GetFieldID() - tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,fid) - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) - e1:SetCode(EVENT_PHASE+PHASE_END) - e1:SetCountLimit(1) - e1:SetLabel(fid) - e1:SetLabelObject(tc) - e1:SetCondition(s.thcon2) - e1:SetOperation(s.thop2) - Duel.RegisterEffect(e1,tp) + aux.DelayedOperation(tc,PHASE_END,id,e,tp,function(ag) Duel.SendtoHand(ag,nil,REASON_EFFECT) end,nil,0) end Duel.SpecialSummonComplete() end -function s.thcon2(e,tp,eg,ep,ev,re,r,rp) - local tc=e:GetLabelObject() - if tc:GetFlagEffectLabel(id)~=e:GetLabel() then - e:Reset() - return false - else return true end -end -function s.thop2(e,tp,eg,ep,ev,re,r,rp) - Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT) -end \ No newline at end of file diff --git a/official/c29669359.lua b/official/c29669359.lua index 87c79a78e0..f16c669b3f 100644 --- a/official/c29669359.lua +++ b/official/c29669359.lua @@ -2,57 +2,52 @@ --Number 61: Volcasaurus local s,id=GetID() function s.initial_effect(c) - --Must be properly summoned before reviving c:EnableReviveLimit() - --Xyz summon procedure + --Xyz Summon procedure: 2 Level 5 monsters Xyz.AddProcedure(c,nil,5,2) - --Destroy 1 of opponent's monsters, and if you do, inflict damage equal to its original ATK + --Destroy 1 face-up monster your opponent controls, and if you do, inflict damage to your opponent equal to the destroyed monster's original ATK local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetCountLimit(1) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.descost)) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) + c:RegisterEffect(e1) end s.xyz_number=61 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - and not e:GetHandler():IsDirectAttacked() end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - --Cannot attack directly - local e1=Effect.CreateEffect(e:GetHandler()) +function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return not c:IsDirectAttacked() end + --This card cannot attack your opponent directly the turn you activate this effect + local e1=Effect.CreateEffect(c) e1:SetDescription(3207) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) - e:GetHandler():RegisterEffect(e1) -end -function s.filter(c) - return c:IsFaceup() + c:RegisterEffect(e1) 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(1-tp) and chkc:IsFaceup() end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) - local atk=g:GetFirst():GetTextAttack() + local tc=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil):GetFirst() + local atk=tc:GetTextAttack() if atk<0 then atk=0 end - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then + if tc:IsRelateToEffect(e) and tc:IsMonster() and tc:IsControler(1-tp) then local atk=tc:GetTextAttack() if atk<0 then atk=0 end - if Duel.Destroy(tc,REASON_EFFECT)~=0 then + if Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.Damage(1-tp,atk,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c2978414.lua b/official/c2978414.lua index c2a1b59c23..450f123491 100644 --- a/official/c2978414.lua +++ b/official/c2978414.lua @@ -1,96 +1,84 @@ ---No.46 神影龍ドラッグルーオン +--No.46 神影龍ドラッグルーオン --Number 46: Dragluon local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),8,2) c:EnableReviveLimit() - --spsummon + --Xyz Summon procedure: 2 Level 8 Dragon monsters + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),8,2) + --Activate 1 of these effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) - e1:SetCondition(s.condition) - e1:SetCost(s.cost) - e1:SetTarget(s.sptg) - e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --control - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_CONTROL) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) - e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetRange(LOCATION_MZONE) - e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) - e2:SetCondition(s.condition) - e2:SetCost(s.cost) - e2:SetTarget(s.cttg) - e2:SetOperation(s.ctop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) - --effect limit - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,2)) - e3:SetType(EFFECT_TYPE_IGNITION) - e3:SetRange(LOCATION_MZONE) - e3:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) - e3:SetCondition(s.condition) - e3:SetCost(s.cost) - e3:SetOperation(s.efop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetCountLimit(1) + e1:SetCondition(function(e,tp) return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,0,1,e:GetHandler()) end) + e1:SetCost(Cost.DetachFromSelf(1)) + e1:SetTarget(s.efftg) + e1:SetOperation(s.effop) + c:RegisterEffect(e1) end s.xyz_number=46 -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<=1 -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.spfilter(c,e,tp) return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -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_HAND,0,1,nil,e,tp) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) +function s.ctrlfilter(c) + return c:IsRace(RACE_DRAGON) and c:IsFaceup() and c:IsControlerCanBeChanged() end -function s.spop(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,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) - if #g>0 then - Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return e:GetLabel()==2 and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.ctrlfilter(chkc) end + local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) + local b2=Duel.IsExistingTarget(s.ctrlfilter,tp,0,LOCATION_MZONE,1,nil) + local b3=not Duel.HasFlagEffect(1-tp,id) + if chk==0 then return b1 or b2 or b3 end + local op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,1)}, + {b2,aux.Stringid(id,2)}, + {b3,aux.Stringid(id,3)}) + e:SetLabel(op) + e:SetCategory(0) + e:SetProperty(0) + if op==1 then + e:SetCategory(CATEGORY_SPECIAL_SUMMON) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) + elseif op==2 then + e:SetCategory(CATEGORY_CONTROL) + e:SetProperty(EFFECT_FLAG_CARD_TARGET) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) + local g=Duel.SelectTarget(tp,s.ctrlfilter,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,tp,0) end end -function s.ctfilter(c) - return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsControlerCanBeChanged() -end -function s.cttg(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.ctfilter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,0,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) - local g=Duel.SelectTarget(tp,s.ctfilter,tp,0,LOCATION_MZONE,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) -end -function s.ctop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) then - Duel.GetControl(tc,tp) +function s.effop(e,tp,eg,ep,ev,re,r,rp) + local op=e:GetLabel() + if op==1 then + --Special Summon 1 Dragon monster from your hand + if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) + end + elseif op==2 then + --Target 1 Dragon monster your opponent controls; take control of that target + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) and tc:IsRace(RACE_DRAGON) and tc:IsFaceup() then + Duel.GetControl(tc,tp) + end + elseif op==3 then + local opp=1-tp + if Duel.HasFlagEffect(opp,id) then return end + Duel.RegisterFlagEffect(opp,id,RESET_PHASE|PHASE_END|RESET_OPPO_TURN,0,1) + local c=e:GetHandler() + aux.RegisterClientHint(c,nil,tp,0,1,aux.Stringid(id,4),RESET_OPPO_TURN) + --Dragon monsters your opponent controls cannot activate their effects until the end of your opponent's turn + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e1:SetCode(EFFECT_CANNOT_TRIGGER) + e1:SetTargetRange(0,LOCATION_MZONE) + e1:SetTarget(function(e,c) return c:IsRace(RACE_DRAGON) end) + e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,1) + Duel.RegisterEffect(e1,tp) end end -function s.efop(e,tp,eg,ep,ev,re,r,rp) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_TRIGGER) - e1:SetTargetRange(0,LOCATION_MZONE) - e1:SetTarget(s.actfilter) - e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,1) - Duel.RegisterEffect(e1,tp) -end -function s.actfilter(e,c) - return c:IsRace(RACE_DRAGON) -end \ No newline at end of file diff --git a/official/c30095833.lua b/official/c30095833.lua index 02039498ab..435998d170 100644 --- a/official/c30095833.lua +++ b/official/c30095833.lua @@ -33,10 +33,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(Cost.Detach(1,1)) + e3:SetCost(Cost.DetachFromSelf(1,1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --Place this card in the Pendulum Zone local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) @@ -101,4 +101,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 \ No newline at end of file +end diff --git a/official/c30100551.lua b/official/c30100551.lua index 83941f5819..6394d44e5e 100644 --- a/official/c30100551.lua +++ b/official/c30100551.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.distg) e1:SetOperation(s.drop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --discard deck & destroy local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DECKDES+CATEGORY_DESTROY) @@ -64,4 +64,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(sdg) Duel.Destroy(sdg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c30128445.lua b/official/c30128445.lua index 4be10c761b..9aa92fcb8a 100644 --- a/official/c30128445.lua +++ b/official/c30128445.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Shuffle 1 Normal Monster from your GY into the Deck and Special Summon this card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -78,4 +78,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.BreakEffect() Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c30350202.lua b/official/c30350202.lua index 636b44916d..625b545227 100644 --- a/official/c30350202.lua +++ b/official/c30350202.lua @@ -28,10 +28,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_CHAINING) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.negcon) - e2:SetCost(Cost.Detach(2,2,nil)) + e2:SetCost(Cost.DetachFromSelf(2,2,nil)) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_DRAGON_RULER} function s.tdfilter(c,e,tp) @@ -81,4 +81,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Remove(eg,POS_FACEUP,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c30382214.lua b/official/c30382214.lua index 14e81d632f..4839084c22 100644 --- a/official/c30382214.lua +++ b/official/c30382214.lua @@ -3,24 +3,24 @@ --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --Special Summon itself from hand + --Special Summon this card from your hand local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) - e1:SetDescription(aux.Stringid(id,0)) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --Draw 1 and search or Special Summon + c:RegisterEffect(e1) + --Draw 1 card, and if you do, show it, then, if it is a "Flower Cardian" monster, you can take 1 "Flower Cardian" monster from your Deck, except "Flower Cardian Cherry Blossom", and either add it to your hand or Special Summon it local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1) e2:SetCost(s.drcost) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) @@ -28,42 +28,40 @@ function s.initial_effect(c) end s.listed_names={id} s.listed_series={SET_FLOWER_CARDIAN} -function s.filter(c) - return c:IsFaceup() and c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsLevelBelow(2) +function s.spconfilter(c) + return c:IsLevelBelow(2) and c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsFaceup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) + return Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end + --You cannot Normal or Special Summon monsters for the rest of this turn, except "Flower Cardian" monsters local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c) return not c:IsSetCard(SET_FLOWER_CARDIAN) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() - e2:SetCode(EFFECT_CANNOT_SUMMON) + e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) Duel.RegisterEffect(e2,tp) - aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,2),nil) -end -function s.splimit(e,c) - return not c:IsSetCard(SET_FLOWER_CARDIAN) end -s.cfilter=aux.FaceupFilter(Card.IsSetCard,SET_FLOWER_CARDIAN) function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil) end - local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil) + if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsSetCard,1,false,nil,nil,SET_FLOWER_CARDIAN) end + local g=Duel.SelectReleaseGroupCost(tp,Card.IsSetCard,1,1,false,nil,nil,SET_FLOWER_CARDIAN) Duel.Release(g,REASON_COST) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) @@ -75,32 +73,35 @@ function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end -function s.spfilter(c) - return c:IsSetCard(SET_FLOWER_CARDIAN) and not c:IsCode(id) +function s.thspfilter(c,e,tp,mmz_chk) + return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsMonster() and not c:IsCode(id) and (c:IsAbleToHand() + or (mmz_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 then - local tc=Duel.GetOperatedGroup():GetFirst() - Duel.ConfirmCards(1-tp,tc) - if tc:IsMonster() and tc:IsSetCard(SET_FLOWER_CARDIAN) then - local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) - if #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then - Duel.BreakEffect() + if Duel.Draw(p,d,REASON_EFFECT)>0 then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then + local mmz_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + local g=Duel.GetMatchingGroup(s.thspfilter,tp,LOCATION_DECK,0,nil,e,tp,mmz_chk) + if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local sc=sg:Select(tp,1,1,nil):GetFirst() + local sc=g:Select(tp,1,1,nil):GetFirst() + Duel.BreakEffect() aux.ToHandOrElse(sc,tp, - function(c) - return sc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + function() + return mmz_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) end, - function(c) + function() return Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, - aux.Stringid(id,0) + aux.Stringid(id,4) ) end else - Duel.SendtoGrave(tc,REASON_EFFECT) + Duel.BreakEffect() + Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end diff --git a/official/c30439101.lua b/official/c30439101.lua index 752106d95a..f04874ab6f 100644 --- a/official/c30439101.lua +++ b/official/c30439101.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Opponent's targeted monster cannot attack, also negate its effect local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -88,4 +88,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) e3:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e3) end -end \ No newline at end of file +end diff --git a/official/c30741334.lua b/official/c30741334.lua index 832a4a818d..8904f486bf 100644 --- a/official/c30741334.lua +++ b/official/c30741334.lua @@ -12,32 +12,30 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(3,id) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.drcost)) + e1:SetTarget(s.drtg) + e1:SetOperation(s.drop) + c:RegisterEffect(e1) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsPhase(PHASE_MAIN1) end local c=e:GetHandler() - if chk==0 then return Duel.IsPhase(PHASE_MAIN1) - and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) + aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,1)) --You cannot conduct your Battle Phase the turn you activate this effect - local e1=Effect.CreateEffect(e:GetHandler()) + local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_BP) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) + e1:SetCode(EFFECT_CANNOT_BP) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,1),nil) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,1,1-tp,800) end -function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drop(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.Draw(tp,1,REASON_EFFECT) if ct==0 then return end local dc=Duel.GetOperatedGroup():GetFirst() @@ -47,4 +45,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Damage(1-tp,800,REASON_EFFECT) end Duel.ShuffleHand(tp) -end \ No newline at end of file +end diff --git a/official/c31123642.lua b/official/c31123642.lua index 91358a3167..b32e37c86f 100644 --- a/official/c31123642.lua +++ b/official/c31123642.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(2,2,nil)) + e1:SetCost(Cost.DetachFromSelf(2,2,nil)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destruction replacement for a "Utopia" or "Utopic" Xyz monster local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -88,4 +88,4 @@ function s.repval(e,c) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT|REASON_REPLACE) -end \ No newline at end of file +end diff --git a/official/c31320433.lua b/official/c31320433.lua index f65b171d6f..6d7f95e74a 100644 --- a/official/c31320433.lua +++ b/official/c31320433.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.dacon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.datg) e2:SetOperation(s.daop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=47 function s.matfilter(c) @@ -82,4 +82,4 @@ function s.daop(e,tp,eg,ep,ev,re,r,rp) end function s.ftarget(e,c) return e:GetLabel()~=c:GetFieldID() -end \ No newline at end of file +end diff --git a/official/c31437713.lua b/official/c31437713.lua index bf41d49f48..738da21e3d 100644 --- a/official/c31437713.lua +++ b/official/c31437713.lua @@ -2,66 +2,51 @@ --Number 82: Heartlandraco local s,id=GetID() function s.initial_effect(c) - --Must be properly summoned before reviving c:EnableReviveLimit() - --Xyz summon procedure + --Xyz Summon procedure: 2 Level 4 monsters Xyz.AddProcedure(c,nil,4,2) - --Cannot be targeted for attack + --While you control a face-up Spell, your opponent cannot target this card for attacks local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) - e1:SetCondition(s.atkcon) + e1:SetRange(LOCATION_MZONE) + e1:SetCondition(function(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSpell),e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) end) e1:SetValue(aux.imval1) c:RegisterEffect(e1) - --Make itself be able to attack directly + --Apply a "this turn, this card can attack your opponent directly, but other monsters cannot attack" effect local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCondition(s.condition) - e2:SetCost(s.cost) - e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + e2:SetCountLimit(1) + e2:SetCondition(function(e) return Duel.IsAbleToEnterBP() and not e:GetHandler():IsHasEffect(EFFECT_DIRECT_ATTACK) end) + e2:SetCost(Cost.DetachFromSelf(1)) + e2:SetOperation(s.effop) + c:RegisterEffect(e2) end s.xyz_number=82 -function s.filter(c) - return c:IsFaceup() and c:IsSpell() -end -function s.atkcon(e) - return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) -end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsAbleToEnterBP() and not e:GetHandler():IsHasEffect(EFFECT_DIRECT_ATTACK) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_ATTACK) - e1:SetProperty(EFFECT_FLAG_OATH) - e1:SetTargetRange(LOCATION_MZONE,0) - e1:SetTarget(s.ftarget) - e1:SetLabel(e:GetHandler():GetFieldID()) - e1:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(e1,tp) -end -function s.ftarget(e,c) - return e:GetLabel()~=c:GetFieldID() -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.effop(e,tp,eg,ep,ev,re,r,rp) + local fid=-1 local c=e:GetHandler() - if c:IsFaceup() and c:IsRelateToEffect(e) then - --Attack directly this turn - local e1=Effect.CreateEffect(e:GetHandler()) + if c:IsRelateToEffect(e) then + fid=c:GetFieldID() + --This turn, this card can attack your opponent directly + local e1=Effect.CreateEffect(c) e1:SetDescription(3205) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file + aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,1)) + --But other monsters cannot attack + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_FIELD) + e2:SetCode(EFFECT_CANNOT_ATTACK) + e2:SetTargetRange(LOCATION_MZONE,0) + e2:SetTarget(function(e,c) return c:GetFieldID()~=fid end) + e2:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e2,tp) +end diff --git a/official/c31539614.lua b/official/c31539614.lua index f3921e5d8e..08d8ffe36c 100644 --- a/official/c31539614.lua +++ b/official/c31539614.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCondition(function() return not (Duel.IsPhase(PHASE_DAMAGE) and Duel.IsDamageCalculated()) end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.changeatkdeftg) e1:SetOperation(s.changeatkdefop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Make a monster(s) Special Summoned to your field gain 900 ATK local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/official/c31563350.lua b/official/c31563350.lua index 72316d617f..f9e2ee0700 100644 --- a/official/c31563350.lua +++ b/official/c31563350.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) aux.AddEREquipLimit(c,nil,s.eqval,s.equipop,e1) end function s.eqval(ec,c,tp) @@ -54,4 +54,4 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp) end function s.eqlimit(e,c) return e:GetOwner()==c -end \ No newline at end of file +end diff --git a/official/c31786629.lua b/official/c31786629.lua index 8f907ac25b..2eb3f889da 100644 --- a/official/c31786629.lua +++ b/official/c31786629.lua @@ -2,30 +2,30 @@ --Thunder Dragon local s,id=GetID() function s.initial_effect(c) - --search + --Add up to 2 "Thunder Dragon" from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCost(Cost.SelfDiscard) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_THUNDRA) + e1:SetTarget(s.thtg) + e1:SetOperation(s.thop) + c:RegisterEffect(e1) end s.listed_names={id} -function s.filter(c) +function s.thfilter(c) return c:IsCode(id) and c:IsAbleToHand() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + 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 -function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) +function s.thop(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,2,nil) + local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,2,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c31801517.lua b/official/c31801517.lua index cfeb76a5e2..2d71199a62 100644 --- a/official/c31801517.lua +++ b/official/c31801517.lua @@ -1,99 +1,87 @@ ---No.62 銀河眼の光子竜皇 +--No.62 銀河眼の光子竜皇 --Number 62: Galaxy-Eyes Prime Photon Dragon local s,id=GetID() function s.initial_effect(c) - --Xyz summon - Xyz.AddProcedure(c,nil,8,2) c:EnableReviveLimit() - --Increase ATK + --Xyz Summon procedure: 2 Level 8 monsters + Xyz.AddProcedure(c,nil,8,2) + --This card gains ATK equal to the combined Ranks of all Xyz Monsters currently on the field x 200 local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e1:SetRange(LOCATION_MZONE) - e1:SetCondition(s.atkcon) - e1:SetCost(s.atkcost) + e1:SetCondition(function(e) return e:GetHandler():IsRelateToBattle() end) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),Cost.SoftOncePerBattle(id))) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --Special summon + c:RegisterEffect(e1) + --Special Summon this card during your 2nd Standby Phase after activation and double its ATK local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_DESTROYED) e2:SetCondition(s.spcon) + e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) - --Halve damage + --Any battle damage this card inflicts to your opponent is halved unless it has "Galaxy-Eyes Photon Dragon" as material local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) - e3:SetCondition(s.rdcon) + e3:SetCondition(function(e) return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,CARD_GALAXYEYES_P_DRAGON) end) e3:SetValue(aux.ChangeBattleDamage(1,HALF_DAMAGE)) c:RegisterEffect(e3) end -s.listed_names={CARD_GALAXYEYES_P_DRAGON} s.xyz_number=62 -function s.atkcon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return c==Duel.GetAttacker() or c==Duel.GetAttackTarget() -end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(id)==0 end - c:RemoveOverlayCard(tp,1,1,REASON_COST) - c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE_CAL,0,1) -end +s.listed_names={CARD_GALAXYEYES_P_DRAGON} function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then - local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil) - local val=g:GetSum(Card.GetRank)*200 - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(val) - e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE_CAL) - c:RegisterEffect(e1) + local rks=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil):GetSum(Card.GetRank) + if rks>0 then + --This card gains ATK equal to the combined Ranks of all Xyz Monsters currently on the field x 200, during that damage calculation only + c:UpdateAttack(rks*200,RESET_EVENT|RESETS_STANDARD_DISABLE|RESET_PHASE|PHASE_DAMAGE_CAL) + end end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:IsPreviousControler(tp) and rp~=tp and c:IsReason(REASON_EFFECT) - and c:IsPreviousLocation(LOCATION_MZONE) and c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,CARD_GALAXYEYES_P_DRAGON) - and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + return c:IsPreviousControler(tp) and rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) + and c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,CARD_GALAXYEYES_P_DRAGON) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e1:SetRange(LOCATION_REMOVED|LOCATION_GRAVE) - e1:SetCode(EVENT_PHASE|PHASE_STANDBY) - if Duel.IsPhase(PHASE_STANDBY) and Duel.IsTurnPlayer(tp) then - e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,3) - else - e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,2) + if c:IsRelateToEffect(e) then + c:SetTurnCounter(0) + local turn_count=Duel.GetTurnCount() + local reset_count=(Duel.IsPhase(PHASE_STANDBY) and Duel.IsTurnPlayer(tp)) and 3 or 2 + --Special Summon this card during your 2nd Standby Phase after activation + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e1:SetCode(EVENT_PHASE+PHASE_STANDBY) + e1:SetRange(c:GetLocation()) + e1:SetCountLimit(1) + e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) and (reset_count==2 or Duel.GetTurnCount()~=turn_count) end) + e1:SetOperation(s.standbyspop) + e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,reset_count) + c:RegisterEffect(e1) end - e1:SetCountLimit(1) - e1:SetCondition(s.spcon2) - e1:SetOperation(s.spop2) - c:RegisterEffect(e1) - c:SetTurnCounter(0) -end -function s.spcon2(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(tp) end -function s.spop2(e,tp,eg,ep,ev,re,r,rp) +function s.standbyspop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - local ct=c:GetTurnCounter() - ct=ct+1 + local ct=c:GetTurnCounter()+1 c:SetTurnCounter(ct) - if ct==2 then - Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) + if ct==2 and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then + --Double its ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetCode(EFFECT_SET_ATTACK) e1:SetValue(c:GetAttack()*2) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) @@ -101,6 +89,3 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) end Duel.SpecialSummonComplete() end -function s.rdcon(e) - return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,CARD_GALAXYEYES_P_DRAGON) -end \ No newline at end of file diff --git a/official/c32003338.lua b/official/c32003338.lua index cc6a20b7ca..1f81971941 100644 --- a/official/c32003338.lua +++ b/official/c32003338.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=34 function s.filter(c) @@ -34,4 +34,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.GetControl(tc,tp,PHASE_END,1) end -end \ No newline at end of file +end diff --git a/official/c32224143.lua b/official/c32224143.lua index ffcf830219..76cb0ed5f7 100644 --- a/official/c32224143.lua +++ b/official/c32224143.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --cannot be battle target local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -84,4 +84,4 @@ function s.disop(e,tp) end function s.atkcon(e) return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) -end \ No newline at end of file +end diff --git a/official/c32302078.lua b/official/c32302078.lua index 839a889263..ab5e0d2f7e 100644 --- a/official/c32302078.lua +++ b/official/c32302078.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Special Summon 1 monster from your opponent's GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -37,10 +37,10 @@ function s.initial_effect(c) e3:SetCode(EVENT_CUSTOM+id) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) local g=Group.CreateGroup() g:KeepAlive() e3:SetLabelObject(g) diff --git a/official/c32446630.lua b/official/c32446630.lua index 246f427e3a..fbf165a36d 100644 --- a/official/c32446630.lua +++ b/official/c32446630.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.condition) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=43 s.listed_names={56051086,32446631} @@ -53,4 +53,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e2:SetCode(EFFECT_SET_DEFENSE) token:RegisterEffect(e2) Duel.SpecialSummonComplete() -end \ No newline at end of file +end diff --git a/official/c32530043.lua b/official/c32530043.lua index 298dd48398..0f94691a57 100644 --- a/official/c32530043.lua +++ b/official/c32530043.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.thfilter(c) return c:IsRace(RACE_ROCK) and c:IsAbleToHand() @@ -60,4 +60,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmCards(1-tp,g) end end -end \ No newline at end of file +end diff --git a/official/c32559361.lua b/official/c32559361.lua index 093d22323f..1b97333e67 100644 --- a/official/c32559361.lua +++ b/official/c32559361.lua @@ -1,85 +1,76 @@ ---CNo.9 天蓋妖星カオス・ダイソン・スフィア +--CNo.9 天蓋妖星カオス・ダイソン・スフィア --Number C9: Chaos Dyson Sphere local s,id=GetID() function s.initial_effect(c) - --Xyz Summon - Xyz.AddProcedure(c,nil,10,3) c:EnableReviveLimit() - --Attach battled monster as material + --Xyz Summon procedure: 3 Level 10 monsters + Xyz.AddProcedure(c,nil,10,3) + --Attach an opponent's monster this card battles to this card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_START) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) + e1:SetTarget(s.attachtg) + e1:SetOperation(s.attachop) c:RegisterEffect(e1) - --Burn 300 for each material + --Inflict 300 damage to your opponent for each material attached to this card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetTarget(s.damtg) - e2:SetOperation(s.damop) + e2:SetTarget(s.dam300tg) + e2:SetOperation(s.dam300op) c:RegisterEffect(e2) - --Burn 800 for each detached material + --Inflict 800 damage to your opponent for each material detached local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_DAMAGE) e3:SetType(EFFECT_TYPE_IGNITION) - e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCondition(s.damcon) - e3:SetCost(Cost.Detach(1,s.mxmc,s.slwc)) - e3:SetTarget(s.damtg2) - e3:SetOperation(s.damop2) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + e3:SetCondition(function(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,1992816) end) + e3:SetCost(Cost.DetachFromSelf(1,function(e) return e:GetHandler():GetOverlayCount() end,function(e,og) e:SetLabel(#og) end)) + e3:SetTarget(s.dam800tg) + e3:SetOperation(s.dam800op) + c:RegisterEffect(e3) end s.xyz_number=9 -s.listed_names={1992816} -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local tc=c:GetBattleTarget() - if chk==0 then return tc and c:IsType(TYPE_XYZ) and not tc:IsType(TYPE_TOKEN) and tc:IsAbleToChangeControler() end +s.listed_names={1992816} --"Number 9: Dyson Sphere" +function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then + local c=e:GetHandler() + local bc=c:GetBattleTarget() + return bc and bc:IsControler(1-tp) and bc:IsCanBeXyzMaterial(c,tp,REASON_EFFECT) + end end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.attachop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - local tc=c:GetBattleTarget() - if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToBattle() and not tc:IsImmuneToEffect(e) then - Duel.Overlay(c,tc,true) + local bc=c:GetBattleTarget() + if c:IsRelateToEffect(e) and bc:IsRelateToBattle() and not bc:IsImmuneToEffect(e) then + Duel.Overlay(c,bc,true) end end -function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.dam300tg(e,tp,eg,ep,ev,re,r,rp,chk) local ct=e:GetHandler():GetOverlayCount() if chk==0 then return ct>0 end Duel.SetTargetPlayer(1-tp) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*300) end -function s.damop(e,tp,eg,ep,ev,re,r,rp) +function s.dam300op(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=e:GetHandler():GetOverlayCount() Duel.Damage(p,ct*300,REASON_EFFECT) end -function s.damcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,1992816) -end -function s.mxmc(e,tp) - return e:GetHandler():GetOverlayCount() -end -function s.slwc(e,og) - e:SetLabel(#og) -end -function s.damtg2(e,tp,eg,ep,ev,re,r,rp,chk) +function s.dam800tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ct=e:GetLabel() Duel.SetTargetPlayer(1-tp) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*800) end -function s.damop2(e,tp,eg,ep,ev,re,r,rp) +function s.dam800op(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=e:GetLabel() Duel.Damage(p,ct*800,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c3292267.lua b/official/c3292267.lua index 32323e3304..2c0142a789 100644 --- a/official/c3292267.lua +++ b/official/c3292267.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.discon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.tfilter(c,tp) return (c:IsOnField() or c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED)) and c:IsControler(tp) @@ -40,4 +40,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c33776843.lua b/official/c33776843.lua index 554f5e5a18..0d8a857b9c 100644 --- a/official/c33776843.lua +++ b/official/c33776843.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=15 function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) @@ -33,4 +33,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if atk<0 then atk=0 end Duel.Damage(1-tp,atk,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c33779875.lua b/official/c33779875.lua index de7802b76c..eca86736cb 100644 --- a/official/c33779875.lua +++ b/official/c33779875.lua @@ -15,16 +15,16 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetCondition(s.igncon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.trtg) e1:SetOperation(s.trop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) local e2=e1:Clone() e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e2:SetCondition(s.quickcon) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Increase ATK when a monster is tributed local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -69,4 +69,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) e1:SetValue(200*ct) c:RegisterEffect(e1) -end \ No newline at end of file +end diff --git a/official/c33909817.lua b/official/c33909817.lua index 60c03f4054..96d5e1041c 100644 --- a/official/c33909817.lua +++ b/official/c33909817.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special Summon 1 "Sylvan" monster from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -73,4 +73,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c34086406.lua b/official/c34086406.lua index e17e0c27e4..0a5798c538 100644 --- a/official/c34086406.lua +++ b/official/c34086406.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local b1=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil) @@ -54,4 +54,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmDecktop(tp,1) end end -end \ No newline at end of file +end diff --git a/official/c34481518.lua b/official/c34481518.lua index e25187aadf..3e4c1567a2 100644 --- a/official/c34481518.lua +++ b/official/c34481518.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.damcon) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destroy 1 card on the field local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -82,4 +82,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.Damage(1-tp,1000,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c34876719.lua b/official/c34876719.lua index 61c59bff9c..e484703f7c 100644 --- a/official/c34876719.lua +++ b/official/c34876719.lua @@ -23,7 +23,7 @@ function s.initial_effect(c) e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) e2:SetCountLimit(1,id) e2:SetCondition(s.attcon) - e2:SetCost(Cost.Detach(2,2,nil)) + e2:SetCost(Cost.DetachFromSelf(2,2,nil)) e2:SetTarget(s.atttg) e2:SetOperation(s.attop) c:RegisterEffect(e2) @@ -63,4 +63,4 @@ function s.attop(e,tp,eg,ep,ev,re,r,rp) Duel.BreakEffect() Duel.Overlay(c,tc,true) end -end \ No newline at end of file +end diff --git a/official/c34909328.lua b/official/c34909328.lua index 32da3cb088..770ff76e80 100644 --- a/official/c34909328.lua +++ b/official/c34909328.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Attach 1 monster from your GY to this card as material local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/official/c34945480.lua b/official/c34945480.lua index 0c1cff9f54..bb16a8697d 100644 --- a/official/c34945480.lua +++ b/official/c34945480.lua @@ -26,10 +26,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.condition) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_OUTER_ENTITY} function s.ovfilter(c,tp,xyzc) @@ -70,4 +70,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c35103106.lua b/official/c35103106.lua index 5dd13fdedf..7dbd20a7ac 100644 --- a/official/c35103106.lua +++ b/official/c35103106.lua @@ -4,18 +4,18 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon Procedure + --Xyz Summon procedure: 2 Level 6 monsters Xyz.AddProcedure(c,nil,6,2) - --Cannot be targeted by opponent's monsters effects while it has material + --While this card has material, your opponent cannot target it with monster effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>0 end) e1:SetValue(function(e,re,rp) return rp==1-e:GetHandlerPlayer() and re:IsMonsterEffect() end) c:RegisterEffect(e1) - --Negate the effects of 1 face-up card your opponent controls + --Negate the effects of 1 face-up card your opponent controls until the end of this turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DISABLE) @@ -23,46 +23,27 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) - e2:SetCondition(function(_,tp,_,_,_,_,_,rp) return rp==1-tp end) - e2:SetCost(s.negcost) - e2:SetTarget(s.negtg) - e2:SetOperation(s.negop) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp end) + e2:SetCost(Cost.DetachFromSelf(s.discostmin,2)) + e2:SetTarget(s.distg) + e2:SetOperation(s.disop) c:RegisterEffect(e2) end -function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local g=c:GetOverlayGroup() - local ct=#g==g:FilterCount(Card.IsRace,nil,RACE_REPTILE|RACE_DINOSAUR) and 1 or 2 - if chk==0 then return c:CheckRemoveOverlayCard(tp,ct,REASON_COST) end - c:RemoveOverlayCard(tp,ct,2,REASON_COST) +function s.discostmin(e,tp,eg,ep,ev,re,r,rp,chk) + local g=e:GetHandler():GetOverlayGroup() + return #g==g:FilterCount(Card.IsRace,nil,RACE_REPTILE|RACE_DINOSAUR) and 1 or 2 end -function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsNegatable() end if chk==0 then return Duel.IsExistingTarget(Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) local g=Duel.SelectTarget(tp,Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,tp,0) end -function s.negop(e,tp,eg,ep,ev,re,r,rp) +function s.disop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsCanBeDisabledByEffect(e) then - Duel.NegateRelatedChain(tc,RESET_TURN_SET) - local c=e:GetHandler() - --Negate its effects - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e1:SetCode(EFFECT_DISABLE) - e1:SetReset(RESETS_STANDARD_PHASE_END) - tc:RegisterEffect(e1) - local e2=e1:Clone() - e2:SetCode(EFFECT_DISABLE_EFFECT) - e2:SetValue(RESET_TURN_SET) - tc:RegisterEffect(e2) - if tc:IsType(TYPE_TRAPMONSTER) then - local e3=e1:Clone() - e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) - tc:RegisterEffect(e3) - end + if tc:IsRelateToEffect(e) and tc:IsFaceup() then + --Negate its effects until the end of this turn + tc:NegateEffects(e:GetHandler(),RESET_PHASE|PHASE_END,true) end -end \ No newline at end of file +end diff --git a/official/c35772782.lua b/official/c35772782.lua index 7da78fd84e..91ab408001 100644 --- a/official/c35772782.lua +++ b/official/c35772782.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) @@ -92,4 +92,4 @@ function s.diceop(e,tp,eg,ep,ev,re,r,rp) s[0]=cid e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end -end \ No newline at end of file +end diff --git a/official/c3594985.lua b/official/c3594985.lua index 9efbedfeee..7baff145ac 100644 --- a/official/c3594985.lua +++ b/official/c3594985.lua @@ -28,10 +28,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(2,{id,1}) e2:SetCondition(s.spcon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Place this card in the Pendulum Zone local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -111,4 +111,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 \ No newline at end of file +end diff --git a/official/c359563.lua b/official/c359563.lua index 630039081a..cb9a9cbe40 100644 --- a/official/c359563.lua +++ b/official/c359563.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsFaceup() and c:IsCanTurnSet() and c:IsSummonPlayer(1-tp) and (not e or c:IsRelateToEffect(e)) @@ -28,4 +28,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=eg:Filter(s.filter,nil,e,tp) Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) -end \ No newline at end of file +end diff --git a/official/c36076683.lua b/official/c36076683.lua index 298a89fa2d..6a02b806d2 100644 --- a/official/c36076683.lua +++ b/official/c36076683.lua @@ -16,9 +16,9 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(aux.StatChangeDamageStepCondition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=73 function s.atkop(e,tp,eg,ep,ev,re,r,rp) @@ -37,4 +37,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) c:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c36757171.lua b/official/c36757171.lua index 8aeb04f5cf..7f7fe57a2d 100644 --- a/official/c36757171.lua +++ b/official/c36757171.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_LSWARM} function s.filter(c) @@ -43,4 +43,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.GetControl(tc,tp) end -end \ No newline at end of file +end diff --git a/official/c36776089.lua b/official/c36776089.lua index 9da006987f..a1f1220562 100644 --- a/official/c36776089.lua +++ b/official/c36776089.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetCondition(s.retcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.rettg) e2:SetOperation(s.retop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.incon(e) return e:GetHandler():GetOverlayCount()>0 @@ -43,4 +43,4 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp) if bc:IsRelateToBattle() then Duel.SendtoHand(bc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c3685372.lua b/official/c3685372.lua index 37d95797b7..e934ebed6f 100644 --- a/official/c3685372.lua +++ b/official/c3685372.lua @@ -24,7 +24,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) @@ -132,4 +132,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and tc:GetBaseAttack()>0 then Duel.Damage(1-tp,tc:GetBaseAttack()//2,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c37057743.lua b/official/c37057743.lua index 19a3053149..e648c48d00 100644 --- a/official/c37057743.lua +++ b/official/c37057743.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToHand() @@ -47,4 +47,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) end function s.sumlimit(e,c) return c:IsCode(e:GetLabel()) -end \ No newline at end of file +end diff --git a/official/c37164373.lua b/official/c37164373.lua index 77c6bddefd..76f045a10f 100644 --- a/official/c37164373.lua +++ b/official/c37164373.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_MADOLCHE} function s.filter(c) @@ -41,4 +41,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(rg) Duel.SendtoDeck(rg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c37279508.lua b/official/c37279508.lua index 5cbf3ee6a4..65ea4ae3ba 100644 --- a/official/c37279508.lua +++ b/official/c37279508.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -66,4 +66,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c3743515.lua b/official/c3743515.lua index f20a667381..5cfb658385 100644 --- a/official/c3743515.lua +++ b/official/c3743515.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destroy this card, and if you do, your Dinosaur monster battling gains 2000 ATK until the end of the Battle Phase local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -83,4 +83,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE) bc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c3758046.lua b/official/c3758046.lua index 056a2ba8d4..08af1c94e5 100644 --- a/official/c3758046.lua +++ b/official/c3758046.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(function() return Duel.IsAbleToEnterBP() or Duel.IsBattlePhase() end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.regtg) e1:SetOperation(s.regop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Search 1 "Dark Contract" card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -94,4 +94,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c37649320.lua b/official/c37649320.lua index 9152113399..c5ddc2543a 100644 --- a/official/c37649320.lua +++ b/official/c37649320.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.thcon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --"Paleozoic" Trap cards can be activated from the hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -56,4 +56,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c3790062.lua b/official/c3790062.lua index 8bd75a1073..8fdff176f0 100644 --- a/official/c3790062.lua +++ b/official/c3790062.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=65 function s.condition(e,tp,eg,ep,ev,re,r,rp,chk) @@ -33,4 +33,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) then Duel.Damage(1-tp,500,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c37926346.lua b/official/c37926346.lua index 3cbadb2268..3f5ff4fc2d 100644 --- a/official/c37926346.lua +++ b/official/c37926346.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_SPSUMMON) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsLevelAbove(5) @@ -34,4 +34,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) local g=eg:Filter(s.filter,nil) Duel.NegateSummon(g) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c38026562.lua b/official/c38026562.lua index 8b3046c580..7c57a72948 100644 --- a/official/c38026562.lua +++ b/official/c38026562.lua @@ -44,10 +44,10 @@ function s.initial_effect(c) e4:SetCode(EVENT_SUMMON_SUCCESS) e4:SetRange(LOCATION_MZONE) e4:SetCondition(s.tgcon) - e4:SetCost(Cost.Detach(1,1,nil)) + e4:SetCost(Cost.DetachFromSelf(1,1,nil)) e4:SetTarget(s.tgtg) e4:SetOperation(s.tgop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end function s.spfilter(c,e,tp) return c:IsType(TYPE_GEMINI) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) @@ -87,4 +87,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(sg,true) Duel.SendtoGrave(sg,REASON_RULE,PLAYER_NONE,1-tp) end -end \ No newline at end of file +end diff --git a/official/c3814632.lua b/official/c3814632.lua index 8f30232ec7..af2506f56e 100644 --- a/official/c3814632.lua +++ b/official/c3814632.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.AND(Cost.Detach(1),s.descost)) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.descost)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() @@ -43,4 +43,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.Damage(1-tp,1000,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c38180759.lua b/official/c38180759.lua index cf05487765..129e162242 100644 --- a/official/c38180759.lua +++ b/official/c38180759.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END) e1:SetCountLimit(1) e1:SetCondition(s.atkcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) and (Duel.IsMainPhase()) @@ -46,4 +46,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e2) end end -end \ No newline at end of file +end diff --git a/official/c38250531.lua b/official/c38250531.lua index edc310c185..185f353f37 100644 --- a/official/c38250531.lua +++ b/official/c38250531.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) @@ -83,4 +83,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP_DEFENSE) end -end \ No newline at end of file +end diff --git a/official/c38273745.lua b/official/c38273745.lua index 3fe824917b..d8c99ff773 100644 --- a/official/c38273745.lua +++ b/official/c38273745.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then @@ -83,4 +83,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c3828844.lua b/official/c3828844.lua index 0ababe2d6a..a6c1032b81 100644 --- a/official/c3828844.lua +++ b/official/c3828844.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --If tributed, special summon 1 rank 5+ plant Xyz from extra deck or GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -84,4 +84,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.BreakEffect() Duel.Overlay(g:GetFirst(),c) end -end \ No newline at end of file +end diff --git a/official/c38495396.lua b/official/c38495396.lua index dba354471e..e902b82a55 100644 --- a/official/c38495396.lua +++ b/official/c38495396.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_CONSTELLAR} function s.ovfilter(c,tp,xyzc) @@ -43,4 +43,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c38667773.lua b/official/c38667773.lua index 262ec89bc0..8915d95d87 100644 --- a/official/c38667773.lua +++ b/official/c38667773.lua @@ -2,38 +2,38 @@ --Satellarknight Vega local s,id=GetID() function s.initial_effect(c) - --Special Summon 1 "tellarknight" monster from the hand - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetTarget(s.sptg) - e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Special Summon 1 "tellarknight" monster from your hand, except "Satellarknight Vega" + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.sptg) + e1a:SetOperation(s.spop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) end s.listed_series={SET_TELLARKNIGHT} s.listed_names={id} -function s.filter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsSetCard(SET_TELLARKNIGHT) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end 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.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(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,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end diff --git a/official/c38694052.lua b/official/c38694052.lua index 823e8b6256..0112d08004 100644 --- a/official/c38694052.lua +++ b/official/c38694052.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) e1:SetCondition(function(e) return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_DRAGON) end) - e1:SetCost(Cost.AND(Cost.Detach(2),s.descost)) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(2),s.descost)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --This is a Quick Effect if this card has a Dragon monster as material local e2=e1:Clone() e2:SetType(EFFECT_TYPE_QUICK_O) diff --git a/official/c39030163.lua b/official/c39030163.lua index af734cd88e..3e5e118415 100644 --- a/official/c39030163.lua +++ b/official/c39030163.lua @@ -1,75 +1,69 @@ ---ギャラクシーアイズ FA・フォトン・ドラゴン +--ギャラクシーアイズ FA・フォトン・ドラゴン --Galaxy-Eyes Full Armor Photon Dragon local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,8,3,s.ovfilter,aux.Stringid(id,0)) c:EnableReviveLimit() - --attach material + --Xyz Summon procedure: 3 Level 8 monsters OR 1 "Galaxy-Eyes" Xyz Monster you control, except "Galaxy-Eyes Full Armor Photon Dragon" + Xyz.AddProcedure(c,nil,8,3,s.ovfilter,aux.Stringid(id,0)) + --Attach up to 2 Equip Cards equipped to this card to this card as material local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.mtcost) - e1:SetTarget(s.mttg) - e1:SetOperation(s.mtop) + e1:SetCost(Cost.HintSelectedEffect) + e1:SetTarget(s.attachtg) + e1:SetOperation(s.attachop) c:RegisterEffect(e1) - --destroy + --Destroy 1 face-up card your opponent controls local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(s.descost) + e2:SetCost(Cost.AND(Cost.DetachFromSelf(1),Cost.HintSelectedEffect)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end +s.listed_names={id} +s.listed_series={SET_GALAXY_EYES} function s.ovfilter(c,tp,xyzc) - return c:IsFaceup() and c:IsSetCard(SET_GALAXY_EYES,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) and not c:IsSummonCode(xyzc,SUMMON_TYPE_XYZ,tp,id) + return c:IsSetCard(SET_GALAXY_EYES,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) and not c:IsSummonCode(xyzc,SUMMON_TYPE_XYZ,tp,id) and c:IsFaceup() end -function s.mtcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) +function s.attachfilter(c,xyzc,e,tp) + return c:IsCanBeXyzMaterial(xyzc,tp,REASON_EFFECT) and c:IsCanBeEffectTarget(e) end -function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local g=e:GetHandler():GetEquipGroup() - if chkc then return g:IsContains(chkc) and chkc:IsCanBeEffectTarget(e) end - if chk==0 then return g:IsExists(Card.IsCanBeEffectTarget,1,nil,e) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) - local tg=g:FilterSelect(tp,Card.IsCanBeEffectTarget,1,2,nil,e) +function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local c=e:GetHandler() + local eqg=c:GetEquipGroup() + if chkc then return eqg:IsContains(chkc) and s.attachfilter(chkc,c,e,tp) end + if chk==0 then return eqg:IsExists(s.attachfilter,1,nil,c,e,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + local tg=eqg:FilterSelect(tp,s.attachfilter,1,2,nil,c,e,tp) Duel.SetTargetCard(tg) end -function s.mtfilter(c,e) - return c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) -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) or c:IsFacedown() then return end - local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(s.mtfilter,nil,e) - if #g>0 then - Duel.Overlay(c,g) + if not c:IsRelateToEffect(e) then return end + local tg=Duel.GetTargetCards(e):Match(aux.NOT(Card.IsImmuneToEffect),nil,e) + if #tg>0 then + Duel.Overlay(c,tg) end end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) -end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsFaceup() end + if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c39139935.lua b/official/c39139935.lua index 7288040bff..0be571154b 100644 --- a/official/c39139935.lua +++ b/official/c39139935.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=33 function s.filter(c) @@ -51,4 +51,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end end end -end \ No newline at end of file +end diff --git a/official/c39272762.lua b/official/c39272762.lua index 548dfb970e..f78cca4962 100644 --- a/official/c39272762.lua +++ b/official/c39272762.lua @@ -26,10 +26,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.attg) e3:SetOperation(s.atop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_names={CARD_GALAXYEYES_P_DRAGON} function s.valcheck(e,c) @@ -90,4 +90,4 @@ function s.atop(e,tp,eg,ep,ev,re,r,rp) e2:SetValue(#g-1) e2:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e2) -end \ No newline at end of file +end diff --git a/official/c39622156.lua b/official/c39622156.lua index f25efdb504..09670939f8 100644 --- a/official/c39622156.lua +++ b/official/c39622156.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetCode(EVENT_PHASE|PHASE_BATTLE_START) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetTarget(Cost.Detach(1)) + e1:SetTarget(Cost.DetachFromSelf(1)) e1:SetOperation(s.btop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --control local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -101,4 +101,4 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp) if tc then Duel.GetControl(tc,1-p) end -end \ No newline at end of file +end diff --git a/official/c3989465.lua b/official/c3989465.lua index 0be940681e..8d59d455ba 100644 --- a/official/c3989465.lua +++ b/official/c3989465.lua @@ -2,42 +2,30 @@ --Lavalval Ignis local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,3,2) c:EnableReviveLimit() - --attack up + --Xyz Summon procedure: 2 Level 3 monsters + Xyz.AddProcedure(c,nil,3,2) + --Make this card gain 500 ATK until the end of this turn local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetRange(LOCATION_MZONE) - e1:SetCondition(s.condition) - e1:SetCost(s.cost) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - local ph=Duel.GetCurrentPhase() - local c=e:GetHandler() - return ph==PHASE_DAMAGE and (c==Duel.GetAttacker() or c==Duel.GetAttackTarget()) - and not Duel.IsDamageCalculated() + e1:SetHintTiming(TIMING_DAMAGE_STEP) + e1:SetCondition(s.atkcon) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),Cost.SoftOncePerBattle(id))) + e1:SetOperation(s.atkop) + c:RegisterEffect(e1) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():GetFlagEffect(id)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - e:GetHandler():RegisterFlagEffect(id,RESET_PHASE|PHASE_DAMAGE,0,1) +function s.atkcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsRelateToBattle() and Duel.IsPhase(PHASE_DAMAGE) and aux.StatChangeDamageStepCondition() end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - if c:IsFaceup() and c:IsRelateToEffect(e) then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(500) - e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) - c:RegisterEffect(e1) + if c:IsRelateToEffect(e) and c:IsFaceup() then + --This card gains 500 ATK until the end of this turn + c:UpdateAttack(500,RESETS_STANDARD_DISABLE_PHASE_END) end -end \ No newline at end of file +end diff --git a/official/c39943352.lua b/official/c39943352.lua index 52db0eb866..29f16566b5 100644 --- a/official/c39943352.lua +++ b/official/c39943352.lua @@ -24,7 +24,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(Cost.Detach(1,1)) + e2:SetCost(Cost.DetachFromSelf(1,1)) e2:SetTarget(s.pltg) e2:SetOperation(s.plop) c:RegisterEffect(e2) @@ -91,4 +91,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 \ No newline at end of file +end diff --git a/official/c39972129.lua b/official/c39972129.lua index 00717690d7..e4faa5adbc 100644 --- a/official/c39972129.lua +++ b/official/c39972129.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Cannot be destroyed by battle or effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -56,4 +56,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end function s.indcon(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_BEAST),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) -end \ No newline at end of file +end diff --git a/official/c39987164.lua b/official/c39987164.lua index 9dd26ec2d4..e2dfb22079 100644 --- a/official/c39987164.lua +++ b/official/c39987164.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) aux.AddEREquipLimit(c,nil,s.eqval,s.equipop,e1) --destroy local e2=Effect.CreateEffect(c) @@ -76,4 +76,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if dt:IsRelateToBattle() then Duel.Destroy(dt,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c40143123.lua b/official/c40143123.lua index 45b433b416..d19a2eba99 100644 --- a/official/c40143123.lua +++ b/official/c40143123.lua @@ -2,7 +2,7 @@ --Constellar Virgo local s,id=GetID() function s.initial_effect(c) - --Special Summon 1 Level 5 "Constellar" monster from the hand + --Special Summon 1 Level 5 "Constellar" monster from your hand in face-up Defense Position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -10,22 +10,22 @@ function s.initial_effect(c) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) + c:RegisterEffect(e1) end s.listed_series={SET_CONSTELLAR} -function s.filter(c,e,tp) - return c:IsSetCard(SET_CONSTELLAR) and c:IsLevel(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) +function s.spfilter(c,e,tp) + return c:IsLevel(5) and c:IsSetCard(SET_CONSTELLAR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) --Excluding itself for a proper interaction with "Tellarknight Constellar Caduceus" [58858807] if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(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,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end diff --git a/official/c4019153.lua b/official/c4019153.lua index cd8ceb3d08..56974b7a1e 100644 --- a/official/c4019153.lua +++ b/official/c4019153.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.condition) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMERON} s.xyz_number=4 @@ -44,4 +44,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END,1) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c40390147.lua b/official/c40390147.lua index 2dcc024235..cbce291b13 100644 --- a/official/c40390147.lua +++ b/official/c40390147.lua @@ -2,55 +2,45 @@ --Starliege Lord Galaxion local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_PHOTON),4,2) c:EnableReviveLimit() - --spsummon + --Xyz Summon procedure: 2 Level 4 "Photon" monsters + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_PHOTON),4,2) + --Special Summon 1 "Galaxy-Eyes Photon Dragon" 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_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.sptg) + e1:SetCost(Cost.Choice( + {Cost.DetachFromSelf(1),aux.Stringid(id,1),s.spcheck(LOCATION_HAND)}, + {Cost.DetachFromSelf(2),aux.Stringid(id,2),s.spcheck(LOCATION_DECK)} + )) + e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_PHOTON} s.listed_names={CARD_GALAXYEYES_P_DRAGON} function s.spfilter(c,e,tp) return c:IsCode(CARD_GALAXYEYES_P_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) - local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - local b2=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) - if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and (b1 or b2) end - local opt=0 - if b1 and b2 then - opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2)) - elseif b1 then - opt=Duel.SelectOption(tp,aux.Stringid(id,1)) - else - opt=Duel.SelectOption(tp,aux.Stringid(id,2))+1 - end - e:SetLabel(opt) - e:GetHandler():RemoveOverlayCard(tp,opt+1,opt+1,REASON_COST) - if opt==0 then - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) - else - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) +function s.spcheck(loc) + return function(e,tp) + return Duel.IsExistingMatchingCard(s.spfilter,tp,loc,0,1,nil,e,tp) end end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end + local loc=e:GetLabel()==1 and LOCATION_HAND or LOCATION_DECK + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc) +end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - local tc=nil - if e:GetLabel()==0 then - tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp) - else - tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) + local loc=e:GetLabel()==1 and LOCATION_HAND or LOCATION_DECK + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,loc,0,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end - if tc then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) - end -end \ No newline at end of file +end diff --git a/official/c40424929.lua b/official/c40424929.lua index 5f9c3d4f8d..cf6ef39fdd 100644 --- a/official/c40424929.lua +++ b/official/c40424929.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end @@ -27,4 +27,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=Duel.GetFieldGroupCount(p,LOCATION_HAND,0) Duel.Damage(p,ct*200,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c40673853.lua b/official/c40673853.lua index aadeb81009..437728aa48 100644 --- a/official/c40673853.lua +++ b/official/c40673853.lua @@ -17,10 +17,10 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) e1:SetCondition(function() return Duel.IsMainPhase() end) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.postg) e1:SetOperation(s.posop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destroy 1 face-down card on the field local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -58,4 +58,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c40706444.lua b/official/c40706444.lua index 9fcffb7452..9a7dc7fd76 100644 --- a/official/c40706444.lua +++ b/official/c40706444.lua @@ -26,7 +26,7 @@ function s.initial_effect(c) e2:SetCode(EVENT_PHASE+PHASE_STANDBY) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(Cost.Detach(2)) + e2:SetCost(Cost.DetachFromSelf(2)) e2:SetTarget(s.pltg) e2:SetOperation(s.plop) c:RegisterEffect(e2) @@ -74,4 +74,4 @@ function s.plop(e,tp,eg,ep,ev,re,r,rp) Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end end -end \ No newline at end of file +end diff --git a/official/c41147577.lua b/official/c41147577.lua index 5ea782c2e0..cf02cd6dd7 100644 --- a/official/c41147577.lua +++ b/official/c41147577.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e2:SetCountLimit(1) e2:SetCondition(s.poscon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.postg) e2:SetOperation(s.posop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_names={14152862} function s.efilter(e,te) @@ -58,4 +58,4 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c41269771.lua b/official/c41269771.lua index c150745133..fc3b48c2e9 100644 --- a/official/c41269771.lua +++ b/official/c41269771.lua @@ -2,7 +2,7 @@ --Constellar Algiedi local s,id=GetID() function s.initial_effect(c) - --Special Summon 1 Level 4 monster from the hand + --Special Summon 1 Level 4 "Constellar" monster from your hand in face-up Defense Position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -10,22 +10,22 @@ function s.initial_effect(c) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) + c:RegisterEffect(e1) end s.listed_series={SET_CONSTELLAR} -function s.filter(c,e,tp) - return c:IsSetCard(SET_CONSTELLAR) and c:IsLevel(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +function s.spfilter(c,e,tp) + return c:IsLevel(4) and c:IsSetCard(SET_CONSTELLAR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) --Excluding itself for a proper interaction with "Tellarknight Constellar Caduceus" [58858807] if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(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,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end diff --git a/official/c41309158.lua b/official/c41309158.lua index ad79374a70..b3045afc34 100644 --- a/official/c41309158.lua +++ b/official/c41309158.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCondition(s.damcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_names={15914410} function s.poscon(e,tp,eg,ep,ev,re,r,rp) @@ -55,4 +55,4 @@ end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c41375811.lua b/official/c41375811.lua index bd30960227..a34a75a26f 100644 --- a/official/c41375811.lua +++ b/official/c41375811.lua @@ -26,10 +26,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_ZOODIAC} function s.ovfilter(c,tp,lc) diff --git a/official/c41418852.lua b/official/c41418852.lua index d32298c8ec..93d411afcf 100644 --- a/official/c41418852.lua +++ b/official/c41418852.lua @@ -4,60 +4,75 @@ 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) + --This effect becomes the effect of 1 "Numeron" Normal Spell when that card is activated local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_ACTIVATE) - e1:SetCode(EVENT_FREE_CHAIN) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_FZONE) + e1:SetCountLimit(1,id) + e1:SetCost(s.applycost) + e1:SetTarget(s.applytg) + e1:SetOperation(s.applyop) c:RegisterEffect(e1) - --Copy spell + --"Numeron" Xyz Monsters you control can activate effects without detaching material(s) local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e2:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE) e2:SetRange(LOCATION_FZONE) - e2:SetCountLimit(1,id) - e2:SetCost(s.cpcost) - e2:SetTarget(s.cptg) - e2:SetOperation(s.cpop) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) + local rc=re:GetHandler() + return (r&REASON_COST)>0 and re:IsActivated() + and re:IsActiveType(TYPE_XYZ) and rc:IsSetCard(SET_NUMERON) + and ep==e:GetOwnerPlayer() and ev>=1 and rc:GetOverlayCount()>=ev-1 + end) + e2:SetOperation(function() Duel.Hint(HINT_CARD,0,id) return true end) c:RegisterEffect(e2) - --Make detaching cost optional for "Numeron" Xyz Monsters - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_FIELD) - e3:SetCode(id) - e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e3:SetRange(LOCATION_FZONE) - e3:SetTargetRange(1,0) - c:RegisterEffect(e3) end s.listed_series={SET_NUMERON} -function s.cpcost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) return true end -function s.filter(c) - return c:IsNormalSpell() and c:IsSetCard(SET_NUMERON) and c:IsAbleToGraveAsCost() +function s.applyfilter(c) + return c:IsSetCard(SET_NUMERON) and c:IsNormalSpell() and c:IsAbleToGraveAsCost() and c:CheckActivateEffect(false,true,false)~=nil end -function s.cptg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then if e:GetLabel()==0 then return false end e:SetLabel(0) - return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) + return Duel.IsExistingMatchingCard(s.applyfilter,tp,LOCATION_DECK,0,1,nil) end e:SetLabel(0) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) - local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true) - Duel.SendtoGrave(g,REASON_COST) + local sc=Duel.SelectMatchingCard(tp,s.applyfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() + local te,ceg,cep,cev,cre,cr,crp=sc:CheckActivateEffect(false,true,true) + Duel.SendtoGrave(sc,REASON_COST) + e:SetLabel(te:GetLabel()) + e:SetLabelObject(te:GetLabelObject()) e:SetProperty(te:GetProperty()) local tg=te:GetTarget() - if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end + if tg then + tg(e,tp,ceg,cep,cev,cre,cr,crp,1) + end + te:SetLabel(e:GetLabel()) te:SetLabelObject(e:GetLabelObject()) e:SetLabelObject(te) Duel.ClearOperationInfo(0) end -function s.cpop(e,tp,eg,ep,ev,re,r,rp) +function s.applyop(e,tp,eg,ep,ev,re,r,rp) local te=e:GetLabelObject() if not te then return end + e:SetLabel(te:GetLabel()) e:SetLabelObject(te:GetLabelObject()) local op=te:GetOperation() - if op then op(e,tp,eg,ep,ev,re,r,rp) end + if op then + op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) + end + e:SetLabel(0) + e:SetLabelObject(nil) end \ No newline at end of file diff --git a/official/c4145852.lua b/official/c4145852.lua index 15775d9192..9db3f0c669 100644 --- a/official/c4145852.lua +++ b/official/c4145852.lua @@ -20,7 +20,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) @@ -66,4 +66,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then Duel.SendtoGrave(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c41522092.lua b/official/c41522092.lua index f9936522b6..bc5620dfb7 100644 --- a/official/c41522092.lua +++ b/official/c41522092.lua @@ -43,10 +43,10 @@ function s.initial_effect(c) e5:SetRange(LOCATION_MZONE) e5:SetCountLimit(1) e5:SetCondition(s.ctcon) - e5:SetCost(Cost.Detach(1)) + e5:SetCost(Cost.DetachFromSelf(1)) e5:SetTarget(s.cttg) e5:SetOperation(s.ctop) - c:RegisterEffect(e5,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e5) end s.xyz_number=0 function s.xyzcheck(g,tp,xyz) @@ -83,4 +83,4 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) c:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c41524885.lua b/official/c41524885.lua index 251a3c38ee..071435088d 100644 --- a/official/c41524885.lua +++ b/official/c41524885.lua @@ -38,10 +38,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_EXOSISTER} function s.valcheck(e,c) @@ -84,4 +84,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c42160203.lua b/official/c42160203.lua index 101c2c2079..1e0ad66ace 100644 --- a/official/c42160203.lua +++ b/official/c42160203.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetCode(EVENT_BATTLE_CONFIRM) e1:SetCountLimit(1) e1:SetCondition(s.atkcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -87,4 +87,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end -end \ No newline at end of file +end diff --git a/official/c42230449.lua b/official/c42230449.lua index e0b2cfeb49..2bd710e86a 100644 --- a/official/c42230449.lua +++ b/official/c42230449.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.condition) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMERON} s.xyz_number=2 @@ -44,4 +44,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END,1) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c42391240.lua b/official/c42391240.lua index 210ce0c81b..6b6cacec72 100644 --- a/official/c42391240.lua +++ b/official/c42391240.lua @@ -2,35 +2,34 @@ --Constellar Antares local s,id=GetID() function s.initial_effect(c) - --Add 1 "Constellar" monster from the GY to the hand - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOHAND) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetTarget(s.thtg) - e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e2) + --Add 1 "Constellar" monster from your GY to your hand + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_TOHAND) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetTarget(s.thtg) + e1a:SetOperation(s.thop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1b) end s.listed_series={SET_CONSTELLAR} -function s.tgfilter(c) +function s.thfilter(c) return c:IsSetCard(SET_CONSTELLAR) and c:IsMonster() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tgfilter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_GRAVE,0,1,nil) end + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) + local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,tc) end end \ No newline at end of file diff --git a/official/c42421606.lua b/official/c42421606.lua index 5389f34871..834119ca67 100644 --- a/official/c42421606.lua +++ b/official/c42421606.lua @@ -17,10 +17,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.eftg) e2:SetOperation(s.efop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.roll_dice=true s.xyz_number=85 @@ -70,4 +70,4 @@ function s.efop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c42589641.lua b/official/c42589641.lua index ad3aa0d9fc..5268dd4ec6 100644 --- a/official/c42589641.lua +++ b/official/c42589641.lua @@ -37,10 +37,10 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.hdtg) e4:SetOperation(s.hdop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) --spsummon local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,2)) @@ -137,4 +137,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c42741437.lua b/official/c42741437.lua index 37c6c549fc..a7ad3ece06 100644 --- a/official/c42741437.lua +++ b/official/c42741437.lua @@ -41,10 +41,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_EXOSISTER} function s.valcheck(e,c) @@ -83,4 +83,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c42752141.lua b/official/c42752141.lua index e41196d70c..6e8f7ffd3d 100644 --- a/official/c42752141.lua +++ b/official/c42752141.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp,chk) return re~=e and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) @@ -35,4 +35,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c42822433.lua b/official/c42822433.lua index 817964ef22..dbb4a6dd2b 100644 --- a/official/c42822433.lua +++ b/official/c42822433.lua @@ -3,62 +3,61 @@ --Scripted by Satella local s,id=GetID() function s.initial_effect(c) - --Destroy cards on the field - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_DESTROY) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetCountLimit(1,id) - e1:SetTarget(s.destg) - e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + --Destroy cards on the field up to the number of LIGHT and DARK Xyz Monsters you control + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_DESTROY) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.destg) + e1a:SetOperation(s.desop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) + --Special Summon this card from your GY + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_SPSUMMON_SUCCESS) + e2:SetRange(LOCATION_GRAVE) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(s.spcon) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) - --Special Summon itself from the GY - local e4=Effect.CreateEffect(c) - e4:SetDescription(aux.Stringid(id,1)) - e4:SetCategory(CATEGORY_SPECIAL_SUMMON) - e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e4:SetProperty(EFFECT_FLAG_DELAY) - e4:SetCode(EVENT_SPSUMMON_SUCCESS) - e4:SetRange(LOCATION_GRAVE) - e4:SetCountLimit(1,{id,1}) - e4:SetCondition(s.spcon) - e4:SetTarget(s.sptg) - e4:SetOperation(s.spop) - c:RegisterEffect(e4) end -s.listed_series={SET_TELLARKNIGHT,SET_CONSTELLAR} +s.listed_series={SET_CONSTELLAR,SET_TELLARKNIGHT} s.listed_names={id} -function s.cfilter(c) - return c:IsType(TYPE_XYZ) and c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) +function s.ctfilter(c) + return c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) and c:IsType(TYPE_XYZ) and c:IsFaceup() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() end - if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) - and Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end - local ct=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,0,nil) + local ct=Duel.GetMatchingGroupCount(s.ctfilter,tp,LOCATION_MZONE,0,nil) + if chk==0 then return ct>0 and Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetTargetCards(e) - if #g>0 then - Duel.Destroy(g,REASON_EFFECT) + local tg=Duel.GetTargetCards(e) + if #tg>0 then + Duel.Destroy(tg,REASON_EFFECT) end end -function s.spcfilter(c,tp) - return c:IsFaceup() and c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsControler(tp) and not c:IsCode(id) +function s.spconfilter(c,tp) + return c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsControler(tp) and c:IsFaceup() and not c:IsCode(id) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.spcfilter,1,nil,tp) + return eg:IsExists(s.spconfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() @@ -71,14 +70,14 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end - --Cannot declare attack with non-Xyz monsters + aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,2),nil) + --You cannot declare attacks for the rest of this turn, except with Xyz Monsters local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e1:SetTargetRange(LOCATION_MZONE,0) - e1:SetTarget(function(_,c) return not c:IsType(TYPE_XYZ) end) + e1:SetTarget(function(e,c) return not c:IsType(TYPE_XYZ) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,2),nil) end \ No newline at end of file diff --git a/official/c42940335.lua b/official/c42940335.lua index b19c3f8c4c..87b3511ea6 100644 --- a/official/c42940335.lua +++ b/official/c42940335.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Equip this card to 1 "Mimighoul Master" you control local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -95,4 +95,4 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(sg,nil,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c43047672.lua b/official/c43047672.lua index 81815864e0..8701f7e071 100644 --- a/official/c43047672.lua +++ b/official/c43047672.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --chain attack local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -75,4 +75,4 @@ function s.atcost(e,tp,eg,ep,ev,re,r,rp,chk) end function s.atop(e,tp,eg,ep,ev,re,r,rp) Duel.ChainAttack() -end \ No newline at end of file +end diff --git a/official/c43413875.lua b/official/c43413875.lua index 4a0223c7b8..5952373283 100644 --- a/official/c43413875.lua +++ b/official/c43413875.lua @@ -3,80 +3,85 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --spsummon from hand + --Must first be Special Summoned (from your hand) by Tributing 1 Level 8 "Flower Cardian" monster, except "Flower Cardian Zebra Grass with Moon" + local e0=Effect.CreateEffect(c) + e0:SetDescription(aux.Stringid(id,0)) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EFFECT_SPSUMMON_PROC) + e0:SetRange(LOCATION_HAND) + e0:SetCondition(s.selfspcon) + e0:SetTarget(s.selfsptg) + e0:SetOperation(s.selfspop) + c:RegisterEffect(e0) + --Draw 1 card, and if you do, show it, then you can Special Summon it if it is a "Flower Cardian" monster local e1=Effect.CreateEffect(c) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetRange(LOCATION_HAND) - e1:SetCode(EFFECT_SPSUMMON_PROC) - e1:SetCondition(s.hspcon) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --draw(spsummon) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetTarget(s.drsptg) + e1:SetOperation(s.drspop) + c:RegisterEffect(e1) + --Draw 1 card local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) + e2:SetDescription(aux.Stringid(id,2)) + e2:SetCategory(CATEGORY_DRAW) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetCode(EVENT_BATTLE_DESTROYING) + e2:SetCountLimit(1) + e2:SetCondition(aux.bdocon) + e2:SetTarget(s.drtg) + e2:SetOperation(s.drop) c:RegisterEffect(e2) - --draw(battle) - local e3=Effect.CreateEffect(c) - e3:SetCategory(CATEGORY_DRAW) - e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e3:SetCode(EVENT_BATTLE_DESTROYING) - e3:SetCountLimit(1) - e3:SetCondition(aux.bdocon) - e3:SetTarget(s.drtg) - e3:SetOperation(s.drop) - c:RegisterEffect(e3) end s.listed_series={SET_FLOWER_CARDIAN} s.listed_names={id} -function s.hspfilter(c,tp) - return c:IsSetCard(SET_FLOWER_CARDIAN) and c:GetLevel()==8 and not c:IsCode(id) +function s.selfspfilter(c) + return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsLevel(8) and not c:IsCode(id) end -function s.hspcon(e,c) +function s.selfspcon(e,c) if c==nil then return true end - return Duel.CheckReleaseGroup(c:GetControler(),s.hspfilter,1,false,1,true,c,c:GetControler(),nil,false,nil) + local tp=c:GetControler() + return Duel.CheckReleaseGroup(tp,s.selfspfilter,1,false,1,true,c,tp,nil,false,nil) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,c) - local g=Duel.SelectReleaseGroup(tp,s.hspfilter,1,1,false,true,true,c,nil,nil,false,nil) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) + local g=Duel.SelectReleaseGroup(tp,s.selfspfilter,1,1,false,true,true,c,nil,nil,false,nil) if g then g:KeepAlive() e:SetLabelObject(g) - return true + return true end return false end -function s.hspop(e,tp,eg,ep,ev,re,r,rp,c) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drsptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.drspop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 then - local tc=Duel.GetOperatedGroup():GetFirst() - Duel.ConfirmCards(1-tp,tc) - Duel.BreakEffect() - if tc:IsMonster() and tc:IsSetCard(SET_FLOWER_CARDIAN) then - if tc:IsCanBeSpecialSummoned(e,0,tp,false,false) - and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) + if Duel.Draw(p,d,REASON_EFFECT)>0 then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and dc:IsCanBeSpecialSummoned(e,0,tp,false,false) + and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + Duel.BreakEffect() + Duel.SpecialSummon(dc,0,tp,tp,false,false,POS_FACEUP) end else - Duel.SendtoGrave(tc,REASON_EFFECT) + Duel.BreakEffect() + Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end diff --git a/official/c43490025.lua b/official/c43490025.lua index 2c35d39524..3a5ce2a5e6 100644 --- a/official/c43490025.lua +++ b/official/c43490025.lua @@ -2,46 +2,38 @@ --Number F0: Utopic Future Slash local s,id=GetID() function s.initial_effect(c) - --Must be properly summoned before reviving c:EnableReviveLimit() - --Xyz summon procedure - Xyz.AddProcedure(c,s.xyzfilter,nil,2,s.ovfilter,aux.Stringid(id,1),nil,nil,false,s.xyzcheck) - --Gains 500 ATK per "Number" Xyz monsters in the GYs + --Xyz Summon procedure: 2 Xyz Monsters with the same Rank, except "Number" monsters OR 1 "Utopia" monster or "Number F0: Utopic Future" you control + Xyz.AddProcedure(c,s.xyzfilter,nil,2,s.ovfilter,aux.Stringid(id,0),nil,nil,false,s.xyzcheck) + --Gains 500 ATK for each "Number" Xyz Monster in the GYs + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetRange(LOCATION_MZONE) + e1:SetValue(function(e,c) return Duel.GetMatchingGroupCount(function(c) return c:IsSetCard(SET_NUMBER) and c:IsType(TYPE_XYZ) end,0,LOCATION_GRAVE,LOCATION_GRAVE,nil)*500 end) + c:RegisterEffect(e1) + --Cannot be destroyed by battle local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e2:SetCode(EFFECT_UPDATE_ATTACK) - e2:SetRange(LOCATION_MZONE) - e2:SetValue(s.atkval) + e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e2:SetValue(1) c:RegisterEffect(e2) - --Cannot be destroyed by battle + --Make this card able to make a second attack during each Battle Phase this turn local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) - e3:SetValue(1) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1) + e3:SetCondition(function() return Duel.IsAbleToEnterBP() end) + e3:SetCost(Cost.DetachFromSelf(1)) + e3:SetTarget(s.secondatktg) + e3:SetOperation(s.secondatkop) c:RegisterEffect(e3) - --Make itself be able to make a second attack - local e4=Effect.CreateEffect(c) - e4:SetDescription(aux.Stringid(id,0)) - e4:SetType(EFFECT_TYPE_IGNITION) - e4:SetRange(LOCATION_MZONE) - e4:SetCountLimit(1) - e4:SetCondition(s.atkcon) - e4:SetCost(Cost.Detach(1)) - e4:SetTarget(s.atktg) - e4:SetOperation(s.atkop) - c:RegisterEffect(e4) - local e5=Effect.CreateEffect(c) - e5:SetType(EFFECT_TYPE_SINGLE) - e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) - e5:SetCode(511002571) - e5:SetLabelObject(e4) - e5:SetLabel(c:GetOriginalCode()) - c:RegisterEffect(e5) end -s.listed_series={SET_NUMBER,SET_UTOPIA} s.xyz_number=0 -s.listed_names={65305468} +s.listed_series={SET_NUMBER,SET_UTOPIA} +s.listed_names={65305468} --"Number F0: Utopic Future" function s.xyzfilter(c,xyz,sumtype,tp) return c:IsType(TYPE_XYZ,xyz,sumtype,tp) and not c:IsSetCard(SET_NUMBER,xyz,sumtype,tp) end @@ -49,25 +41,19 @@ function s.xyzcheck(g,tp,xyz) local mg=g:Filter(function(c) return not c:IsHasEffect(EFFECT_EQUIP_SPELL_XYZ_MAT) end,nil) return mg:GetClassCount(Card.GetRank)==1 end -function s.ovfilter(c,tp,lc) - return c:IsFaceup() and (c:IsSetCard(SET_UTOPIA,lc,SUMMON_TYPE_XYZ,tp) or c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,65305468)) +function s.ovfilter(c,tp,xyzc) + return (c:IsSetCard(SET_UTOPIA,xyzc,SUMMON_TYPE_XYZ,tp) or c:IsSummonCode(xyzc,SUMMON_TYPE_XYZ,tp,65305468)) and c:IsFaceup() end -function s.atkfilter(c) - return c:IsType(TYPE_XYZ) and c:IsSetCard(SET_NUMBER) -end -function s.atkval(e,c) - return Duel.GetMatchingGroupCount(s.atkfilter,c:GetControler(),LOCATION_GRAVE,LOCATION_GRAVE,nil)*500 -end -function s.atkcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsAbleToEnterBP() -end -function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK)==0 end +function s.secondatktg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then + local c=e:GetHandler() + return c:CanAttack() and c:GetEffectCount(EFFECT_EXTRA_ATTACK)==0 + end end -function s.atkop(e,tp,eg,ep,ev,re,r,rp) +function s.secondatkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then - --Can make a second attack + --This card can make a second attack during each Battle Phase this turn local e1=Effect.CreateEffect(c) e1:SetDescription(3201) e1:SetType(EFFECT_TYPE_SINGLE) diff --git a/official/c43513897.lua b/official/c43513897.lua index 3faf4a55c5..21fd574dfc 100644 --- a/official/c43513897.lua +++ b/official/c43513897.lua @@ -2,17 +2,17 @@ --Constellar Acubens local s,id=GetID() function s.initial_effect(c) - --Increase the ATK of all "Constellar" monsters you control - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_ATKCHANGE) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e2) + --Make all "Constellar" monsters you currently control gain 500 ATK + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_ATKCHANGE) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetOperation(s.atkop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1b) end s.listed_series={SET_CONSTELLAR} function s.atkop(e,tp,eg,ep,ev,re,r,rp) @@ -20,7 +20,7 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) if #g==0 then return end local c=e:GetHandler() for tc in g:Iter() do - --Increase ATK + --All "Constellar" monsters you currently control gain 500 ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) diff --git a/official/c4367330.lua b/official/c4367330.lua index e42d595ac8..74504d91df 100644 --- a/official/c4367330.lua +++ b/official/c4367330.lua @@ -20,7 +20,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) @@ -63,4 +63,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then Duel.SendtoGrave(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c440556.lua b/official/c440556.lua index 14ae85bf96..4603399726 100644 --- a/official/c440556.lua +++ b/official/c440556.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsRankBelow(3) and c:IsAttribute(ATTRIBUTE_WATER) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) @@ -38,4 +38,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) -end \ No newline at end of file +end diff --git a/official/c4423206.lua b/official/c4423206.lua index d78b3937ce..081266f570 100644 --- a/official/c4423206.lua +++ b/official/c4423206.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.spfilter(c,e,tp) return c:IsRace(RACE_WARRIOR|RACE_BEASTWARRIOR) and c:IsAttribute(ATTRIBUTE_EARTH) @@ -55,4 +55,4 @@ function s.descon(e,tp,eg,ep,ev,re,r,rp) end function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetLabelObject(),REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c44311445.lua b/official/c44311445.lua index 5f0910cad2..4f1cbd6a05 100644 --- a/official/c44311445.lua +++ b/official/c44311445.lua @@ -2,11 +2,12 @@ --Madolche Puddingcess Chocolat-a-la-Mode local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_EARTH),5,2,s.ovfilter,aux.Stringid(id,0)) c:EnableReviveLimit() - --todeck + --xyz Summon procedure: 2 Level 5 EARTH monsters OR 1 Rank 4 or lower "Madolche" Xyz Monster you control + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_EARTH),5,2,s.ovfilter,aux.Stringid(id,0)) + --Shuffle 1 "Madolche" card from your GY into the Deck local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) @@ -15,22 +16,24 @@ function s.initial_effect(c) e1:SetTarget(s.tdtg) e1:SetOperation(s.tdop) c:RegisterEffect(e1) - --spsummon + --Special Summon 1 "Madolche" monster from your Deck in Attack Position or face-down Defense Position local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_TO_DECK) + e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) e2:SetCondition(s.spcon) - e2:SetCost(s.spcost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_MADOLCHE} -s.listed_names={74641045} +s.listed_names={74641045} --"Madolche Puddingcess" function s.ovfilter(c,tp,lc) - return c:IsFaceup() and c:IsRankBelow(4) and c:IsSetCard(SET_MADOLCHE,lc,SUMMON_TYPE_XYZ,tp) + return c:IsRankBelow(4) and c:IsSetCard(SET_MADOLCHE,lc,SUMMON_TYPE_XYZ,tp) and c:IsFaceup() end function s.tdfilter(c) return c:IsSetCard(SET_MADOLCHE) and c:IsAbleToDeck() @@ -40,7 +43,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() @@ -48,18 +51,12 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end -function s.cfilter(c,tp) - return c:IsSetCard(SET_MADOLCHE) and c:IsLocation(LOCATION_DECK) - and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_GRAVE) +function s.spconfilter(c,tp) + return c:IsSetCard(SET_MADOLCHE) and c:IsLocation(LOCATION_DECK) and c:IsPreviousControler(tp) + and c:IsPreviousLocation(LOCATION_GRAVE) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,74641045) and eg:IsExists(s.cfilter,1,nil,tp) -end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(id)==0 end - c:RemoveOverlayCard(tp,1,1,REASON_COST) - c:RegisterFlagEffect(id,RESET_CHAIN,0,1) + return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,74641045) and eg:IsExists(s.spconfilter,1,nil,tp) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_MADOLCHE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE) @@ -72,11 +69,9 @@ end function s.spop(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,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) - local tc=g:GetFirst() - if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)~=0 then - if tc:IsFacedown() then - Duel.ConfirmCards(1-tp,tc) - end + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)>0 + and sc:IsFacedown() then + Duel.ConfirmCards(1-tp,tc) end -end \ No newline at end of file +end diff --git a/official/c44405066.lua b/official/c44405066.lua index 18a379195b..409308a447 100644 --- a/official/c44405066.lua +++ b/official/c44405066.lua @@ -37,10 +37,10 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCountLimit(1) - e4:SetCost(Cost.Detach(1,1,nil)) + e4:SetCost(Cost.DetachFromSelf(1,1,nil)) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_series={SET_RED_EYES} function s.indcon(e) @@ -73,4 +73,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c44505297.lua b/official/c44505297.lua index 9694cfc72e..5fe11bd049 100644 --- a/official/c44505297.lua +++ b/official/c44505297.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCategory(CATEGORY_TOGRAVE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.eqcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsXyzSummoned() @@ -90,4 +90,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) if #tg>0 then Duel.SendtoGrave(tg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c44698398.lua b/official/c44698398.lua index 1f494a831d..b0048016ab 100644 --- a/official/c44698398.lua +++ b/official/c44698398.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(Cost.Detach(2,2,nil)) + e2:SetCost(Cost.DetachFromSelf(2,2,nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_GALAXY,SET_TACHYON} function s.thfilter(c) @@ -79,4 +79,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Overlay(sc,mc) end end -end \ No newline at end of file +end diff --git a/official/c45533023.lua b/official/c45533023.lua index e9c5361bfe..ed64fda26e 100644 --- a/official/c45533023.lua +++ b/official/c45533023.lua @@ -20,14 +20,14 @@ function s.initial_effect(c) e2:SetCondition(s.descon) e2:SetTarget(s.destg1) e2:SetOperation(s.desop1) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg2) e3:SetOperation(s.desop2) c:RegisterEffect(e3) @@ -66,4 +66,4 @@ function s.desop2(e,tp,eg,ep,ev,re,r,rp) if ct>0 then Duel.Damage(1-tp,ct*500,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c45742626.lua b/official/c45742626.lua index 62129ff339..3816511b87 100644 --- a/official/c45742626.lua +++ b/official/c45742626.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.value(e,c) return Duel.GetMatchingGroupCount(Card.IsAttribute,0,LOCATION_GRAVE,LOCATION_GRAVE,nil,ATTRIBUTE_DARK)*200 @@ -41,4 +41,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) g1:Merge(g2) Duel.DisableShuffleCheck() Duel.SendtoGrave(g1,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c45852939.lua b/official/c45852939.lua index 25e375d7f8..deedb6774b 100644 --- a/official/c45852939.lua +++ b/official/c45852939.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCondition(function() return Duel.IsAbleToEnterBP() end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special Summon 1 Rank 4 or lower Xyz monster from the GY and attach another to it local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -86,4 +86,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) g:RemoveCard(sc) Duel.Overlay(sc,g) end -end \ No newline at end of file +end diff --git a/official/c45935145.lua b/official/c45935145.lua index 0fa715cfce..dfad14c7fd 100644 --- a/official/c45935145.lua +++ b/official/c45935145.lua @@ -4,20 +4,20 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon procedure + --Xyz Summon procedure: 2+ Level 6 monsters Xyz.AddProcedure(c,nil,6,2,nil,nil,Xyz.InfiniteMats) - --Increase ATK/DEF + --Monsters you control gain 100 ATK/DEF for each card in your opponent's GY local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) - e1:SetValue(s.val) + e1:SetValue(function(e) return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),0,LOCATION_GRAVE)*100 end) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) - --Shuffle, Special Summon, or Set the targeted card + --Activate the appropriate effect based on the number of detached materials local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_QUICK_O) @@ -26,61 +26,62 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e3:SetCountLimit(1,id) - e3:SetTarget(s.eftg) - e3:SetOperation(s.efop) + e3:SetCost(Cost.AND(s.efftgcost,s.effdetachcost)) + e3:SetTarget(s.efftg) + e3:SetOperation(s.effop) c:RegisterEffect(e3) end -function s.val(e) - return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),0,LOCATION_GRAVE)*100 -end function s.tgfilter(c,e,tp,detach_1,detach_2) - return (detach_1 and c:IsAbleToDeck()) or (detach_2 and (s.spfilter(c,e,tp) or s.setfilter(c))) -end -function s.spfilter(c,e,tp) - return c:IsMonster() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP|POS_FACEDOWN_DEFENSE) + return (detach_1 and c:IsAbleToDeck()) or (detach_2 and s.setfilter(c,e,tp)) end -function s.setfilter(c) - return c:IsSpellTrap() and c:IsSSetable() +function s.setfilter(c,e,tp) + if c:IsSpellTrap() then return c:IsSSetable() end + return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP|POS_FACEDOWN_DEFENSE) end -function s.eftg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.efftgcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local detach_1=c:CheckRemoveOverlayCard(tp,1,REASON_COST) local detach_2=c:CheckRemoveOverlayCard(tp,2,REASON_COST) - if chk==0 then return (detach_1 or detach_2) and Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp,detach_1,detach_2) end + if chk==0 then return (detach_1 or detach_2) + and Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp,detach_1,detach_2) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) - local tc=Duel.SelectTarget(tp,s.tgfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp,detach_1,detach_2):GetFirst() - local b1=detach_1 and tc:IsAbleToDeck() - local b2=detach_2 and (s.spfilter(tc,e,tp) or s.setfilter(tc)) - local op=Duel.SelectEffect(tp, - {b1,aux.Stringid(id,1)}, - {b2,aux.Stringid(id,2)}) - e:SetLabel(op) - if op==1 then - c:RemoveOverlayCard(tp,1,1,REASON_COST) - e:SetCategory(CATEGORY_TODECK) - Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,tp,0) - elseif op==2 then - c:RemoveOverlayCard(tp,2,2,REASON_COST) - if tc:IsMonster() then - e:SetCategory(CATEGORY_SPECIAL_SUMMON) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,tp,0) - else - e:SetCategory(0) - Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,tc,1,tp,0) - end + Duel.SelectTarget(tp,s.tgfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp,detach_1,detach_2) +end +function s.tccheck(op) + return function(e,tp) + local tc=Duel.GetFirstTarget() + if not tc then return true end + return op==1 and tc:IsAbleToDeck() or s.setfilter(tc,e,tp) end end -function s.efop(e,tp,eg,ep,ev,re,r,rp) +s.effdetachcost=Cost.Choice( + {Cost.DetachFromSelf(1),aux.Stringid(id,1),s.tccheck(1)}, + {Cost.DetachFromSelf(2),aux.Stringid(id,2),s.tccheck(2)} +) +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return false end + if chk==0 then return true end local op=e:GetLabel() + local categ=CATEGORY_TODECK + local tc=Duel.GetFirstTarget() + if op==2 then categ=tc:IsMonster() and CATEGORY_SPECIAL_SUMMON or CATEGORY_LEAVE_GRAVE end + e:SetCategory(categ) + Duel.SetOperationInfo(0,categ,tc,1,tp,0) +end +function s.effop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end + local op=e:GetLabel() if op==1 then + --Return it to the Deck Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) elseif op==2 then + --If the target is a monster, Special Summon it face-up, or in face-down Defense Position, to your field if tc:IsMonster() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP|POS_FACEDOWN_DEFENSE)>0 and tc:IsFacedown() then Duel.ConfirmCards(1-tp,tc) + --If it is not, Set it on your field elseif tc:IsSSetable() then Duel.SSet(tp,tc) end diff --git a/official/c46772449.lua b/official/c46772449.lua index 565ee3c36d..b4f4fbf87f 100644 --- a/official/c46772449.lua +++ b/official/c46772449.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetHintTiming(TIMING_SPSUMMON,TIMING_BATTLE_START|TIMING_BATTLE_END) e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) e1:SetCondition(s.descon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.descon(e,tp,eg,ep,ev,re,r,rp) if not ((Duel.IsTurnPlayer(tp) and Duel.IsMainPhase()) or (Duel.IsTurnPlayer(1-tp) and Duel.IsBattlePhase())) then return false end @@ -49,4 +49,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) local e2=e1:Clone() e2:SetCode(EFFECT_NO_EFFECT_DAMAGE) Duel.RegisterEffect(e2,tp) -end \ No newline at end of file +end diff --git a/official/c46871387.lua b/official/c46871387.lua index 97bb8b9813..8fd91f1530 100644 --- a/official/c46871387.lua +++ b/official/c46871387.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --def local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) @@ -43,4 +43,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end -end \ No newline at end of file +end diff --git a/official/c46895036.lua b/official/c46895036.lua index d8ec8a65c2..8ba5c093be 100644 --- a/official/c46895036.lua +++ b/official/c46895036.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(aux.StatChangeDamageStepCondition) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --to hand local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TOHAND) @@ -79,4 +79,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end -end \ No newline at end of file +end diff --git a/official/c47017574.lua b/official/c47017574.lua index 4cc823ca42..39843ecfc7 100644 --- a/official/c47017574.lua +++ b/official/c47017574.lua @@ -32,10 +32,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.discon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.distg) e3:SetOperation(s.disop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.xyz_number=92 s.listed_names={97403510} @@ -82,4 +82,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e3) end end -end \ No newline at end of file +end diff --git a/official/c47060528.lua b/official/c47060528.lua index 892cb0f6d6..174618a583 100644 --- a/official/c47060528.lua +++ b/official/c47060528.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Change the name of 1 other face-up monster on the field to "Sakra Vendirage" until the End Phase local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/official/c47132793.lua b/official/c47132793.lua index 91a22a9b89..1cf27517a0 100644 --- a/official/c47132793.lua +++ b/official/c47132793.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special Summon this card from your GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -74,4 +74,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1,true) end -end \ No newline at end of file +end diff --git a/official/c47349116.lua b/official/c47349116.lua index ad514827f2..0b176db738 100644 --- a/official/c47349116.lua +++ b/official/c47349116.lua @@ -18,10 +18,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --destroy replace local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -75,4 +75,4 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.repval(e,c) return s.repfilter(c,e:GetHandlerPlayer()) -end \ No newline at end of file +end diff --git a/official/c47506081.lua b/official/c47506081.lua index 9a8f620a91..278fa439a0 100644 --- a/official/c47506081.lua +++ b/official/c47506081.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCondition(s.damcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -31,4 +31,4 @@ end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c47579719.lua b/official/c47579719.lua index 90af745c69..d605b9ed5b 100644 --- a/official/c47579719.lua +++ b/official/c47579719.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return not c:IsPosition(POS_FACEUP_DEFENSE) and c:IsCanChangePosition() @@ -26,4 +26,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE) -end \ No newline at end of file +end diff --git a/official/c47805931.lua b/official/c47805931.lua index d5197d76d3..51437dde6c 100644 --- a/official/c47805931.lua +++ b/official/c47805931.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=20 function s.operation(e,tp,eg,ep,ev,re,r,rp) @@ -29,4 +29,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c48009503.lua b/official/c48009503.lua index 53a66b9f93..cbdeb63a1d 100644 --- a/official/c48009503.lua +++ b/official/c48009503.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) @@ -29,4 +29,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=eg:Filter(s.filter,nil,e,tp) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c48348921.lua b/official/c48348921.lua index 52d61461ed..81aff22ae8 100644 --- a/official/c48348921.lua +++ b/official/c48348921.lua @@ -14,9 +14,9 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(function(_,tp) return Duel.IsTurnPlayer(tp) end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Unaffected by opponent's monster effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -60,4 +60,4 @@ function s.atkval(e,c) local g=c:GetOverlayGroup() local sum=g:GetSum(Card.GetLevel)+g:GetSum(Card.GetRank) return sum*100 -end \ No newline at end of file +end diff --git a/official/c48608796.lua b/official/c48608796.lua index c5b0fe023f..af933dcc1b 100644 --- a/official/c48608796.lua +++ b/official/c48608796.lua @@ -32,9 +32,9 @@ function s.initial_effect(c) e4:SetCode(EVENT_FREE_CHAIN) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetOperation(s.indop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_series={SET_LYRILUSC} function s.atkval(e,c) @@ -65,4 +65,4 @@ function s.indop(e,tp,eg,ep,ev,re,r,rp) e3:SetValue(1) e3:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e3,tp) -end \ No newline at end of file +end diff --git a/official/c48626373.lua b/official/c48626373.lua index c8b53cb02d..a15587cc7e 100644 --- a/official/c48626373.lua +++ b/official/c48626373.lua @@ -34,7 +34,7 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END) - e3:SetCost(Cost.Detach(3,3)) + e3:SetCost(Cost.DetachFromSelf(3,3)) e3:SetTarget(s.rmtg) e3:SetOperation(s.rmop) c:RegisterEffect(e3) @@ -82,4 +82,4 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c48739166.lua b/official/c48739166.lua index 171dea3e29..c1107f50ee 100644 --- a/official/c48739166.lua +++ b/official/c48739166.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(2,2,nil)) + e1:SetCost(Cost.DetachFromSelf(2,2,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Protect itself from destruction local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) @@ -50,4 +50,4 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) return true else return false end -end \ No newline at end of file +end diff --git a/official/c48905153.lua b/official/c48905153.lua index 081b7fc9e2..c52df6d349 100644 --- a/official/c48905153.lua +++ b/official/c48905153.lua @@ -27,10 +27,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_ZOODIAC} function s.ovfilter(c,tp,lc) @@ -68,4 +68,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c48928529.lua b/official/c48928529.lua index 61ac6e818f..1e5c4448dd 100644 --- a/official/c48928529.lua +++ b/official/c48928529.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=83 function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) @@ -39,4 +39,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetReset(RESETS_STANDARD_PHASE_END,2) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c49032236.lua b/official/c49032236.lua index f8325f9e12..fad748fd98 100644 --- a/official/c49032236.lua +++ b/official/c49032236.lua @@ -13,11 +13,11 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) e1:SetHintTiming(TIMING_STANDBY_PHASE|TIMING_END_PHASE) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=81 function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) @@ -43,4 +43,4 @@ end function s.efilter(e,re) local c=e:GetHandler() return c~=re:GetOwner() and not c:IsStatus(STATUS_BATTLE_DESTROYED) -end \ No newline at end of file +end diff --git a/official/c49121795.lua b/official/c49121795.lua index 622bdcb1f0..c35105105a 100644 --- a/official/c49121795.lua +++ b/official/c49121795.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.dacon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.datg) e1:SetOperation(s.daop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -82,4 +82,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c49195710.lua b/official/c49195710.lua index a3a35fe37b..689f68ffc9 100644 --- a/official/c49195710.lua +++ b/official/c49195710.lua @@ -1,63 +1,48 @@ ---CNo.65 裁断魔王ジャッジ・デビル +--CNo.65 裁断魔王ジャッジ・デビル --Number C65: King Overfiend local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_DARK),3,3) c:EnableReviveLimit() - --addown + --Xyz Summon procedure: 3 Level 3 DARK monsters + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_DARK),3,3) + --Make 1 face-up monster your opponent controls lose 1000 ATK and DEF local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) + e1:SetCost(Cost.DetachFromSelf(1)) + e1:SetTarget(s.atkdeftg) + e1:SetOperation(s.atkdefop) c:RegisterEffect(e1) - --act limit + --Effect Monsters your opponent controls cannot activate their effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) - e2:SetRange(LOCATION_MZONE) + e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetCode(EFFECT_CANNOT_TRIGGER) + e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(0,LOCATION_MZONE) - e2:SetCondition(s.accon) + e2:SetCondition(function(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,3790062) end) c:RegisterEffect(e2) - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) - e3:SetCode(511002571) - e3:SetLabelObject(e1) - e3:SetLabel(c:GetOriginalCode()) - c:RegisterEffect(e3) end s.xyz_number=65 -s.listed_names={3790062} -function s.filter(c) - return c:IsFaceup() -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) - Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil) +s.listed_names={3790062} --"Number 65: Djinn Buster" +function s.atkdeftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end + if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) + local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,1,tp,-1000) + Duel.SetOperationInfo(0,CATEGORY_DEFCHANGE,g,1,tp,-1000) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() +function s.atkdefop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsFaceup() and tc:IsRelateToEffect(e) then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(-1000) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e1) - local e2=e1:Clone() - e2:SetCode(EFFECT_UPDATE_DEFENSE) - tc:RegisterEffect(e2) + if tc:IsRelateToEffect(e) and tc:IsFaceup() then + local c=e:GetHandler() + --It loses 1000 ATK and DEF + tc:UpdateAttack(-1000,nil,c) + tc:UpdateDefense(-1000,nil,c) end end -function s.accon(e) - return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,3790062) -end \ No newline at end of file diff --git a/official/c49202331.lua b/official/c49202331.lua index 1987bddccb..82ffdf4e2c 100644 --- a/official/c49202331.lua +++ b/official/c49202331.lua @@ -23,9 +23,9 @@ function s.initial_effect(c) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCountLimit(1) e2:SetCondition(s.atcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(s.atop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_names={3814632} function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) @@ -54,4 +54,4 @@ function s.atcon(e,tp,eg,ep,ev,re,r,rp) end function s.atop(e,tp,eg,ep,ev,re,r,rp) Duel.ChainAttack() -end \ No newline at end of file +end diff --git a/official/c49221191.lua b/official/c49221191.lua index 7ff2078dec..932a2026e6 100644 --- a/official/c49221191.lua +++ b/official/c49221191.lua @@ -1,70 +1,60 @@ ---CNo.32 海咬龍シャーク・ドレイク・バイス +--CNo.32 海咬龍シャーク・ドレイク・バイス --Number C32: Shark Drake Veiss local s,id=GetID() function s.initial_effect(c) - --xyz summon c:EnableReviveLimit() + --Xyz Summon procedure: 4 Level 4 WATER monsters OR 1 "Number 32: Shark Drake" you control Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_WATER),4,4,s.ovfilter,aux.Stringid(id,0)) - --atk/def + --Make the ATK/DEF of 1 face-up monster on the field become 0 until the end of your turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) - e1:SetCategory(CATEGORY_ATKCHANGE) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) + e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) - e1:SetHintTiming(TIMING_DAMAGE_STEP) - e1:SetCondition(s.condition) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP|TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetCondition(function(e,tp) return Duel.GetLP(tp)<=1000 and aux.StatChangeDamageStepCondition() end) + e1:SetCost(Cost.AND(s.atkdefcost,Cost.DetachFromSelf(1))) + e1:SetTarget(s.atkdeftg) + e1:SetOperation(s.atkdefop) + c:RegisterEffect(e1) end s.xyz_number=32 -s.listed_names={65676461} +s.listed_names={65676461} --"Number 32: Shark Drake" function s.ovfilter(c,tp,lc) - return c:IsFaceup() and c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,65676461) -end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetLP(tp)<=1000 and aux.StatChangeDamageStepCondition() + return c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,65676461) and c:IsFaceup() end -function s.rfilter(c) +function s.atkdefcostfilter(c) return c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c) - and Duel.IsExistingTarget(s.filter,0,LOCATION_MZONE,LOCATION_MZONE,1,c) + and Duel.IsExistingTarget(aux.OR(Card.HasNonZeroAttack,Card.HasNonZeroDefense),0,LOCATION_MZONE,LOCATION_MZONE,1,c) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - and Duel.IsExistingMatchingCard(s.rfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) +function s.atkdefcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.atkdefcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local g=Duel.SelectMatchingCard(tp,s.rfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.atkdefcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end -function s.filter(c) - return c:IsFaceup() and (c:GetAttack()>0 or c:GetDefense()>0) +function s.atkdeftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and (chkc:HasNonZeroAttack() or chkc:HasNonZeroDefense()) end + if chk==0 then return Duel.IsExistingTarget(aux.OR(Card.HasNonZeroAttack,Card.HasNonZeroDefense),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) + Duel.SelectTarget(tp,aux.OR(Card.HasNonZeroAttack,Card.HasNonZeroDefense),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) - Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.atkdefop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then + if tc:IsRelateToEffect(e) and tc:IsFaceup() then + local ct=Duel.IsTurnPlayer(1-tp) and 2 or 1 + --Its ATK/DEF become 0 until the end of your turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(0) - if Duel.IsTurnPlayer(1-tp) then - e1:SetReset(RESETS_STANDARD_PHASE_END,2) - else - e1:SetReset(RESETS_STANDARD_PHASE_END,1) - end + e1:SetReset(RESETS_STANDARD_PHASE_END,ct) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE_FINAL) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c49456901.lua b/official/c49456901.lua index 345319ccb7..00e8251b87 100644 --- a/official/c49456901.lua +++ b/official/c49456901.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetCountLimit(1) e2:SetCode(EVENT_CHAINING) e2:SetCondition(s.condition) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) aux.DoubleSnareValidity(c,LOCATION_MZONE) end s.xyz_number=104 @@ -66,4 +66,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoGrave(g,REASON_EFFECT) Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2) end -end \ No newline at end of file +end diff --git a/official/c4965193.lua b/official/c4965193.lua index 2b38a9740e..5dce0dd35e 100644 --- a/official/c4965193.lua +++ b/official/c4965193.lua @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) - e1:SetCost(s.applycost) + e1:SetCost(Cost.AND(s.applycost,Cost.DetachFromSelf(1))) e1:SetTarget(s.applytg) e1:SetOperation(s.applyop) c:RegisterEffect(e1) @@ -32,60 +32,60 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.listed_series={SET_DRAGON_RULER} -function s.tgfilter(c,tp) - if not (c:IsSetCard(SET_DRAGON_RULER) and c:IsLevel(7) and c:IsAbleToGraveAsCost() and c:IsHasEffect(id)) then - return false - end - local eff=c:GetCardEffect(id) - local te=eff:GetLabelObject() - local con=te:GetCondition() - local tg=te:GetTarget() - if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) - and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) then - return true +function s.runfn(fn,eff,tp,chk) + return not fn or fn(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,nil,REASON_EFFECT,PLAYER_NONE,chk) +end +function s.applyfilter(c,tp) + if not (c:IsSetCard(SET_DRAGON_RULER) and c:IsLevel(7) and c:IsAbleToGraveAsCost()) then return false end + for _,eff in ipairs({c:GetOwnEffects()}) do + if eff:HasSelfDiscardCost() and s.runfn(eff:GetCondition(),eff,tp,0) and s.runfn(eff:GetTarget(),eff,tp,0) then return true end end return false end function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) - and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,tp) end + if chk==0 then return Duel.IsExistingMatchingCard(s.applyfilter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local sc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() + local sc=Duel.SelectMatchingCard(tp,s.applyfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() + local effs={} + local options={} + for _,eff in ipairs({sc:GetOwnEffects()}) do + if eff:HasSelfDiscardCost() then + table.insert(effs,eff) + local eff_chk=s.runfn(eff:GetCondition(),eff,tp,0) and s.runfn(eff:GetTarget(),eff,tp,0) + table.insert(options,{eff_chk,eff:GetDescription()}) + end + end + local op=#options==1 and 1 or Duel.SelectEffect(tp,table.unpack(options)) + local te=effs[op] + e:SetLabelObject(te) Duel.SendtoGrave(sc,REASON_COST) - sc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1) - e:SetLabelObject(sc:GetCardEffect(id):GetLabelObject()) - c:RemoveOverlayCard(tp,1,1,REASON_COST) end function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local te=e:GetLabelObject() - local tg=te and te:GetTarget() or nil - if chkc then return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end + if chkc then return te and te:GetTarget() and te:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0,chkc) end if chk==0 then return true end e:SetLabel(te:GetLabel()) e:SetLabelObject(te:GetLabelObject()) e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local tg=te:GetTarget() if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) + te:SetLabel(e:GetLabel()) + te:SetLabelObject(e:GetLabelObject()) + Duel.ClearOperationInfo(0) end e:SetLabelObject(te) - Duel.ClearOperationInfo(0) end function s.applyop(e,tp,eg,ep,ev,re,r,rp) local te=e:GetLabelObject() if not te then return end - local sc=te:GetHandler() - if sc:GetFlagEffect(id)==0 then - e:SetLabel(0) - e:SetLabelObject(nil) - return - end - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) local op=te:GetOperation() if op then - op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) + e:SetLabel(te:GetLabel()) + e:SetLabelObject(te:GetLabelObject()) + op(e,tp,eg,ep,ev,re,r,rp) end + e:SetProperty(0) e:SetLabel(0) e:SetLabelObject(nil) end @@ -108,4 +108,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c49678559.lua b/official/c49678559.lua index a184ad305f..035c439558 100644 --- a/official/c49678559.lua +++ b/official/c49678559.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destruction Replacement local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) @@ -73,4 +73,4 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.RegisterEffect(e1,tp) return true else return false end -end \ No newline at end of file +end diff --git a/official/c49689480.lua b/official/c49689480.lua index 3ce170c315..401155e3c1 100644 --- a/official/c49689480.lua +++ b/official/c49689480.lua @@ -17,7 +17,7 @@ function s.initial_effect(c) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END) e1:SetCountLimit(1) e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.tdtg) e1:SetOperation(s.tdop) c:RegisterEffect(e1) @@ -79,4 +79,4 @@ function s.texop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c4997565.lua b/official/c4997565.lua index ea1885fe46..ff37c3629a 100644 --- a/official/c4997565.lua +++ b/official/c4997565.lua @@ -26,10 +26,10 @@ function s.initial_effect(c) e2:SetCountLimit(1,{id,1}) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=3 function s.spfilter(c,e,tp) @@ -97,4 +97,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) sc:RegisterEffect(e3) end end -end \ No newline at end of file +end diff --git a/official/c5014629.lua b/official/c5014629.lua index 845672b4f8..b131e0fd92 100644 --- a/official/c5014629.lua +++ b/official/c5014629.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsMonster() @@ -31,4 +31,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_REMOVED,0,nil) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) Duel.Damage(p,ct*100,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c50260683.lua b/official/c50260683.lua index ec81aabb35..fc151c17eb 100644 --- a/official/c50260683.lua +++ b/official/c50260683.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(aux.StatChangeDamageStepCondition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -78,4 +78,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:GetAttack()~=tc:GetBaseAttack() then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c50449881.lua b/official/c50449881.lua index 85bbbc0b28..0593a5180a 100644 --- a/official/c50449881.lua +++ b/official/c50449881.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Opponent can only target this card for attacks local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) @@ -55,4 +55,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.atlimit(e,c) return c~=e:GetHandler() -end \ No newline at end of file +end diff --git a/official/c50789693.lua b/official/c50789693.lua index 33c52d32a4..c981dee4e3 100644 --- a/official/c50789693.lua +++ b/official/c50789693.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.adop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) -- local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -72,4 +72,4 @@ function s.btop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESET_PHASE|PHASE_END) e2:SetValue(1) Duel.RegisterEffect(e2,tp) -end \ No newline at end of file +end diff --git a/official/c5088741.lua b/official/c5088741.lua index 5b91f0fdb6..125f8d2d59 100644 --- a/official/c5088741.lua +++ b/official/c5088741.lua @@ -23,8 +23,8 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(Cost.Detach(1,1,nil)) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) + c:RegisterEffect(e2) --Add 1 "A.I." Trap from your Deck to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -60,4 +60,4 @@ function s.thop(filter) Duel.ConfirmCards(1-tp,g) end end -end \ No newline at end of file +end diff --git a/official/c51497409.lua b/official/c51497409.lua index df593f92cb..8358b804e5 100644 --- a/official/c51497409.lua +++ b/official/c51497409.lua @@ -12,17 +12,17 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.ddtg) e1:SetOperation(s.ddop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --indes local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e2:SetCondition(s.incon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(s.inop) c:RegisterEffect(e2) end @@ -73,4 +73,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if dc and Duel.Destroy(dc,REASON_EFFECT)>0 then Duel.Damage(1-tp,500,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c51543904.lua b/official/c51543904.lua index 9be8f566df..da87fb934c 100644 --- a/official/c51543904.lua +++ b/official/c51543904.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_RANK_UP_MAGIC,SET_NUMBER} s.xyz_number=99 @@ -93,4 +93,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c51735257.lua b/official/c51735257.lua index f3aa3b4bd9..113a02e218 100644 --- a/official/c51735257.lua +++ b/official/c51735257.lua @@ -2,54 +2,51 @@ --Number 50: Blackship of Corn local s,id=GetID() function s.initial_effect(c) - --Must be properly summoned before reviving c:EnableReviveLimit() - --Xyz summon procedure + --Xyz Summon procedure: 2 Level 4 monsters Xyz.AddProcedure(c,nil,4,2) - --Send 1 of opponent's monsters to GY, and if you do, inflict 1000 damage + --Send 1 monster your opponent controls to the GY, and if you do, inflict 1000 damage to them local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetCountLimit(1) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetCountLimit(1) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.tgcost)) + e1:SetTarget(s.tgtg) + e1:SetOperation(s.tgop) + c:RegisterEffect(e1) end s.xyz_number=50 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 - and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - --Cannot attack this turn - local e1=Effect.CreateEffect(e:GetHandler()) +function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return c:GetAttackAnnouncedCount()==0 end + --This card cannot attack during the turn you activate this effect + local e1=Effect.CreateEffect(c) e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) - e:GetHandler():RegisterEffect(e1) + c:RegisterEffect(e1) end -function s.filter(c,atk) - return c:IsFaceup() and c:IsAttackBelow(atk) +function s.tgfilter(c,atk) + return c:IsAttackBelow(atk) and c:IsFaceup() and c:IsAbleToGrave() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,e:GetHandler():GetAttack()) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil,e:GetHandler():GetAttack()) end +function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local atk=e:GetHandler():GetAttack() + if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc,atk) end + if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_MZONE,1,nil,atk) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil,e:GetHandler():GetAttack()) - Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0) + local g=Duel.SelectTarget(tp,s.tgfilter,tp,0,LOCATION_MZONE,1,1,nil,atk) + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.tgop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then - Duel.SendtoGrave(tc,REASON_EFFECT) - if tc:IsLocation(LOCATION_GRAVE) then - Duel.Damage(1-tp,1000,REASON_EFFECT) - end + if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,REASON_EFFECT)>0 + and tc:IsLocation(LOCATION_GRAVE) then + Duel.Damage(1-tp,1000,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c51960178.lua b/official/c51960178.lua index 5e6bb4e02e..fe1b472d1f 100644 --- a/official/c51960178.lua +++ b/official/c51960178.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end @@ -27,4 +27,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c52323874.lua b/official/c52323874.lua index 70789d45ab..82983fa316 100644 --- a/official/c52323874.lua +++ b/official/c52323874.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_RAIDRAPTOR} function s.filter(c) @@ -37,4 +37,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if atk<0 then atk=0 end Duel.Damage(1-tp,atk,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c52558805.lua b/official/c52558805.lua index 7b196035de..43c03bca69 100644 --- a/official/c52558805.lua +++ b/official/c52558805.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e1:SetHintTiming(TIMING_DAMAGE_STEP|TIMINGS_CHECK_MONSTER) e1:SetCountLimit(1) e1:SetCondition(aux.StatChangeDamageStepCondition) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_DJINN} function s.filter(c,tp) @@ -49,4 +49,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c52653092.lua b/official/c52653092.lua index 64bd918ea6..add3b3fbdd 100644 --- a/official/c52653092.lua +++ b/official/c52653092.lua @@ -39,9 +39,9 @@ function s.initial_effect(c) e6:SetHintTiming(0,TIMING_DRAW_PHASE) e6:SetCountLimit(1) e6:SetCondition(s.actcon) - e6:SetCost(Cost.Detach(1)) + e6:SetCost(Cost.DetachFromSelf(1)) e6:SetOperation(s.actop) - c:RegisterEffect(e6,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e6) end s.listed_series={SET_NUMBER,SET_RANK_UP_MAGIC,SET_UTOPIA} s.xyz_number=0 @@ -94,4 +94,4 @@ function s.actop(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(1) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) -end \ No newline at end of file +end diff --git a/official/c53054164.lua b/official/c53054164.lua index 76c9abd44b..558fddb44d 100644 --- a/official/c53054164.lua +++ b/official/c53054164.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atkcond) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Return to the Extra Deck and Special Summon from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/official/c53244294.lua b/official/c53244294.lua index dbc16b6607..488285c515 100644 --- a/official/c53244294.lua +++ b/official/c53244294.lua @@ -20,10 +20,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.zcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.ztg) e2:SetOperation(s.zop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=57 function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) @@ -66,4 +66,4 @@ function s.zop(e,tp,eg,ep,ev,re,r,rp) end function s.disop(e,tp) return e:GetLabel() -end \ No newline at end of file +end diff --git a/official/c53334641.lua b/official/c53334641.lua index b854bee499..56daacc7c8 100644 --- a/official/c53334641.lua +++ b/official/c53334641.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --material local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -77,4 +77,4 @@ function s.mtop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.Overlay(c,g) end -end \ No newline at end of file +end diff --git a/official/c53618197.lua b/official/c53618197.lua index 331972536b..b36eb485cf 100644 --- a/official/c53618197.lua +++ b/official/c53618197.lua @@ -4,6 +4,14 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() + --Register that it was Special Summoned by the effect of a "Nouvelles" monster + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EVENT_SPSUMMON_SUCCESS) + e0:SetCondition(s.regcon) + e0:SetOperation(function(e) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD&~RESET_TEMP_REMOVE,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) end) + c:RegisterEffect(e0) --Destroy 1 Spell/Trap on the field local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) @@ -32,6 +40,17 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_NOUVELLES,SET_RECIPE} +function s.regcon(e,tp,eg,ep,ev,re,r,rp) + if not (re and re:IsMonsterEffect()) then return false end + local rc=re:GetHandler() + local trig_loc,trig_setcodes=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SETCODES) + if not Duel.IsChainSolving() or (rc:IsRelateToEffect(re) and rc:IsFaceup() and rc:IsLocation(trig_loc)) then + return rc:IsSetCard(SET_NOUVELLES) + end + for _,set in ipairs(trig_setcodes) do + if (SET_NOUVELLES&0xfff)==(set&0xfff) and (SET_NOUVELLES&set)==SET_NOUVELLES then return true end + end +end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsSpellTrap() end if chk==0 then return Duel.IsExistingTarget(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end diff --git a/official/c53701457.lua b/official/c53701457.lua index c8891d92bc..c96cba8597 100644 --- a/official/c53701457.lua +++ b/official/c53701457.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetCondition(s.damcon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.damtg) e3:SetOperation(s.damop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.xyz_number=28 function s.dircon(e) @@ -53,4 +53,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local dam=Duel.GetFieldGroupCount(p,LOCATION_HAND,0)*500 Duel.Damage(p,dam,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c53797637.lua b/official/c53797637.lua index d6ce3a4bc2..d11b4cf571 100644 --- a/official/c53797637.lua +++ b/official/c53797637.lua @@ -2,31 +2,19 @@ --Burner, Dragon Ruler of Sparks local s,id=GetID() function s.initial_effect(c) - --Special summon 1 "Blaster, Dragon Ruler of Infernos" from deck + --Special Summon 1 "Blaster, Dragon Ruler of Infernos" from your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) - e1:SetCost(s.spcost) + e1:SetCost(DragonRuler.SelfDiscardCost(ATTRIBUTE_FIRE)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DRAGON_RULER) + c:RegisterEffect(e1) end s.listed_names={53804307}--"Blaster, Dragon Ruler of Infernos" -function s.costfilter(c) - return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_FIRE)) and c:IsDiscardable() -end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() - and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c) - g:AddCard(c) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) -end function s.spfilter(c,e,tp) return c:IsCode(53804307) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end @@ -37,16 +25,16 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - local tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) + local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then - --Cannot attack + --Cannot attack this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) - e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end Duel.SpecialSummonComplete() -end \ No newline at end of file +end diff --git a/official/c53804307.lua b/official/c53804307.lua index 51886831e3..1ccf780970 100644 --- a/official/c53804307.lua +++ b/official/c53804307.lua @@ -2,42 +2,42 @@ --Blaster, Dragon Ruler of Infernos local s,id=GetID() function s.initial_effect(c) - --Special Summon this card from the hand or GY + --Special Summon this card from your hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCountLimit(1,id) - e1:SetCost(s.hspcost) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) + e1:SetCost(s.selfspcost) + e1:SetTarget(s.selfsptg) + e1:SetOperation(s.selfspop) c:RegisterEffect(e1) --Return this card to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e2:SetCode(EVENT_PHASE|PHASE_END) e2:SetRange(LOCATION_MZONE) - e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1,id) - e2:SetCondition(s.retcon) - e2:SetTarget(s.rettg) - e2:SetOperation(s.retop) + e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSpecialSummoned() end) + e2:SetTarget(s.rthtg) + e2:SetOperation(s.rthop) c:RegisterEffect(e2) --Destroy 1 card on the field local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_IGNITION) - e3:SetRange(LOCATION_HAND) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) + e3:SetRange(LOCATION_HAND) e3:SetCountLimit(1,id) - e3:SetCost(s.descost) + e3:SetCost(DragonRuler.SelfDiscardToGraveCost(ATTRIBUTE_FIRE)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DRAGON_RULER) - --Add 1 FIRE Dragon monster from your Deck to your han + c:RegisterEffect(e3) + --Add 1 FIRE Dragon monster from your Deck to your hand local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,3)) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) @@ -49,52 +49,37 @@ function s.initial_effect(c) e4:SetOperation(s.thop) c:RegisterEffect(e4) end -function s.rfilter(c) - return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_FIRE)) and c:IsAbleToRemoveAsCost() +function s.spcostfilter(c) + return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_FIRE)) and c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true)) end -function s.hspcost(e,tp,eg,ep,ev,re,r,rp,chk) - local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) +function s.selfspcost(e,tp,eg,ep,ev,re,r,rp,chk) + local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) if chk==0 then return #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE) Duel.Remove(g,POS_FACEUP,REASON_COST) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end -function s.hspop(e,tp,eg,ep,ev,re,r,rp) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end -function s.retcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSpecialSummoned() -end -function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,0) end -function s.retop(e,tp,eg,ep,ev,re,r,rp) +function s.rthop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then Duel.SendtoHand(c,nil,REASON_EFFECT) end end -function s.dfilter(c) - return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDiscardable() and c:IsAbleToGraveAsCost() -end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() and c:IsAbleToGraveAsCost() - and Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND,0,1,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_HAND,0,1,1,c) - g:AddCard(e:GetHandler()) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) -end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end diff --git a/official/c54135423.lua b/official/c54135423.lua index 8e58c05853..67784b2652 100644 --- a/official/c54135423.lua +++ b/official/c54135423.lua @@ -2,78 +2,76 @@ --Flower Cardian Willow local s,id=GetID() function s.initial_effect(c) - --spsummon + --Special Summon this card from your hand local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --shuffle + c:RegisterEffect(e1) + --Shuffle 1 "Flower Cardian" monster from your GY into your Deck, then draw 1 card local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) + e2:SetTarget(s.drtg) + e2:SetOperation(s.drop) c:RegisterEffect(e2) end s.listed_series={SET_FLOWER_CARDIAN} -function s.cfilter(c) - return c:IsFaceup() and c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsLevelBelow(10) +function s.spconfilter(c) + return c:IsLevelBelow(10) and c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsFaceup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) + return Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end + --You cannot Normal or Special Summon monsters for the rest of this turn, except "Flower Cardian" monsters local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c) return not c:IsSetCard(SET_FLOWER_CARDIAN) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() - e2:SetCode(EFFECT_CANNOT_SUMMON) + e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) Duel.RegisterEffect(e2,tp) - aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,2),nil) -end -function s.splimit(e,c) - return not c:IsSetCard(SET_FLOWER_CARDIAN) end -function s.filter(c) - return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsAbleToDeck() +function s.tdfilter(c) + return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsMonster() and c:IsAbleToDeck() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end - if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc) end + if chk==0 then return Duel.IsPlayerCanDraw(tp,1) + and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) - local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) + local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) - if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=1 then return end - Duel.SendtoDeck(tg,nil,SEQ_DECKTOP,REASON_EFFECT) - local g=Duel.GetOperatedGroup() - if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end - local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK|LOCATION_EXTRA) - if ct==1 then +function s.drop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK|LOCATION_EXTRA) then + if tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) end Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end diff --git a/official/c54191698.lua b/official/c54191698.lua index 62c7afe8d0..ed81db033b 100644 --- a/official/c54191698.lua +++ b/official/c54191698.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg1) e1:SetOperation(s.spop1) c:RegisterEffect(e1) @@ -75,4 +75,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end -end \ No newline at end of file +end diff --git a/official/c54358015.lua b/official/c54358015.lua index 137be567ca..5708846896 100644 --- a/official/c54358015.lua +++ b/official/c54358015.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Prevent effect target local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) @@ -55,4 +55,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end function s.tgtg(e,c) return c:IsSetCard(SET_GALAXY) and c~=e:GetHandler() -end \ No newline at end of file +end diff --git a/official/c54366836.lua b/official/c54366836.lua index b18e7b51c2..307b5bef88 100644 --- a/official/c54366836.lua +++ b/official/c54366836.lua @@ -1,46 +1,42 @@ ---No.54 反骨の闘士ライオンハート +--No.54 反骨の闘士ライオンハート --Number 54: Lion Heart local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,1,3) c:EnableReviveLimit() - --cannot be destroyed + --Xyz Summon procedure: 3 Level 1 monsters + Xyz.AddProcedure(c,nil,1,3) + --This Attack Position card cannot be destroyed by battle local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) - e1:SetCondition(s.indcon) + e1:SetRange(LOCATION_MZONE) + e1:SetCondition(function(e) return e:GetHandler():IsAttackPos() end) e1:SetValue(1) c:RegisterEffect(e1) - --inflict damage + --Inflict damage to your opponent equal to the battle damage you took local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetRange(LOCATION_MZONE) - e2:SetCondition(s.damcon) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ep==tp and e:GetHandler():IsRelateToBattle() end) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) - --change battle damage + --Your opponent takes any battle damage you would have taken from that battle local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e3:SetRange(LOCATION_MZONE) - e3:SetCondition(s.damcon2) - e3:SetCost(s.damcost2) - e3:SetOperation(s.damop2) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + e3:SetCondition(function(e,tp) local bc=e:GetHandler():GetBattleTarget() return bc and bc:IsControler(1-tp) end) + e3:SetCost(Cost.AND(Cost.DetachFromSelf(1),Cost.SoftOncePerBattle)) + e3:SetOperation(s.reversedamop) + c:RegisterEffect(e3) end s.xyz_number=54 -function s.damcon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return ep==tp and c:IsRelateToBattle() -end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) @@ -51,24 +47,13 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end -function s.damcon2(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetBattleTarget()~=nil -end -function s.damcost2(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:GetFlagEffect(id)==0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) - c:RegisterFlagEffect(id,RESET_CHAIN,0,1) -end -function s.damop2(e,tp,eg,ep,ev,re,r,rp) +function s.reversedamop(e,tp,eg,ep,ev,re,r,rp) + --Your opponent takes any battle damage you would have taken from that battle local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE|PHASE_DAMAGE_CAL) Duel.RegisterEffect(e1,tp) end -function s.indcon(e) - return e:GetHandler():IsPosition(POS_FACEUP_ATTACK) -end \ No newline at end of file diff --git a/official/c54719828.lua b/official/c54719828.lua index 05aa18609d..2ce019df67 100644 --- a/official/c54719828.lua +++ b/official/c54719828.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=16 function s.target(e,tp,eg,ep,ev,re,r,rp,chk) @@ -50,4 +50,4 @@ function s.aclimit2(e,re,tp) end function s.aclimit3(e,re,tp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsTrapEffect() -end \ No newline at end of file +end diff --git a/official/c5489987.lua b/official/c5489987.lua index 9f05b05873..b93694548c 100644 --- a/official/c5489987.lua +++ b/official/c5489987.lua @@ -3,80 +3,86 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --draw + --Draw 1 card, and if you do, show it, then Special Summon this card if the drawn card is a "Flower Cardian" monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) - e1:SetCost(s.drcost) + e1:SetCost(Cost.SelfReveal) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --atk up + c:RegisterEffect(e1) + --Your battling "Flower Cardian" monster gains 1000 ATK until the end of this turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_HAND) - e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e2:SetHintTiming(TIMING_DAMAGE_STEP) e2:SetCondition(s.atkcon) e2:SetCost(Cost.SelfDiscard) + e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end -function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return not e:GetHandler():IsPublic() end -end +s.listed_series={SET_FLOWER_CARDIAN} function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end + and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,c,2,tp,LOCATION_HAND) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 then + if Duel.Draw(p,d,REASON_EFFECT)>0 then local c=e:GetHandler() - local g=Duel.GetOperatedGroup() - local tc=g:GetFirst() - Duel.ConfirmCards(1-tp,tc) - Duel.BreakEffect() - if tc:IsMonster() and tc:IsSetCard(SET_FLOWER_CARDIAN) then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then if c:IsRelateToEffect(e) then - if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)~=0 then + Duel.BreakEffect() + if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)>0 then c:CompleteProcedure() end end else + local g=Group.FromCards(dc) if c:IsRelateToEffect(e) then g:AddCard(c) end + Duel.BreakEffect() Duel.SendtoGrave(g,REASON_EFFECT) end Duel.ShuffleHand(tp) end end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) - local phase=Duel.GetCurrentPhase() - if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end - local tc=Duel.GetAttackTarget() - if not tc then return false end - if tc:IsControler(1-tp) then tc=Duel.GetAttacker() end - e:SetLabelObject(tc) - return tc:IsFaceup() and tc:IsSetCard(SET_FLOWER_CARDIAN) and tc:IsRelateToBattle() + if not aux.StatChangeDamageStepCondition() then return false end + local bc1,bc2=Duel.GetBattleMonster(tp) + return bc1 and bc2 and bc1:IsSetCard(SET_FLOWER_CARDIAN) +end +function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + local bc=Duel.GetBattleMonster(tp) + e:SetLabelObject(bc) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - local tc=e:GetLabelObject() - if tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsControler(tp) then + local bc=e:GetLabelObject() + if bc:IsRelateToBattle() and bc:IsFaceup() and bc:IsControler(tp) then + --Your battling monster gains 1000 ATK until the end of this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1000) e1:SetReset(RESETS_STANDARD_PHASE_END) - tc:RegisterEffect(e1) + bc:RegisterEffect(e1) end end \ No newline at end of file diff --git a/official/c54919528.lua b/official/c54919528.lua index 93bd49d9cb..f2a398d310 100644 --- a/official/c54919528.lua +++ b/official/c54919528.lua @@ -44,7 +44,7 @@ function s.initial_effect(c) e4:SetCode(EVENT_PHASE|PHASE_STANDBY) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.rmvtg) e4:SetOperation(s.rmvop) c:RegisterEffect(e4) @@ -78,4 +78,4 @@ function s.rmvop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c5530780.lua b/official/c5530780.lua index 9c5f4d7441..8dbf51a70c 100644 --- a/official/c5530780.lua +++ b/official/c5530780.lua @@ -4,96 +4,80 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --2 Level 4 monsters + --Xyz Summon procedure: 2 Level 4 monsters Xyz.AddProcedure(c,nil,4,2) - --Check materials on Xyz Summon + --Check if this card was Xyz Summoned by using an "Exosister" monster as material local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetCode(EFFECT_MATERIAL_CHECK) e0:SetValue(s.valcheck) c:RegisterEffect(e0) - --Effect destruction immunity + --Cannot be destroyed by the activated effects of monsters Special Summoned from the GY local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) + e1:SetRange(LOCATION_MZONE) e1:SetValue(s.indval) c:RegisterEffect(e1) - --Negate + --Negate the effects of 1 Effect Monster your opponent controls until the end of this turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DISABLE) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) - e2:SetCondition(function(e) return e:GetHandler():GetFlagEffect(id)>0 end) - e2:SetTarget(s.ngtg) - e2:SetOperation(s.ngop) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e2:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end) + e2:SetCost(Cost.HintSelectedEffect) + e2:SetTarget(s.distg) + e2:SetOperation(s.disop) c:RegisterEffect(e2) - --Gain ATK + --Apply a "for the rest of this turn, all Xyz Monsters you control will gain 800 ATK" effect local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(s.atkcost) + e3:SetCost(Cost.AND(Cost.DetachFromSelf(1),Cost.HintSelectedEffect)) e3:SetOperation(s.atkop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_EXOSISTER} function s.valcheck(e,c) - local g=c:GetMaterial() - if g:IsExists(Card.IsSetCard,1,nil,SET_EXOSISTER) then - local reset=RESET_EVENT|RESETS_STANDARD-RESET_TOFIELD|RESET_PHASE|PHASE_END - c:RegisterFlagEffect(id,reset,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) + if c:GetMaterial():IsExists(Card.IsSetCard,1,nil,SET_EXOSISTER) then + c:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END&~RESET_TOFIELD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) end end function s.indval(e,re,rp) local rc=re:GetHandler() - return rc:IsSpecialSummoned() and rc:IsSummonLocation(LOCATION_GRAVE) - and re:IsMonsterEffect() and re:IsActivated() + return rc:IsSpecialSummoned() and rc:IsSummonLocation(LOCATION_GRAVE) and re:IsMonsterEffect() and re:IsActivated() end -function s.ngtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local c=e:GetHandler() - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsNegatableMonster() and chkc:IsControler(1-tp) end - if chk==0 then return Duel.IsExistingTarget(Card.IsNegatableMonster,tp,0,LOCATION_MZONE,1,nil) end +function s.disfilter(c) + return c:IsNegatableMonster() and c:IsType(TYPE_EFFECT) +end +function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.disfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.disfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) - local tg=Duel.SelectTarget(tp,Card.IsNegatableMonster,tp,0,LOCATION_MZONE,1,1,nil) - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) - Duel.SetOperationInfo(0,CATEGORY_DISABLE,tg,1,0,0) + local g=Duel.SelectTarget(tp,s.disfilter,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,tp,0) end -function s.ngop(e,tp,eg,ep,ev,re,r,rp) +function s.disop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then - local c=e:GetHandler() - Duel.NegateRelatedChain(tc,RESET_TURN_SET) - --Negate targeted monster's effects - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_DISABLE) - e1:SetReset(RESETS_STANDARD_PHASE_END) - tc:RegisterEffect(e1) - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_DISABLE_EFFECT) - e2:SetValue(RESET_TURN_SET) - e2:SetReset(RESETS_STANDARD_PHASE_END) - tc:RegisterEffect(e2) + if tc:IsRelateToEffect(e) then + --Negate its effects until the end of this turn + tc:NegateEffects(e:GetHandler(),RESET_PHASE|PHASE_END) end end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) -end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - --Increase ATK - local e1=Effect.CreateEffect(e:GetHandler()) + local c=e:GetHandler() + aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,3)) + --For the rest of this turn, all Xyz Monsters you control will gain 800 ATK + local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetTargetRange(LOCATION_MZONE,0) @@ -101,4 +85,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(800) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) -end \ No newline at end of file +end diff --git a/official/c55470553.lua b/official/c55470553.lua index bda4f9b7ad..4ab762b5e2 100644 --- a/official/c55470553.lua +++ b/official/c55470553.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.postg) e1:SetOperation(s.posop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -64,4 +64,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then Duel.Overlay(c,tc,true) end -end \ No newline at end of file +end diff --git a/official/c55727845.lua b/official/c55727845.lua index bd2ee51764..caa96397be 100644 --- a/official/c55727845.lua +++ b/official/c55727845.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=96 function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) @@ -43,4 +43,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c55935416.lua b/official/c55935416.lua index d1b894db89..8cb3cfafff 100644 --- a/official/c55935416.lua +++ b/official/c55935416.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=56 function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) @@ -32,4 +32,4 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c56051086.lua b/official/c56051086.lua index 3d5a9248c3..fc1f55ce06 100644 --- a/official/c56051086.lua +++ b/official/c56051086.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) aux.AddEREquipLimit(c,nil,s.eqval,Card.EquipByEffectAndLimitRegister,e1) --indest local e2=Effect.CreateEffect(c) @@ -88,4 +88,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) Duel.Damage(1-tp,ev,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c56292140.lua b/official/c56292140.lua index 6867a1409c..292bc22ce2 100644 --- a/official/c56292140.lua +++ b/official/c56292140.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetCategory(CATEGORY_COUNTER) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DAMAGE_STEP_END) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.cttg) e2:SetOperation(s.ctop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -59,4 +59,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c56337500.lua b/official/c56337500.lua index 58864c0962..911b0af04b 100644 --- a/official/c56337500.lua +++ b/official/c56337500.lua @@ -4,73 +4,61 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() + --Xyz Summon procedure: 2 Level 3 monsters Xyz.AddProcedure(c,nil,3,2) - Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) - --salvage + --Add 1 "Cynet" Spell/Trap from your GY to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(s.thcost) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.cost)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --spsummon + c:RegisterEffect(e1) + --Special Summon 2 Level 4 Cyberse monsters with different names from your Deck, but their effects are negated local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_DESTROYED) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon) e2:SetCost(s.cost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) + Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsRace(RACE_CYBERSE) end) end s.listed_series={SET_CYNET} -function s.counterfilter(c) - return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsRace(RACE_CYBERSE) -end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end - local e1=Effect.CreateEffect(e:GetHandler()) + local c=e:GetHandler() + --You cannot Special Summon monsters from the Extra Deck the turn you activate either of this card's effects, except Cyberse 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_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsRace(RACE_CYBERSE) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - --lizard check - aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter) -end -function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) - return not c:IsRace(RACE_CYBERSE) and c:IsLocation(LOCATION_EXTRA) -end -function s.lizfilter(e,c) - return not c:IsOriginalRace(RACE_CYBERSE) -end -function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - and s.cost(e,tp,eg,ep,ev,re,r,rp,0) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - s.cost(e,tp,eg,ep,ev,re,r,rp,1) + --"Clock Lizard" check + aux.addTempLizardCheck(c,tp,function(e,c) return not c:IsOriginalRace(RACE_CYBERSE) end) end function s.thfilter(c) - return c:IsSpellTrap() and c:IsSetCard(SET_CYNET) and c:IsAbleToHand() + return c:IsSetCard(SET_CYNET) and c:IsSpellTrap() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() @@ -80,11 +68,11 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp))) - and c:IsPreviousLocation(LOCATION_MZONE) and c:IsXyzSummoned() + return c:IsXyzSummoned() and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp))) + and c:IsPreviousLocation(LOCATION_MZONE) end function s.spfilter(c,e,tp) - return c:IsRace(RACE_CYBERSE) and c:IsLevel(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + return c:IsLevel(4) and c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) @@ -97,21 +85,13 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) local sg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dncheck,1,tp,HINTMSG_SPSUMMON) - if #sg==2 then - local tc=sg:GetFirst() - for tc in aux.Next(sg) do - Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_DISABLE) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e1,true) - local e2=Effect.CreateEffect(e:GetHandler()) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_DISABLE_EFFECT) - e2:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e2,true) + if #sg~=2 then return end + local c=e:GetHandler() + for sc in sg:Iter() do + if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then + --Their effects are negated + sc:NegateEffects(c) end - Duel.SpecialSummonComplete() end -end \ No newline at end of file + Duel.SpecialSummonComplete() +end diff --git a/official/c56410769.lua b/official/c56410769.lua index 9878c68f66..40cad7625a 100644 --- a/official/c56410769.lua +++ b/official/c56410769.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1,1)) + e1:SetCost(Cost.DetachFromSelf(1,1)) e1:SetTarget(s.postg) e1:SetOperation(s.posop) c:RegisterEffect(e1) @@ -52,4 +52,4 @@ function s.poscon(pos) local g=Duel.GetFieldGroup(e:GetHandlerPlayer(),LOCATION_MZONE,0) return #g==g:FilterCount(Card.IsPosition,nil,pos) end -end \ No newline at end of file +end diff --git a/official/c56638325.lua b/official/c56638325.lua index fdf1128da1..bd0a53cfcf 100644 --- a/official/c56638325.lua +++ b/official/c56638325.lua @@ -30,10 +30,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --spsummon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) @@ -97,4 +97,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c56713174.lua b/official/c56713174.lua index aff01402ba..bcc5298b34 100644 --- a/official/c56713174.lua +++ b/official/c56713174.lua @@ -3,7 +3,7 @@ --scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --Discard itself to dd to hand + --Add 1 "Thunder Dragondark" from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfDiscard) - e1:SetTarget(s.thtg) - e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_THUNDRA) - --Add to hand when banished or sent to the GY + e1:SetTarget(s.thtg(s.dragondarkfilter)) + e1:SetOperation(s.thop(s.dragondarkfilter)) + c:RegisterEffect(e1) + --Add 1 "Thunder Dragon" card from your Deck to your hand, except "Thunder Dragondark" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) @@ -23,46 +23,35 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_REMOVE) e2:SetCountLimit(1,id) - e2:SetTarget(s.thtg2) - e2:SetOperation(s.thop2) + e2:SetTarget(s.thtg(s.thundrafilter)) + e2:SetOperation(s.thop(s.thundrafilter)) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_TO_GRAVE) - e3:SetCondition(s.thcon) + e3:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end) c:RegisterEffect(e3) end s.listed_series={SET_THUNDER_DRAGON} s.listed_names={id} -function s.thfilter(c) +function s.dragondarkfilter(c) return c:IsCode(id) and c:IsAbleToHand() end -function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) - 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 -function s.thop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local tc=Duel.GetFirstMatchingCard(s.thfilter,tp,LOCATION_DECK,0,nil) - if tc then - Duel.SendtoHand(tc,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,tc) - end -end -function s.thcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) -end -function s.thfilter2(c) +function s.thundrafilter(c) return c:IsSetCard(SET_THUNDER_DRAGON) and not c:IsCode(id) and c:IsAbleToHand() end -function s.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) +function s.thtg(filter) + return function(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(filter,tp,LOCATION_DECK,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + end end -function s.thop2(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local tc=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil) - if #tc>0 then - Duel.SendtoHand(tc,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,tc) +function s.thop(filter) + return function(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,filter,tp,LOCATION_DECK,0,1,1,nil) + if #g>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) + end end -end \ No newline at end of file +end diff --git a/official/c56832966.lua b/official/c56832966.lua index 8d02e99e40..2921d5528f 100644 --- a/official/c56832966.lua +++ b/official/c56832966.lua @@ -1,64 +1,61 @@ ---SNo.39 希望皇ホープ・ザ・ライトニング +--SNo.39 希望皇ホープ・ザ・ライトニング --Number S39: Utopia the Lightning local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_LIGHT),5,3,s.ovfilter,aux.Stringid(id,0)) c:EnableReviveLimit() - --cannot be Xyz material + --Xyz Summon procedure: 3 Level 5 LIGHT monsters OR 1 Rank 4 "Utopia" monster you control + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_LIGHT),5,3,s.ovfilter,aux.Stringid(id,0)) + --Cannot be used as material for an Xyz Summon + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_SINGLE) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) + e0:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) + e0:SetValue(1) + c:RegisterEffect(e0) + --If this card battles, your opponent cannot activate cards or effects until the end of the Damage Step local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) - e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetCode(EFFECT_CANNOT_ACTIVATE) + e1:SetRange(LOCATION_MZONE) + e1:SetTargetRange(0,1) + e1:SetCondition(function(e) return e:GetHandler():IsRelateToBattle() end) e1:SetValue(1) c:RegisterEffect(e1) - --actlimit + --This card's ATK becomes 5000 during that damage calculation only local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_FIELD) - e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetCode(EFFECT_CANNOT_ACTIVATE) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_ATKCHANGE) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e2:SetRange(LOCATION_MZONE) - e2:SetTargetRange(0,1) - e2:SetValue(1) - e2:SetCondition(s.actcon) + e2:SetCondition(s.atkcon) + e2:SetCost(Cost.AND(Cost.DetachFromSelf(2),Cost.SoftOncePerBattle)) + e2:SetOperation(s.atkop) c:RegisterEffect(e2) - --atk - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetCategory(CATEGORY_ATKCHANGE) - e3:SetType(EFFECT_TYPE_QUICK_O) - e3:SetRange(LOCATION_MZONE) - e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE) - e3:SetCondition(s.atkcon) - e3:SetCost(s.atkcost) - e3:SetOperation(s.atkop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) end s.listed_series={SET_UTOPIA} s.xyz_number=39 function s.ovfilter(c,tp,xyzc) - return c:IsFaceup() and c:IsSetCard(SET_UTOPIA) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) and c:GetRank()==4 + return c:IsRank(4) and c:IsSetCard(SET_UTOPIA,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsFaceup() end -function s.actcon(e) - return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() +function s.atkconfilter(c) + return c:IsSetCard(SET_UTOPIA) and c:IsType(TYPE_XYZ) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetBattleTarget()~=nil and e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,SET_UTOPIA) -end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,2,REASON_COST) and c:GetFlagEffect(id)==0 end - c:RemoveOverlayCard(tp,2,2,REASON_COST) - c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE_CAL,0,1) + local bc=c:GetBattleTarget() + return bc and bc:IsControler(1-tp) and c:GetOverlayGroup():IsExists(s.atkconfilter,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then + --This card's ATK becomes 5000 during that damage calculation only local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) - e1:SetReset(RESET_PHASE|PHASE_DAMAGE_CAL) e1:SetValue(5000) + e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE_CAL) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c56840427.lua b/official/c56840427.lua index 9f29958667..09b53b848c 100644 --- a/official/c56840427.lua +++ b/official/c56840427.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCondition(function(e,tp) return Duel.GetLP(tp)<=1000 end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) @@ -46,4 +46,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e2:SetValue(-1000) sc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c56910167.lua b/official/c56910167.lua index 3a433afe0e..2fbb32e56b 100644 --- a/official/c56910167.lua +++ b/official/c56910167.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end @@ -27,4 +27,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c57031794.lua b/official/c57031794.lua index 2ca958293c..b3f217d64a 100644 --- a/official/c57031794.lua +++ b/official/c57031794.lua @@ -20,17 +20,17 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) e2:SetCondition(aux.NOT(s.quickeffcond)) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --This is a Quick effect if this card has "Super Quantum Red Layer" as Xyz Material local e3=e2:Clone() e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e3:SetCondition(s.quickeffcond) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --Attach 1 "Super Quantum" monster from your hand or field to this card local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) @@ -76,4 +76,4 @@ function s.attachop(e,tp,eg,ep,ev,re,r,rp) if tc and not tc:IsImmuneToEffect(e) then Duel.Overlay(c,tc,true) end -end \ No newline at end of file +end diff --git a/official/c57043117.lua b/official/c57043117.lua index ec683b14b6..6b0bc9b54b 100644 --- a/official/c57043117.lua +++ b/official/c57043117.lua @@ -23,9 +23,9 @@ function s.initial_effect(c) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCountLimit(1) e2:SetHintTiming(TIMING_DAMAGE_STEP) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.efilter(e,te) return te:IsMonsterEffect() and te:GetOwner()~=e:GetOwner() @@ -57,4 +57,4 @@ end function s.damval(e,re,val,r,rp,rc) if (r&REASON_EFFECT)~=0 and rp~=e:GetOwnerPlayer() then return 0 else return val end -end \ No newline at end of file +end diff --git a/official/c57261568.lua b/official/c57261568.lua index 6f8a0de876..7eac1c74b1 100644 --- a/official/c57261568.lua +++ b/official/c57261568.lua @@ -3,81 +3,88 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --special summon rule + --Must first be Special Summoned (from your hand) by Tributing 1 "Flower Cardian" monster, except "Flower Cardian Peony with Butterfly" + local e0=Effect.CreateEffect(c) + e0:SetDescription(aux.Stringid(id,0)) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EFFECT_SPSUMMON_PROC) + e0:SetRange(LOCATION_HAND) + e0:SetCondition(s.selfspcon) + e0:SetTarget(s.selfsptg) + e0:SetOperation(s.selfspop) + c:RegisterEffect(e0) + --Draw 1 card, and if you do, show it, then, if it is a "Flower Cardian" monster, look at the top 3 cards of your opponent's Deck, then place them all on the top or bottom of the Deck in any order local e1=Effect.CreateEffect(c) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetRange(LOCATION_HAND) - e1:SetCode(EFFECT_SPSUMMON_PROC) - e1:SetCondition(s.hspcon) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --draw + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetTarget(s.drtg) + e1:SetOperation(s.drop) + c:RegisterEffect(e1) + --When this card is used as Synchro Material, you can treat it and all other Synchro Materials (that have a Level) as Level 2 monsters local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_DRAW) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM) + e2:SetOperation(s.synop) c:RegisterEffect(e2) - --synchro - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM) - e3:SetOperation(s.synop) - c:RegisterEffect(e3) end s.listed_series={SET_FLOWER_CARDIAN} s.listed_names={id} -function s.hspfilter(c) +function s.selfspfilter(c) return c:IsSetCard(SET_FLOWER_CARDIAN) and not c:IsCode(id) end -function s.hspcon(e,c) +function s.selfspcon(e,c) if c==nil then return true end - return Duel.CheckReleaseGroup(c:GetControler(),s.hspfilter,1,false,1,true,c,c:GetControler(),nil,false,nil) + local tp=c:GetControler() + return Duel.CheckReleaseGroup(tp,s.selfspfilter,1,false,1,true,c,tp,nil,false,nil) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,c) - local g=Duel.SelectReleaseGroup(tp,s.hspfilter,1,1,false,true,true,c,nil,nil,false,nil) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) + local g=Duel.SelectReleaseGroup(tp,s.selfspfilter,1,1,false,true,true,c,nil,nil,false,nil) if g then g:KeepAlive() e:SetLabelObject(g) - return true + return true end return false end -function s.hspop(e,tp,eg,ep,ev,re,r,rp,c) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 then - local tc=Duel.GetOperatedGroup():GetFirst() - Duel.ConfirmCards(1-tp,tc) - if tc:IsMonster() and tc:IsSetCard(SET_FLOWER_CARDIAN) then - local ct=math.min(Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0),3) - if ct==0 then return end + if Duel.Draw(p,d,REASON_EFFECT)>0 then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then + local deck_ct=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0) + local ct=math.min(deck_ct,3) + if ct==0 then Duel.ShuffleHand(tp) return end Duel.BreakEffect() local g=Duel.GetDecktopGroup(1-tp,ct) Duel.ConfirmCards(tp,g) - local opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2)) + local op=0 + if deck_ct>3 then + op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3)) + end Duel.SortDecktop(tp,1-tp,ct) - if opt==0 then + if op==1 then Duel.MoveToDeckBottom(ct,1-tp) end else Duel.BreakEffect() - Duel.SendtoGrave(tc,REASON_EFFECT) + Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end diff --git a/official/c57314798.lua b/official/c57314798.lua index acfb964845..295c6fd9e9 100644 --- a/official/c57314798.lua +++ b/official/c57314798.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destroy as many monsters on the field as possible and each player sets 1 Spell/Trap from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -109,4 +109,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c57450198.lua b/official/c57450198.lua index b0d863cf7d..3aa7560574 100644 --- a/official/c57450198.lua +++ b/official/c57450198.lua @@ -21,17 +21,17 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) e2:SetCondition(aux.NOT(s.quickeffcond)) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --This is a Quick effect if this card has "Super Quantum White Layer" as Xyz Material local e3=e2:Clone() e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e3:SetCondition(s.quickeffcond) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --Attach 1 "Super Quantum" monster from your hand or field to this card local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) @@ -81,4 +81,4 @@ function s.attachop(e,tp,eg,ep,ev,re,r,rp) if tc and not tc:IsImmuneToEffect(e) then Duel.Overlay(c,tc,true) end -end \ No newline at end of file +end diff --git a/official/c57566760.lua b/official/c57566760.lua index c8b64c8173..4791fc2435 100644 --- a/official/c57566760.lua +++ b/official/c57566760.lua @@ -32,9 +32,9 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_DAMAGE_STEP_END) e4:SetCondition(s.atcon) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetOperation(s.atop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_series={SET_MIKANKO} function s.thfilter(c) @@ -60,4 +60,4 @@ function s.atop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToBattle() then Duel.ChainAttack() end -end \ No newline at end of file +end diff --git a/official/c57707471.lua b/official/c57707471.lua index 7fbf337933..c54a44a8ed 100644 --- a/official/c57707471.lua +++ b/official/c57707471.lua @@ -18,10 +18,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.xyz_number=21 function s.ovfilter(c,tp,xyzc) @@ -46,4 +46,4 @@ end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c58058134.lua b/official/c58058134.lua index 4f11743cac..5a9a1a01d8 100644 --- a/official/c58058134.lua +++ b/official/c58058134.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.negcon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.valcon(e,re,r,rp) return (r&REASON_BATTLE)~=0 @@ -50,4 +50,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) then Duel.Destroy(rc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c58069384.lua b/official/c58069384.lua index 2fdf6a7307..8650d1408f 100644 --- a/official/c58069384.lua +++ b/official/c58069384.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Increase ATK by 2100 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -98,4 +98,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c581014.lua b/official/c581014.lua index 974ae8a7cd..e959210d0a 100644 --- a/official/c581014.lua +++ b/official/c581014.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.spfilter(c,e,tp) return c:IsNonEffectMonster() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) @@ -72,4 +72,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end -end \ No newline at end of file +end diff --git a/official/c58201062.lua b/official/c58201062.lua index 5f7d68c1d4..9ce96afc02 100644 --- a/official/c58201062.lua +++ b/official/c58201062.lua @@ -10,10 +10,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) - e1:SetCost(s.thcost) + e1:SetCost(DragonRuler.SelfDiscardCost(ATTRIBUTE_LIGHT)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DRAGON_RULER) + c:RegisterEffect(e1) --Special Summon 1 "Chasmatis, Dragon Ruler of Auroras" from your GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -29,17 +29,6 @@ function s.initial_effect(c) end s.listed_series={SET_DRAGON_RULER} s.listed_names={id,4965193} --"Chasmatis, Dragon Ruler of Auroras" -function s.thcostfilter(c) - return (c:IsAttribute(ATTRIBUTE_LIGHT) or c:IsRace(RACE_DRAGON)) and c:IsDiscardable() -end -function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.thcostfilter,tp,LOCATION_HAND,0,1,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.thcostfilter,tp,LOCATION_HAND,0,1,1,c) - g:AddCard(c) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) -end function s.thfilter(c) return c:IsSetCard(SET_DRAGON_RULER) and c:IsMonster() and c:IsAbleToHand() and not c:IsCode(id) end @@ -84,4 +73,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c58504745.lua b/official/c58504745.lua index fd411b8a1d..a6a9959a2c 100644 --- a/official/c58504745.lua +++ b/official/c58504745.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_FIRE_FIST,SET_FIRE_FORMATION} function s.filter1(c) @@ -39,4 +39,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c58600555.lua b/official/c58600555.lua index 5a48be649a..1403635c0a 100644 --- a/official/c58600555.lua +++ b/official/c58600555.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Change position local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -76,4 +76,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.Overlay(c,g) end -end \ No newline at end of file +end diff --git a/official/c58712976.lua b/official/c58712976.lua index 189b2a3289..b9fb9996cf 100644 --- a/official/c58712976.lua +++ b/official/c58712976.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -60,4 +60,4 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) if #rg>0 then Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c58720904.lua b/official/c58720904.lua index 34dfc1b7c9..1a3cc7dbcb 100644 --- a/official/c58720904.lua +++ b/official/c58720904.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>0 end @@ -56,4 +56,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.BreakEffect() Duel.SetLP(1-tp,3000) end -end \ No newline at end of file +end diff --git a/official/c58820923.lua b/official/c58820923.lua index 5cc9562242..627439d2d3 100644 --- a/official/c58820923.lua +++ b/official/c58820923.lua @@ -26,10 +26,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.atkcon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.xyz_number=95 function s.ovfilter(c,tp,xyzc) @@ -87,4 +87,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c58858807.lua b/official/c58858807.lua index f28dd90670..837d2eb708 100644 --- a/official/c58858807.lua +++ b/official/c58858807.lua @@ -4,27 +4,27 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon procedure + --Xyz Summon procedure: 2+ Level 4 monsters Xyz.AddProcedure(c,nil,4,2,nil,nil,Xyz.InfiniteMats) - --Add 1 "tellarknight" and/or 1 "Constellar" card from the GY to the hand + --Add 1 "tellarknight" and/or 1 "Constellar" card from your GY to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) - --Apply the effect of 1 "tellarknight" or "Constellar" monster + --This effect becomes the effect of the banished "tellarknight" or "Constellar" monster that activates when it is Normal Summoned local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(s.applycost) + e2:SetCost(Cost.AND(s.applycost,Cost.DetachFromSelf(1))) e2:SetTarget(s.applytg) e2:SetOperation(s.applyop) c:RegisterEffect(e2) @@ -33,7 +33,7 @@ s.listed_series={SET_TELLARKNIGHT,SET_CONSTELLAR} function s.thfilter(c,e) return c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e) end -function s.rescon(sg) +function s.rescon(sg,e,tp,mg) return #sg==1 or (sg:IsExists(Card.IsSetCard,1,nil,SET_TELLARKNIGHT) and sg:IsExists(Card.IsSetCard,1,nil,SET_CONSTELLAR)) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) @@ -49,58 +49,77 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(tg,nil,REASON_EFFECT) end end -function s.rmvfilter(c,tp) - if not (c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsAbleToRemoveAsCost() - and c:IsHasEffect(id)) then - return false - end - local eff=c:GetCardEffect(id) - local te=eff:GetLabelObject() - local con=te:GetCondition() - local tg=te:GetTarget() - if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) - and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) then - return true +function s.rmfilter(c,e,tp) + if not (c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsMonster() and c:IsAbleToRemoveAsCost()) then return false end + local effs={c:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:GetCode()==EVENT_SUMMON_SUCCESS then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + return true + end + end end return false end function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) - and Duel.IsExistingMatchingCard(s.rmvfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,tp) end + if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local sc=Duel.SelectMatchingCard(tp,s.rmvfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,tp):GetFirst() - Duel.Remove(sc,POS_FACEUP,REASON_COST) - sc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1) - e:SetLabelObject(sc:GetCardEffect(id):GetLabelObject()) - c:RemoveOverlayCard(tp,1,1,REASON_COST) + local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + Duel.Remove(rc,POS_FACEUP,REASON_COST) + local available_effs={} + local effs={rc:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:GetCode()==EVENT_SUMMON_SUCCESS then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + table.insert(available_effs,eff) + end + end + end + e:SetLabelObject(available_effs) end function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local te=e:GetLabelObject() - local tg=te and te:GetTarget() or nil - if chkc then return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end + if chkc then + local eff=e:GetLabelObject() + return eff and eff:GetTarget() and eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0,chkc) + end if chk==0 then return true end - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) - e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local eff=nil + local available_effs=e:GetLabelObject() + if #available_effs>1 then + local available_effs_desc={} + for _,eff in ipairs(available_effs) do + table.insert(available_effs_desc,eff:GetDescription()) + end + local op=Duel.SelectOption(tp,table.unpack(available_effs_desc)) + eff=available_effs[op+1] + else + eff=available_effs[1] + end + Duel.Hint(HINT_OPSELECTED,1-tp,eff:GetDescription()) + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + e:SetProperty(eff:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local tg=eff:GetTarget() if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end - e:SetLabelObject(te) + eff:SetLabel(e:GetLabel()) + eff:SetLabelObject(e:GetLabelObject()) + e:SetLabelObject(eff) Duel.ClearOperationInfo(0) end function s.applyop(e,tp,eg,ep,ev,re,r,rp) - local te=e:GetLabelObject() - if not te then return end - local sc=te:GetHandler() - if sc:GetFlagEffect(id)==0 then - e:SetLabel(0) - e:SetLabelObject(nil) - return - end - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) - local op=te:GetOperation() + local eff=e:GetLabelObject() + if not eff then return end + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + local op=eff:GetOperation() if op then op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) end diff --git a/official/c58931850.lua b/official/c58931850.lua index 50b54590ad..fb52423905 100644 --- a/official/c58931850.lua +++ b/official/c58931850.lua @@ -34,7 +34,7 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCondition(function(e,tp) return Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE)>=25 end) - e4:SetCost(Cost.Detach(1,1)) + e4:SetCost(Cost.DetachFromSelf(1,1)) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) c:RegisterEffect(e4) @@ -57,4 +57,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c59071624.lua b/official/c59071624.lua index e5c3f92b12..5952941eb2 100644 --- a/official/c59071624.lua +++ b/official/c59071624.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(2)) + e2:SetCost(Cost.DetachFromSelf(2)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --If an opponent's monster is in GY/banished due to your effect, special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -36,14 +36,14 @@ function s.initial_effect(c) e3:SetCode(EVENT_TO_GRAVE) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetCondition(s.sscon) e3:SetTarget(s.sstg) e3:SetOperation(s.ssop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_REMOVE) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end --Part of "Traptrix" archetype s.listed_series={SET_TRAPTRIX} diff --git a/official/c5916510.lua b/official/c5916510.lua index 599b79cd74..60ff0779ce 100644 --- a/official/c5916510.lua +++ b/official/c5916510.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,{id,0}) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special Summon itself from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -67,4 +67,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) and tc:IsRelateToEffect(e) and s.matfilter(tc) and not tc:IsImmuneToEffect(e) then Duel.Overlay(c,tc,true) end -end \ No newline at end of file +end diff --git a/official/c59170782.lua b/official/c59170782.lua index 04f161119c..a0595b5869 100644 --- a/official/c59170782.lua +++ b/official/c59170782.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.tgcon1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.tgop1) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Change battle target local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) @@ -22,9 +22,9 @@ function s.initial_effect(c) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.tgcon2) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(s.tgop2) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Special Summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -91,4 +91,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c59208943.lua b/official/c59208943.lua index c3d231e021..b8fad2bf9a 100644 --- a/official/c59208943.lua +++ b/official/c59208943.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --attach local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -69,4 +69,4 @@ function s.matop(e,tp,eg,ep,ev,re,r,rp) Duel.Overlay(tc,g) end end -end \ No newline at end of file +end diff --git a/official/c59242457.lua b/official/c59242457.lua index dfdac7124b..fcea49e857 100644 --- a/official/c59242457.lua +++ b/official/c59242457.lua @@ -28,10 +28,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Return material to Extra Deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -99,4 +99,4 @@ function s.teop(e,tp,eg,ep,ev,re,r,rp) tc:CompleteProcedure() end end -end \ No newline at end of file +end diff --git a/official/c59627393.lua b/official/c59627393.lua index 3d37048b91..606cc67817 100644 --- a/official/c59627393.lua +++ b/official/c59627393.lua @@ -2,75 +2,49 @@ --Number 105: Battlin' Boxer Star Cestus local s,id=GetID() function s.initial_effect(c) - --Must be properly summoned before reviving c:EnableReviveLimit() - --Xyz summon procedure + --Xyz Summon procedure: 3 Level 4 monsters Xyz.AddProcedure(c,nil,4,3) - --Make your battling "Battlin' Boxer" monster unable to be destroyed by battle and opponent takes the damage instead + --Negate the effects of that opponent's monster while it is face-up until the end of this turn, that monster you control cannot be destroyed by that battle, also your opponent takes any battle damage you would have taken from that battle local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetHintTiming(TIMING_BATTLE_PHASE) - e1:SetCondition(s.condition) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetHintTiming(TIMING_ATTACK|TIMING_BATTLE_PHASE) + e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) + e1:SetCondition(s.discon) + e1:SetCost(Cost.DetachFromSelf(1)) + e1:SetOperation(s.disop) + c:RegisterEffect(e1) end -s.listed_series={SET_BATTLIN_BOXER} s.xyz_number=105 -function s.condition(e,tp,eg,ep,ev,re,r,rp) - local a=Duel.GetAttacker() - local at=Duel.GetAttackTarget() - return Duel.IsBattlePhase() and at and ((a:IsControler(tp) and a:IsOnField() and a:IsSetCard(SET_BATTLIN_BOXER)) - or (at:IsControler(tp) and at:IsOnField() and at:IsFaceup() and at:IsSetCard(SET_BATTLIN_BOXER))) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_DAMAGE,0,1) -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end - Duel.SetTargetCard(Duel.GetAttacker()) - Duel.SetTargetCard(Duel.GetAttackTarget()) +s.listed_series={SET_BATTLIN_BOXER} +function s.discon(e,tp,eg,ep,ev,re,r,rp) + local bc1,bc2=Duel.GetBattleMonster(tp) + return bc1 and bc2 and bc1:IsSetCard(SET_BATTLIN_BOXER) and bc1:IsFaceup() end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local a=Duel.GetAttacker() - local at=Duel.GetAttackTarget() - if at:IsControler(tp) then a,at=at,a end - if a:IsFacedown() or not a:IsRelateToEffect(e) or not at:IsRelateToEffect(e) then return end - --Cannot be destroyed by battle - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetDescription(3000) - e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) - e1:SetValue(1) - e1:SetReset(RESET_PHASE|PHASE_DAMAGE) - a:RegisterEffect(e1,true) - --Opponent takes the battle damage instead - local e2=Effect.CreateEffect(e:GetHandler()) - e2:SetDescription(3112) - e2:SetProperty(EFFECT_FLAG_CLIENT_HINT) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) - e2:SetValue(1) - e2:SetReset(RESET_PHASE|PHASE_DAMAGE) - a:RegisterEffect(e2,true) - --Negate opponent's battling monster - if at:IsType(TYPE_EFFECT) then - local e3=Effect.CreateEffect(e:GetHandler()) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_DISABLE) - e3:SetReset(RESETS_STANDARD_PHASE_END) - at:RegisterEffect(e3) - local e4=Effect.CreateEffect(e:GetHandler()) - e4:SetType(EFFECT_TYPE_SINGLE) - e4:SetCode(EFFECT_DISABLE_EFFECT) - e4:SetReset(RESETS_STANDARD_PHASE_END) - at:RegisterEffect(e4) +function s.disop(e,tp,eg,ep,ev,re,r,rp) + local bc1,bc2=Duel.GetBattleMonster(tp) + if bc2:IsRelateToBattle() and bc2:IsNegatableMonster() then + --Negate the effects of that opponent's monster while it is face-up until the end of this turn + bc2:NegateEffects(RESET_PHASE|PHASE_END) + end + if bc1:IsRelateToBattle() then + --That monster you control cannot be destroyed by that battle + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(3000) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetValue(1) + e1:SetReset(RESET_PHASE|PHASE_DAMAGE) + bc1:RegisterEffect(e1,true) + --Also your opponent takes any battle damage you would have taken from that battle + local e2=e1:Clone() + e2:SetDescription(3112) + e2:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) + bc1:RegisterEffect(e2,true) end -end \ No newline at end of file +end diff --git a/official/c60195675.lua b/official/c60195675.lua index a52e7923f8..b3e894b15b 100644 --- a/official/c60195675.lua +++ b/official/c60195675.lua @@ -22,9 +22,9 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetOperation(s.atkop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Special Summon this card from the GY in Defense Position local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -85,4 +85,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end -end \ No newline at end of file +end diff --git a/official/c60517697.lua b/official/c60517697.lua index a59d5d7679..f78a70473e 100644 --- a/official/c60517697.lua +++ b/official/c60517697.lua @@ -4,7 +4,7 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon procedure: 3 Level 7 monsters + --Xyz Summon procedure: 3 Level 7 monsters OR 1 "Atlantean" or "Mermail" Xyz Monster you control Xyz.AddProcedure(c,nil,7,3,s.ovfilter,aux.Stringid(id,0),3,s.xyzop) --Return up to 3 cards your opponent controls to the hand local e1=Effect.CreateEffect(c) @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.thcost) - e1:SetTarget(s.thtg) - e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(2),s.rthcost)) + e1:SetTarget(s.rthtg) + e1:SetOperation(s.rthop) + c:RegisterEffect(e1) --Special Summon 3 Level 3 or lower Fish, Sea Serpent, and/or Aqua monsters from your hand and/or GY. local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) @@ -33,30 +33,26 @@ end s.listed_series={SET_ATLANTEAN,SET_MERMAIL} s.listed_names={id} function s.ovfilter(c,tp,lc) - return c:IsFaceup() and c:IsSetCard(s.listed_series,lc,SUMMON_TYPE_XYZ,tp) and c:IsType(TYPE_XYZ,lc,SUMMON_TYPE_XYZ,tp) + return c:IsSetCard(s.listed_series,lc,SUMMON_TYPE_XYZ,tp) and c:IsType(TYPE_XYZ,lc,SUMMON_TYPE_XYZ,tp) and c:IsFaceup() end function s.xyzop(e,tp,chk) if chk==0 then return not Duel.HasFlagEffect(tp,id) end - Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,EFFECT_FLAG_OATH,1) - return true + return Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,EFFECT_FLAG_OATH,1) end -function s.thcostfilter(c) +function s.rthcostfilter(c) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost() end -function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,2,REASON_COST) - and Duel.IsExistingMatchingCard(s.thcostfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil) end - c:RemoveOverlayCard(tp,2,2,REASON_COST) +function s.rthcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.rthcostfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.thcostfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.rthcostfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end -function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_ONFIELD) end -function s.thop(e,tp,eg,ep,ev,re,r,rp) +function s.rthop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,3,nil) if #g>0 then @@ -88,4 +84,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g==3 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c60645181.lua b/official/c60645181.lua index 4d7376f41c..58705f789c 100644 --- a/official/c60645181.lua +++ b/official/c60645181.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -26,4 +26,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END,2) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c60992364.lua b/official/c60992364.lua index 976cf47e11..b83881272a 100644 --- a/official/c60992364.lua +++ b/official/c60992364.lua @@ -18,10 +18,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Equip this card on the field to 1 "Utopia" monster local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -123,4 +123,4 @@ function s.atop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c613013.lua b/official/c613013.lua index 2b2c1882d7..3a01fd2b20 100644 --- a/official/c613013.lua +++ b/official/c613013.lua @@ -27,7 +27,7 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSetCard(SET_SHARK_DRAKE) and re:IsSpellTrapEffect() and Duel.IsChainDisablable(ev) end) - e3:SetCost(Cost.Detach(2,2,nil)) + e3:SetCost(Cost.DetachFromSelf(2,2,nil)) e3:SetTarget(s.distg) e3:SetOperation(s.disop) c:RegisterEffect(e3) @@ -78,4 +78,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c61307542.lua b/official/c61307542.lua index 4a66361639..c0c38fe41e 100644 --- a/official/c61307542.lua +++ b/official/c61307542.lua @@ -36,10 +36,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) e3:SetCondition(s.descon) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.efilter(e,re) return re:IsMonsterEffect() and re:GetOwner()~=e:GetOwner() diff --git a/official/c61344030.lua b/official/c61344030.lua index 59fe12f3a3..a93d79844f 100644 --- a/official/c61344030.lua +++ b/official/c61344030.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --draw local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -75,4 +75,4 @@ end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c61374414.lua b/official/c61374414.lua index 25afbc871d..994983918c 100644 --- a/official/c61374414.lua +++ b/official/c61374414.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMBER} s.listed_names={34876719} @@ -83,4 +83,4 @@ end function s.desop(e,tp,eg,ep,ev,re,r,rp) local sc=e:GetLabelObject() Duel.Destroy(sc,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c61399402.lua b/official/c61399402.lua index d0fddc7996..6a371945e9 100644 --- a/official/c61399402.lua +++ b/official/c61399402.lua @@ -4,65 +4,70 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() + --Xyz Summon procedure: 2 Level 4 monsters Xyz.AddProcedure(c,nil,4,2) - --destroy monsters + --If a monster(s) you control would be destroyed by card effect, you can detach 1 material from this card instead local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_DESTROY) - e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e1:SetCode(EFFECT_DESTROY_REPLACE) e1:SetRange(LOCATION_MZONE) - e1:SetCountLimit(1,id) - e1:SetCost(s.descost) - e1:SetTarget(s.destg) - e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --special summon + e1:SetTarget(s.reptg) + e1:SetValue(function(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end) + c:RegisterEffect(e1) + --Dstroy face-up monsters your opponent controls, up to the number of "@Ignister" monsters you control local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_SPECIAL_SUMMON) - e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e2:SetCode(EVENT_BATTLE_DAMAGE) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_DESTROY) + e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) - e2:SetCountLimit(1,{id,1}) - e2:SetCondition(s.spcon) - e2:SetTarget(s.sptg) - e2:SetOperation(s.spop) + e2:SetCountLimit(1,id) + e2:SetCost(Cost.DetachFromSelf(1)) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) c:RegisterEffect(e2) - --destruction replacement + --Special Summon 1 Link Monster from your GY local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e3:SetCode(EFFECT_DESTROY_REPLACE) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetRange(LOCATION_MZONE) - e3:SetTarget(s.reptg) - e3:SetValue(s.repval) + e3:SetCountLimit(1,{id,1}) + e3:SetCondition(s.spcon) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_IGNISTER} -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.repfilter(c,tp) + return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE) +end +function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) + if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end + return Duel.SelectEffectYesNo(tp,c,96) and c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)>0 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) if chk==0 then return #g>0 and Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_IGNISTER),tp,LOCATION_MZONE,0,nil)>0 end - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_IGNISTER),tp,LOCATION_MZONE,0,nil) - if ct<1 then return end + if ct==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,ct,nil) if #g>0 then + Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - local tc=eg:GetFirst() - return ep==1-tp and tc:IsControler(tp) and tc:IsRace(RACE_CYBERSE) and tc~=e:GetHandler() + local bc=eg:GetFirst() + return ep==1-tp and bc:IsControler(tp) and bc:IsRace(RACE_CYBERSE) and bc~=e:GetHandler() end function s.spfilter(c,e,tp) - return c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + return c:IsLinkMonster() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 @@ -72,23 +77,8 @@ end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end -function s.repfilter(c,tp) - return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) - and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE) -end -function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end - if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then - local c=e:GetHandler() - c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) - return true - else return false end -end -function s.repval(e,c) - return s.repfilter(c,e:GetHandlerPlayer()) -end \ No newline at end of file diff --git a/official/c61641818.lua b/official/c61641818.lua index 9922a4b2c2..ad11e55296 100644 --- a/official/c61641818.lua +++ b/official/c61641818.lua @@ -24,7 +24,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(2)) + e2:SetCost(Cost.DetachFromSelf(2)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) diff --git a/official/c6165656.lua b/official/c6165656.lua index cd4d502ffb..ce219c6884 100644 --- a/official/c6165656.lua +++ b/official/c6165656.lua @@ -27,10 +27,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --win local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -82,4 +82,4 @@ function s.wincon(e,tp,eg,ep,ev,re,r,rp) end function s.winop(e,tp,eg,ep,ev,re,r,rp) Duel.Win(tp,WIN_REASON_DISASTER_LEO) -end \ No newline at end of file +end diff --git a/official/c62070231.lua b/official/c62070231.lua index cc6c786f45..947033cb6e 100644 --- a/official/c62070231.lua +++ b/official/c62070231.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCondition(aux.StatChangeDamageStepCondition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=94 function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) @@ -41,4 +41,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c6247535.lua b/official/c6247535.lua index 7e13a454ac..973d23f2fb 100644 --- a/official/c6247535.lua +++ b/official/c6247535.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_BORREL} function s.mfilter(c,lc,sumtype,tp) @@ -111,4 +111,4 @@ end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c62517849.lua b/official/c62517849.lua index 64b0a69600..0a578f11c3 100644 --- a/official/c62517849.lua +++ b/official/c62517849.lua @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) @@ -81,4 +81,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e2:SetValue(sc:GetTextAttack()*2) e2:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e2) -end \ No newline at end of file +end diff --git a/official/c62541668.lua b/official/c62541668.lua index e8cbeb35da..4e74cff50d 100644 --- a/official/c62541668.lua +++ b/official/c62541668.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(2,2,nil)) + e1:SetCost(Cost.DetachFromSelf(2,2,nil)) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Protect itself from destruction local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) @@ -66,4 +66,4 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) return true else return false end -end \ No newline at end of file +end diff --git a/official/c62709239.lua b/official/c62709239.lua index f51530087f..16704f5a44 100644 --- a/official/c62709239.lua +++ b/official/c62709239.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -102,4 +102,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end function s.splimit(e,c) return not c:IsAttribute(ATTRIBUTE_DARK) -end \ No newline at end of file +end diff --git a/official/c6284176.lua b/official/c6284176.lua index c52764d729..4171fc06da 100644 --- a/official/c6284176.lua +++ b/official/c6284176.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --destroy replace local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -92,4 +92,4 @@ function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,1-tp,id) local tc=Duel.GetFirstTarget() Duel.Release(tc,REASON_EFFECT|REASON_REPLACE) -end \ No newline at end of file +end diff --git a/official/c62967433.lua b/official/c62967433.lua index 908d8e20b4..476976c8c2 100644 --- a/official/c62967433.lua +++ b/official/c62967433.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,{id,0}) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.tdtg) e1:SetOperation(s.tdop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special Summon 1 Level 4 monster from your hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -68,4 +68,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c63274863.lua b/official/c63274863.lua index 03ec5dd5f1..e30d108f94 100644 --- a/official/c63274863.lua +++ b/official/c63274863.lua @@ -2,46 +2,45 @@ --Satellarknight Sirius local s,id=GetID() function s.initial_effect(c) - --Shuffle 5 "tellarknight" monsters into the Deck and draw 1 card - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Shuffle 5 "tellarknight" monsters from your GY into the Deck, then draw 1 card + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.tdtg) + e1a:SetOperation(s.tdop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) end s.listed_series={SET_TELLARKNIGHT} -function s.filter(c) +function s.tdfilter(c) return c:IsSetCard(SET_TELLARKNIGHT) and c:IsMonster() and c:IsAbleToDeck() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end +function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) - and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,5,nil) end + and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,5,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) - local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,5,5,nil) - Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,0,0) + local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,5,5,nil) + Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,tp,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) - if #tg~=5 then return end - Duel.SendtoDeck(tg,nil,SEQ_DECKTOP,REASON_EFFECT) - local g=Duel.GetOperatedGroup() - if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end - local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK|LOCATION_EXTRA) - if ct==5 then - Duel.BreakEffect() - Duel.Draw(tp,1,REASON_EFFECT) + if #tg==5 and Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==5 + and tg:FilterCount(Card.IsLocation,nil,LOCATION_DECK|LOCATION_EXTRA)==5 then + if Duel.GetOperatedGroup():IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end + if Duel.IsPlayerCanDraw(tp) then + Duel.BreakEffect() + Duel.Draw(tp,1,REASON_EFFECT) + end end end \ No newline at end of file diff --git a/official/c63746411.lua b/official/c63746411.lua index 9fe3874dc7..ffd150527d 100644 --- a/official/c63746411.lua +++ b/official/c63746411.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=106 function s.condition(e,tp,eg,ep,ev,re,r,rp) @@ -51,4 +51,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.rcon(e) return e:GetOwner():IsHasCardTarget(e:GetHandler()) -end \ No newline at end of file +end diff --git a/official/c63767246.lua b/official/c63767246.lua index 36900da489..6bcb4c6126 100644 --- a/official/c63767246.lua +++ b/official/c63767246.lua @@ -24,9 +24,9 @@ function s.initial_effect(c) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_MZONE) e2:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()~=e:GetHandler() end) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetOperation(s.chngtgop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Make 1 of your Xyz monsters gain ATK local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -99,4 +99,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(g:GetFirst():GetBaseAttack()) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) -end \ No newline at end of file +end diff --git a/official/c6387204.lua b/official/c6387204.lua index bde33d679a..605741589c 100644 --- a/official/c6387204.lua +++ b/official/c6387204.lua @@ -1,11 +1,11 @@ ---CNo.6 先史遺産カオス・アトランタル +--CNo.6 先史遺産カオス・アトランタル --Number C6: Chronomaly Chaos Atlandis local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,7,3) c:EnableReviveLimit() - --equip + --Xyz Summon procedure: 3 Level 7 monsters + Xyz.AddProcedure(c,nil,7,3) + --Equip 1 monster your opponent controls to this card as an Equip Spell Card whose effect makes this monster gain 1000 ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_EQUIP) @@ -17,19 +17,33 @@ function s.initial_effect(c) e1:SetOperation(s.eqop) c:RegisterEffect(e1) aux.AddEREquipLimit(c,nil,function(ec,_,tp) return ec:IsControler(1-tp) end,s.equipop,e1) - --lp + --Make your opponent's Life Points 100 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) - e2:SetCondition(s.lpcon) - e2:SetCost(s.lpcost) + e2:SetCondition(function(e,tp) return Duel.GetLP(1-tp)~=100 and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,9161357) end) + e2:SetCost(Cost.AND(Cost.DetachFromSelf(3),s.lpcost)) e2:SetOperation(s.lpop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMBER} s.xyz_number=6 s.listed_names={9161357} +function s.nodamage(e,tp) + if Duel.HasFlagEffect(tp,id) then return end + Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) + --Your opponent takes no further damage this turn + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,2)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetCode(EFFECT_CHANGE_DAMAGE) + e1:SetTargetRange(0,1) + e1:SetValue(0) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) +end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToChangeControler() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 @@ -40,53 +54,31 @@ function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.equipop(c,e,tp,tc) if not c:EquipByEffectAndLimitRegister(e,tp,tc,id) then return end - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_EQUIP) - e2:SetCode(EFFECT_UPDATE_ATTACK) - e2:SetReset(RESET_EVENT|RESETS_STANDARD) - e2:SetValue(1000) - tc:RegisterEffect(e2) + --Equipped monster gains 1000 ATK + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_EQUIP) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + e1:SetValue(1000) + tc:RegisterEffect(e1) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then + if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then s.equipop(c,e,tp,tc) end - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_FIELD) - e3:SetCode(EFFECT_CHANGE_DAMAGE) - e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e3:SetTargetRange(0,1) - e3:SetValue(0) - e3:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(e3,tp) - local e4=e3:Clone() - e4:SetCode(EFFECT_NO_EFFECT_DAMAGE) - e4:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(e4,tp) -end -function s.lpcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetLP(1-tp)~=100 and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,9161357) + s.nodamage(e,tp) end -function s.filter(c) - return c:GetFlagEffect(id)~=0 and c:IsSetCard(SET_NUMBER) and c:IsFaceup() and c:IsAbleToGraveAsCost() +function s.lpcostfilter(c) + return c:HasFlagEffect(id) and c:IsSetCard(SET_NUMBER) and c:IsFaceup() and c:IsAbleToGraveAsCost() end function s.lpcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) - and e:GetHandler():GetEquipGroup():IsExists(s.filter,1,nil) end - e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST) - local g=e:GetHandler():GetEquipGroup():Filter(s.filter,nil) - Duel.SendtoGrave(g,REASON_COST) + local eqg=e:GetHandler():GetEquipGroup():Filter(s.lpcostfilter,nil) + if chk==0 then return #eqg>0 end + Duel.SendtoGrave(eqg,REASON_COST) end function s.lpop(e,tp,eg,ep,ev,re,r,rp) Duel.SetLP(1-tp,100) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CHANGE_DAMAGE) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e1:SetTargetRange(0,1) - e1:SetValue(0) - e1:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(e1,tp) -end \ No newline at end of file + s.nodamage(e,tp) +end diff --git a/official/c64182380.lua b/official/c64182380.lua index 3dcc6eeff0..caf684877c 100644 --- a/official/c64182380.lua +++ b/official/c64182380.lua @@ -26,7 +26,7 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.stdestg) e2:SetOperation(s.stdesop) c:RegisterEffect(e2) @@ -101,4 +101,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c64245689.lua b/official/c64245689.lua index 58e7bc7a0c..99490ae61a 100644 --- a/official/c64245689.lua +++ b/official/c64245689.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.tgfilter(c) return c:IsRace(RACE_PLANT) and c:IsAbleToGrave() @@ -60,4 +60,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end -end \ No newline at end of file +end diff --git a/official/c64276752.lua b/official/c64276752.lua index 7e842ca791..7321b46b9c 100644 --- a/official/c64276752.lua +++ b/official/c64276752.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1,id) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.indescon(e) return e:GetHandler():IsXyzSummoned() @@ -83,4 +83,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) end function s.ftarget(e,c) return e:GetLabel()~=c:GetFieldID() -end \ No newline at end of file +end diff --git a/official/c64332231.lua b/official/c64332231.lua index f6bc6a2670..574a17c472 100644 --- a/official/c64332231.lua +++ b/official/c64332231.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsReleasableByEffect,1,nil) @@ -35,4 +35,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(dg) Duel.Destroy(dg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c64414267.lua b/official/c64414267.lua index f41f5abf80..9adab994b1 100644 --- a/official/c64414267.lua +++ b/official/c64414267.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) e2:SetCondition(aux.NOT(s.quickcon)) - e2:SetCost(Cost.AND(Cost.Detach(1),Cost.Discard())) + e2:SetCost(Cost.AND(Cost.DetachFromSelf(1),Cost.Discard())) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) local e3=e2:Clone() e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) @@ -75,4 +75,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) e1:SetTarget(function(e,c,sump,sumtype) return (sumtype&SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) -end \ No newline at end of file +end diff --git a/official/c64554883.lua b/official/c64554883.lua index 93a59b1e79..aaabb96372 100644 --- a/official/c64554883.lua +++ b/official/c64554883.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=25 function s.filter(c) @@ -46,4 +46,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c64689404.lua b/official/c64689404.lua index 485cf83396..ac61de8d28 100644 --- a/official/c64689404.lua +++ b/official/c64689404.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.ractg) e1:SetOperation(s.racop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -61,4 +61,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if bc and bc:IsRelateToBattle() then Duel.Destroy(bc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c65056481.lua b/official/c65056481.lua index ff8864a47e..6d51bd3f27 100644 --- a/official/c65056481.lua +++ b/official/c65056481.lua @@ -2,23 +2,23 @@ --Satellarknight Alsahm local s,id=GetID() function s.initial_effect(c) - --Inflict 1000 damage to the opponent - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_DAMAGE) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetTarget(s.damtg) - e1:SetOperation(s.damop) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Inflict 1000 damage to your opponent + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_DAMAGE) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.damtg) + e1a:SetOperation(s.damop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end diff --git a/official/c6511113.lua b/official/c6511113.lua index c344a429b8..d12b316646 100644 --- a/official/c6511113.lua +++ b/official/c6511113.lua @@ -2,92 +2,102 @@ --Traptrix Rafflesia local s,id=GetID() function s.initial_effect(c) - --Xyz summon - Xyz.AddProcedure(c,nil,4,2) c:EnableReviveLimit() - --Unaffected by trap effects + --Xyz Summon procedure: 2 Level 4 monsters + Xyz.AddProcedure(c,nil,4,2) + --Unaffected by Trap effects while it has material 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:SetCondition(s.imcon) - e1:SetValue(s.efilter) + e1:SetRange(LOCATION_MZONE) + e1:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>0 end) + e1:SetValue(function(e,te) return te:IsTrapEffect() end) c:RegisterEffect(e1) - --Other "Traptrix" monsters cannot be destroyed by battle or card effect - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_FIELD) - e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) - e2:SetRange(LOCATION_MZONE) - e2:SetTargetRange(LOCATION_MZONE,0) - e2:SetTarget(s.imtg) - e2:SetValue(1) - c:RegisterEffect(e2) - local e3=e2:Clone() - e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) + --"Traptrix" monsters you control, except "Traptrix Rafflesia", cannot be destroyed by battle or card effects + local e2a=Effect.CreateEffect(c) + e2a:SetType(EFFECT_TYPE_FIELD) + e2a:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e2a:SetRange(LOCATION_MZONE) + e2a:SetTargetRange(LOCATION_MZONE,0) + e2a:SetTarget(function(e,c) return c:IsSetCard(SET_TRAPTRIX) and not c:IsCode(id) end) + e2a:SetValue(1) + c:RegisterEffect(e2a) + local e2b=e2a:Clone() + e2b:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) + c:RegisterEffect(e2b) + --Your opponent cannot target "Traptrix" monsters you control, except "Traptrix Rafflesia", with card effects + local e2c=e2a:Clone() + e2c:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e2c:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) + e2c:SetValue(aux.tgoval) + c:RegisterEffect(e2c) + --This effect becomes that sent "Hole" Normal Trap's effect when that card is activated + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,0)) + e3:SetType(EFFECT_TYPE_QUICK_O) + e3:SetRange(LOCATION_MZONE) + e3:SetCode(EVENT_FREE_CHAIN) + e3:SetCountLimit(1) + e3:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMING_BATTLE_START|TIMING_MSET|TIMINGS_CHECK_MONSTER_E) + e3:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.effcost)) + e3:SetTarget(s.efftg) + e3:SetOperation(s.effop) c:RegisterEffect(e3) - --Other "Traptrix" monsters cannot be target - local e4=e3:Clone() - e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) - e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) - e4:SetValue(aux.tgoval) - c:RegisterEffect(e4) - --Copy 1 "Hole" trap - local e5=Effect.CreateEffect(c) - e5:SetDescription(aux.Stringid(id,0)) - e5:SetType(EFFECT_TYPE_QUICK_O) - e5:SetRange(LOCATION_MZONE) - e5:SetCode(EVENT_FREE_CHAIN) - e5:SetHintTiming(TIMINGS_CHECK_MONSTER|TIMING_BATTLE_START|TIMING_MAIN_END) - e5:SetCountLimit(1) - e5:SetCost(s.cost) - e5:SetTarget(s.target) - e5:SetOperation(s.operation) - c:RegisterEffect(e5,false,EFFECT_MARKER_DETACH_XMAT) end s.listed_names={id} s.listed_series={SET_TRAPTRIX,SET_TRAP_HOLE,SET_HOLE} -function s.imcon(e) - return e:GetHandler():GetOverlayCount()>0 -end -function s.efilter(e,te) - return te:IsTrapEffect() -end -function s.imtg(e,c) - return c:IsSetCard(SET_TRAPTRIX) and not c:IsCode(id) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - e:SetLabel(1) - return true -end -function s.filter(c) - return c:IsNormalTrap() and (c:IsSetCard(SET_TRAP_HOLE) or c:IsSetCard(SET_HOLE)) and c:IsAbleToGraveAsCost() +function s.copyfilter(c) + return c:IsNormalTrap() and c:IsSetCard({SET_HOLE,SET_TRAP_HOLE}) and c:IsAbleToGraveAsCost() and c:CheckActivateEffect(false,true,true)~=nil end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk) + e:SetLabel(-100) if chk==0 then - if e:GetLabel()==0 then return false end - e:SetLabel(0) - return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) + --Storing the legal group before detaching due to rulings (Q&A #16286) + local g=Duel.GetMatchingGroup(s.copyfilter,tp,LOCATION_DECK,0,nil) + e:SetLabelObject(g) + return #g>0 end - e:SetLabel(0) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) - local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true) - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - Duel.SendtoGrave(g,REASON_COST) - e:SetProperty(te:GetProperty()) + local sc=e:GetLabelObject():Select(tp,1,1,nil):GetFirst() + e:SetLabelObject(sc) + Duel.SendtoGrave(sc,REASON_COST) +end +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then + local te,ceg,cep,cev,cre,cr,crp=table.unpack(e:GetLabelObject()) + return te and te:GetTarget() and te:GetTarget()(e,tp,ceg,cep,cev,cre,cr,crp,chk,chkc) + end + if chk==0 then + local res=e:GetLabel()==-100 + e:SetLabel(0) + return res + end + local sc=e:GetLabelObject() + local te,ceg,cep,cev,cre,cr,crp=sc:CheckActivateEffect(true,true,true) + e:SetLabel(te:GetLabel()) + e:SetLabelObject(te:GetLabelObject()) local tg=te:GetTarget() - if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end - te:SetLabelObject(e:GetLabelObject()) - e:SetLabelObject(te) - Duel.ClearOperationInfo(0) + if tg then + e:SetProperty(te:GetProperty()) + tg(e,tp,ceg,cep,cev,cre,cr,crp,1) + te:SetLabel(e:GetLabel()) + te:SetLabelObject(e:GetLabelObject()) + Duel.ClearOperationInfo(0) + end + e:SetLabel(0) + e:SetLabelObject({te,ceg,cep,cev,cre,cr,crp}) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local te=e:GetLabelObject() +function s.effop(e,tp,eg,ep,ev,re,r,rp) + local te,ceg,cep,cev,cre,cr,crp=table.unpack(e:GetLabelObject()) if not te then return end - e:SetLabelObject(te:GetLabelObject()) local op=te:GetOperation() - if op then op(e,tp,eg,ep,ev,re,r,rp) end -end \ No newline at end of file + if op then + e:SetLabel(te:GetLabel()) + e:SetLabelObject(te:GetLabelObject()) + op(e,tp,ceg,cep,cev,cre,cr,crp) + end + e:SetLabel(0) + e:SetLabelObject(nil) +end diff --git a/official/c65301952.lua b/official/c65301952.lua index 08da822755..bb30168ba3 100644 --- a/official/c65301952.lua +++ b/official/c65301952.lua @@ -2,56 +2,46 @@ --Alchemic Magician local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_SPELLCASTER),4,3) c:EnableReviveLimit() - --atkup + --Xyz Summon procedure: 3 Level 4 Spellcaster monsters + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_SPELLCASTER),4,3) + --This card gains 200 ATK for each Spell in your GY local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(s.atkval) + e1:SetValue(function(e,c) return Duel.GetMatchingGroupCount(Card.IsSpell,c:GetControler(),LOCATION_GRAVE,0,nil)*200 end) c:RegisterEffect(e1) - --set + --Set 1 Spell from your Deck to your Spell & Trap Zone local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCondition(s.setcon) - e2:SetCost(s.setcost) + e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end) + e2:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.setcost)) e2:SetTarget(s.settg) e2:SetOperation(s.setop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.atkval(e,c) - return Duel.GetMatchingGroupCount(Card.IsSpell,c:GetControler(),LOCATION_GRAVE,0,nil)*200 -end -function s.setcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(tp) + c:RegisterEffect(e2) end function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end -function s.filter(c) - return c:IsSpell() and not c:IsType(TYPE_FIELD) and c:IsSSetable() +function s.setfilter(c) + return c:IsSpell() and not c:IsFieldSpell() and c:IsSSetable() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end + if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end end function s.setop(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then - Duel.SSet(tp,g:GetFirst()) + Duel.SSet(tp,g) end -end \ No newline at end of file +end diff --git a/official/c65676461.lua b/official/c65676461.lua index 87ee6eabce..bbf8abfb5c 100644 --- a/official/c65676461.lua +++ b/official/c65676461.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCondition(s.atcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.attg) e1:SetOperation(s.atop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=32 function s.atcon(e,tp,eg,ep,ev,re,r,rp) @@ -58,4 +58,4 @@ function s.atop(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/official/c65884091.lua b/official/c65884091.lua index c8bca23033..4d26f1af0d 100644 --- a/official/c65884091.lua +++ b/official/c65884091.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -35,4 +35,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.efilter(e,te) return te:IsActiveType(TYPE_EFFECT) and te:GetOwner()~=e:GetOwner() -end \ No newline at end of file +end diff --git a/official/c65892585.lua b/official/c65892585.lua index e32b74c3dd..990780ff88 100644 --- a/official/c65892585.lua +++ b/official/c65892585.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Return itself to the Extra Deck and Special Summon "Gold Pride - Captain Carrie" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -78,4 +78,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end -end \ No newline at end of file +end diff --git a/official/c66011101.lua b/official/c66011101.lua index d5ee56a410..7f33619144 100644 --- a/official/c66011101.lua +++ b/official/c66011101.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(2,2,nil)) + e1:SetCost(Cost.DetachFromSelf(2,2,nil)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=60 function s.spfilter(c,e,tp) @@ -109,4 +109,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e2) end end -end \ No newline at end of file +end diff --git a/official/c66506689.lua b/official/c66506689.lua index a5ef91aff4..b05ba2a152 100644 --- a/official/c66506689.lua +++ b/official/c66506689.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.tg) e1:SetOperation(s.op) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsCanChangePosition() @@ -35,4 +35,4 @@ function s.op(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,true) end -end \ No newline at end of file +end diff --git a/official/c66523544.lua b/official/c66523544.lua index 3244964b06..bf9a22ecc3 100644 --- a/official/c66523544.lua +++ b/official/c66523544.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsSpellTrap() @@ -32,4 +32,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.climit(e,lp,tp) return lp==tp or not e:IsHasType(EFFECT_TYPE_ACTIVATE) -end \ No newline at end of file +end diff --git a/official/c66547759.lua b/official/c66547759.lua index 6841d6e086..c41917f59d 100644 --- a/official/c66547759.lua +++ b/official/c66547759.lua @@ -30,10 +30,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.discon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.distg) e3:SetOperation(s.disop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) aux.DoubleSnareValidity(c,LOCATION_MZONE) end s.xyz_number=23 @@ -68,4 +68,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then Duel.SendtoGrave(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c6659193.lua b/official/c6659193.lua index cb04fd58cf..d7cacb8bab 100644 --- a/official/c6659193.lua +++ b/official/c6659193.lua @@ -34,9 +34,9 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCondition(s.atkcon) - e4:SetCost(Cost.Detach(1,1,nil)) + e4:SetCost(Cost.DetachFromSelf(1,1,nil)) e4:SetOperation(s.atkop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_names={17016362} --"Performage Trapeze Magician" function s.reflectcond(e) @@ -68,4 +68,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c66970002.lua b/official/c66970002.lua index 21cc02ced5..2137ff94c0 100644 --- a/official/c66970002.lua +++ b/official/c66970002.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.descon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_UTOPIA} s.xyz_number=39 @@ -71,4 +71,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,atk,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c67173574.lua b/official/c67173574.lua index afa51c3a85..a3e0750d36 100644 --- a/official/c67173574.lua +++ b/official/c67173574.lua @@ -32,10 +32,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) e3:SetCondition(s.condition) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.xyz_number=102 s.listed_names={49678559} @@ -93,4 +93,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e3:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e3) end -end \ No newline at end of file +end diff --git a/official/c67865534.lua b/official/c67865534.lua index ead2978e18..796a05ec80 100644 --- a/official/c67865534.lua +++ b/official/c67865534.lua @@ -25,7 +25,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) @@ -98,4 +98,4 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp) if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then Duel.Overlay(c,tc) end -end \ No newline at end of file +end diff --git a/official/c68300121.lua b/official/c68300121.lua index afb9715d3a..e51979b78b 100644 --- a/official/c68300121.lua +++ b/official/c68300121.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Make the opponent send a monste to the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -24,7 +24,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_START) e2:SetCondition(s.gycon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.gytg) e2:SetOperation(s.gyop) c:RegisterEffect(e2) @@ -64,4 +64,4 @@ function s.gyop(e,tp,eg,ep,ev,re,r,rp) if bc:IsRelateToBattle() and bc:IsFaceup() then Duel.SendtoGrave(bc,REASON_RULE,PLAYER_NONE,1-tp) end -end \ No newline at end of file +end diff --git a/official/c68396121.lua b/official/c68396121.lua index 9a1521e99e..7aae844570 100644 --- a/official/c68396121.lua +++ b/official/c68396121.lua @@ -11,9 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.negop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --atk local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -86,4 +86,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c68597372.lua b/official/c68597372.lua index 960532daf6..0cddcfd906 100644 --- a/official/c68597372.lua +++ b/official/c68597372.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.atkval(e,c) return c:GetOverlayCount()*300 @@ -62,4 +62,4 @@ end function s.flipop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() Duel.ChangePosition(tc,POS_FACEUP_ATTACK) -end \ No newline at end of file +end diff --git a/official/c68618157.lua b/official/c68618157.lua index f6b96d8067..0b1a5e9e3c 100644 --- a/official/c68618157.lua +++ b/official/c68618157.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.spcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -30,10 +30,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.thcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) @@ -74,4 +74,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end -end \ No newline at end of file +end diff --git a/official/c68679595.lua b/official/c68679595.lua index d1d71014b3..789b5fc623 100644 --- a/official/c68679595.lua +++ b/official/c68679595.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -102,4 +102,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) e3:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e3) end -end \ No newline at end of file +end diff --git a/official/c68836428.lua b/official/c68836428.lua index e343873701..d277eed5c7 100644 --- a/official/c68836428.lua +++ b/official/c68836428.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(aux.StatChangeDamageStepCondition) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.filter(c) return c:IsFaceup() and (c:IsType(TYPE_EFFECT) or c:GetAttack()>0) @@ -61,4 +61,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e3:SetValue(-800) tc:RegisterEffect(e3) end -end \ No newline at end of file +end diff --git a/official/c69058960.lua b/official/c69058960.lua index d68a0aa8c7..49ed55b0d9 100644 --- a/official/c69058960.lua +++ b/official/c69058960.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --cannot be destroyed local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -75,4 +75,4 @@ end function s.refcon(e) return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) and Duel.GetAttackTarget()==e:GetHandler() -end \ No newline at end of file +end diff --git a/official/c69069911.lua b/official/c69069911.lua index 52497ebd0b..1013efeb29 100644 --- a/official/c69069911.lua +++ b/official/c69069911.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCountLimit(1) e1:SetCondition(s.atcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.atop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.atcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -23,4 +23,4 @@ function s.atcon(e,tp,eg,ep,ev,re,r,rp) end function s.atop(e,tp,eg,ep,ev,re,r,rp) Duel.ChainAttack() -end \ No newline at end of file +end diff --git a/official/c69170557.lua b/official/c69170557.lua index a1cb897824..943049316f 100644 --- a/official/c69170557.lua +++ b/official/c69170557.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.cttg) e2:SetOperation(s.ctop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.counter_place_list={0x1024} s.xyz_number=40 @@ -58,4 +58,4 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp) for tc in aux.Next(g) do tc:AddCounter(0x1024,1) end -end \ No newline at end of file +end diff --git a/official/c69610924.lua b/official/c69610924.lua index d9c1f4b0dc..0e8c268dc6 100644 --- a/official/c69610924.lua +++ b/official/c69610924.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --cannot direct attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -37,4 +37,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c69655484.lua b/official/c69655484.lua index ee2dc16b0a..1c63f678b2 100644 --- a/official/c69655484.lua +++ b/official/c69655484.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_BECOME_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCondition(function(e,tp,eg) return eg:IsContains(e:GetHandler()) end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.edsptg) e1:SetOperation(s.edspop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Add 1 "Rank-Up-Magic" Spell from your Deck to your hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -26,10 +26,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(s.thcost) + e2:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.thcost)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Special Summon 1 "Performage" monster from your GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -63,10 +63,7 @@ function s.thcostfilter(c) return c:IsSetCard(SET_PERFORMAGE) and c:IsMonster() and c:IsAbleToGraveAsCost() end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) - and Duel.IsExistingMatchingCard(s.thcostfilter,tp,LOCATION_DECK,0,1,nil) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) + if chk==0 then return Duel.IsExistingMatchingCard(s.thcostfilter,tp,LOCATION_DECK,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.thcostfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) @@ -100,4 +97,4 @@ function s.gyspop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c69757518.lua b/official/c69757518.lua index caac9b8852..4628287a86 100644 --- a/official/c69757518.lua +++ b/official/c69757518.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetCondition(s.atcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(s.atop) --Place 1 card from the GY on the top of the Deck, and if you do, attach another to this card as material - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TODECK) @@ -80,4 +80,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Overlay(c,sg) end end -end \ No newline at end of file +end diff --git a/official/c6983839.lua b/official/c6983839.lua index c4b64dee35..161f0fc78f 100644 --- a/official/c6983839.lua +++ b/official/c6983839.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetHintTiming(0,TIMING_END_PHASE|TIMING_EQUIP) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsSpellTrap() end @@ -32,4 +32,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c69840739.lua b/official/c69840739.lua index a358a9f688..13270b39de 100644 --- a/official/c69840739.lua +++ b/official/c69840739.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local event_chaining,_,_,event_value,reason_effect,_,reason_player=Duel.CheckEvent(EVENT_CHAINING,true) diff --git a/official/c698785.lua b/official/c698785.lua index b2293f7dec..fc33e4fe91 100644 --- a/official/c698785.lua +++ b/official/c698785.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end @@ -25,4 +25,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c7020743.lua b/official/c7020743.lua index 8b57528695..70a5ff58c1 100644 --- a/official/c7020743.lua +++ b/official/c7020743.lua @@ -48,10 +48,10 @@ function s.initial_effect(c) e6:SetRange(LOCATION_MZONE) e6:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e6:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>=8 end) - e6:SetCost(Cost.Detach(4,4,nil)) + e6:SetCost(Cost.DetachFromSelf(4,4,nil)) e6:SetTarget(s.destg) e6:SetOperation(s.desop) - c:RegisterEffect(e6,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e6) end function s.atchtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.GetFieldGroupCount(0,LOCATION_GRAVE,LOCATION_GRAVE)>0 end @@ -77,4 +77,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c70597485.lua b/official/c70597485.lua index 18db65bd78..13977812be 100644 --- a/official/c70597485.lua +++ b/official/c70597485.lua @@ -22,7 +22,7 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.xyztg) e3:SetOperation(s.xyzop) c:RegisterEffect(e3) diff --git a/official/c70636044.lua b/official/c70636044.lua index f5e4899135..c7981e7b81 100644 --- a/official/c70636044.lua +++ b/official/c70636044.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.negcon) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --At start of Damage Step, destroy 1 card on the field local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/official/c71068247.lua b/official/c71068247.lua index f9b918e92d..ed01ebb957 100644 --- a/official/c71068247.lua +++ b/official/c71068247.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --ATK decrease local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -47,4 +47,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.adcon(e) return e:GetHandler():GetOverlayCount()==0 -end \ No newline at end of file +end diff --git a/official/c71166481.lua b/official/c71166481.lua index a720138752..7da92a3da1 100644 --- a/official/c71166481.lua +++ b/official/c71166481.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.chcon) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.chtg) e1:SetOperation(s.chop) c:RegisterEffect(e1) @@ -61,4 +61,4 @@ function s.xop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then Duel.Overlay(tc,c) end -end \ No newline at end of file +end diff --git a/official/c71222868.lua b/official/c71222868.lua index f08ca7c501..e95327bbc2 100644 --- a/official/c71222868.lua +++ b/official/c71222868.lua @@ -32,7 +32,7 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(3,3,nil)) + e3:SetCost(Cost.DetachFromSelf(3,3,nil)) e3:SetTarget(s.copytg) e3:SetOperation(s.copyop) c:RegisterEffect(e3) @@ -80,4 +80,4 @@ function s.copyop(e,tp,eg,ep,ev,re,r,rp) local code=tc:GetOriginalCodeRule() c:CopyEffect(code,RESETS_STANDARD_PHASE_END,1) end -end \ No newline at end of file +end diff --git a/official/c71612253.lua b/official/c71612253.lua index 6204352e32..3103078d72 100644 --- a/official/c71612253.lua +++ b/official/c71612253.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCountLimit(1) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --to grave local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOGRAVE) @@ -87,4 +87,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c7194917.lua b/official/c7194917.lua index e1241cbdfd..d132478890 100644 --- a/official/c7194917.lua +++ b/official/c7194917.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.adop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --pos local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -66,4 +66,4 @@ function s.posop2(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToBattle() and c:IsDefensePos() then Duel.ChangePosition(c,POS_FACEUP_ATTACK) end -end \ No newline at end of file +end diff --git a/official/c72409226.lua b/official/c72409226.lua index 082be83783..cf76abdb5b 100644 --- a/official/c72409226.lua +++ b/official/c72409226.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.deckspthtg) e1:SetOperation(s.deckspthop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Add up to 2 cards attached to this card to your hand, including at least 1 "Materiactor" card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/official/c72971064.lua b/official/c72971064.lua index 9679da9925..a6c22cfa98 100644 --- a/official/c72971064.lua +++ b/official/c72971064.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.retopthcon) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.retopthtg) e2:SetOperation(s.retopthop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Add 1 "Lyrilusc" monster from your GY to your hand, except this card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -87,4 +87,4 @@ function s.llthop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(tc,tp,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end -end \ No newline at end of file +end diff --git a/official/c73082255.lua b/official/c73082255.lua index 20bc7c52f7..7010f7b16f 100644 --- a/official/c73082255.lua +++ b/official/c73082255.lua @@ -30,10 +30,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.gytg) e3:SetOperation(s.gyop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.lvtg(e,c) return c:IsLevelAbove(1) and c:GetOwner()~=e:GetHandlerPlayer() diff --git a/official/c73289035.lua b/official/c73289035.lua index 5dc2a6e6b2..b250239130 100644 --- a/official/c73289035.lua +++ b/official/c73289035.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -70,4 +70,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c73347079.lua b/official/c73347079.lua index d851a4c152..5dd3b1292a 100644 --- a/official/c73347079.lua +++ b/official/c73347079.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.adval(e,c) return Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_WINGEDBEAST),c:GetControler(),LOCATION_MZONE,0,c)*500 @@ -44,4 +44,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c73445448.lua b/official/c73445448.lua index 30c7957d1d..84b64cdda6 100644 --- a/official/c73445448.lua +++ b/official/c73445448.lua @@ -1,71 +1,48 @@ ---No.22 不乱健 +--No.22 不乱健 --Number 22: Zombiestein local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_DARK),8,2) c:EnableReviveLimit() - --spsummon limit + --Xyz Summon procedure: 2 Level 8 DARK monsters + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_DARK),8,2) + c:AddMustBeXyzSummoned() + --Change this card to Defense Position, and if you do, negate the effects of 1 face-up card your opponent controls until the end of this turn local e1=Effect.CreateEffect(c) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_SPSUMMON_CONDITION) - e1:SetValue(aux.xyzlimit) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_POSITION+CATEGORY_DISABLE) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.discost)) + e1:SetTarget(s.distg) + e1:SetOperation(s.disop) c:RegisterEffect(e1) - --negate - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_DISABLE) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) - e2:SetType(EFFECT_TYPE_QUICK_O) - e2:SetCode(EVENT_FREE_CHAIN) - e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER) - e2:SetRange(LOCATION_MZONE) - e2:SetCountLimit(1) - e2:SetCost(s.cost) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) end s.xyz_number=22 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) +function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsNegatable() end - if chk==0 then return e:GetHandler():IsAttackPos() + local c=e:GetHandler() + if chk==0 then return c:IsAttackPos() and c:IsCanChangePosition() and Duel.IsExistingTarget(Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) local g=Duel.SelectTarget(tp,Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,tp,POS_DEFENSE) + Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,tp,0) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - if not c:IsRelateToEffect(e) or c:IsDefensePos() then return end - Duel.ChangePosition(c,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,0,0) local tc=Duel.GetFirstTarget() - if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then - Duel.NegateRelatedChain(tc,RESET_TURN_SET) - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_DISABLE) - e1:SetReset(RESETS_STANDARD_PHASE_END) - tc:RegisterEffect(e1) - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_DISABLE_EFFECT) - e2:SetValue(RESET_TURN_SET) - e2:SetReset(RESETS_STANDARD_PHASE_END) - tc:RegisterEffect(e2) - if tc:IsType(TYPE_TRAPMONSTER) then - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) - e3:SetReset(RESETS_STANDARD_PHASE_END) - tc:RegisterEffect(e3) - end + if c:IsRelateToEffect(e) and c:IsAttackPos() and c:IsCanChangePosition() + and Duel.ChangePosition(c,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,0,0)>0 + and tc:IsRelateToEffect(e) and tc:IsFaceup()then + --Negate that targeted card's effects, until the end of this turn + tc:NegateEffects(c,RESET_PHASE|PHASE_END,true) end -end \ No newline at end of file +end diff --git a/official/c73659078.lua b/official/c73659078.lua index 307cf9dd50..bcda1f5d79 100644 --- a/official/c73659078.lua +++ b/official/c73659078.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.countertg) e1:SetOperation(s.counterop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Non-WATER monsters lose 200 ATK for each Ice Counter on the field local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) @@ -50,4 +50,4 @@ function s.counterop(e,tp,eg,ep,ev,re,r,rp) tc=g:Select(tp,1,1,nil):GetFirst() tc:AddCounter(0x1015,1) end -end \ No newline at end of file +end diff --git a/official/c73887236.lua b/official/c73887236.lua index aaea9da5ea..131c61505e 100644 --- a/official/c73887236.lua +++ b/official/c73887236.lua @@ -18,10 +18,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.atkfilter(e,c) return c:IsSpecialSummoned() @@ -47,4 +47,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c73964868.lua b/official/c73964868.lua index d9952e7f7e..fa2caf63a1 100644 --- a/official/c73964868.lua +++ b/official/c73964868.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() end @@ -32,4 +32,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c74294676.lua b/official/c74294676.lua index e630b27e30..831ca58179 100644 --- a/official/c74294676.lua +++ b/official/c74294676.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition1) - e1:SetCost(Cost.Detach(2,2,nil)) + e1:SetCost(Cost.DetachFromSelf(2,2,nil)) e1:SetTarget(s.target1) e1:SetOperation(s.operation1) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Negate Normal Summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -26,15 +26,15 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_SUMMON) e2:SetCondition(s.condition2) - e2:SetCost(Cost.Detach(2,2,nil)) + e2:SetCost(Cost.DetachFromSelf(2,2,nil)) e2:SetTarget(s.target2) e2:SetOperation(s.operation2) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Negate Special Summon local e3=e2:Clone() e3:SetDescription(aux.Stringid(id,2)) e3:SetCode(EVENT_SPSUMMON) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) aux.DoubleSnareValidity(c,LOCATION_MZONE) end function s.condition1(e,tp,eg,ep,ev,re,r,rp) @@ -65,4 +65,4 @@ end function s.operation2(e,tp,eg,ep,ev,re,r,rp) Duel.NegateSummon(eg) Duel.Destroy(eg,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c74371660.lua b/official/c74371660.lua index aa995ed37f..6ae484bdfb 100644 --- a/official/c74371660.lua +++ b/official/c74371660.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.dscon(e) return e:GetHandler():GetOverlayCount()~=0 @@ -55,4 +55,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e2) Duel.NegateRelatedChain(tc,RESET_TURN_SET) end -end \ No newline at end of file +end diff --git a/official/c74416224.lua b/official/c74416224.lua index 5f402ba261..dd2ff877fb 100644 --- a/official/c74416224.lua +++ b/official/c74416224.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end @@ -39,4 +39,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c74593218.lua b/official/c74593218.lua index 85a0531fe9..c639f63ae2 100644 --- a/official/c74593218.lua +++ b/official/c74593218.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.negcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) aux.DoubleSnareValidity(c,LOCATION_MZONE) end function s.negcon(e,tp,eg,ep,ev,re,r,rp) @@ -46,4 +46,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/official/c74689476.lua b/official/c74689476.lua index 2bb6e3805a..21cddab227 100644 --- a/official/c74689476.lua +++ b/official/c74689476.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) @@ -76,4 +76,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp,chk) if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsDisabled() then tc:NegateEffects(e:GetHandler(),RESETS_STANDARD_PHASE_END) end -end \ No newline at end of file +end diff --git a/official/c75083197.lua b/official/c75083197.lua index d350b04ec9..547e8bf94d 100644 --- a/official/c75083197.lua +++ b/official/c75083197.lua @@ -28,10 +28,10 @@ function s.initial_effect(c) e3:SetCode(EVENT_PHASE|PHASE_STANDBY) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_names={id} --Filter for cards summoned from GY @@ -62,4 +62,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c75253697.lua b/official/c75253697.lua index dc8620c56a..1d36c9c0a3 100644 --- a/official/c75253697.lua +++ b/official/c75253697.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=72 function s.dfilter(c,pos) @@ -46,4 +46,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(HALF_DAMAGE) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) -end \ No newline at end of file +end diff --git a/official/c75367227.lua b/official/c75367227.lua index 5ff8096065..c77c5f68ca 100644 --- a/official/c75367227.lua +++ b/official/c75367227.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) -- local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TOHAND) @@ -72,4 +72,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end -end \ No newline at end of file +end diff --git a/official/c75402014.lua b/official/c75402014.lua index e04799ceda..67d8c86ccb 100644 --- a/official/c75402014.lua +++ b/official/c75402014.lua @@ -38,10 +38,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_ZW} s.xyz_number=39 @@ -112,4 +112,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e3) end end -end \ No newline at end of file +end diff --git a/official/c75433814.lua b/official/c75433814.lua index 7cbf22ca2b..f5d47fa333 100644 --- a/official/c75433814.lua +++ b/official/c75433814.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.cttg) e1:SetOperation(s.ctop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destroy monsters with String counters and burn 500 for each local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -55,4 +55,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local ct=Duel.Destroy(g,REASON_EFFECT) Duel.Damage(1-tp,ct*500,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c75574498.lua b/official/c75574498.lua index debd577791..955cf04a79 100644 --- a/official/c75574498.lua +++ b/official/c75574498.lua @@ -38,10 +38,10 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetCode(EVENT_TO_GRAVE) e4:SetCondition(s.spcon2) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.sptg2) e4:SetOperation(s.spop2) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_names={81587028} --"Box of Friends" function s.spcon(e,tp,eg,ep,ev,re,r,rp) @@ -89,4 +89,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end -end \ No newline at end of file +end diff --git a/official/c75620895.lua b/official/c75620895.lua index 2e5f33665a..055649c79d 100644 --- a/official/c75620895.lua +++ b/official/c75620895.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) @@ -41,4 +41,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e1) c:CopyEffect(code,RESET_EVENT|RESETS_STANDARD,1) end -end \ No newline at end of file +end diff --git a/official/c75797046.lua b/official/c75797046.lua index 07c90db3f7..083f040604 100644 --- a/official/c75797046.lua +++ b/official/c75797046.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.rettg) e1:SetOperation(s.retop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_BUTTERSPY} function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk) @@ -35,4 +35,4 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(tp,ct1*300,REASON_EFFECT,true) Duel.Damage(1-tp,ct2*300,REASON_EFFECT,true) Duel.RDComplete() -end \ No newline at end of file +end diff --git a/official/c75840616.lua b/official/c75840616.lua index eb1a9e4aa9..cf72f14f68 100644 --- a/official/c75840616.lua +++ b/official/c75840616.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --attack all local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -35,4 +35,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) aux.ToHandOrElse(g:GetFirst(),tp) -end \ No newline at end of file +end diff --git a/official/c75878039.lua b/official/c75878039.lua index 18ab174d99..626217e0eb 100644 --- a/official/c75878039.lua +++ b/official/c75878039.lua @@ -2,36 +2,36 @@ --Satellarknight Deneb local s,id=GetID() function s.initial_effect(c) - --Add 1 "tellarknight" monsters from the Deck to the hand - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Add 1 "tellarknight" monster from your Deck to your hand, except "Satellarknight Deneb" + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.thtg) + e1a:SetOperation(s.thop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) end s.listed_series={SET_TELLARKNIGHT} s.listed_names={id} -function s.filter(c) +function s.thfilter(c) return c:IsSetCard(SET_TELLARKNIGHT) and c:IsMonster() and not c:IsCode(id) and c:IsAbleToHand() end -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 +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + 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 -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.thop(e,tp,eg,ep,ev,re,r,rp) 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) diff --git a/official/c7593748.lua b/official/c7593748.lua index 490debf65b..3d7195dc8b 100644 --- a/official/c7593748.lua +++ b/official/c7593748.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(2)) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.cttg) e1:SetOperation(s.ctop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --level local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -89,4 +89,4 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c76067258.lua b/official/c76067258.lua index bf2cdd90d8..3c9c2012db 100644 --- a/official/c76067258.lua +++ b/official/c76067258.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --desrep local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) @@ -68,4 +68,4 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SendtoGrave(g,REASON_EFFECT) return true else return false end -end \ No newline at end of file +end diff --git a/official/c7628844.lua b/official/c7628844.lua index 2cc0f3d7f4..5760841049 100644 --- a/official/c7628844.lua +++ b/official/c7628844.lua @@ -17,10 +17,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP|TIMINGS_CHECK_MONSTER_E) e1:SetCondition(function() return not (Duel.IsPhase(PHASE_DAMAGE) and Duel.IsDamageCalculated()) end) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --This card can make a second attack during each Battle Phase local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -78,4 +78,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) e2:SetCode(EFFECT_SET_DEFENSE_FINAL) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c76290637.lua b/official/c76290637.lua index 9e4575e99d..db908ce331 100644 --- a/official/c76290637.lua +++ b/official/c76290637.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special Summon this card from your GY to either field in Defense Position local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -97,4 +97,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmCards(1-tp,g) end end -end \ No newline at end of file +end diff --git a/official/c76372778.lua b/official/c76372778.lua index 0b6cbacc0d..4826cc2612 100644 --- a/official/c76372778.lua +++ b/official/c76372778.lua @@ -11,9 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLED) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -41,4 +41,4 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c76419637.lua b/official/c76419637.lua index 9fffb55ebc..99dfa931e1 100644 --- a/official/c76419637.lua +++ b/official/c76419637.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.damcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_names={40424929} function s.dccon(e,tp,eg,ep,ev,re,r,rp) @@ -57,4 +57,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=Duel.GetFieldGroupCount(p,LOCATION_ONFIELD,LOCATION_ONFIELD) Duel.Damage(p,ct*300,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c76589815.lua b/official/c76589815.lua index 8a211902a1..db3a4e640a 100644 --- a/official/c76589815.lua +++ b/official/c76589815.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.cfcon) - e3:SetCost(Cost.Detach(2)) + e3:SetCost(Cost.DetachFromSelf(2)) e3:SetTarget(s.cftg) e3:SetOperation(s.cfop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_BATTLIN_BOXER} function s.atfilter(c) @@ -63,4 +63,4 @@ function s.cfop(e,tp,eg,ep,ev,re,r,rp) end end Duel.ShuffleHand(1-tp) -end \ No newline at end of file +end diff --git a/official/c770365.lua b/official/c770365.lua index ef2084ffd3..ce8044926c 100644 --- a/official/c770365.lua +++ b/official/c770365.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_SPELLBOOK} function s.atkval(e,c) @@ -49,4 +49,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.BreakEffect() end Duel.SortDecktop(tp,tp,5) -end \ No newline at end of file +end diff --git a/official/c77205367.lua b/official/c77205367.lua index 6ad258b2ed..451cae28ee 100644 --- a/official/c77205367.lua +++ b/official/c77205367.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.atkcon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.xyz_number=96 s.listed_names={55727845} @@ -65,4 +65,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c77334267.lua b/official/c77334267.lua index e3a0755822..df0f7aa9e1 100644 --- a/official/c77334267.lua +++ b/official/c77334267.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) @@ -32,4 +32,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local dg=g:Filter(Card.IsRelateToEffect,nil,e) Duel.Destroy(dg,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c77571454.lua b/official/c77571454.lua index cd1cffe2e5..d735391495 100644 --- a/official/c77571454.lua +++ b/official/c77571454.lua @@ -26,10 +26,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.namechangetg) e3:SetOperation(s.namechangeop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --Negate the activated effects of "Unknown" your opponent controls local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -69,4 +69,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end end -end \ No newline at end of file +end diff --git a/official/c77799846.lua b/official/c77799846.lua index 526aae1559..29e887597a 100644 --- a/official/c77799846.lua +++ b/official/c77799846.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -72,4 +72,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Overlay(c,mg) end end -end \ No newline at end of file +end diff --git a/official/c77894049.lua b/official/c77894049.lua index 714abbcf78..d821480a27 100644 --- a/official/c77894049.lua +++ b/official/c77894049.lua @@ -32,7 +32,7 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.attrcon(ATTRIBUTE_EARTH)) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) @@ -77,4 +77,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c78135071.lua b/official/c78135071.lua index 2af87057fd..a1278ff770 100644 --- a/official/c78135071.lua +++ b/official/c78135071.lua @@ -37,10 +37,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_EXOSISTER} function s.valcheck(e,c) @@ -80,4 +80,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c78144171.lua b/official/c78144171.lua index d84d254498..da56871e00 100644 --- a/official/c78144171.lua +++ b/official/c78144171.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.ovfilter(c,tp,lc) return c:IsFaceup() and c:IsRace(RACE_DRAGON,lc,SUMMON_TYPE_XYZ,tp) and c:IsAttribute(ATTRIBUTE_DARK,lc,SUMMON_TYPE_XYZ,tp) and c:IsLevelAbove(5) diff --git a/official/c78486968.lua b/official/c78486968.lua index 38381d5dc5..714f64d178 100644 --- a/official/c78486968.lua +++ b/official/c78486968.lua @@ -2,28 +2,28 @@ --Constellar Sheratan local s,id=GetID() function s.initial_effect(c) - --Add 1 "Constellar" monster from the Deck to the hand + --Add 1 "Constellar" monster from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) - e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetTarget(s.tg) - e1:SetOperation(s.op) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) + e1:SetTarget(s.thtg) + e1:SetOperation(s.thop) + c:RegisterEffect(e1) end s.listed_series={SET_CONSTELLAR} -function s.filter(c) +function s.thfilter(c) return c:IsSetCard(SET_CONSTELLAR) and c:IsMonster() and c:IsAbleToHand() end -function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) --Excluding itself for a proper interaction with "Tellarknight Constellar Caduceus" [58858807] - if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,e:GetHandler()) end + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end -function s.op(e,tp,eg,ep,ev,re,r,rp) +function s.thop(e,tp,eg,ep,ev,re,r,rp) 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) diff --git a/official/c78625448.lua b/official/c78625448.lua index 1274d9537a..2c63b49d2f 100644 --- a/official/c78625448.lua +++ b/official/c78625448.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.condition) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMERON} s.xyz_number=3 @@ -44,4 +44,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END,1) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c78872731.lua b/official/c78872731.lua index 140decc29e..7883d5aa80 100644 --- a/official/c78872731.lua +++ b/official/c78872731.lua @@ -18,7 +18,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetCondition(s.spcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) @@ -58,4 +58,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c78876707.lua b/official/c78876707.lua index e738d05fbf..e0f3b4d720 100644 --- a/official/c78876707.lua +++ b/official/c78876707.lua @@ -4,9 +4,9 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon Procedure + --Xyz Summon procedure: 2+ Level 4 "Noble Knight" monsters Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_NOBLE_KNIGHT),4,2,nil,nil,Xyz.InfiniteMats) - --Return cards to the hand + --Return cards your opponent controls to the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) @@ -14,14 +14,14 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(s.thcost) + e1:SetCost(Cost.DetachFromSelf(1,s.thcostmax,function(e,og) e:SetLabel(#og) end)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) - --Special Summon 1 "Noble Knight" Xyz Monster from your Extra Deck + --Special Summon 1 "Noble Knight" Xyz Monster from your Extra Deck, except "Sacred Noble Knight of King Custennin" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_LEAVE_GRAVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) @@ -34,15 +34,10 @@ end s.listed_series={SET_NOBLE_KNIGHT} s.listed_names={id} function s.thfilter(c,e) - return c:IsAbleToHand() and (not e or c:IsCanBeEffectTarget(e)) + return c:IsAbleToHand() and c:IsCanBeEffectTarget(e) end -function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local g=Duel.GetMatchingGroup(s.thfilter,tp,0,LOCATION_ONFIELD,nil,e) - if chk==0 then return #g>0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - local rt=math.min(#g,c:GetOverlayCount()) - local ct=c:RemoveOverlayCard(tp,1,rt,REASON_COST) - e:SetLabel(ct) +function s.thcostmax(e,tp) + return Duel.GetMatchingGroupCount(s.thfilter,tp,0,LOCATION_ONFIELD,nil,e) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end @@ -63,7 +58,8 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp) return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE|REASON_EFFECT) end function s.spfilter(c,e,tp) - return c:IsSetCard(SET_NOBLE_KNIGHT) and c:IsType(TYPE_XYZ) and not c:IsCode(id) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 + return c:IsSetCard(SET_NOBLE_KNIGHT) and c:IsType(TYPE_XYZ) + and not c:IsCode(id) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) diff --git a/official/c79210531.lua b/official/c79210531.lua index aca1943810..ddfc5b9910 100644 --- a/official/c79210531.lua +++ b/official/c79210531.lua @@ -3,7 +3,7 @@ --scripted by Naim local s,id=GetID() function s.initial_effect(c) - --Special Summon itself from the hand + --Special Summon this card from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -16,31 +16,31 @@ function s.initial_effect(c) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Add 1 "tellarknight" Spell from the Deck to the hand - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetProperty(EFFECT_FLAG_DELAY) - e2:SetCode(EVENT_SUMMON_SUCCESS) - e2:SetCountLimit(1,{id,1}) - e2:SetTarget(s.thtg) - e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_TELLAR) - local e3=e2:Clone() - e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e3) - local e4=e2:Clone() - e4:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e4) + --Add 1 "tellarknight" Spell from your Deck to your hand + local e2a=Effect.CreateEffect(c) + e2a:SetDescription(aux.Stringid(id,1)) + e2a:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2a:SetProperty(EFFECT_FLAG_DELAY) + e2a:SetCode(EVENT_SUMMON_SUCCESS) + e2a:SetCountLimit(1,{id,1}) + e2a:SetTarget(s.thtg) + e2a:SetOperation(s.thop) + c:RegisterEffect(e2a) + local e2b=e2a:Clone() + e2b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e2b) + local e2c=e2a:Clone() + e2c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e2c) end -s.listed_series={SET_TELLARKNIGHT,SET_CONSTELLAR} +s.listed_series={SET_CONSTELLAR,SET_TELLARKNIGHT} s.listed_names={id} -function s.cfilter(c,tp) - return c:IsControler(tp) and c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and not c:IsCode(id) +function s.spconfilter(c,tp) + return c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsControler(tp) and c:IsFaceup() and not c:IsCode(id) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.cfilter,1,nil,tp) + return eg:IsExists(s.spconfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() diff --git a/official/c79559912.lua b/official/c79559912.lua index 8290d1f607..0b052b8da0 100644 --- a/official/c79559912.lua +++ b/official/c79559912.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.negcon) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Search 1 "Dark Contract" card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) @@ -88,4 +88,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c79625003.lua b/official/c79625003.lua index 77e60086e6..a3763d0c51 100644 --- a/official/c79625003.lua +++ b/official/c79625003.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1)) + e1:SetCost(Cost.DetachFromSelf(1,1)) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Special Summon this card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) @@ -76,4 +76,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c80117527.lua b/official/c80117527.lua index b57d7dcff2..23026ee819 100644 --- a/official/c80117527.lua +++ b/official/c80117527.lua @@ -2,44 +2,45 @@ --Number 11: Big Eye local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,7,2) c:EnableReviveLimit() - --attack up + --Xyz Summon: 2 Level 7 monsters + Xyz.AddProcedure(c,nil,7,2) + --Take control of 1 monster your opponent controls local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_CONTROL) e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_CONTROL) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetCountLimit(1) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.ctrlcost)) + e1:SetTarget(s.ctrltg) + e1:SetOperation(s.ctrlop) + c:RegisterEffect(e1) end s.xyz_number=11 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - and e:GetHandler():GetAttackAnnouncedCount()==0 end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - local e1=Effect.CreateEffect(e:GetHandler()) +function s.ctrlcost(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return c:GetAttackAnnouncedCount()==0 end + --This card cannot attack the turn this effect is activated + local e1=Effect.CreateEffect(c) + e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) - e:GetHandler():RegisterEffect(e1) + c:RegisterEffect(e1) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:GetControler()~=tp and chkc:IsControlerCanBeChanged() end +function s.ctrltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControlerCanBeChanged() end if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,tp,0) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.ctrlop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.GetControl(tc,tp) end -end \ No newline at end of file +end diff --git a/official/c80630522.lua b/official/c80630522.lua index ee51e2c27b..4f9105ae13 100644 --- a/official/c80630522.lua +++ b/official/c80630522.lua @@ -2,66 +2,69 @@ --Flower Cardian Paulownia local s,id=GetID() function s.initial_effect(c) - --Special summon itself from hand + --Special Summon this card from your hand local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --Draw 1 + c:RegisterEffect(e1) + --Negate the attack, end the Battle Phase, then draw 1 card local e2=Effect.CreateEffect(c) - e2:SetCategory(CATEGORY_DRAW) e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BE_BATTLE_TARGET) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) + e2:SetTarget(s.drtg) + e2:SetOperation(s.drop) c:RegisterEffect(e2) end s.listed_series={SET_FLOWER_CARDIAN} -function s.cfilter(c) - return c:IsFaceup() and c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsLevelBelow(11) +function s.spconfilter(c) + return c:IsLevelBelow(11) and c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsFaceup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) + return Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end + --You cannot Normal or Special Summon monsters for the rest of this turn, except "Flower Cardian" monsters local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c) return not c:IsSetCard(SET_FLOWER_CARDIAN) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() - e2:SetCode(EFFECT_CANNOT_SUMMON) + e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) Duel.RegisterEffect(e2,tp) - aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,2),nil) end -function s.splimit(e,c) - return not c:IsSetCard(SET_FLOWER_CARDIAN) -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.drop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateAttack() then - Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE|PHASE_BATTLE_STEP,1) Duel.BreakEffect() - Duel.Draw(tp,1,REASON_EFFECT) + Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE|PHASE_BATTLE_STEP,1) + if Duel.IsPlayerCanDraw(tp) then + Duel.BreakEffect() + Duel.Draw(tp,1,REASON_EFFECT) + end end end \ No newline at end of file diff --git a/official/c80764541.lua b/official/c80764541.lua index 898fa8adf7..52cc91b92a 100644 --- a/official/c80764541.lua +++ b/official/c80764541.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=44 function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) @@ -38,4 +38,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(tc,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c80796456.lua b/official/c80796456.lua index d7a66ccbde..a93672dc4b 100644 --- a/official/c80796456.lua +++ b/official/c80796456.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --atkup local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -76,4 +76,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c80993256.lua b/official/c80993256.lua index 31e7494a76..7dfd85a9d8 100644 --- a/official/c80993256.lua +++ b/official/c80993256.lua @@ -30,10 +30,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetCondition(s.negcond) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.negtg) e3:SetOperation(s.negop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.matkval(e,c) local oc=e:GetHandler():GetOverlayCount() diff --git a/official/c81096431.lua b/official/c81096431.lua index 085cd5bbca..d3ac25714c 100644 --- a/official/c81096431.lua +++ b/official/c81096431.lua @@ -30,7 +30,7 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) e3:SetCondition(function(e) return e:GetHandler():IsSetCard(SET_SHARK_DRAKE) end) - e3:SetCost(Cost.Detach(2,2,nil)) + e3:SetCost(Cost.DetachFromSelf(2,2,nil)) e3:SetTarget(s.attachtg) e3:SetOperation(s.attachop) c:RegisterEffect(e3) diff --git a/official/c81122844.lua b/official/c81122844.lua index a5ae8638b7..cdfc05a9d6 100644 --- a/official/c81122844.lua +++ b/official/c81122844.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --salvage local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND) @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_TO_GRAVE) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.thcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_WIND_UP} function s.spfilter(c,e,tp) @@ -68,4 +68,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end -end \ No newline at end of file +end diff --git a/official/c8165596.lua b/official/c8165596.lua index 8ca63e30e8..d985115a53 100644 --- a/official/c8165596.lua +++ b/official/c8165596.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp,chk) return rp==1-tp and re:IsMonsterEffect() and Duel.IsChainDisablable(ev) end) - e2:SetCost(Cost.Detach(1,1,function(e,og) e:SetLabel(og:GetFirst():IsSetCard(SET_GALAXY) and 1 or 0) end)) + e2:SetCost(Cost.DetachFromSelf(1,1,function(e,og) e:SetLabel(og:GetFirst():IsSetCard(SET_GALAXY) and 1 or 0) end)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Take 1 "Photon" or "Galaxy" card from your Deck, and either add it to your hand or attach it to this card as material local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) diff --git a/official/c81752019.lua b/official/c81752019.lua index 694e55c13e..3019591840 100644 --- a/official/c81752019.lua +++ b/official/c81752019.lua @@ -2,49 +2,59 @@ --Flower Cardian Pine local s,id=GetID() function s.initial_effect(c) - --draw (summon) + --Draw 1 card, show it, then send it to the GY unless it is a "Flower Cardian" monster local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_DRAW) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) - e1:SetTarget(s.drtg) - e1:SetOperation(s.drop1) + e1:SetTarget(s.nsdrtg) + e1:SetOperation(s.nsdrop) c:RegisterEffect(e1) - --draw (destroy) + --Draw 1 card local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) - e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) - e2:SetCondition(s.drcon) - e2:SetTarget(s.drtg) - e2:SetOperation(s.drop2) + e2:SetCondition(s.desdrcon) + e2:SetTarget(s.desdrtg) + e2:SetOperation(s.desdrop) c:RegisterEffect(e2) end s.listed_series={SET_FLOWER_CARDIAN} -function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end +function s.nsdrtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end -function s.drop1(e,tp,eg,ep,ev,re,r,rp) +function s.nsdrop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)==0 then return end - local tc=Duel.GetOperatedGroup():GetFirst() - Duel.ConfirmCards(1-tp,tc) - if not (tc:IsSetCard(SET_FLOWER_CARDIAN) and tc:IsMonster()) then - Duel.SendtoGrave(tc,REASON_EFFECT) + if Duel.Draw(p,d,REASON_EFFECT)>0 then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if not (dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster()) then + Duel.SendtoGrave(dc,REASON_EFFECT) + end + Duel.ShuffleHand(tp) end - Duel.ShuffleHand(tp) end -function s.drcon(e,tp,eg,ep,ev,re,r,rp) +function s.desdrcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:IsReason(REASON_BATTLE) - or (rp~=tp and c:IsReason(REASON_DESTROY) and c:IsPreviousControler(tp)) + return c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_DESTROY) and c:IsReason(REASON_EFFECT) + and c:IsPreviousControler(tp)) +end +function s.desdrtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end + Duel.SetTargetPlayer(tp) + Duel.SetTargetParam(1) + Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end -function s.drop2(e,tp,eg,ep,ev,re,r,rp) +function s.desdrop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end \ No newline at end of file diff --git a/official/c81927732.lua b/official/c81927732.lua index 312d3dc8ec..e435d811cf 100644 --- a/official/c81927732.lua +++ b/official/c81927732.lua @@ -11,9 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --atk/def local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) @@ -92,4 +92,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,dam,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c82308875.lua b/official/c82308875.lua index 9c88e3c42f..1fedda548f 100644 --- a/official/c82308875.lua +++ b/official/c82308875.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW+CATEGORY_HANDES) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.roll_dice=true s.xyz_number=7 @@ -72,4 +72,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.BreakEffect() Duel.DiscardHand(tp,nil,2,2,REASON_EFFECT|REASON_DISCARD) end -end \ No newline at end of file +end diff --git a/official/c82633039.lua b/official/c82633039.lua index 54b8fad727..bd8554aac1 100644 --- a/official/c82633039.lua +++ b/official/c82633039.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.settg) e1:SetOperation(s.setop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Shuffle 1 face-up card into the Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(2,2,nil)) + e2:SetCost(Cost.DetachFromSelf(2,2,nil)) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.setfilter(c) return c:IsFaceup() and c:IsCanTurnSet() @@ -62,4 +62,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c82697249.lua b/official/c82697249.lua index 48f872c583..cee90bce49 100644 --- a/official/c82697249.lua +++ b/official/c82697249.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=59 function s.imcon(e) @@ -58,4 +58,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/official/c82944432.lua b/official/c82944432.lua index 23c5c0a5b5..376f677ec6 100644 --- a/official/c82944432.lua +++ b/official/c82944432.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_NINJA} function s.condition(e,tp,eg,ep,ev,re,r,rp) @@ -45,4 +45,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(1) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c83107873.lua b/official/c83107873.lua index 18edeec8e9..419c860bef 100644 --- a/official/c83107873.lua +++ b/official/c83107873.lua @@ -3,7 +3,7 @@ --scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --special summon + --Special Summon 1 of your "Thunder Dragon" monsters that is banished or in your GY, except "Thunder Dragonhawk" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -13,8 +13,8 @@ function s.initial_effect(c) e1:SetCost(Cost.SelfDiscard) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_THUNDRA) - --to deck + c:RegisterEffect(e1) + --Shuffle any number of cards from your hand into the Deck, then draw the same number of cards local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) @@ -27,13 +27,14 @@ function s.initial_effect(c) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_TO_GRAVE) - e3:SetCondition(s.tdcon) + e3:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end) c:RegisterEffect(e3) end s.listed_names={id} s.listed_series={SET_THUNDER_DRAGON} function s.spfilter(c,e,tp) - return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(SET_THUNDER_DRAGON) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + return c:IsSetCard(SET_THUNDER_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id) + and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 @@ -44,27 +45,25 @@ function s.spop(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.spfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp) - local tc=g:GetFirst() - if tc then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end -function s.tdcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) -end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,e:GetHandler()) end - Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) - local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) - Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK) - local g=Duel.SelectMatchingCard(p,Card.IsAbleToDeck,p,LOCATION_HAND,0,1,63,nil) - if #g==0 then return end - Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) - Duel.ShuffleDeck(p) - Duel.BreakEffect() - Duel.Draw(p,#g,REASON_EFFECT) -end \ No newline at end of file + local hg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_HAND,0,nil) + if #hg==0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) + local g=hg:Select(tp,1,#hg,nil) + if #g==0 or Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==0 then return end + local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK) + if ct>0 then + Duel.ShuffleDeck(tp) + Duel.BreakEffect() + Duel.Draw(tp,ct,REASON_EFFECT) + end +end diff --git a/official/c83531441.lua b/official/c83531441.lua index ca8cdac92a..b01d68f387 100644 --- a/official/c83531441.lua +++ b/official/c83531441.lua @@ -2,34 +2,34 @@ --Dante, Traveler of the Burning Abyss local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,3,2) c:EnableReviveLimit() - --atkup + --Xyz Summon procedure: 2 Level 3 monsters + Xyz.AddProcedure(c,nil,3,2) + --This card gains 500 ATK for each sent to the GY for the cost local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.atkcost)) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --to defense + c:RegisterEffect(e1) + --If this card attacks, it is changed to Defense Position at the end of the Battle Phase local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e2:SetCode(EVENT_PHASE|PHASE_BATTLE) + e2:SetCode(EVENT_PHASE+PHASE_BATTLE) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCondition(s.poscon) - e2:SetOperation(s.posop) + e2:SetCondition(function(e) return e:GetHandler():GetAttackedCount()>0 end) + e2:SetOperation(function(e) Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE) end) c:RegisterEffect(e2) - --to hand + --Add 1 other "Burning Abyss" card from your GY to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_TO_GRAVE) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) @@ -37,58 +37,38 @@ function s.initial_effect(c) end s.listed_series={SET_BURNING_ABYSS} function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - local ct={} - for i=3,1,-1 do - if Duel.IsPlayerCanDiscardDeckAsCost(tp,i) then - table.insert(ct,i) - end - end - if #ct==1 then - Duel.DiscardDeck(tp,ct[1],REASON_COST) - e:SetLabel(1) - else - Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) - local ac=Duel.AnnounceNumber(tp,table.unpack(ct)) - Duel.DiscardDeck(tp,ac,REASON_COST) - e:SetLabel(ac) - end + if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end + local max_ct=math.min(Duel.GetFieldGroupCount(tp,LOCATION_DECK,0),3) + local op=max_ct==1 and 1 or Duel.AnnounceNumberRange(tp,1,max_ct) + e:SetLabel(op) + Duel.DiscardDeck(tp,op,REASON_COST) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - if c:IsFaceup() and c:IsRelateToEffect(e) then - local ct=e:GetLabel() + if c:IsRelateToEffect(e) and c:IsFaceup() then + --Until the end of this turn, this card gains 500 ATK for each card sent to the GY this way local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetValue(e:GetLabel()*500) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) - e1:SetValue(ct*500) c:RegisterEffect(e1) end end -function s.poscon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetAttackedCount()>0 -end -function s.posop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if c:IsAttackPos() then - Duel.ChangePosition(c,POS_FACEUP_DEFENSE) - end -end -function s.filter(c) +function s.thfilter(c) return c:IsSetCard(SET_BURNING_ABYSS) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end + local c=e:GetHandler() + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc~=c and s.thfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) + local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,c) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c83827392.lua b/official/c83827392.lua index 768f11bcff..78cbb5725f 100644 --- a/official/c83827392.lua +++ b/official/c83827392.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.tdcon) - e2:SetCost(Cost.Detach(2,2,nil)) + e2:SetCost(Cost.DetachFromSelf(2,2,nil)) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) local e3=e2:Clone() e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) @@ -56,4 +56,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c84013237.lua b/official/c84013237.lua index b6c288d8c1..4a4677d98c 100644 --- a/official/c84013237.lua +++ b/official/c84013237.lua @@ -11,9 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetOperation(function() Duel.NegateAttack() end) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Self destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -39,4 +39,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.Destroy(c,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c84025439.lua b/official/c84025439.lua index b8e60ffe61..8c39b1424c 100644 --- a/official/c84025439.lua +++ b/official/c84025439.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.tdcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.tdtg) e1:SetOperation(s.tdop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Unaffected by other effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -99,4 +99,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) local tg=aux.SelectUnselectGroup(g,e,tp,3,3,aux.dncheck,1,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c84124261.lua b/official/c84124261.lua index e8b2c7207f..39ec3584cd 100644 --- a/official/c84124261.lua +++ b/official/c84124261.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=39 function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) @@ -33,4 +33,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c84224627.lua b/official/c84224627.lua index 6bdc72f2cf..07bc83ce19 100644 --- a/official/c84224627.lua +++ b/official/c84224627.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetHintTiming(TIMING_DAMAGE_STEP) e2:SetCountLimit(1) e2:SetCondition(aux.StatChangeDamageStepCondition) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.indcon(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WATER) @@ -56,4 +56,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e2:SetValue(tc:GetBaseDefense()*2) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c84401683.lua b/official/c84401683.lua index c439d394d1..5357967560 100644 --- a/official/c84401683.lua +++ b/official/c84401683.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(aux.StatChangeDamageStepCondition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destroy monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -82,4 +82,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c84417082.lua b/official/c84417082.lua index 46abe584d7..c96eb81ff5 100644 --- a/official/c84417082.lua +++ b/official/c84417082.lua @@ -1,59 +1,46 @@ ---No.91 サンダー・スパーク・ドラゴン +--No.91 サンダー・スパーク・ドラゴン --Number 91: Thunder Spark Dragon local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,4,3) c:EnableReviveLimit() - --destroy1 + --Xyz Summon procedure: 3 Level 4 monsters + Xyz.AddProcedure(c,nil,4,3) + --Activate 1 of these effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) - e1:SetCost(s.cost1) - e1:SetTarget(s.target1) - e1:SetOperation(s.operation1) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --destroy2 - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_DESTROY) - e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetRange(LOCATION_MZONE) - e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) - e2:SetCost(s.cost2) - e2:SetTarget(s.target2) - e2:SetOperation(s.operation2) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetCountLimit(1) + e1:SetCost(Cost.Choice( + {Cost.DetachFromSelf(3),aux.Stringid(id,1),s.desmonscheck}, + {Cost.DetachFromSelf(5),aux.Stringid(id,2),s.desallcheck} + )) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) + c:RegisterEffect(e1) end s.xyz_number=91 -function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) - e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST) -end -function s.target1(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end - local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) +function s.desmonscheck(e,tp,eg,ep,ev,re,r,rp,chk) + return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end -function s.operation1(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) - Duel.Destroy(g,REASON_EFFECT) +function s.desallcheck(e,tp,eg,ep,ev,re,r,rp,chk) + return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 end -function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,5,REASON_COST) end - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) - e:GetHandler():RemoveOverlayCard(tp,5,5,REASON_COST) +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + local g=e:GetLabel()==1 + and Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) + or Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0) end -function s.target2(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end - local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local exc=c:IsRelateToEffect(e) and c or nil + local g=e:GetLabel()==1 + and Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,exc) + or Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) + if #g>0 then + Duel.Destroy(g,REASON_EFFECT) + end end -function s.operation2(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) - Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file diff --git a/official/c8491961.lua b/official/c8491961.lua index 84a7137642..d2f6f091d8 100644 --- a/official/c8491961.lua +++ b/official/c8491961.lua @@ -28,10 +28,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsXyzSummoned() and e:GetHandler():GetOverlayCount()>0 @@ -76,4 +76,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c85004150.lua b/official/c85004150.lua index 10125e445e..4db1b98d45 100644 --- a/official/c85004150.lua +++ b/official/c85004150.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) -- local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) @@ -48,4 +48,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) local dg=g:GetMaxGroup(Card.GetDefense) Duel.Destroy(dg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c85115440.lua b/official/c85115440.lua index 3d2ea8485e..04e9552fd5 100644 --- a/official/c85115440.lua +++ b/official/c85115440.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_ZOODIAC} function s.ovfilter(c,tp,lc) @@ -67,4 +67,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c85121942.lua b/official/c85121942.lua index 33ac6e8bfb..82b5458fcf 100644 --- a/official/c85121942.lua +++ b/official/c85121942.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.descon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=105 s.listed_names={59627393} @@ -71,4 +71,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,atk,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c85252081.lua b/official/c85252081.lua index 0b9f356ef7..dc3c6a1b42 100644 --- a/official/c85252081.lua +++ b/official/c85252081.lua @@ -20,17 +20,17 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) e2:SetCondition(aux.NOT(s.quickeffcond)) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --This is a Quick effect if this card has "Super Quantum Blue Layer" as Xyz Material local e3=e2:Clone() e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetHintTiming(0,TIMING_END_PHASE|TIMING_EQUIP) e3:SetCondition(s.quickeffcond) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --Attach 1 "Super Quantum" monster from your hand or field to this card local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) @@ -76,4 +76,4 @@ function s.attachop(e,tp,eg,ep,ev,re,r,rp) if tc and not tc:IsImmuneToEffect(e) then Duel.Overlay(c,tc,true) end -end \ No newline at end of file +end diff --git a/official/c85692042.lua b/official/c85692042.lua index 4a8a1fbee3..13f4a0b4da 100644 --- a/official/c85692042.lua +++ b/official/c85692042.lua @@ -3,143 +3,86 @@ --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,4,2,nil,nil,Xyz.InfiniteMats) c:EnableReviveLimit() - --search + --Xyz Summon procedure: 2+ Level 4 monsters + Xyz.AddProcedure(c,nil,4,2,nil,nil,Xyz.InfiniteMats) + --Special Summon 1 Level 4 "Mathmech" monster from your hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) - e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCondition(s.thcon) - e1:SetCost(s.thcost) - e1:SetTarget(s.thtg) - e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --special summon + e1:SetCost(s.spcost) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) + --Activate the appropriate effect based on the number of materials detached local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,4)) - e2:SetCategory(CATEGORY_SPECIAL_SUMMON) - e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) - e2:SetRange(LOCATION_MZONE) - e2:SetCost(s.spcost) - e2:SetTarget(s.sptg) - e2:SetOperation(s.spop) + e2:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) + e2:SetCost(Cost.Choice( + {Cost.DetachFromSelf(2),aux.Stringid(id,2),s.thcheck(s.mmfilter)}, + {Cost.DetachFromSelf(3),aux.Stringid(id,3),s.thcheck(s.l4filter)}, + {Cost.DetachFromSelf(4),aux.Stringid(id,4),s.thcheck(s.stfilter)} + )) + e2:SetTarget(s.thtg) + e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_MATHMECH} -function s.thcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsXyzSummoned() -end -function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local mm=s.mmtg(e,tp,eg,ep,ev,re,r,rp,0) --"Mathmech" target - local l4=s.l4tg(e,tp,eg,ep,ev,re,r,rp,0) --"Level 4" target - local st=s.sttg(e,tp,eg,ep,ev,re,r,rp,0) --"Spell/Trap" target - local ct - if st then ct = 4 end - if l4 then ct = 3 end - if mm then ct = 2 end - if chk==0 then return (l4 or mm or st) and c:CheckRemoveOverlayCard(tp,ct,REASON_COST) end - local selections={} - if st and c:CheckRemoveOverlayCard(tp,4,REASON_COST) then - table.insert(selections,4) - end - if l4 and c:CheckRemoveOverlayCard(tp,3,REASON_COST) then - table.insert(selections,3) - end - if mm and c:CheckRemoveOverlayCard(tp,2,REASON_COST) then - table.insert(selections,2) - end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ) - local sel=Duel.AnnounceNumber(tp,table.unpack(selections)) - c:RemoveOverlayCard(tp,sel,sel,REASON_COST) - if sel==2 then - Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1)) - elseif sel==3 then - Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,2)) - else - Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,3)) - end - e:SetLabel(sel) -end -function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end --legality handled in cost by necessity - local sel=e:GetLabel() - if sel==2 then - s.mmtg(e,tp,eg,ep,ev,re,r,rp,chk) - elseif sel==3 then - s.l4tg(e,tp,eg,ep,ev,re,r,rp,chk) - else - s.sttg(e,tp,eg,ep,ev,re,r,rp,chk) - end +function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,aux.ReleaseCheckMMZ,nil) end + local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,aux.ReleaseCheckMMZ,nil) + Duel.Release(g,REASON_COST) end -function s.thop(e,tp,eg,ep,ev,re,r,rp) - local sel=e:GetLabel() - if sel==2 then - s.mmop(e,tp,eg,ep,ev,re,r,rp) - elseif sel==3 then - s.l4op(e,tp,eg,ep,ev,re,r,rp) - else - s.stop(e,tp,eg,ep,ev,re,r,rp) - end +function s.spfilter(c,e,tp) + return c:IsSetCard(SET_MATHMECH) and c:IsLevel(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function s.tg(filter) - return function(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(filter,tp,LOCATION_DECK,0,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) - end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) end -function s.op(filter) - return function(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectMatchingCard(tp,filter,tp,LOCATION_DECK,0,1,1,nil) - if #g>0 then - Duel.SendtoHand(g,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,g) - end +function s.spop(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.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.mmfilter(c) return c:IsSetCard(SET_MATHMECH) and c:IsAbleToHand() end -s.mmtg=s.tg(s.mmfilter) -s.mmop=s.op(s.mmfilter) function s.l4filter(c) return c:IsLevel(4) and c:IsAbleToHand() end -s.l4tg=s.tg(s.l4filter) -s.l4op=s.op(s.l4filter) function s.stfilter(c) return c:IsSpellTrap() and c:IsAbleToHand() end -s.sttg=s.tg(s.stfilter) -s.stop=s.op(s.stfilter) -function s.cfilter(c,ft,tp) - return ft>0 or (c:IsControler(tp) and c:GetSequence()<5) -end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if chk==0 then return ft>-1 and Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,ft,tp) end - local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,ft,tp) - Duel.Release(g,REASON_COST) -end -function s.spfilter(c,e,tp) - return c:IsSetCard(SET_MATHMECH) and c:IsLevel(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +function s.thcheck(filter) + return function(e,tp) + return Duel.IsExistingMatchingCard(filter,tp,LOCATION_DECK,0,1,nil) + end end -function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end -function s.spop(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.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp) +function s.thop(e,tp,eg,ep,ev,re,r,rp) + local op=e:GetLabel() + local filter=(op==1 and s.mmfilter) + or (op==2 and s.l4filter) + or s.stfilter + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then - Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c85747929.lua b/official/c85747929.lua index 28a6608cd7..61450f13c4 100644 --- a/official/c85747929.lua +++ b/official/c85747929.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Change levels to 4 or 8 local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -110,4 +110,4 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c8617563.lua b/official/c8617563.lua index f17f2ae311..609dc1dfec 100644 --- a/official/c8617563.lua +++ b/official/c8617563.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.settg) e1:SetOperation(s.setop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Search 1 "Rank-Up-Magic" Spell if it has a Winged Beast monster attached local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(function(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_WINGEDBEAST) end) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --A "Raidraptor" Xyz Monster that has this card as material gains ATK local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_XMATERIAL) @@ -66,4 +66,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c86221741.lua b/official/c86221741.lua index b2c08d0acd..f17dbb90fb 100644 --- a/official/c86221741.lua +++ b/official/c86221741.lua @@ -17,9 +17,9 @@ function s.initial_effect(c) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Minus 1000 ATK for opp cards, optionally inflict damage local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) @@ -79,4 +79,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) else Duel.Damage(1-tp,1000,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c86238081.lua b/official/c86238081.lua index b784f96cb9..75549e9313 100644 --- a/official/c86238081.lua +++ b/official/c86238081.lua @@ -46,10 +46,10 @@ function s.initial_effect(c) e5:SetRange(LOCATION_MZONE) e5:SetCountLimit(1) e5:SetCondition(s.effcon) - e5:SetCost(Cost.Detach(1)) + e5:SetCost(Cost.DetachFromSelf(1)) e5:SetTarget(s.destg) e5:SetOperation(s.desop) - c:RegisterEffect(e5,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e5) --Place itself into pendulum zone local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,2)) @@ -128,4 +128,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 \ No newline at end of file +end diff --git a/official/c86331741.lua b/official/c86331741.lua index 6cdf61c29d..5178a412d1 100644 --- a/official/c86331741.lua +++ b/official/c86331741.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Xyz Material local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -25,7 +25,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCondition(s.ngcon) - e2:SetCost(Cost.Detach(2)) + e2:SetCost(Cost.DetachFromSelf(2)) e2:SetTarget(s.ngtg) e2:SetOperation(s.ngop) c:RegisterEffect(e2) @@ -96,4 +96,4 @@ function s.ngop(e,tp,eg,ep,ev,re,r,rp) e3:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e3) end -end \ No newline at end of file +end diff --git a/official/c86466163.lua b/official/c86466163.lua index 27f250b207..f01e9d8049 100644 --- a/official/c86466163.lua +++ b/official/c86466163.lua @@ -2,42 +2,37 @@ --Satellarknight Capella local s,id=GetID() function s.initial_effect(c) - --Treat "tellarknight" monsters as Level 5 for Xyz Summons - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Apply a "You can treat Level 4 or lower "tellarknight" monsters you control as Level 5 when Xyz Summoning using 3 or more monsters as Xyz Materials" effect + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetOperation(s.effop) + c:RegisterEffect(e1a) + local e1ab=e1a:Clone() + e1ab:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1ab) + local e1ac=e1a:Clone() + e1ac:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1ac) end s.listed_series={SET_TELLARKNIGHT} -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_XYZ_LEVEL) - e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) - e1:SetTargetRange(LOCATION_MZONE,0) - e1:SetTarget(s.xyztg) - e1:SetValue(s.xyzlv) - e1:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(e1,tp) - local e2=e1:Clone() - e2:SetCode(EFFECT_SATELLARKNIGHT_CAPELLA) - e2:SetLabelObject(e1) - e2:SetValue(0x30003) --0x1 >, 0x2 =, 0x4 <, value == last digit(s) - Duel.RegisterEffect(e2,tp) -end -function s.xyztg(e,c) - return c:IsLevelBelow(4) and c:IsSetCard(SET_TELLARKNIGHT) -end -function s.xyzlv(e,c,rc) - return 0x50000+c:GetLevel() -end +function s.effop(e,tp,eg,ep,ev,re,r,rp) + --For the rest of this turn, you can treat Level 4 or lower "tellarknight" monsters you control as Level 5 when Xyz Summoning using 3 or more monsters as Xyz Materials + local e1a=Effect.CreateEffect(e:GetHandler()) + e1a:SetType(EFFECT_TYPE_FIELD) + e1a:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e1a:SetCode(EFFECT_XYZ_LEVEL) + e1a:SetTargetRange(LOCATION_MZONE,0) + e1a:SetTarget(function(e,c) return c:IsLevelBelow(4) and c:IsSetCard(SET_TELLARKNIGHT) end) + e1a:SetValue(function(e,c,rc) return 0x50000+c:GetLevel() end) + e1a:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1a,tp) + local e1b=e1a:Clone() + e1b:SetCode(EFFECT_SATELLARKNIGHT_CAPELLA) + e1b:SetLabelObject(e1a) + e1b:SetValue(0x30003) --0x1 >, 0x2 =, 0x4 <, value == last digit(s) + Duel.RegisterEffect(e1b,tp) +end \ No newline at end of file diff --git a/official/c86532744.lua b/official/c86532744.lua index 55b7d965c0..eddc5519be 100644 --- a/official/c86532744.lua +++ b/official/c86532744.lua @@ -1,55 +1,47 @@ ---SNo.39 希望皇ホープONE +--SNo.39 希望皇ホープONE --Number S39: Utopia Prime local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon procedure - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_LIGHT),4,3,s.ovfilter,aux.Stringid(id,1)) - --Destroy Special Summoned monsters and inflict damage + --Xyz Summon procedure: 3 Level 4 LIGHT monsters OR 1 "Number 39: Utopia" you control + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_LIGHT),4,3,s.ovfilter,aux.Stringid(id,0)) + --Destroy as many Special Summoned monsters your opponent controls as possible, and if you do, banish them, then inflict 300 damage to your opponent for each monster banished local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCondition(s.condition) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetCondition(function(e,tp) return Duel.GetLP(1-tp)>=Duel.GetLP(tp)+3000 end) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(3),Cost.PayLP(10,true))) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) + c:RegisterEffect(e1) end s.xyz_number=39 -s.listed_names={84013237} --Number 39: Utopia +s.listed_names={84013237} --"Number 39: Utopia" function s.ovfilter(c,tp,lc) - return c:IsFaceup() and c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,84013237) + return c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,84013237) and c:IsFaceup() end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetLP(tp)<=Duel.GetLP(1-tp)-3000 +function s.desfilter(c) + return c:IsSpecialSummoned() and c:IsAbleToRemove() end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.GetLP(tp)>10 and e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST) - Duel.PayLPCost(tp,Duel.GetLP(tp)-10) +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) + local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil) + if chk==0 then return #g>0 end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0) + Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,tp,0) + Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,#g*300) end -function s.filter(c) - return c:IsAbleToRemove() - and (c:GetSummonType()&SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL -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(1-tp) and s.filter(chkc) end - if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) end - local sg=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,#sg,0,0) - Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,#sg*300) -end -function s.ctfilter(c) +function s.rmctfilter(c) return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local sg=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) - Duel.Destroy(sg,REASON_EFFECT,LOCATION_REMOVED) - local ct=Duel.GetOperatedGroup():FilterCount(s.ctfilter,nil) - if ct>0 then - Duel.BreakEffect() - Duel.Damage(1-tp,ct*300,REASON_EFFECT) +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil) + if #g>0 and Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED)>0 then + local ct=Duel.GetOperatedGroup():FilterCount(s.rmctfilter,nil) + if ct>0 then + Duel.BreakEffect() + Duel.Damage(1-tp,ct*300,REASON_EFFECT) + end end -end \ No newline at end of file +end diff --git a/official/c8660395.lua b/official/c8660395.lua index fb1b0ac998..9e2cc70c70 100644 --- a/official/c8660395.lua +++ b/official/c8660395.lua @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) @@ -74,4 +74,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if #tg>0 then Duel.Destroy(tg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c86848580.lua b/official/c86848580.lua index a64ac774f0..e2098d300e 100644 --- a/official/c86848580.lua +++ b/official/c86848580.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,nil) end @@ -54,4 +54,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE|RESET_PHASE|PHASE_STANDBY,2) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c87257460.lua b/official/c87257460.lua index 8e188d9faa..7d5c261f97 100644 --- a/official/c87257460.lua +++ b/official/c87257460.lua @@ -36,7 +36,7 @@ function s.initial_effect(c) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) e3:SetLabelObject(e1) - c:RegisterEffect(e3,false,EFFECT_MARKER_ALLURE_LVUP) + c:RegisterEffect(e3) end s.listed_names={23756165} --"Allure Queen LV5" s.LVnum=3 diff --git a/official/c87327776.lua b/official/c87327776.lua index 6ed6c41581..557d0fd47a 100644 --- a/official/c87327776.lua +++ b/official/c87327776.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Return 1 monster on the field to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -75,4 +75,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c87676171.lua b/official/c87676171.lua index d725c84cc2..7a8cdcd983 100644 --- a/official/c87676171.lua +++ b/official/c87676171.lua @@ -25,9 +25,9 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(function(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,CARD_CRYSTAL_GOD_TISTINA) end) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetOperation(s.atkop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Special Summon 1 "Tistina" monster from the GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -92,4 +92,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c87911394.lua b/official/c87911394.lua index 8ab6016d70..7bc0cefa1d 100644 --- a/official/c87911394.lua +++ b/official/c87911394.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetCondition(s.atkcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_UTOPIA} s.xyz_number=39 @@ -69,4 +69,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/official/c88021907.lua b/official/c88021907.lua index e335ab044b..e7360ce5e7 100644 --- a/official/c88021907.lua +++ b/official/c88021907.lua @@ -4,138 +4,100 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon Procedure + --Xyz Summon procedure: 3 Level 4 monsters Xyz.AddProcedure(c,nil,4,3) - --Send cards to the GY + --If a "Mathmech" card(s) you control would be destroyed by card effect, you can detach 1 material from this card instead local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOGRAVE) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) - e1:SetCode(EVENT_SPSUMMON_SUCCESS) - e1:SetCountLimit(1,id) - e1:SetCondition(s.con) - e1:SetCost(s.cost) - e1:SetTarget(s.tg) - e1:SetOperation(s.op) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --Destruction replacement for "Mathmech" cards + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e1:SetCode(EFFECT_DESTROY_REPLACE) + e1:SetRange(LOCATION_MZONE) + e1:SetTarget(s.reptg) + e1:SetValue(function(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end) + c:RegisterEffect(e1) + --Activate a number of effects to activate equal to the number of materials detached local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e2:SetCode(EFFECT_DESTROY_REPLACE) - e2:SetRange(LOCATION_MZONE) - e2:SetTarget(s.reptg) - e2:SetValue(s.repval) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_TOGRAVE) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_SPSUMMON_SUCCESS) + e2:SetCountLimit(1,id) + e2:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) + e2:SetCost(Cost.DetachFromSelf(1,s.effcostmax,function(e,og) e:SetLabel(#og) end)) + e2:SetTarget(s.efftg) + e2:SetOperation(s.effop) c:RegisterEffect(e2) end s.listed_series={SET_MATHMECH} -function s.con(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsXyzSummoned() +function s.repfilter(c,tp) + return c:IsSetCard(SET_MATHMECH) and c:IsControler(tp) and c:IsOnField() and c:IsFaceup() + and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - local ct=0 - if s.handtg(e,tp,eg,ep,ev,re,r,rp,0) then ct=ct+1 end - if s.montg(e,tp,eg,ep,ev,re,r,rp,0) then ct=ct+1 end - if s.sttg(e,tp,eg,ep,ev,re,r,rp,0) then ct=ct+1 end - if chk==0 then return ct>0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - local ft=c:RemoveOverlayCard(tp,1,ct,REASON_COST) - e:SetLabel(ft) + if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end + return Duel.SelectEffectYesNo(tp,c,96) and c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)>0 end -function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) - local hand=s.handtg(e,tp,eg,ep,ev,re,r,rp,0) - local mon=s.montg(e,tp,eg,ep,ev,re,r,rp,0) - local st=s.sttg(e,tp,eg,ep,ev,re,r,rp,0) - if chk==0 then return hand or mon or st end +function s.effcostmax(e,tp) local ct=0 - if hand then ct=ct+1 end - if mon then ct=ct+1 end - if st then ct=ct+1 end - local ft=e:GetLabel() - if ft0 do - local stable={} - local dtable={} - if hand and (sel&0x1==0) then - table.insert(stable,0x1) - table.insert(dtable,aux.Stringid(id,1)) - end - if mon and (sel&0x2==0) then - table.insert(stable,0x2) - table.insert(dtable,aux.Stringid(id,2)) - end - if st and (sel&0x4==0) then - table.insert(stable,0x4) - table.insert(dtable,aux.Stringid(id,3)) - end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) - local op=Duel.SelectOption(tp,table.unpack(dtable))+1 - sel=sel+stable[op] - ct=ct-1 - end - e:SetLabel(sel) + if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND,1,nil) then ct=ct+1 end + if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,nil) then ct=ct+1 end + if Duel.IsExistingMatchingCard(aux.AND(Card.IsSpellTrap,Card.IsAbleToGrave),tp,0,LOCATION_ONFIELD,1,nil) then ct=ct+1 end + return ct end -function s.op(e,tp,eg,ep,ev,re,r,rp) - local sel=e:GetLabel() - if (sel&0x1==0x1) then - s.handop(e,tp,eg,ep,ev,re,r,rp) - end - if (sel&0x2==0x2) then - s.monop(e,tp,eg,ep,ev,re,r,rp) - end - if (sel&0x4==0x4) then - s.stop(e,tp,eg,ep,ev,re,r,rp) +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + local b1=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND,1,nil) + local b2=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,nil) + local b3=Duel.IsExistingMatchingCard(aux.AND(Card.IsSpellTrap,Card.IsAbleToGrave),tp,0,LOCATION_ONFIELD,1,nil) + local options={ + {b1,aux.Stringid(id,1)}, + {b2,aux.Stringid(id,2)}, + {b3,aux.Stringid(id,3)} + } + local locations=0 + local selection={} + local ct=e:GetLabel() + for i=1,ct do + local op=Duel.SelectEffect(tp,table.unpack(options)) + options[op][1]=false + selection[op]=true + locations=locations|((op==1 and LOCATION_HAND) or (op==2 and LOCATION_MZONE) or LOCATION_ONFIELD) end + e:SetLabelObject(selection) + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,ct,1-tp,locations) end -function s.handtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)~=0 end - Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_HAND) -end -function s.handop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0) - if #g==0 then return end - local sg=g:RandomSelect(1-tp,1) - Duel.SendtoGrave(sg,REASON_EFFECT) -end -function s.montg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,0) -end -function s.monop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,1,nil) - if #g>0 then - Duel.SendtoGrave(g,REASON_EFFECT) +function s.effop(e,tp,eg,ep,ev,re,r,rp) + local break_chk=false + local selection=e:GetLabelObject() + if selection[1] then + --Send 1 random card from your opponent's hand to the GY + local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND,nil) + if #g>0 then + break_chk=true + local sg=g:RandomSelect(1-tp,1) + Duel.SendtoGrave(sg,REASON_EFFECT) + end end -end -function s.stfilter(c) - return c:IsSpellTrap() and c:IsAbleToGrave() -end -function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.stfilter,tp,0,LOCATION_SZONE,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,0) -end -function s.stop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.stftiler,tp,0,LOCATION_SZONE,1,1,nil) - if #g>0 then - Duel.SendtoGrave(g,REASON_EFFECT) + if selection[2] then + --Send 1 monster your opponent controls to the GY + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + if break_chk then Duel.BreakEffect() end + break_chk=true + Duel.SendtoGrave(g,REASON_EFFECT) + end + end + if selection[3] then + --Send 1 Spell/Trap your opponent controls to the GY + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + local g=Duel.SelectMatchingCard(tp,aux.AND(Card.IsSpellTrap,Card.IsAbleToGrave),tp,0,LOCATION_ONFIELD,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + if break_chk then Duel.BreakEffect() end + Duel.SendtoGrave(g,REASON_EFFECT) + end end end -function s.repfilter(c,tp) - return c:IsFaceup() and c:IsSetCard(SET_MATHMECH) and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) - and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE) -end -function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local g=c:GetLinkedGroup() - if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end - if Duel.SelectEffectYesNo(tp,c,96) then - c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) - return true - else return false end -end -function s.repval(e,c) - return s.repfilter(c,e:GetHandlerPlayer()) -end \ No newline at end of file diff --git a/official/c88120966.lua b/official/c88120966.lua index 55a8ce5de0..1e8eb24e65 100644 --- a/official/c88120966.lua +++ b/official/c88120966.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetCountLimit(2) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=15 function s.condition(e,tp,eg,ep,ev,re,r,rp) @@ -43,4 +43,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,atk,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c88177324.lua b/official/c88177324.lua index b0099b3493..0abbae9201 100644 --- a/official/c88177324.lua +++ b/official/c88177324.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.negcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Can gain ATK and make a second attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -106,4 +106,4 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp) e2:SetValue(1) e2:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE) c:RegisterEffect(e2) -end \ No newline at end of file +end diff --git a/official/c88581108.lua b/official/c88581108.lua index a7130c029c..17bce443dd 100644 --- a/official/c88581108.lua +++ b/official/c88581108.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetHintTiming(0,TIMING_DRAW_PHASE) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.attg) e1:SetOperation(s.atop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --"True Draco" and "True King" opponent destruction flag local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) @@ -68,4 +68,4 @@ function s.aclimit(e,re,tp) end function s.atktarget(e,c) return c:IsAttribute(e:GetLabel()) -end \ No newline at end of file +end diff --git a/official/c88722973.lua b/official/c88722973.lua index 026e35be63..f931895fb2 100644 --- a/official/c88722973.lua +++ b/official/c88722973.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_DRACOSLAYER} function s.regtg(e,tp,eg,ep,ev,re,r,rp,chk) @@ -79,4 +79,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c88754763.lua b/official/c88754763.lua index 5be903838e..4d8afaad72 100644 --- a/official/c88754763.lua +++ b/official/c88754763.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.condition) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsType,1,nil,TYPE_XYZ) @@ -42,4 +42,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Damage(1-tp,800,REASON_EFFECT) end Duel.ShuffleHand(tp) -end \ No newline at end of file +end diff --git a/official/c88917691.lua b/official/c88917691.lua index e13b48b91c..f617d6f065 100644 --- a/official/c88917691.lua +++ b/official/c88917691.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(function(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,{SET_ZUBABA,SET_GAGAGA,SET_GOGOGO,SET_DODODO}) end) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --A "Utopic Future" Xyz Monster that has this card as material gains this effect. --● If it is Xyz Summoned: Activate this effect; it can make a second attack during each Battle Phase this turn. local e2=Effect.CreateEffect(c) @@ -61,4 +61,4 @@ function s.secondattackop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c88942504.lua b/official/c88942504.lua index 5a0e67895c..b918281f36 100644 --- a/official/c88942504.lua +++ b/official/c88942504.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_DJINN} function s.condition(e,tp,eg,ep,ev,re,r,rp) @@ -45,4 +45,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(1) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c89016236.lua b/official/c89016236.lua index 6308c4457e..1f8138fe1b 100644 --- a/official/c89016236.lua +++ b/official/c89016236.lua @@ -4,6 +4,14 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() + --Register that it was Special Summoned by the effect of a "Nouvelles" monster + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EVENT_SPSUMMON_SUCCESS) + e0:SetCondition(s.regcon) + e0:SetOperation(function(e) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD&~RESET_TEMP_REMOVE,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) end) + c:RegisterEffect(e0) --Draw 1 card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) @@ -32,6 +40,17 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_RECIPE,SET_NOUVELLES} +function s.regcon(e,tp,eg,ep,ev,re,r,rp) + if not (re and re:IsMonsterEffect()) then return false end + local rc=re:GetHandler() + local trig_loc,trig_setcodes=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SETCODES) + if not Duel.IsChainSolving() or (rc:IsRelateToEffect(re) and rc:IsFaceup() and rc:IsLocation(trig_loc)) then + return rc:IsSetCard(SET_NOUVELLES) + end + for _,set in ipairs(trig_setcodes) do + if (SET_NOUVELLES&0xfff)==(set&0xfff) and (SET_NOUVELLES&set)==SET_NOUVELLES then return true end + end +end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) diff --git a/official/c89185742.lua b/official/c89185742.lua index 1f1851f3c9..20a7e4bec9 100644 --- a/official/c89185742.lua +++ b/official/c89185742.lua @@ -2,31 +2,19 @@ --Lightning, Dragon Ruler of Drafts local s,id=GetID() function s.initial_effect(c) - --Special summon 1 "Tempest, Dragon Ruler of Storms" from deck + --Special Summon 1 "Tempest, Dragon Ruler of Storms" from your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) - e1:SetCost(s.spcost) + e1:SetCost(DragonRuler.SelfDiscardCost(ATTRIBUTE_WIND)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DRAGON_RULER) + c:RegisterEffect(e1) end s.listed_names={89399912} --"Tempest, Dragon Ruler of Storms" -function s.costfilter(c) - return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WIND)) and c:IsDiscardable() -end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() - and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c) - g:AddCard(c) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) -end function s.spfilter(c,e,tp) return c:IsCode(89399912) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end @@ -37,16 +25,16 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - local tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) + local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then - --Cannot attack + --Cannot attack this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) - e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end Duel.SpecialSummonComplete() -end \ No newline at end of file +end diff --git a/official/c89399912.lua b/official/c89399912.lua index 224811ab18..dcbbe53d9a 100644 --- a/official/c89399912.lua +++ b/official/c89399912.lua @@ -2,28 +2,28 @@ --Tempest, Dragon Ruler of Storms local s,id=GetID() function s.initial_effect(c) - --Special Summon this card from the hand or GY + --Special Summon this card from your hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCountLimit(1,id) - e1:SetCost(s.hspcost) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) + e1:SetCost(s.selfspcost) + e1:SetTarget(s.selfsptg) + e1:SetOperation(s.selfspop) c:RegisterEffect(e1) --Return this card to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e2:SetCode(EVENT_PHASE|PHASE_END) e2:SetRange(LOCATION_MZONE) - e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1,id) - e2:SetCondition(s.retcon) - e2:SetTarget(s.rettg) - e2:SetOperation(s.retop) + e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSpecialSummoned() end) + e2:SetTarget(s.rthtg) + e2:SetOperation(s.rthop) c:RegisterEffect(e2) --Add 1 Dragon monster from your Deck to your hand local e3=Effect.CreateEffect(c) @@ -32,10 +32,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_HAND) e3:SetCountLimit(1,id) - e3:SetCost(s.thdrgncost) - e3:SetTarget(s.thdrgntg) - e3:SetOperation(s.thdrgnop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DRAGON_RULER) + e3:SetCost(DragonRuler.SelfDiscardToGraveCost(ATTRIBUTE_WIND)) + e3:SetTarget(s.dthtg) + e3:SetOperation(s.dthop) + c:RegisterEffect(e3) --Add 1 WIND Dragon monster from your Deck to your hand local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,3)) @@ -44,81 +44,67 @@ function s.initial_effect(c) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCode(EVENT_REMOVE) e4:SetCountLimit(1,id) - e4:SetTarget(s.thwindtg) - e4:SetOperation(s.thwindop) + e4:SetTarget(s.wdthtg) + e4:SetOperation(s.wdthop) c:RegisterEffect(e4) end -function s.rfilter(c) - return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WIND)) and c:IsAbleToRemoveAsCost() +function s.spcostfilter(c) + return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WIND)) and c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true)) end -function s.hspcost(e,tp,eg,ep,ev,re,r,rp,chk) - local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) +function s.selfspcost(e,tp,eg,ep,ev,re,r,rp,chk) + local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) if chk==0 then return #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE) Duel.Remove(g,POS_FACEUP,REASON_COST) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end -function s.hspop(e,tp,eg,ep,ev,re,r,rp) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end -function s.retcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSpecialSummoned() -end -function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,0) end -function s.retop(e,tp,eg,ep,ev,re,r,rp) +function s.rthop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then Duel.SendtoHand(c,nil,REASON_EFFECT) end end -function s.dfilter(c) - return c:IsAttribute(ATTRIBUTE_WIND) and c:IsDiscardable() and c:IsAbleToGraveAsCost() -end -function s.thdrgncost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() and c:IsAbleToGraveAsCost() - and Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND,0,1,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_HAND,0,1,1,c) - g:AddCard(e:GetHandler()) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) -end -function s.thdrgnfilter(c) +function s.dthfilter(c) return c:IsRace(RACE_DRAGON) and c:IsAbleToHand() end -function s.thdrgntg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.thdrgnfilter,tp,LOCATION_DECK,0,1,e:GetHandler()) end +function s.dthtg(e,tp,eg,ep,ev,re,r,rp,chk) + --Excluding itself for a correct interaction with "Chasma, Dragon Ruler of Auroras" [04965193] + if chk==0 then return Duel.IsExistingMatchingCard(s.dthfilter,tp,LOCATION_DECK,0,1,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end -function s.thdrgnop(e,tp,eg,ep,ev,re,r,rp) +function s.dthop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectMatchingCard(tp,s.thdrgnfilter,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.dthfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end -function s.thwindfilter(c) +function s.wdthfilter(c) return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToHand() end -function s.thwindtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.thwindfilter,tp,LOCATION_DECK,0,1,nil) end +function s.wdthtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.wdthfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end -function s.thwindop(e,tp,eg,ep,ev,re,r,rp) +function s.wdthop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectMatchingCard(tp,s.thwindfilter,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.wdthfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) diff --git a/official/c89477759.lua b/official/c89477759.lua index b46d2df2e7..0b6dc02b91 100644 --- a/official/c89477759.lua +++ b/official/c89477759.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Destroy and Special Summon (Battle Phase) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -98,4 +98,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc and Duel.SpecialSummon(tc,0x53b,tp,tp,false,false,POS_FACEUP)>0 and e:GetHandler():IsRelateToEffect(e) then Duel.Overlay(tc,e:GetHandler()) end -end \ No newline at end of file +end diff --git a/official/c89516305.lua b/official/c89516305.lua index a1b8f864a9..b6bbfad3ec 100644 --- a/official/c89516305.lua +++ b/official/c89516305.lua @@ -1,111 +1,93 @@ ---No.87 雪月花美神クイーン・オブ・ナイツ +--No.87 雪月花美神クイーン・オブ・ナイツ --Number 87: Queen of the Night local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,8,3) c:EnableReviveLimit() - --s/t + --Xyz Summon procedure: 3 Level 8 monsters + Xyz.AddProcedure(c,nil,8,3) + --Ativate 1 of these effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) - e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) - e1:SetCost(s.cost) - e1:SetTarget(s.sttg) - e1:SetOperation(s.stop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --turn set - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) - e2:SetType(EFFECT_TYPE_QUICK_O) - e2:SetCode(EVENT_FREE_CHAIN) - e2:SetRange(LOCATION_MZONE) - e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) - e2:SetCost(s.cost) - e2:SetTarget(s.settg) - e2:SetOperation(s.setop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) - --atkup - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,2)) - e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) - e3:SetType(EFFECT_TYPE_QUICK_O) - e3:SetCode(EVENT_FREE_CHAIN) - e3:SetRange(LOCATION_MZONE) - e3:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) - e3:SetHintTiming(TIMING_DAMAGE_STEP) - e3:SetCondition(aux.StatChangeDamageStepCondition) - e3:SetCost(s.cost) - e3:SetTarget(s.atktg) - e3:SetOperation(s.atkop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + e1:SetCountLimit(1) + e1:SetHintTiming(TIMING_DAMAGE_STEP|TIMING_SSET,TIMING_DAMAGE_STEP|TIMING_SSET|TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetCost(Cost.DetachFromSelf(1)) + e1:SetTarget(s.efftg) + e1:SetOperation(s.effop) + c:RegisterEffect(e1) end s.xyz_number=87 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end -function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_SZONE) and chkc:IsFacedown() end - if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,0,LOCATION_SZONE,1,e:GetHandler()) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN) - Duel.SelectTarget(tp,Card.IsFacedown,tp,0,LOCATION_SZONE,1,1,e:GetHandler()) -end -function s.stop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local tc=Duel.GetFirstTarget() - if c:IsRelateToEffect(e) and tc:IsFacedown() and tc:IsRelateToEffect(e) then - c:SetCardTarget(tc) - e:SetLabelObject(tc) - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_OWNER_RELATE) - e1:SetCode(EFFECT_CANNOT_TRIGGER) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - e1:SetCondition(s.rcon) - e1:SetValue(1) - tc:RegisterEffect(e1) - end -end -function s.rcon(e) - return e:GetOwner():IsHasCardTarget(e:GetHandler()) -end function s.setfilter(c) - return c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsCanTurnSet() -end -function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.setfilter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) - local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) + return c:IsRace(RACE_PLANT) and c:IsCanTurnSet() end -function s.setop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - if tc:IsFaceup() and tc:IsRelateToEffect(e) then - Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then + local op=e:GetLabel() + if op==1 then + return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_SZONE) and chkc:IsFacedown() + elseif op==2 then + return chkc:IsLocation(LOCATION_MZONE) and s.setfilter(chkc) + elseif op==3 then + return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() + end + end + local not_dmg_step=not Duel.IsPhase(PHASE_DAMAGE) + local b1=not_dmg_step and Duel.IsExistingTarget(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) + local b2=not_dmg_step and Duel.IsExistingTarget(s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) + local b3=aux.StatChangeDamageStepCondition() + and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) + if chk==0 then return b1 or b2 or b3 end + local op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,1)}, + {b2,aux.Stringid(id,2)}, + {b3,aux.Stringid(id,3)}) + e:SetLabel(op) + e:SetCategory(0) + if op==1 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN) + Duel.SelectTarget(tp,Card.IsFacedown,tp,0,LOCATION_SZONE,1,1,nil) + elseif op==2 then + e:SetCategory(CATEGORY_POSITION) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) + local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,tp,0) + elseif op==3 then + e:SetCategory(CATEGORY_ATKCHANGE) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) + Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end end -function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end - if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) - Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) -end -function s.atkop(e,tp,eg,ep,ev,re,r,rp) +function s.effop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsFaceup() and tc:IsRelateToEffect(e) then - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e1:SetValue(300) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e1) + if not tc:IsRelateToEffect(e) then return end + local op=e:GetLabel() + local c=e:GetHandler() + if op==1 then + --Target 1 Set Spell/Trap your opponent controls; while this card is face-up on the field, that Set card cannot be activated + if c:IsRelateToEffect(e) and tc:IsFacedown() then + c:SetCardTarget(tc) + --While this card is face-up on the field, that Set card cannot be activated + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_OWNER_RELATE) + e1:SetCode(EFFECT_CANNOT_TRIGGER) + e1:SetCondition(function() return c:IsHasCardTarget(tc) and tc:IsFacedown() end) + e1:SetValue(1) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + tc:RegisterEffect(e1) + end + elseif op==2 then + --Target 1 Plant monster on the field; change that target to face-down Defense Position + if tc:IsRace(RACE_PLANT) then + Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) + end + elseif op==3 then + --Target 1 face-up monster on the field; that target gains 300 ATK + if tc:IsFaceup() then + tc:UpdateAttack(300,nil,c) + end end -end \ No newline at end of file +end diff --git a/official/c89642993.lua b/official/c89642993.lua index ec07df051e..eec3176d85 100644 --- a/official/c89642993.lua +++ b/official/c89642993.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.eftg) e1:SetOperation(s.efop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=63 function s.eftg(e,tp,eg,ep,ev,re,r,rp,chk) @@ -44,4 +44,4 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(1-tp,1,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c89818984.lua b/official/c89818984.lua index f108c92f25..b4aef87897 100644 --- a/official/c89818984.lua +++ b/official/c89818984.lua @@ -3,76 +3,80 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --spsummon from hand + --Must first be Special Summoned (from your hand) by Tributing 1 Level 11 "Flower Cardian" monster, except "Flower Cardian Willow with Calligrapher" + local e0=Effect.CreateEffect(c) + e0:SetDescription(aux.Stringid(id,0)) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EFFECT_SPSUMMON_PROC) + e0:SetRange(LOCATION_HAND) + e0:SetCondition(s.selfspcon) + e0:SetTarget(s.selfsptg) + e0:SetOperation(s.selfspop) + c:RegisterEffect(e0) + --Draw 1 card, and if you do, show it, then you can Special Summon it if it is a "Flower Cardian" monster local e1=Effect.CreateEffect(c) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetRange(LOCATION_HAND) - e1:SetCode(EFFECT_SPSUMMON_PROC) - e1:SetCondition(s.hspcon) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) - --draw + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetTarget(s.drsptg) + e1:SetOperation(s.drspop) + c:RegisterEffect(e1) + --When this card is used as Synchro Material, you can treat it and all other Synchro Materials (that have a Level) as Level 2 monsters local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM) + e2:SetOperation(s.synop) c:RegisterEffect(e2) - --synchro - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM) - e3:SetOperation(s.synop) - c:RegisterEffect(e3) end s.listed_series={SET_FLOWER_CARDIAN} s.listed_names={id} -function s.hspfilter(c,tp) - return c:IsSetCard(SET_FLOWER_CARDIAN) and c:GetLevel()==11 and not c:IsCode(id) +function s.selfspfilter(c) + return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsLevel(11) and not c:IsCode(id) end -function s.hspcon(e,c) +function s.selfspcon(e,c) if c==nil then return true end - return Duel.CheckReleaseGroup(c:GetControler(),s.hspfilter,1,false,1,true,c,c:GetControler(),nil,false,nil) + local tp=c:GetControler() + return Duel.CheckReleaseGroup(tp,s.selfspfilter,1,false,1,true,c,tp,nil,false,nil) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,c) - local g=Duel.SelectReleaseGroup(tp,s.hspfilter,1,1,false,true,true,c,nil,nil,false,nil) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) + local g=Duel.SelectReleaseGroup(tp,s.selfspfilter,1,1,false,true,true,c,nil,nil,false,nil) if g then g:KeepAlive() e:SetLabelObject(g) - return true + return true end return false end -function s.hspop(e,tp,eg,ep,ev,re,r,rp,c) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drsptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.drspop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 then - local tc=Duel.GetOperatedGroup():GetFirst() - Duel.ConfirmCards(1-tp,tc) - Duel.BreakEffect() - if tc:IsMonster() and tc:IsSetCard(SET_FLOWER_CARDIAN) then - if tc:IsCanBeSpecialSummoned(e,0,tp,false,false) - and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) + if Duel.Draw(p,d,REASON_EFFECT)>0 then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and dc:IsCanBeSpecialSummoned(e,0,tp,false,false) + and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.BreakEffect() + Duel.SpecialSummon(dc,0,tp,tp,false,false,POS_FACEUP) end else - Duel.SendtoGrave(tc,REASON_EFFECT) + Duel.BreakEffect() + Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end diff --git a/official/c90098780.lua b/official/c90098780.lua index d70baf525a..a6f00568cf 100644 --- a/official/c90098780.lua +++ b/official/c90098780.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_DJINN} function s.filter(c,e,tp) @@ -68,4 +68,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c90162951.lua b/official/c90162951.lua index 12840437de..47f7a35df8 100644 --- a/official/c90162951.lua +++ b/official/c90162951.lua @@ -31,10 +31,10 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) - e4:SetCost(Cost.Detach(1,1,nil)) + e4:SetCost(Cost.DetachFromSelf(1,1,nil)) e4:SetTarget(s.destg) e4:SetOperation(s.desop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) --Register flag in order to avoid some loops with certain anime cards local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) @@ -68,4 +68,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if not c:IsRelateToEffect(e) or c:IsFacedown() then return end local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil,c:GetAttack()) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c90303227.lua b/official/c90303227.lua index 9b37ac94b6..1a34470d8c 100644 --- a/official/c90303227.lua +++ b/official/c90303227.lua @@ -21,7 +21,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp end) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.efftg) e2:SetOperation(s.effop) c:RegisterEffect(e2) @@ -54,4 +54,4 @@ end function s.rescon(sg,e,tp,mg) return sg:FilterCount(Card.IsLocation,nil,LOCATION_ONFIELD)<=1 and sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1 -end \ No newline at end of file +end diff --git a/official/c90411554.lua b/official/c90411554.lua index 9e93950e7e..c14362518a 100644 --- a/official/c90411554.lua +++ b/official/c90411554.lua @@ -2,42 +2,42 @@ --Redox, Dragon Ruler of Boulders local s,id=GetID() function s.initial_effect(c) - --Special Summon this card from the hand or GY + --Special Summon this card from your hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCountLimit(1,id) - e1:SetCost(s.hspcost) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) + e1:SetCost(s.selfspcost) + e1:SetTarget(s.selfsptg) + e1:SetOperation(s.selfspop) c:RegisterEffect(e1) --Return this card to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e2:SetCode(EVENT_PHASE|PHASE_END) e2:SetRange(LOCATION_MZONE) - e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1,id) - e2:SetCondition(s.retcon) - e2:SetTarget(s.rettg) - e2:SetOperation(s.retop) + e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSpecialSummoned() end) + e2:SetTarget(s.rthtg) + e2:SetOperation(s.rthop) c:RegisterEffect(e2) - --Special Summon 1 monster from the GY + --Special Summon 1 monster from your GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) - e3:SetRange(LOCATION_HAND) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) + e3:SetRange(LOCATION_HAND) e3:SetCountLimit(1,id) - e3:SetCost(s.spcost) + e3:SetCost(DragonRuler.SelfDiscardToGraveCost(ATTRIBUTE_EARTH)) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DRAGON_RULER) - --Add 1 EARTH Dragon-Type monster from your Deck to your hand + c:RegisterEffect(e3) + --Add 1 EARTH Dragon monster from your Deck to your hand local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,3)) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) @@ -49,61 +49,43 @@ function s.initial_effect(c) e4:SetOperation(s.thop) c:RegisterEffect(e4) end -function s.rfilter(c) - return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_EARTH)) and c:IsAbleToRemoveAsCost() +function s.spcostfilter(c) + return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_EARTH)) and c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true)) end -function s.hspcost(e,tp,eg,ep,ev,re,r,rp,chk) - local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) +function s.selfspcost(e,tp,eg,ep,ev,re,r,rp,chk) + local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) if chk==0 then return #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE) Duel.Remove(g,POS_FACEUP,REASON_COST) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end -function s.hspop(e,tp,eg,ep,ev,re,r,rp) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end -function s.retcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSpecialSummoned() -end -function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,0) end -function s.retop(e,tp,eg,ep,ev,re,r,rp) +function s.rthop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then Duel.SendtoHand(c,nil,REASON_EFFECT) end end -function s.dfilter(c) - return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsDiscardable() and c:IsAbleToGraveAsCost() -end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() and c:IsAbleToGraveAsCost() - and Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND,0,1,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_HAND,0,1,1,c) - g:AddCard(e:GetHandler()) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) -end -function s.spfilter(c,e,tp) - return 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.spfilter(chkc,e,tp) end + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end + and Duel.IsExistingTarget(Card.IsCanBeSpecialSummoned,tp,LOCATION_GRAVE,0,1,nil,e,0,tp,false,false) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) + local g=Duel.SelectTarget(tp,Card.IsCanBeSpecialSummoned,tp,LOCATION_GRAVE,0,1,1,nil,e,0,tp,false,false) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) diff --git a/official/c90448279.lua b/official/c90448279.lua index 91af0eea3b..ae9f7a6800 100644 --- a/official/c90448279.lua +++ b/official/c90448279.lua @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) - e1:SetCost(Cost.Detach(2,2,nil)) + e1:SetCost(Cost.DetachFromSelf(2,2,nil)) e1:SetTarget(s.gytg) e1:SetOperation(s.gyop) c:RegisterEffect(e1) @@ -84,4 +84,4 @@ function s.attop(e,tp,eg,ep,ev,re,r,rp) if tc then Duel.Overlay(c,tc,true) end -end \ No newline at end of file +end diff --git a/official/c90664857.lua b/official/c90664857.lua index ed66ee57d5..36a66d3c03 100644 --- a/official/c90664857.lua +++ b/official/c90664857.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.indtg) e1:SetOperation(s.indop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Banish a battled monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/official/c90726340.lua b/official/c90726340.lua index cc379f315e..be3c5ad4d8 100644 --- a/official/c90726340.lua +++ b/official/c90726340.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.indtg(e,c) return c:IsRace(RACE_DRAGON) and c:GetCode()~=id @@ -66,4 +66,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e3,true) end Duel.SpecialSummonComplete() -end \ No newline at end of file +end diff --git a/official/c90809975.lua b/official/c90809975.lua index a48eb02319..f75085d468 100644 --- a/official/c90809975.lua +++ b/official/c90809975.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Negate activation local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -125,4 +125,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c91020571.lua b/official/c91020571.lua index 06f83e8178..42f71e4828 100644 --- a/official/c91020571.lua +++ b/official/c91020571.lua @@ -2,31 +2,19 @@ --Reactan, Dragon Ruler of Pebbles local s,id=GetID() function s.initial_effect(c) - --Special summon 1 "Redox, Dragon Ruler of Boulders" from deck + --Special Summon 1 "Redox, Dragon Ruler of Boulders" from your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) - e1:SetCost(s.spcost) + e1:SetCost(DragonRuler.SelfDiscardCost(ATTRIBUTE_EARTH)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DRAGON_RULER) -end -s.listed_names={90411554} --"Redox, Dragon Ruler of Boulders" -function s.costfilter(c) - return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_EARTH)) and c:IsDiscardable() -end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() - and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c) - g:AddCard(c) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) + c:RegisterEffect(e1) end +s.listed_names={90411554} --"Redox, Dragon Ruler of Boulders" function s.spfilter(c,e,tp) return c:IsCode(90411554) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end @@ -37,16 +25,16 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - local tc=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) + local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then --Cannot attack this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) - e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end Duel.SpecialSummonComplete() -end \ No newline at end of file +end diff --git a/official/c91279700.lua b/official/c91279700.lua index 07fac66b00..0b41faf6c5 100644 --- a/official/c91279700.lua +++ b/official/c91279700.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_INFESTATION,SET_LSWARM} function s.dscon(e) @@ -47,4 +47,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c91499077.lua b/official/c91499077.lua index da3ceffd5c..c92af12592 100644 --- a/official/c91499077.lua +++ b/official/c91499077.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.attg) e1:SetOperation(s.atop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --When your monster is targeted for attack, change the attack target to this card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -67,4 +67,4 @@ function s.cbop(e,tp,eg,ep,ev,re,r,rp) Duel.CalculateDamage(at,c) end end -end \ No newline at end of file +end diff --git a/official/c9161357.lua b/official/c9161357.lua index 57aec67ad0..c56c65c4d1 100644 --- a/official/c9161357.lua +++ b/official/c9161357.lua @@ -1,99 +1,82 @@ ---No.6 先史遺産アトランタル +--No.6 先史遺産アトランタル --Number 6: Chronomaly Atlandis local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,6,2) c:EnableReviveLimit() - --equip + --Xyz Summon procedure: 2 Level 6 monsters + Xyz.AddProcedure(c,nil,6,2) + --Equip 1 "Number" monster from your GY to this card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_LEAVE_GRAVE+CATEGORY_EQUIP) + e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetCondition(s.eqcon) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) - aux.AddEREquipLimit(c,nil,s.eqval,s.equipop,e1) - --lp + aux.AddEREquipLimit(c,nil,function(ec,c,tp) return ec:IsSetCard(SET_NUMBER) and ec:IsControler(tp) end,function(c,e,tp,tc) c:EquipByEffectAndLimitRegister(e,tp,tc,id) end,e1) + --This card gains ATK equal to half the ATK of that equipped monster local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetCountLimit(1) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_MZONE) - e2:SetCost(s.lpcost) - e2:SetOperation(s.lpop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + e2:SetValue(function(e,c) return c:GetEquipGroup():Match(Card.HasFlagEffect,nil,id):GetSum(Card.GetAttack)/2 end) + c:RegisterEffect(e2) + --Halve your opponent's Life Points + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1) + e3:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.halvelpcost)) + e3:SetOperation(function(e,tp) local opp=1-tp Duel.SetLP(opp,Duel.GetLP(opp)/2) end) + c:RegisterEffect(e3) end -s.listed_series={SET_NUMBER} s.xyz_number=6 -function s.eqval(ec,c,tp) - return ec:IsControler(tp) and ec:IsSetCard(SET_NUMBER) -end -function s.eqcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsXyzSummoned() -end -function s.filter(c) - return c:IsSetCard(SET_NUMBER) and c:IsMonster() and not c:IsForbidden() +s.listed_series={SET_NUMBER} +function s.eqfilter(c,tp) + return c:IsSetCard(SET_NUMBER) and c:IsMonster() and not c:IsForbidden() and c:CheckUniqueOnField(tp) end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.eqfilter(chkc,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end + and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) - local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) - Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) -end -function s.equipop(c,e,tp,tc) - if not c:EquipByEffectAndLimitRegister(e,tp,tc,id) then return end - local atk=tc:GetBaseAttack()/2 - if atk>0 then - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_EQUIP) - e2:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_IGNORE_IMMUNE) - e2:SetCode(EFFECT_UPDATE_ATTACK) - e2:SetReset(RESET_EVENT|RESETS_STANDARD) - e2:SetValue(atk) - tc:RegisterEffect(e2) - end + local g=Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,tp,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end local c=e:GetHandler() local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then - s.equipop(c,e,tp,tc) + if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then + c:EquipByEffectAndLimitRegister(e,tp,tc,id) end end -function s.eqfilter(c,tp) - return c:GetFlagEffect(id)~=0 and c:IsControler(tp) and c:IsLocation(LOCATION_SZONE) and c:IsAbleToGraveAsCost() +function s.halvelpcostfilter(c,tp) + return c:HasFlagEffect(id) and c:IsControler(tp) and c:IsAbleToGraveAsCost() end -function s.lpcost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.halvelpcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - local eqg=c:GetEquipGroup() - if chk==0 then return Duel.IsPhase(PHASE_MAIN1) and #eqg>0 and eqg:IsExists(s.eqfilter,1,nil,tp) - and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local ec=eqg:FilterSelect(tp,s.eqfilter,1,1,nil,tp) - Duel.SendtoGrave(ec,REASON_COST) + local eqg=c:GetEquipGroup():Match(s.halvelpcostfilter,nil,tp) + if chk==0 then return Duel.IsPhase(PHASE_MAIN1) and #eqg>0 end + local g=nil + if #eqg==1 then + g=eqg + else + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + g=eqg:Select(tp,1,1,nil) + end + Duel.SendtoGrave(g,REASON_COST) + --You cannot conduct your Battle Phase the turn you activate this effect local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_BP) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - local e2=Effect.CreateEffect(c) - e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) - e2:SetDescription(aux.Stringid(id,2)) - e2:SetReset(RESET_PHASE|PHASE_END) - e2:SetTargetRange(1,0) - Duel.RegisterEffect(e2,tp) end -function s.lpop(e,tp,eg,ep,ev,re,r,rp) - Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2) -end \ No newline at end of file diff --git a/official/c91895091.lua b/official/c91895091.lua index 1130ea831a..a7b8c7f897 100644 --- a/official/c91895091.lua +++ b/official/c91895091.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -75,4 +75,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end -end \ No newline at end of file +end diff --git a/official/c92661479.lua b/official/c92661479.lua index a279fa791d..985b613209 100644 --- a/official/c92661479.lua +++ b/official/c92661479.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp,chk) local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) @@ -33,4 +33,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateEffect(ev) then Duel.Damage(1-tp,1000,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c9272381.lua b/official/c9272381.lua index e4ce7627a2..a57bde5135 100644 --- a/official/c9272381.lua +++ b/official/c9272381.lua @@ -40,10 +40,10 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e4:SetCondition(s.condition) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.target) e4:SetOperation(s.operation) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end function s.ovfilter(c,tp,xyzc) return c:IsFaceup() and c:IsSetCard(SET_TELLARKNIGHT,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) diff --git a/official/c92918648.lua b/official/c92918648.lua index fcc06f657e..c97baed47e 100644 --- a/official/c92918648.lua +++ b/official/c92918648.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_series={SET_SPELLBOOK} function s.cfilter(c) @@ -36,4 +36,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,s.filter,tp,0,LOCATION_ONFIELD,1,ct,nil) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c93039339.lua b/official/c93039339.lua index b12050ac8f..4659d81b13 100644 --- a/official/c93039339.lua +++ b/official/c93039339.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Register Special Summons from the Extra Deck aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) @@ -78,4 +78,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(g,true) Duel.SendtoHand(g,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c93568288.lua b/official/c93568288.lua index b307cb05c9..c810820cfa 100644 --- a/official/c93568288.lua +++ b/official/c93568288.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(2,id) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=80 function s.filter(c) @@ -82,4 +82,4 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c93713837.lua b/official/c93713837.lua index c434818ad2..0f98a4c586 100644 --- a/official/c93713837.lua +++ b/official/c93713837.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.postg) e1:SetOperation(s.posop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -87,4 +87,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(g) Duel.SendtoGrave(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c93730230.lua b/official/c93730230.lua index df496c2044..5efd2593bd 100644 --- a/official/c93730230.lua +++ b/official/c93730230.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetCode(EVENT_BE_BATTLE_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -36,4 +36,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e3:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) c:RegisterEffect(e3) end -end \ No newline at end of file +end diff --git a/official/c94119480.lua b/official/c94119480.lua index f4c1383203..492faa2cd0 100644 --- a/official/c94119480.lua +++ b/official/c94119480.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsFaceup() end @@ -30,4 +30,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c94151981.lua b/official/c94151981.lua index 28480485b9..23c637a0df 100644 --- a/official/c94151981.lua +++ b/official/c94151981.lua @@ -20,10 +20,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(2,2,nil)) + e2:SetCost(Cost.DetachFromSelf(2,2,nil)) e2:SetTarget(s.drwtg) e2:SetOperation(s.drwop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Your opponent cannot activate cards or effects if the equipped monster battles local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) @@ -73,4 +73,4 @@ end function s.btlcond(e) local ec=e:GetHandler():GetEquipTarget() return ec and (Duel.GetAttacker()==ec or Duel.GetAttackTarget()==ec) -end \ No newline at end of file +end diff --git a/official/c94380860.lua b/official/c94380860.lua index 92cfe1824f..6698df34f9 100644 --- a/official/c94380860.lua +++ b/official/c94380860.lua @@ -14,11 +14,11 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.xyz_number=103 function s.filter(c,e) @@ -48,4 +48,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then Duel.Draw(tp,1,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c94388754.lua b/official/c94388754.lua index 65850d9f43..0f354cd3ff 100644 --- a/official/c94388754.lua +++ b/official/c94388754.lua @@ -3,71 +3,79 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --special summon rule + --Must first be Special Summoned (from your hand) by Tributing 1 "Flower Cardian" monster, except "Flower Cardian Clover with Boar" + local e0=Effect.CreateEffect(c) + e0:SetDescription(aux.Stringid(id,0)) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EFFECT_SPSUMMON_PROC) + e0:SetRange(LOCATION_HAND) + e0:SetCondition(s.selfspcon) + e0:SetTarget(s.selfsptg) + e0:SetOperation(s.selfspop) + c:RegisterEffect(e0) + --Draw 1 card, and if you do, show it, then, if it is a "Flower Cardian" monster, you can destroy 1 monster your opponent controls local e1=Effect.CreateEffect(c) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetRange(LOCATION_HAND) - e1:SetCode(EFFECT_SPSUMMON_PROC) - e1:SetCondition(s.hspcon) - e1:SetTarget(s.hsptg) - e1:SetOperation(s.hspop) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY+CATEGORY_TOGRAVE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetTarget(s.drtg) + e1:SetOperation(s.drop) c:RegisterEffect(e1) - --draw - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) - c:RegisterEffect(e2) end s.listed_series={SET_FLOWER_CARDIAN} s.listed_names={id} -function s.hspfilter(c,tp) +function s.selfspfilter(c) return c:IsSetCard(SET_FLOWER_CARDIAN) and not c:IsCode(id) end -function s.hspcon(e,c) +function s.selfspcon(e,c) if c==nil then return true end - return Duel.CheckReleaseGroup(c:GetControler(),s.hspfilter,1,false,1,true,c,c:GetControler(),nil,false,nil) + local tp=c:GetControler() + return Duel.CheckReleaseGroup(tp,s.selfspfilter,1,false,1,true,c,tp,nil,false,nil) end -function s.hsptg(e,tp,eg,ep,ev,re,r,rp,c) - local g=Duel.SelectReleaseGroup(tp,s.hspfilter,1,1,false,true,true,c,nil,nil,false,nil) +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) + local g=Duel.SelectReleaseGroup(tp,s.selfspfilter,1,1,false,true,true,c,nil,nil,false,nil) if g then g:KeepAlive() e:SetLabelObject(g) - return true + return true end return false end -function s.hspop(e,tp,eg,ep,ev,re,r,rp,c) +function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_MZONE) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 then - local tc=Duel.GetOperatedGroup():GetFirst() - Duel.ConfirmCards(1-tp,tc) - if tc:IsMonster() and tc:IsSetCard(SET_FLOWER_CARDIAN) then - local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil) - if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then - Duel.BreakEffect() - local sg=g:Select(tp,1,1,nil) - Duel.Destroy(sg,REASON_EFFECT) + if Duel.Draw(p,d,REASON_EFFECT)>0 then + local dc=Duel.GetOperatedGroup():GetFirst() + Duel.ConfirmCards(1-tp,dc) + if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then + if Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) + and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.BreakEffect() + Duel.Destroy(g,REASON_EFFECT) + end end else Duel.BreakEffect() - Duel.SendtoGrave(tc,REASON_EFFECT) + Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end diff --git a/official/c9453320.lua b/official/c9453320.lua index 4017f958aa..86eddc1591 100644 --- a/official/c9453320.lua +++ b/official/c9453320.lua @@ -36,10 +36,10 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,{id,1}) - e4:SetCost(Cost.Detach(1,1,nil)) + e4:SetCost(Cost.DetachFromSelf(1,1,nil)) e4:SetTarget(s.settg) e4:SetOperation(s.setop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_series={SET_ABYSS} function s.spfilter(c,e,tp) diff --git a/official/c94655777.lua b/official/c94655777.lua index 83b66ddc4e..5c1365b41f 100644 --- a/official/c94655777.lua +++ b/official/c94655777.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) - e1:SetCost(s.rmspcost) + e1:SetCost(DragonRuler.SelfDiscardCost(ATTRIBUTE_DARK)) e1:SetTarget(s.rmsptg) e1:SetOperation(s.rmspop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DRAGON_RULER) + c:RegisterEffect(e1) --Special Summon 1 "Eclepsis, Dragon Ruler of Woes" from your GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -30,17 +30,6 @@ function s.initial_effect(c) end s.listed_series={SET_DRAGON_RULER} s.listed_names={id,30350202} --"Eclepsis, Dragon Ruler of Woes" -function s.rmcostfilter(c) - return (c:IsAttribute(ATTRIBUTE_DARK) or c:IsRace(RACE_DRAGON)) and c:IsDiscardable() -end -function s.rmspcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.rmcostfilter,tp,LOCATION_HAND,0,1,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,s.rmcostfilter,tp,LOCATION_HAND,0,1,1,c) - g:AddCard(c) - Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) -end function s.rmspfilter(c,e,tp) return c:IsSetCard(SET_DRAGON_RULER) and c:IsFaceup() and c:IsCanBeEffectTarget(e) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) @@ -109,4 +98,4 @@ function s.gyspop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c9486959.lua b/official/c9486959.lua index 662c9cc370..21d3d2c963 100644 --- a/official/c9486959.lua +++ b/official/c9486959.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,{id,1}) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Return to the Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -90,4 +90,4 @@ function s.matpreop(e,tp,eg,ep,ev,re,r,rp) local g=e:GetHandler():GetOverlayGroup() g:KeepAlive() e:GetLabelObject():SetLabelObject(g) -end \ No newline at end of file +end diff --git a/official/c95113856.lua b/official/c95113856.lua index aebb59c63c..e431494853 100644 --- a/official/c95113856.lua +++ b/official/c95113856.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD|LOCATION_HAND|LOCATION_GRAVE|LOCATION_DECK,1,nil) end @@ -68,4 +68,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c95134948.lua b/official/c95134948.lua index be9f4c8ed2..f5f0ebee09 100644 --- a/official/c95134948.lua +++ b/official/c95134948.lua @@ -1,37 +1,38 @@ ---No.99 希望皇ホープドラグナー +--No.99 希望皇ホープドラグナー --Number 99: Utopia Dragonar --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) - --xyz summon c:EnableReviveLimit() + --Xyz Summon procedure: 3+ Level 12 monsters Xyz.AddProcedure(c,nil,12,3,nil,nil,Xyz.InfiniteMats) - --Special Summon + --Special Summon from your Extra Deck, 1 "Number" monster that has a number between "1" and "100" in its name (this is treated as an Xyz Summon) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) - e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --disable attack + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(2),s.spcost)) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) + --Change the ATK of the opponent's monster to 0 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_ATTACK_ANNOUNCE) + e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCondition(s.atkcon) + e2:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) - Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) + --Keep track of Special Summons and direct attacks + Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsType(TYPE_XYZ) end) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -40,87 +41,74 @@ function s.initial_effect(c) Duel.RegisterEffect(ge1,0) end) end -s.listed_series={SET_NUMBER} s.xyz_number=99 -function s.counterfilter(c) - return c:IsType(TYPE_XYZ) or c:GetSummonLocation()~=LOCATION_EXTRA -end +s.listed_series={SET_NUMBER} function s.checkop(e,tp,eg,ep,ev,re,r,rp) - local tc=eg:GetFirst() if not Duel.GetAttackTarget() then Duel.RegisterFlagEffect(ep,id,RESET_PHASE|PHASE_END,0,1) - tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) + eg:GetFirst():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,2,REASON_COST) - and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 - and (Duel.GetFlagEffect(tp,id)==0 or Duel.GetFlagEffect(tp,id)==c:GetFlagEffect(id)) end - c:RemoveOverlayCard(tp,2,2,REASON_COST) - aux.RegisterClientHint(e:GetHandler(),EFFECT_FLAG_OATH,tp,1,0,aux.Stringid(id,2),nil) - local ge1=Effect.CreateEffect(c) - ge1:SetType(EFFECT_TYPE_FIELD) - ge1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) - ge1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - ge1:SetTargetRange(1,0) - ge1:SetTarget(s.splimit) - ge1:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(ge1,tp) - --lizard check - aux.addTempLizardCheck(c,tp,s.lizfilter) - --cannot attack directly with other cards - local ge2=Effect.CreateEffect(c) - ge2:SetType(EFFECT_TYPE_FIELD) - ge2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) - ge2:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE) - ge2:SetTargetRange(LOCATION_MZONE,0) - ge2:SetTarget(s.ftarget) - ge2:SetLabel(c:GetFieldID()) - ge2:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(ge2,tp) -end -function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) - return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA) -end -function s.lizfilter(e,c) - return not c:IsOriginalType(TYPE_XYZ) -end -function s.ftarget(e,c) - return e:GetLabel()~=c:GetFieldID() + if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 + and (not Duel.HasFlagEffect(tp,id) or Duel.GetFlagEffect(tp,id)==c:GetFlagEffect(id)) end + local fid=c:GetFieldID() + --The turn you activate this effect, other monsters you control cannot attack directly + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE) + e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) + e1:SetTargetRange(LOCATION_MZONE,0) + e1:SetTarget(function(e,c) return c:GetFieldID()~=fid end) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) + --Also you cannot Special Summon from the Extra Deck, except Xyz Monsters + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,2)) + e2:SetType(EFFECT_TYPE_FIELD) + e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) + e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e2:SetTargetRange(1,0) + e2:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_XYZ) end) + e2:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e2,tp) + --"Clock Lizard" check + aux.addTempLizardCheck(c,tp,function(e,c) return not c:IsOriginalType(TYPE_XYZ) end) end -function s.filter(c,e,tp,rp) - return c:IsSetCard(SET_NUMBER) and c.xyz_number and c.xyz_number>=1 and c.xyz_number<=100 - and Duel.GetLocationCountFromEx(tp,rp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,true) +function s.spfilter(c,e,tp) + return c:IsSetCard(SET_NUMBER) and c.xyz_number and c.xyz_number>=1 and c.xyz_number<=100 and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 + and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,rp) end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,rp):GetFirst() - if tc then - Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,true,POS_FACEUP) - tc:CompleteProcedure() + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() + if not sc then return end + sc:SetMaterial(nil) + if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then + sc:CompleteProcedure() end end -function s.atkcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetAttacker():IsControler(1-tp) -end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) - local at=Duel.GetAttacker() - if chk==0 then return at:IsOnField() and at:HasNonZeroAttack() end - Duel.SetTargetCard(at) + local bc=Duel.GetAttacker() + if chk==0 then return bc:IsOnField() and bc:HasNonZeroAttack() end + e:SetLabelObject(bc) + bc:CreateEffectRelation(e) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then + local bc=e:GetLabelObject() + if bc:IsRelateToEffect(e) and bc:IsFaceup() and bc:IsControler(1-tp) then + --The ATK of that opponent's monster becomes 0 local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(0) - tc:RegisterEffect(e1) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + bc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c95169481.lua b/official/c95169481.lua index 5015fdf9fa..548146e401 100644 --- a/official/c95169481.lua +++ b/official/c95169481.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.desfilter(c) return c:IsFaceup() and c:IsRace(RACES_BEAST_BWARRIOR_WINGB) @@ -35,4 +35,4 @@ end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c95239444.lua b/official/c95239444.lua index bdf00b2efd..1d834f0166 100644 --- a/official/c95239444.lua +++ b/official/c95239444.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1,1,nil)) + e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.cfilter(c,lv) return c:IsRace(RACE_PLANT) and c:IsLevelBelow(lv) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost() @@ -78,4 +78,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.MoveSequence(mg:GetFirst(),1) end end -end \ No newline at end of file +end diff --git a/official/c95243515.lua b/official/c95243515.lua index db54f8ace1..eb495753f1 100644 --- a/official/c95243515.lua +++ b/official/c95243515.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Can attack directly local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) diff --git a/official/c95442074.lua b/official/c95442074.lua index 0ec57a4de7..27feb2d4fc 100644 --- a/official/c95442074.lua +++ b/official/c95442074.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --cannot be destroyed local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -75,4 +75,4 @@ end function s.refcon(e) return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) and Duel.GetAttackTarget()==e:GetHandler() -end \ No newline at end of file +end diff --git a/official/c95474755.lua b/official/c95474755.lua index 079e3a0b77..c8ccdd3553 100644 --- a/official/c95474755.lua +++ b/official/c95474755.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1,1,nil)) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.extg) e1:SetOperation(s.exop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Banish 1 card from the opponent's GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -100,4 +100,4 @@ function s.dkop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetDecktopGroup(1-tp,ct) Duel.DisableShuffleCheck() Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c95685352.lua b/official/c95685352.lua index a8fff2952f..e209c94950 100644 --- a/official/c95685352.lua +++ b/official/c95685352.lua @@ -28,10 +28,10 @@ function s.initial_effect(c) e2:SetHintTiming(TIMING_DAMAGE_STEP) e2:SetCountLimit(1) e2:SetCondition(aux.StatChangeDamageStepCondition) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.atkop2) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --place in pendulum zone local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) @@ -97,4 +97,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 \ No newline at end of file +end diff --git a/official/c95856586.lua b/official/c95856586.lua index 8f88f98bb6..c6d9fbc41b 100644 --- a/official/c95856586.lua +++ b/official/c95856586.lua @@ -8,14 +8,14 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) - --act limit + --Your opponent cannot activate cards or effects in response to the activation of your cards and effects that target an Xyz Monster you control local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_FZONE) e2:SetOperation(s.chainop) c:RegisterEffect(e2) - --attach + --Attach 1 Xyz Monster from your Extra Deck or GY to a Xyz Monster(s) Special Summoned to your field local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) @@ -29,7 +29,7 @@ function s.initial_effect(c) local g=Group.CreateGroup() g:KeepAlive() e3:SetLabelObject(g) - --Mass register + --Keep track of Xyz Monster(s) Special Summoned to your field local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_SPSUMMON_SUCCESS) @@ -38,7 +38,7 @@ function s.initial_effect(c) e4:SetLabelObject(e3) e4:SetOperation(s.regop) c:RegisterEffect(e4) - --excavate + --You can place 1 "Shining Draw" from your Deck on top of your Deck local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,1)) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) @@ -48,9 +48,9 @@ function s.initial_effect(c) e5:SetOperation(s.operation) c:RegisterEffect(e5) end -s.listed_names={35906693} +s.listed_names={35906693} --"Shining Draw" function s.chfilter(c,tp) - return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsControler(tp) + return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) end function s.chainop(e,tp,eg,ep,ev,re,r,rp) if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end @@ -68,7 +68,7 @@ end function s.regop(e,tp,eg,ep,ev,re,r,rp) local tg=eg:Filter(s.mcfilter,nil,e,tp) if #tg>0 then - for tc in aux.Next(tg) do + for tc in tg:Iter() do tc:RegisterFlagEffect(id,RESET_CHAIN,0,1) end local g=e:GetLabelObject():GetLabelObject() @@ -82,7 +82,8 @@ end function s.mtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local g=e:GetLabelObject():Filter(s.mcfilter,nil,e,tp) if chkc then return g:IsContains(chkc) and s.mcfilter(chkc,e,tp) end - if chk==0 then return #g>0 and Duel.GetFlagEffect(tp,id)==0 and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE|LOCATION_EXTRA,0,1,nil,TYPE_XYZ) end + if chk==0 then return #g>0 and Duel.GetFlagEffect(tp,id)==0 + and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE|LOCATION_EXTRA,0,1,nil,TYPE_XYZ) end Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1) if #g==1 then Duel.SetTargetCard(g:GetFirst()) @@ -94,7 +95,7 @@ function s.mtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.mop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if e:GetHandler():IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then + if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsType),tp,LOCATION_GRAVE|LOCATION_EXTRA,0,1,1,tc,TYPE_XYZ) if #g>0 then @@ -106,7 +107,6 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK,0,1,nil,35906693) end function s.operation(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstMatchingCard(Card.IsCode,tp,LOCATION_DECK,0,nil,35906693) if tc then Duel.ShuffleDeck(tp) diff --git a/official/c95992081.lua b/official/c95992081.lua index 4258cfa505..7959e763e5 100644 --- a/official/c95992081.lua +++ b/official/c95992081.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsFaceup() and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) @@ -34,4 +34,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c96157835.lua b/official/c96157835.lua index 67d010030e..87c6844b67 100644 --- a/official/c96157835.lua +++ b/official/c96157835.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg1) e1:SetOperation(s.spop1) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --extra attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -81,4 +81,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) Duel.Overlay(tc,c) end end -end \ No newline at end of file +end diff --git a/official/c96223501.lua b/official/c96223501.lua index e7f19c6e05..64b1b899a1 100644 --- a/official/c96223501.lua +++ b/official/c96223501.lua @@ -2,58 +2,51 @@ --Satellarknight Zefrathuban local s,id=GetID() function s.initial_effect(c) - --Pendulum Summon procedure Pendulum.AddProcedure(c) - --You cannot Pendulum Summon, except "tellarknight" and "Zefra" monsters + --You cannot Pendulum Summon monsters, except "tellarknight" and "Zefra" monsters local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetRange(LOCATION_PZONE) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c,sump,sumtype) return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM and not c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) end) c:RegisterEffect(e1) - --Destroy 1 card you control and 1 face-up card your opponent controls - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_DESTROY) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) - e2:SetCode(EVENT_SUMMON_SUCCESS) - e2:SetCountLimit(1,id) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_TELLAR) - local e3=e2:Clone() - e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e3) - local e4=e2:Clone() - e4:SetCode(EVENT_SPSUMMON_SUCCESS) - e4:SetCondition(function(e) return e:GetHandler():IsPendulumSummoned() end) - c:RegisterEffect(e4) + --Destroy 1 other "tellarknight" or "Zefra" card in your Monster Zone or Pendulum Zone and 1 face-up card your opponent controls + local e2a=Effect.CreateEffect(c) + e2a:SetDescription(aux.Stringid(id,0)) + e2a:SetCategory(CATEGORY_DESTROY) + e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e2a:SetCode(EVENT_SUMMON_SUCCESS) + e2a:SetCountLimit(1,id) + e2a:SetTarget(s.destg) + e2a:SetOperation(s.desop) + c:RegisterEffect(e2a) + local e2b=e2a:Clone() + e2b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e2b) + local e2c=e2a:Clone() + e2c:SetCode(EVENT_SPSUMMON_SUCCESS) + e2c:SetCondition(function(e) return e:GetHandler():IsPendulumSummoned() end) + c:RegisterEffect(e2c) end s.listed_series={SET_TELLARKNIGHT,SET_ZEFRA} -function s.splimit(e,c,sump,sumtype,sumpos,targetp) - if c:IsSetCard(SET_TELLARKNIGHT) or c:IsSetCard(SET_ZEFRA) then return false end - return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM -end -function s.filter1(c) - return c:IsFaceup() and c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) +function s.desfilter(c,e,tp) + return ((c:IsControler(tp) and c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA})) or c:IsControler(1-tp)) and c:IsFaceup() + and c:IsCanBeEffectTarget(e) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end - if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE|LOCATION_PZONE,0,1,e:GetHandler()) - and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g1=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE|LOCATION_PZONE,0,1,1,e:GetHandler()) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil) - g1:Merge(g2) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0) + local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE|LOCATION_PZONE,LOCATION_ONFIELD,e:GetHandler(),e,tp) + if chk==0 then return 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_DESTROY) + Duel.SetTargetCard(tg) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,2,tp,0) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetTargetCards(e) - if #g>0 then - Duel.Destroy(g,REASON_EFFECT) +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local tg=Duel.GetTargetCards(e) + if #tg>0 then + Duel.Destroy(tg,REASON_EFFECT) end end \ No newline at end of file diff --git a/official/c96381979.lua b/official/c96381979.lua index 494b7b5b6c..ebc38f0952 100644 --- a/official/c96381979.lua +++ b/official/c96381979.lua @@ -21,7 +21,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) @@ -124,4 +124,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummonStep(tc2,0,tp,tp,false,false,POS_FACEUP_DEFENSE) Duel.SpecialSummonComplete() end -end \ No newline at end of file +end diff --git a/official/c96471335.lua b/official/c96471335.lua index 2191a8511c..69dd683929 100644 --- a/official/c96471335.lua +++ b/official/c96471335.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --remove local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) @@ -65,4 +65,4 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c96592102.lua b/official/c96592102.lua index 72c3b1c064..3d85f2dd97 100644 --- a/official/c96592102.lua +++ b/official/c96592102.lua @@ -1,18 +1,19 @@ ---RR-ブレード・バーナー・ファルコン +--RR-ブレード・バーナー・ファルコン --Raidraptor - Blade Burner Falcon local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon Procedure + --Xyz Summon procedure: 2 Level 4 Winged Beast monsters Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_WINGEDBEAST),4,2) --Make this card gain 3000 ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetCondition(s.atkcon) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) + e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLP(1-tp)>=Duel.GetLP(tp)+3000 end end) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Destroy monsters your opponent controls @@ -22,43 +23,29 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(aux.bdocon) - e2:SetCost(s.descost) + e2:SetCost(Cost.DetachFromSelf(1,function(e,tp) return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) end,function(e,og) e:SetLabel(#og) end)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.atkcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetLP(tp)<=Duel.GetLP(1-tp)-3000 and e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ + c:RegisterEffect(e2) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(3000) - e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) - c:RegisterEffect(e1) + --This card gains 3000 ATK + c:UpdateAttack(3000) end end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - local rt=math.min(Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_MZONE,nil),c:GetOverlayCount()) - local ct=c:RemoveOverlayCard(tp,1,rt,REASON_COST) - e:SetLabel(ct) -end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) end - local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,e:GetLabel(),0,0) + if chk==0 then return true end + local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,e:GetLabel(),tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local ct=e:GetLabel() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,ct,ct,nil) - if #g>0 then - Duel.HintSelection(g,true) + if #g==ct then + Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c96864105.lua b/official/c96864105.lua index afead73d09..b72bdfa9e7 100644 --- a/official/c96864105.lua +++ b/official/c96864105.lua @@ -1,11 +1,11 @@ ---CNo.73 激瀧瀑神アビス・スープラ +--CNo.73 激瀧瀑神アビス・スープラ --Number C73: Abyss Supra Splash local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,6,3) c:EnableReviveLimit() - --atk up + --Xyz Summon procedure: 3 Level 6 monsters + Xyz.AddProcedure(c,nil,6,3) + --Your battling monster gains ATK equal to the ATK of the opponent's monster it is battling, during that damage calculation only local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) @@ -13,45 +13,29 @@ function s.initial_effect(c) e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atkcon) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),Cost.SoftOncePerBattle(id))) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --indes + c:RegisterEffect(e1) + --This card cannot be destroyed by card effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) - e2:SetCondition(s.indcon) + e2:SetRange(LOCATION_MZONE) + e2:SetCondition(function(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,36076683) end) e2:SetValue(1) c:RegisterEffect(e2) end s.xyz_number=73 -s.listed_names={36076683} +s.listed_names={36076683} --"Number 73: Abyss Splash" function s.atkcon(e,tp,eg,ep,ev,re,r,rp) - local a=Duel.GetAttacker() - local d=Duel.GetAttackTarget() - return d and a:GetControler()~=d:GetControler() -end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(id)==0 end - c:RemoveOverlayCard(tp,1,1,REASON_COST) - c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE_CAL,0,1) + local bc1,bc2=Duel.GetBattleMonster(tp) + return bc1 and bc2 and bc2:GetAttack()>0 end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - local a=Duel.GetAttacker() - local d=Duel.GetAttackTarget() - if not a:IsRelateToBattle() or a:IsFacedown() or not d:IsRelateToBattle() or d:IsFacedown() then return end - if a:IsControler(1-tp) then a,d=d,a end - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetOwnerPlayer(tp) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE_CAL) - e1:SetValue(d:GetAttack()) - a:RegisterEffect(e1) + local bc1,bc2=Duel.GetBattleMonster(tp) + if bc1:IsRelateToBattle() and bc1:IsFaceup() and bc2:IsRelateToBattle() and bc2:IsFaceup() then + --Your battling monster gains ATK equal to the ATK of the opponent's monster it is battling, during that damage calculation only + bc1:UpdateAttack(bc2:GetAttack(),RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE_CAL,e:GetHandler()) + end end -function s.indcon(e) - return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,36076683) -end \ No newline at end of file diff --git a/official/c97170107.lua b/official/c97170107.lua index 725184b480..9c4a10a87d 100644 --- a/official/c97170107.lua +++ b/official/c97170107.lua @@ -12,13 +12,13 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SUMMON_SUCCESS) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.filter(c,e,tp) return c:IsFaceup() and c:IsControler(1-tp) and c:GetAttack()>0 and (not e or c:IsRelateToEffect(e)) @@ -38,4 +38,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c97403510.lua b/official/c97403510.lua index de3e00d351..5a52974ec1 100644 --- a/official/c97403510.lua +++ b/official/c97403510.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.rmcon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.rmtg) e3:SetOperation(s.rmop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --spsummon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) @@ -109,4 +109,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c97453744.lua b/official/c97453744.lua index 085b4b121c..f79a78dd12 100644 --- a/official/c97453744.lua +++ b/official/c97453744.lua @@ -35,10 +35,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,2}) e3:SetCondition(s.atkcon) - e3:SetCost(Cost.Detach(1,1,nil)) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end --Cannot target other monsters for attacks function s.tgtg(e,c) @@ -103,4 +103,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c97584719.lua b/official/c97584719.lua index f044176e18..facbb7e81c 100644 --- a/official/c97584719.lua +++ b/official/c97584719.lua @@ -23,10 +23,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) - e2:SetCost(Cost.Detach(1,function(e,tp) return Duel.GetMatchingGroupCount(Card.IsCanBeEffectTarget,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e) end,function(e,og) e:SetLabel(#og) end)) + e2:SetCost(Cost.DetachFromSelf(1,function(e,tp) return Duel.GetMatchingGroupCount(Card.IsCanBeEffectTarget,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e) end,function(e,og) e:SetLabel(#og) end)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Special Summon this card from the GY in Defense Position local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) @@ -89,4 +89,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end -end \ No newline at end of file +end diff --git a/official/c99469936.lua b/official/c99469936.lua index 99aa1a329d..63a0144dc9 100644 --- a/official/c99469936.lua +++ b/official/c99469936.lua @@ -28,10 +28,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.ovfilter(c,tp,xyzc) return c:IsFaceup() and c:GetRank()==5 and c:IsAttribute(ATTRIBUTE_WATER,xyzc,SUMMON_TYPE_XYZ,tp) @@ -66,4 +66,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/official/c99666430.lua b/official/c99666430.lua index 27856fbbe5..9f08e8d2a7 100644 --- a/official/c99666430.lua +++ b/official/c99666430.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.ctrltg) e1:SetOperation(s.ctrlop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Tribute 1 monster, and if you do, destroy 1 face-up card on the field local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -70,4 +70,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(dg) Duel.Destroy(dg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c99668578.lua b/official/c99668578.lua index a04e757a25..3b7c5c512d 100644 --- a/official/c99668578.lua +++ b/official/c99668578.lua @@ -2,39 +2,37 @@ --Satellarknight Procyon local s,id=GetID() function s.initial_effect(c) - --Send 1 "tellarknight" monster to the GY and draw 1 card - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetCountLimit(1,id) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR) - local e2=e1:Clone() - e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e3) + --Send 1 "tellarknight" monster from your hand to the GY, and if you do, draw 1 card + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.drtg) + e1a:SetOperation(s.drop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1c) end s.listed_series={SET_TELLARKNIGHT} -function s.filter(c) - return c:IsSetCard(SET_TELLARKNIGHT) and c:IsMonster() +function s.tgfilter(c) + return c:IsSetCard(SET_TELLARKNIGHT) and c:IsMonster() and c:IsAbleToGrave() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) --Excluding itself for a proper interaction with "Tellarknight Constellar Caduceus" [58858807] if chk==0 then return Duel.IsPlayerCanDraw(tp,1) - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,e:GetHandler()) end + and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - if Duel.DiscardHand(tp,s.filter,1,1,REASON_EFFECT)==0 then return end - local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_GRAVE) - if ct>0 then +function s.drop(e,tp,eg,ep,ev,re,r,rp) + if Duel.DiscardHand(tp,s.tgfilter,1,1,REASON_EFFECT)>0 and Duel.GetOperatedGroup():GetFirst():IsLocation(LOCATION_GRAVE) then Duel.Draw(tp,1,REASON_EFFECT) end end \ No newline at end of file diff --git a/pre-release/c100200277.lua b/pre-release/c100200277.lua new file mode 100644 index 0000000000..65c6173297 --- /dev/null +++ b/pre-release/c100200277.lua @@ -0,0 +1,81 @@ +--熒焅聖 アレクゥス +--Alekus the Shining Stunner Saint +--scripted by pyrQ +local s,id=GetID() +function s.initial_effect(c) + --If you control a face-up card in your Spell & Trap Zone, you can Special Summon this card (from your hand) + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e1:SetCode(EFFECT_SPSUMMON_PROC) + e1:SetRange(LOCATION_HAND) + e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) + e1:SetCondition(s.spcon) + c:RegisterEffect(e1) + --Destroy both 1 face-up Spell/Trap you control and this card, then draw 1 card + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1,{id,1}) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) + c:RegisterEffect(e2) + --Attach this card to 1 Xyz Monster you control + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e3:SetCode(EVENT_DESTROYED) + e3:SetCountLimit(1,{id,2}) + e3:SetTarget(s.attachtg) + e3:SetOperation(s.attachop) + c:RegisterEffect(e3) +end +function s.spcon(e,c) + if c==nil then return true end + local tp=e:GetHandlerPlayer() + return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_STZONE,0,1,nil) +end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsSpellTrap() and chkc:IsFaceup() end + if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsSpellTrap),tp,LOCATION_ONFIELD,0,1,nil) + and Duel.IsPlayerCanDraw(tp,1) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsSpellTrap),tp,LOCATION_ONFIELD,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g+e:GetHandler(),2,tp,0) + Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) +end +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and Duel.Destroy(Group.FromCards(c,tc),REASON_EFFECT)==2 + and Duel.IsPlayerCanDraw(tp) then + Duel.BreakEffect() + Duel.Draw(tp,1,REASON_EFFECT) + end +end +function s.attachfilter(c,mc,tp) + return c:IsType(TYPE_XYZ) and c:IsFaceup() and mc:IsCanBeXyzMaterial(c,tp,REASON_EFFECT) +end +function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local c=e:GetHandler() + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.attachfilter(chkc,c,tp) end + if chk==0 then return Duel.IsExistingTarget(s.attachfilter,tp,LOCATION_MZONE,0,1,nil,c,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + Duel.SelectTarget(tp,s.attachfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp) + if c:IsLocation(LOCATION_GRAVE) then + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,tp,0) + end +end +function s.attachop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then + Duel.Overlay(tc,c) + end +end \ No newline at end of file diff --git a/pre-release/c100348001.lua b/pre-release/c100348001.lua new file mode 100644 index 0000000000..dd8bebde38 --- /dev/null +++ b/pre-release/c100348001.lua @@ -0,0 +1,47 @@ +--フルスピード・ウォリアー +--Fullspeed Warrior +--scripted by pyrQ +local s,id=GetID() +function s.initial_effect(c) + --Add 1 "Junk Synchron" or 1 Spell/Trap that mentions "Junk Warrior" from your Deck to your hand + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.thtg) + e1a:SetOperation(s.thop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1b) + --Monsters you control that mention "Junk Warrior", and Synchro Monsters you control with "Warrior" in their original names, gain 900 ATK during your Battle Phase only + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_FIELD) + e2:SetCode(EFFECT_UPDATE_ATTACK) + e2:SetRange(LOCATION_MZONE) + e2:SetTargetRange(LOCATION_MZONE,0) + e2:SetCondition(function(e) return Duel.IsBattlePhase() and Duel.IsTurnPlayer(e:GetHandlerPlayer()) end) + e2:SetTarget(function(e,c) return c:ListsCode(CARD_JUNK_WARRIOR) or (c:IsType(TYPE_SYNCHRO) and c:IsOriginalSetCard(SET_WARRIOR)) end) + e2:SetValue(900) + c:RegisterEffect(e2) +end +s.listed_names={CARD_JUNK_SYNCHRON,CARD_JUNK_WARRIOR} +s.listed_series={SET_WARRIOR} +function s.thfilter(c) + return (c:IsCode(CARD_JUNK_SYNCHRON) or (c:IsSpellTrap() and c:ListsCode(CARD_JUNK_WARRIOR))) and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + 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 +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + 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 \ No newline at end of file diff --git a/pre-release/c100348002.lua b/pre-release/c100348002.lua new file mode 100644 index 0000000000..d9f0f2da51 --- /dev/null +++ b/pre-release/c100348002.lua @@ -0,0 +1,48 @@ +--アンカーボルト・ヘッジホッグ +--Anchorbolt Hedgehog +--scripted by pyrQ +local s,id=GetID() +function s.initial_effect(c) + --Special Summon this card in Defense Position + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetRange(LOCATION_GRAVE) + e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetCondition(s.spcon) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) +end +s.listed_names={CARD_JUNK_WARRIOR,id} +function s.spconfilter(c) + return (c:IsCode(CARD_JUNK_WARRIOR) or c:ListsCode(CARD_JUNK_WARRIOR)) and not c:IsCode(id) +end +function s.spcon(e,tp,eg,ep,ev,re,r,rp) + return Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_MZONE,0,1,nil) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) + end + --You cannot Special Summon from the Extra Deck for the rest of this turn, except Synchro Monsters + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetTargetRange(1,0) + e1:SetTarget(function(e,c) return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA) end) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) +end \ No newline at end of file diff --git a/pre-release/c100348005.lua b/pre-release/c100348005.lua new file mode 100644 index 0000000000..23e979b7a2 --- /dev/null +++ b/pre-release/c100348005.lua @@ -0,0 +1,88 @@ +--シンクロ・フェローズ +--Synchro Fellows +--scripted by pyrQ +local s,id=GetID() +function s.initial_effect(c) + --Add 1 "Junk Synchron", and 1 monster that mentions "Junk Warrior" or "Stardust Dragon", from your Deck to your hand, then discard 1 card + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) + e1:SetTarget(s.thtg) + e1:SetOperation(s.thop) + c:RegisterEffect(e1) + --Decrease the Level of 1 Synchro Monster you control by 1 + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_LVCHANGE) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_GRAVE) + e2:SetCondition(function(e,tp) return Duel.IsPlayerCanAdditionalSummon(tp) end) + e2:SetCost(Cost.SelfBanish) + e2:SetTarget(s.lvtg) + e2:SetOperation(s.lvop) + c:RegisterEffect(e2) +end +s.listed_names={CARD_JUNK_SYNCHRON,CARD_JUNK_WARRIOR,CARD_STARDUST_DRAGON} +s.listed_series={SET_SYNCHRON} +function s.thfilter(c) + return (c:IsCode(CARD_JUNK_SYNCHRON) or (c:IsMonster() and c:ListsCode(CARD_JUNK_WARRIOR,CARD_STARDUST_DRAGON))) and c:IsAbleToHand() +end +function s.rescon(sg,e,tp,mg) + return sg:IsExists(Card.IsCode,1,nil,CARD_JUNK_SYNCHRON) and sg:IsExists(Card.ListsCode,1,nil,CARD_JUNK_WARRIOR,CARD_STARDUST_DRAGON) +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) + if chk==0 then return aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK) + Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) + if #g==0 then return end + local sg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_ATOHAND) + if #sg>0 and Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 then + Duel.ConfirmCards(1-tp,sg) + Duel.ShuffleHand(tp) + Duel.BreakEffect() + Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD) + end +end +function s.lvfilter(c) + return c:IsType(TYPE_SYNCHRO) and c:HasLevel() and c:IsLevelAbove(2) and c:IsFaceup() +end +function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvfilter(chkc) end + if chk==0 then return Duel.IsPlayerCanSummon(tp) + and Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + local g=Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,g,1,tp,1) +end +function s.lvop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsLevelAbove(2) and not tc:IsImmuneToEffect(e) then + --Decrease its Level by 1 + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_UPDATE_LEVEL) + e1:SetValue(-1) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + tc:RegisterEffect(e1) + Duel.BreakEffect() + --You can Normal Summon 1 "Synchron" monster during your Main Phase this turn, in addition to your Normal Summon/Set (you can only gain this effect once per turn) + aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,2)) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_FIELD) + e2:SetCode(EFFECT_EXTRA_SUMMON_COUNT) + e2:SetTargetRange(LOCATION_HAND|LOCATION_MZONE,0) + e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_SYNCHRON)) + e2:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e2,tp) + end +end \ No newline at end of file diff --git a/pre-release/c100348032.lua b/pre-release/c100348032.lua new file mode 100644 index 0000000000..eccd2eb38e --- /dev/null +++ b/pre-release/c100348032.lua @@ -0,0 +1,112 @@ +--ジャンク・ウォリアー・エクストリーム +--Junk Warrior Extreme +--scripted by pyrQ +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + --Synchro Summon procedure: "Junk Synchron" + 1+ non-Tuner monsters + Synchro.AddProcedure(c,s.tunerfilter,1,1,Synchro.NonTuner(nil),1,99) + --Special Summon as many Level 2 or lower monsters from your GY as possible + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetCountLimit(1,id) + e1:SetCondition(function(e) return e:GetHandler():IsSynchroSummoned() end) + e1:SetTarget(s.gysptg) + e1:SetOperation(s.gyspop) + c:RegisterEffect(e1) + --Special Summon 1 "Junk" Synchro Monster from your Extra Deck (this is treated as a Synchro Summon) + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetCode(EVENT_BATTLE_DESTROYING) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(aux.bdocon) + e2:SetCost(Cost.SelfBanish) + e2:SetTarget(s.exsptg) + e2:SetOperation(s.exspop) + c:RegisterEffect(e2) +end +s.material={CARD_JUNK_SYNCHRON} +s.listed_names={CARD_JUNK_SYNCHRON} +s.listed_series={SET_JUNK} +s.material_setcode=SET_SYNCHRON +function s.tunerfilter(c,lc,stype,tp) + return c:IsSummonCode(lc,stype,tp,CARD_JUNK_SYNCHRON) or c:IsHasEffect(20932152) +end +function s.gyspfilter(c,e,tp) + return c:IsLevelBelow(2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.gysptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.gyspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) +end +function s.gyspop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + if ft>0 then + local g=Duel.GetMatchingGroup(s.gyspfilter,tp,LOCATION_GRAVE,0,nil,e,tp) + ft=math.min(ft,#g) + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sg=Duel.SelectMatchingCard(tp,s.gyspfilter,tp,LOCATION_GRAVE,0,ft,ft,nil,e,tp) + if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then + local og=Duel.GetOperatedGroup() + for sc in og:Iter() do + --They cannot activate their effects this turn + local e1=Effect.CreateEffect(c) + e1:SetDescription(3302) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_TRIGGER) + e1:SetReset(RESETS_STANDARD_PHASE_END) + sc:RegisterEffect(e1) + end + end + end + --You can only Special Summon once for the rest of this turn + 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:SetTargetRange(1,0) + e1:SetTarget(function(e,c,tp) return Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)-e:GetLabel()>=1 end) + e1:SetLabel(Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) + local e2=e1:Clone() + e2:SetCode(EFFECT_LEFT_SPSUMMON_COUNT) + e2:SetValue(s.countval) + Duel.RegisterEffect(e2,tp) +end +function s.countval(e,re,tp) + local label=e:GetLabel() + local sp=Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON) + if sp-label>=1 then + return 0 + else + return 1-sp+label + end +end +function s.exspfilter(c,e,tp,mc) + local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,c,nil,REASON_SYNCHRO) + return #pg<=0 and c:IsSetCard(SET_JUNK) and c:IsType(TYPE_SYNCHRO) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 + and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) +end +function s.exsptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.exspfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler()) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) +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 + sc:CompleteProcedure() + end +end \ No newline at end of file diff --git a/pre-release/c100446001.lua b/pre-release/c100446001.lua new file mode 100644 index 0000000000..1b1d013e4b --- /dev/null +++ b/pre-release/c100446001.lua @@ -0,0 +1,82 @@ +--見えざる手イブエル +--Hecatoncheire Ibel +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --If this card battles a monster, neither can be destroyed by that battle + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetRange(LOCATION_MZONE) + e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e1:SetTarget(s.indestg) + e1:SetValue(1) + c:RegisterEffect(e1) + --Shuffle this card into the Deck, then Special Summon 1 "Hecatoncheire" monster from your Deck in Defense Position + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id) + e2:SetCost(Cost.SelfReveal) + e2:SetTarget(s.tdtg) + e2:SetOperation(s.tdop) + c:RegisterEffect(e2) + --Special Summon 1 "Hecatoncheire" monster from your GY + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_TO_GRAVE) + e3:SetCountLimit(1,{id,1}) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) +end +s.listed_series={SET_HECATONCHEIRE} +s.listed_names={id} +function s.indestg(e,c) + local handler=e:GetHandler() + return c==handler or c==handler:GetBattleTarget() +end +function s.deckspfilter(c,e,tp) + return c:IsSetCard(SET_HECATONCHEIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not c:IsCode(id) +end +function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return c:IsAbleToDeck() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.deckspfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) +end +function s.tdop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 + and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sg=Duel.SelectMatchingCard(tp,s.deckspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) + if #sg>0 then + Duel.BreakEffect() + Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE) + end + end +end +function s.spfilter(c,e,tp) + return c:IsSetCard(SET_HECATONCHEIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectTarget(tp,s.spfilter,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) + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) then + Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) + end +end \ No newline at end of file diff --git a/pre-release/c100446002.lua b/pre-release/c100446002.lua new file mode 100644 index 0000000000..c65cec30f4 --- /dev/null +++ b/pre-release/c100446002.lua @@ -0,0 +1,78 @@ +--見えざる手ヤドエル +--Hecatoncheire Yadel +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --If this card battles a monster, neither can be destroyed by that battle + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetRange(LOCATION_MZONE) + e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e1:SetTarget(s.indestg) + e1:SetValue(1) + c:RegisterEffect(e1) + --Shuffle this card into the Deck, then add 1 "Hecatoncheire" Spell/Trap from your Deck to your hand + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_TODECK+CATEGORY_SEARCH+CATEGORY_TOHAND) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id) + e2:SetCost(Cost.SelfReveal) + e2:SetTarget(s.thtg) + e2:SetOperation(s.thop) + c:RegisterEffect(e2) + --Set 1 "Hecatoncheire" Spell/Trap from your GY + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_TO_GRAVE) + e3:SetCountLimit(1,{id,1}) + e3:SetTarget(s.settg) + e3:SetOperation(s.setop) + c:RegisterEffect(e3) +end +s.listed_series={SET_HECATONCHEIRE} +function s.indestg(e,c) + local handler=e:GetHandler() + return c==handler or c==handler:GetBattleTarget() +end +function s.thfilter(c) + return c:IsSetCard(SET_HECATONCHEIRE) and c:IsSpellTrap() and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return c:IsAbleToDeck() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local hg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) + if #hg>0 then + Duel.BreakEffect() + Duel.SendtoHand(hg,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,hg) + end + end +end +function s.setfilter(c) + return c:IsSetCard(SET_HECATONCHEIRE) and c:IsSpellTrap() and c:IsSSetable() +end +function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.setfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) + local tc=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,tc,1,tp,0) +end +function s.setop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) then + Duel.SSet(tp,tc) + end +end \ No newline at end of file diff --git a/pre-release/c100446003.lua b/pre-release/c100446003.lua new file mode 100644 index 0000000000..f950589805 --- /dev/null +++ b/pre-release/c100446003.lua @@ -0,0 +1,84 @@ +--見えざる手ゴッドス +--Hecatoncheire Goddus +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --If this card battles a monster, neither can be destroyed by that battle + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetRange(LOCATION_MZONE) + e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e1:SetTarget(s.indestg) + e1:SetValue(1) + c:RegisterEffect(e1) + --Special Summon this card from your hand + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_TO_HAND) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsControler,1,nil,1-tp) and not Duel.IsPhase(PHASE_DRAW) end) + e2:SetTarget(s.selfsptg) + e2:SetOperation(s.selfspop) + c:RegisterEffect(e2) + --Special Summon to your field 1 monster from your opponent's GY + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_QUICK_O) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET) + e3:SetCode(EVENT_FREE_CHAIN) + e3:SetRange(LOCATION_MZONE) + e3:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) + e3:SetCountLimit(1,{id,1}) + e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase() end) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) +end +function s.indestg(e,c) + local handler=e:GetHandler() + return c==handler or c==handler:GetBattleTarget() +end +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) +end +function s.selfspop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) + end +end +function s.spfilter(c,e,tp) + return 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:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and s.spfilter(chkc,e,tp) end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingTarget(s.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectTarget(tp,s.spfilter,tp,0,LOCATION_GRAVE,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) + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then + --Banish it when it leaves the field + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(3300) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) + e1:SetValue(LOCATION_REMOVED) + e1:SetReset(RESET_EVENT|RESETS_REDIRECT) + tc:RegisterEffect(e1,true) + end + Duel.SpecialSummonComplete() +end \ No newline at end of file diff --git a/pre-release/c100446004.lua b/pre-release/c100446004.lua new file mode 100644 index 0000000000..77e641fe1b --- /dev/null +++ b/pre-release/c100446004.lua @@ -0,0 +1,75 @@ +--見えざる手ガイガス +--Hecatoncheire Gygas +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --If this card battles a monster, neither can be destroyed by that battle + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetRange(LOCATION_MZONE) + e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e1:SetTarget(s.indestg) + e1:SetValue(1) + c:RegisterEffect(e1) + --Special Summon this card from your hand + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_TO_HAND) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsControler,1,nil,1-tp) and not Duel.IsPhase(PHASE_DRAW) end) + e2:SetTarget(s.selfsptg) + e2:SetOperation(s.selfspop) + c:RegisterEffect(e2) + --Excavate the top 3 cards of your opponent's Deck and you can Special Summon 1 excavated monster + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1,{id,1}) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) +end +function s.indestg(e,c) + local handler=e:GetHandler() + return c==handler or c==handler:GetBattleTarget() +end +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) +end +function s.selfspop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) + end +end +function s.spfilter(c,e,tp) + return c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>=3 end + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end + Duel.ConfirmDecktop(1-tp,3) + local g=Duel.GetDecktopGroup(1-tp,3) + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:IsExists(s.spfilter,1,nil,e,tp) + and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=g:FilterSelect(tp,s.spfilter,1,1,nil,e,tp):GetFirst() + if sc then + Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) + end + end + Duel.ShuffleDeck(1-tp) +end \ No newline at end of file diff --git a/pre-release/c100446005.lua b/pre-release/c100446005.lua new file mode 100644 index 0000000000..0063d0045b --- /dev/null +++ b/pre-release/c100446005.lua @@ -0,0 +1,69 @@ +--見えざる手ブレアス +--Hecatoncheire Breus +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --If this card battles a monster, neither can be destroyed by that battle + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetRange(LOCATION_MZONE) + e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e1:SetTarget(s.indestg) + e1:SetValue(1) + c:RegisterEffect(e1) + --Special Summon this card from your hand + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_TO_HAND) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsControler,1,nil,1-tp) and not Duel.IsPhase(PHASE_DRAW) end) + e2:SetTarget(s.selfsptg) + e2:SetOperation(s.selfspop) + c:RegisterEffect(e2) + --Look at 1 random card in your opponent's hand, and if it is a monster, you can Special Summon it to your field + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1,{id,1}) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) +end +function s.indestg(e,c) + local handler=e:GetHandler() + return c==handler or c==handler:GetBattleTarget() +end +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) +end +function s.selfspop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) + end +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND) + if #g==0 then return end + local sc=g:RandomSelect(tp,1):GetFirst() + Duel.ConfirmCards(tp,sc) + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) + and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) + end + Duel.ShuffleHand(1-tp) +end \ No newline at end of file diff --git a/pre-release/c100446006.lua b/pre-release/c100446006.lua new file mode 100644 index 0000000000..94bc5265a5 --- /dev/null +++ b/pre-release/c100446006.lua @@ -0,0 +1,91 @@ +--見えざる神ジャウザー +--Hecatoncheire Jawza +--scripted by pyrQ +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + --Fusion Materials: 1 "Hecatoncheire" monster + 1 Illusion monster + Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_HECATONCHEIRE),aux.FilterBoolFunctionEx(Card.IsRace,RACE_ILLUSION)) + c:AddMustFirstBeFusionSummoned() + --Must first be either Fusion Summoned, or Special Summoned (from your Extra Deck) by Tributing 1 Illusion monster and 1 face-up monster you control owned by your opponent + local e0=Effect.CreateEffect(c) + e0:SetDescription(aux.Stringid(id,0)) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) + e0:SetCode(EFFECT_SPSUMMON_PROC) + e0:SetRange(LOCATION_EXTRA) + e0:SetCondition(s.selfspcon) + e0:SetTarget(s.selfsptg) + e0:SetOperation(s.selfspop) + c:RegisterEffect(e0) + --Add 1 "Hecatoncheire" card from your Deck or GY to your hand + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1,id) + e1:SetTarget(s.thtg) + e1:SetOperation(s.thop) + c:RegisterEffect(e1) + --If this card battles a monster, neither can be destroyed by that battle + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_FIELD) + e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e2:SetRange(LOCATION_MZONE) + e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e2:SetTarget(s.indestg) + e2:SetValue(1) + c:RegisterEffect(e2) +end +s.listed_series={SET_HECATONCHEIRE} +s.material_setcode=SET_HECATONCHEIRE +function s.selfspcostfilter(c,tp,fc) + return (c:IsRace(RACE_ILLUSION) or (c:IsFaceup() and c:IsOwner(1-tp))) and c:IsReleasable() + and c:IsCanBeFusionMaterial(fc,MATERIAL_FUSION) +end +function s.rescon(sg,e,tp,mg) + return Duel.GetLocationCountFromEx(tp,tp,sg,e:GetHandler())>0 + and sg:IsExists(Card.IsRace,1,nil,RACE_ILLUSION) and sg:IsExists(aux.FaceupFilter(Card.IsOwner,1-tp),1,nil) +end +function s.selfspcon(e,c) + if not c then return true end + local tp=c:GetControler() + local mg=Duel.GetMatchingGroup(s.selfspcostfilter,tp,LOCATION_MZONE,0,nil,tp,c) + return #mg>=2 and aux.SelectUnselectGroup(mg,e,tp,2,2,s.rescon,0) +end +function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) + local mg=Duel.GetMatchingGroup(s.selfspcostfilter,tp,LOCATION_MZONE,0,nil,tp,c) + local g=aux.SelectUnselectGroup(mg,e,tp,2,2,s.rescon,1,tp,HINTMSG_RELEASE,nil,nil,true) + if #g>0 then + g:KeepAlive() + e:SetLabelObject(g) + return true + end + return false +end +function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c) + local g=e:GetLabelObject() + if not g then return end + Duel.Release(g,REASON_COST|REASON_MATERIAL) + g:DeleteGroup() +end +function s.thfilter(c) + return c:IsSetCard(SET_HECATONCHEIRE) and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil) + if #g>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) + end +end +function s.indestg(e,c) + local handler=e:GetHandler() + return c==handler or c==handler:GetBattleTarget() +end \ No newline at end of file diff --git a/pre-release/c100446007.lua b/pre-release/c100446007.lua new file mode 100644 index 0000000000..adc21e2fe0 --- /dev/null +++ b/pre-release/c100446007.lua @@ -0,0 +1,87 @@ +--見えざる神ゼノ +--Hecatoncheire Xeno +--scripted by pyrQ +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + --Fusion Materials: 3 "Hecatoncheire" monsters + Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_HECATONCHEIRE),3) + --If this card battles a monster, neither can be destroyed by that battle + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetRange(LOCATION_MZONE) + e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e1:SetTarget(s.indestg) + e1:SetValue(1) + c:RegisterEffect(e1) + --Look at 2 random face-down cards in your opponent's Extra Deck, and if you do, you can Special Summon 1 of them to your field + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1,id) + e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) + e2:SetCondition(function() return Duel.IsMainPhase() end) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) + --Take control of any number of monsters your opponent controls + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_CONTROL) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_DESTROYED) + e3:SetCountLimit(1,{id,1}) + e3:SetCondition(s.ctrlcon) + e3:SetTarget(s.ctrltg) + e3:SetOperation(s.ctrlop) + c:RegisterEffect(e3) +end +s.listed_series={SET_HECATONCHEIRE} +s.material_setcode=SET_HECATONCHEIRE +function s.indestg(e,c) + local handler=e:GetHandler() + return c==handler or c==handler:GetBattleTarget() +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil)>=2 end + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) +end +function s.spfilter(c,e,tp) + return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local exg=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil) + if #exg==0 then return end + local g=exg:RandomSelect(tp,2) + Duel.ConfirmCards(tp,g) + if g:IsExists(s.spfilter,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sg=g:FilterSelect(tp,s.spfilter,1,1,nil,e,tp) + if #sg>0 then + Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) + end + end + Duel.ShuffleExtra(1-tp) +end +function s.ctrlcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return rp==1-tp and c:IsFusionSummoned() and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT) +end +function s.ctrltg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,tp,0) +end +function s.ctrlop(e,tp,eg,ep,ev,re,r,rp) + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) + local g=Duel.SelectMatchingCard(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,ft,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.GetControl(g,tp) + end +end \ No newline at end of file diff --git a/pre-release/c100446009.lua b/pre-release/c100446009.lua new file mode 100644 index 0000000000..e370882807 --- /dev/null +++ b/pre-release/c100446009.lua @@ -0,0 +1,95 @@ +--見えざる幽獄 +--Hecatoncheire Tartarus +--scripted by pyrQ +local s,id=GetID() +function s.initial_effect(c) + --Activate 1 of these effects (but you can only use each effect of "Hecatoncheire Tartarus" once per turn) + 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_STANDBY_PHASE|TIMING_MAIN_END|TIMING_BATTLE_START|TIMINGS_CHECK_MONSTER_E) + e1:SetCost(s.effcost) + e1:SetTarget(s.efftg) + e1:SetOperation(s.effop) + c:RegisterEffect(e1) + --If you use a face-up monster(s) you control owned by your opponent, you can treat it as a "Hecatoncheire" monster + aux.GlobalCheck(s,function() + local e0a=Effect.CreateEffect(c) + e0a:SetType(EFFECT_TYPE_FIELD) + e0a:SetCode(EFFECT_ADD_SETCODE) + e0a:SetTargetRange(LOCATION_MZONE,0) + e0a:SetTarget(function(e,c) local tp=e:GetHandlerPlayer() return c:IsFaceup() and c:IsControler(tp) and c:IsOwner(1-tp) end) + e0a:SetOperation(s.chngcon) + e0a:SetValue(SET_HECATONCHEIRE) + Duel.RegisterEffect(e0a,0) + local e0b=e0a:Clone() + Duel.RegisterEffect(e0b,1) + end) +end +s.listed_series={SET_HECATONCHEIRE} +function s.chngcon(scard,sumtype,tp) + return Fusion.SummonEffect and Fusion.SummonEffect:GetHandler():IsCode(id) and ((sumtype&MATERIAL_FUSION)~=0 or (sumtype&SUMMON_TYPE_FUSION)~=0) +end +function s.fextra(e,tp,mg) + if not Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then + return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,nil) + end + return nil +end +function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE|LOCATION_GRAVE) +end +function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk) + e:SetLabel(-100) + local fusion_params={handler=e:GetHandler(),fusfilter=aux.FilterBoolFunction(Card.IsSetCard,SET_HECATONCHEIRE),matfilter=Fusion.OnFieldMat(Card.IsAbleToRemove),extrafil=s.fextra,extraop=Fusion.BanishMaterial,extratg=s.extratg} + local b1=not Duel.HasFlagEffect(tp,id) + and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_HECATONCHEIRE),tp,LOCATION_MZONE,0,1,nil) + and Duel.IsExistingTarget(aux.AND(Card.IsSpellTrap,Card.IsAbleToHand),tp,0,LOCATION_ONFIELD,1,nil) + local b2=not Duel.HasFlagEffect(tp,id+100) + and Fusion.SummonEffTG(fusion_params)(e,tp,eg,ep,ev,re,r,rp,0) + if chk==0 then return b1 or b2 end +end +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return e:GetLabel()==1 and chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsAbleToHand() end + local cost_skip=e:GetLabel()~=-100 + local fusion_params={handler=e:GetHandler(),fusfilter=aux.FilterBoolFunction(Card.IsSetCard,SET_HECATONCHEIRE),matfilter=Fusion.OnFieldMat(Card.IsAbleToRemove),extrafil=s.fextra,extraop=Fusion.BanishMaterial,extratg=s.extratg} + local b1=(cost_skip or not Duel.HasFlagEffect(tp,id)) + and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_HECATONCHEIRE),tp,LOCATION_MZONE,0,1,nil) + and Duel.IsExistingTarget(aux.AND(Card.IsSpellTrap,Card.IsAbleToHand),tp,0,LOCATION_ONFIELD,1,nil) + local b2=(cost_skip or not Duel.HasFlagEffect(tp,id+100)) + and Fusion.SummonEffTG(fusion_params)(e,tp,eg,ep,ev,re,r,rp,0) + if chk==0 then e:SetLabel(0) return b1 or b2 end + local op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,1)}, + {b2,aux.Stringid(id,2)}) + e:SetLabel(op) + if op==1 then + e:SetCategory(CATEGORY_TOHAND) + e:SetProperty(EFFECT_FLAG_CARD_TARGET) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) + local g=Duel.SelectTarget(tp,aux.AND(Card.IsSpellTrap,Card.IsAbleToHand),tp,0,LOCATION_ONFIELD,1,1,nil) + if not cost_skip then Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) + elseif op==2 then + e:SetCategory(CATEGORY_FUSION_SUMMON) + e:SetProperty(0) + if not cost_skip then Duel.RegisterFlagEffect(tp,id+100,RESET_PHASE|PHASE_END,0,1) end + Fusion.SummonEffTG(fusion_params)(e,tp,eg,ep,ev,re,r,rp,1) + end +end +function s.effop(e,tp,eg,ep,ev,re,r,rp) + local op=e:GetLabel() + if op==1 then + --Return 1 Spell/Trap your opponent controls to the hand + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) then + Duel.SendtoHand(tc,nil,REASON_EFFECT) + end + elseif op==2 then + --Fusion Summon 1 "Hecatoncheire" Fusion Monster from your Extra Deck, by banishing its materials from your field and/or GY + local fusion_params={handler=e:GetHandler(),fusfilter=aux.FilterBoolFunction(Card.IsSetCard,SET_HECATONCHEIRE),matfilter=Fusion.OnFieldMat(Card.IsAbleToRemove),extrafil=s.fextra,extraop=Fusion.BanishMaterial,extratg=s.extratg} + Fusion.SummonEffOP(fusion_params)(e,tp,eg,ep,ev,re,r,rp) + end +end \ No newline at end of file diff --git a/pre-release/c100446010.lua b/pre-release/c100446010.lua new file mode 100644 index 0000000000..b616dc663c --- /dev/null +++ b/pre-release/c100446010.lua @@ -0,0 +1,46 @@ +--えざる誘う手 +--Ipt al Hecatoncherie +--Scripted by The Razgriz +local s,id=GetID() +function s.initial_effect(c) + --Negate the activation of an opponent's monster effect, and if you do, destroy it + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_CHAINING) + e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) + e1:SetCondition(s.condition) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) +end +s.listed_series={SET_HECATONCHEIRE} +function s.condition(e,tp,eg,ep,ev,re,r,rp) + return re:IsMonsterEffect() and rp==1-tp and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_HECATONCHEIRE),tp,LOCATION_MZONE,0,1,nil) + and Duel.IsChainNegatable(ev) +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,tp,0) + local rc=re:GetHandler() + if rc:IsRelateToEffect(re) and rc:IsDestructable() then + Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,tp,0) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,rc,1,tp,0) + end +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + local rc=re:GetHandler() + if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 and not rc:IsLocation(LOCATION_HAND|LOCATION_DECK) and aux.nvfilter(rc) + and rc:IsCanBeSpecialSummoned(e,0,tp,false,false) then + if rc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,rc)<=0 then + return + elseif not rc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then + return + end + if Duel.SelectYesNo(tp,aux.Stringid(id,1)) then + Duel.BreakEffect() + Duel.SpecialSummon(rc,0,tp,tp,false,false,POS_FACEUP) + end + end +end \ No newline at end of file diff --git a/pre-release/c100446011.lua b/pre-release/c100446011.lua new file mode 100644 index 0000000000..5596ebe41a --- /dev/null +++ b/pre-release/c100446011.lua @@ -0,0 +1,41 @@ +--見えざる招き手 +--Yad al Hecatoncheire +--Scripted by The Razgriz +local s,id=GetID() +function s.initial_effect(c) + --Negate the activation of an opponent's Spell/Trap Card, and if you do, destroy it + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_CHAINING) + e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) + e1:SetCondition(s.condition) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) +end +s.listed_series={SET_HECATONCHEIRE} +function s.condition(e,tp,eg,ep,ev,re,r,rp) + return re:IsHasType(EFFECT_TYPE_ACTIVATE) and rp==1-tp and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_HECATONCHEIRE),tp,LOCATION_MZONE,0,1,nil) + and Duel.IsChainNegatable(ev) +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,tp,0) + local rc=re:GetHandler() + if rc:IsRelateToEffect(re) and rc:IsDestructable() then + Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,tp,0) + if rc:IsLocation(LOCATION_GRAVE) then + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,rc,1,tp,0) + end + end +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + local rc=re:GetHandler() + if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 and not rc:IsLocation(LOCATION_HAND|LOCATION_DECK) + and aux.nvfilter(rc) and rc:IsSSetable() and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then + Duel.BreakEffect() + Duel.SSet(tp,rc) + end +end \ No newline at end of file diff --git a/pre-release/c101302008.lua b/pre-release/c101302008.lua new file mode 100644 index 0000000000..95a23f9ef8 --- /dev/null +++ b/pre-release/c101302008.lua @@ -0,0 +1,82 @@ +--終刻竜機ⅩⅡ-ドラスティア +--Doom-Z Zero - Drastia +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --Destroy 1 "Doom-Z" card you control, and if you do, Special Summon this card from the hand then you can equip 1 Equip Spell from your Deck to it + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetRange(LOCATION_HAND) + e1:SetCountLimit(1,id) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) + c:RegisterEffect(e1) + --Special Summon 1 WIND Machine Xyz Monster from your Extra Deck and attach this card and all cards equipped to it to that monster + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetRange(LOCATION_MZONE) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(function(e) return e:GetHandler():GetEquipCount()>0 end) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) +end +s.listed_series={SET_DOOM_Z} +function s.desfilter(c,tp) + return c:IsSetCard(SET_DOOM_Z) and c:IsFaceup() and Duel.GetMZoneCount(tp,c)>0 +end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local c=e:GetHandler() + if chkc then return chkc:IsControler(tp) and chkc:IsOnField() and s.desfilter(chkc,tp) end + if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) + Duel.SetPossibleOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK) +end +function s.eqsfilter(c,tp,ec) + return c:IsEquipSpell() and c:CheckEquipTarget(ec) and c:CheckUniqueOnField(tp) +end +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and c:IsRelateToEffect(e) + and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 + and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingMatchingCard(s.eqsfilter,tp,LOCATION_DECK,0,1,nil,tp,c) + and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local eqc=Duel.SelectMatchingCard(tp,s.eqsfilter,tp,LOCATION_DECK,0,1,1,nil,tp,c):GetFirst() + if eqc then + Duel.BreakEffect() + Duel.Equip(tp,eqc,c) + end + end +end +function s.spfilter(c,e,tp,lv) + return c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_XYZ) and c:IsRank(lv) + and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler():GetLevel()) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not (c:IsRelateToEffect(e) and c:IsFaceup()) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c:GetLevel()):GetFirst() + if sc and Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then + sc:CompleteProcedure() + Duel.Overlay(sc,c+c:GetEquipGroup(),true) + end +end \ No newline at end of file diff --git a/pre-release/c101302009.lua b/pre-release/c101302009.lua new file mode 100644 index 0000000000..d6e8688e37 --- /dev/null +++ b/pre-release/c101302009.lua @@ -0,0 +1,72 @@ +--終刻竜機Ⅴ-アマルテ +--Doom-Z Five - Amalthe +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --Add 1 "Doom-Z" monster from your Deck to your hand + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.thtg) + e1a:SetOperation(s.thop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_DESTROYED) + e1c:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return r&REASON_EFFECT>0 end) + c:RegisterEffect(e1c) + --Special Summon 1 WIND Machine Xyz Monster from your Extra Deck and attach this card and all cards equipped to it to that monster + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetRange(LOCATION_MZONE) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(function(e) return e:GetHandler():GetEquipCount()>0 end) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) +end +s.listed_series={SET_DOOM_Z} +s.listed_names={id} +function s.thfilter(c) + return c:IsSetCard(SET_DOOM_Z) and c:IsMonster() and c:IsAbleToHand() and not c:IsCode(id) +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + 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 +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + 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 +function s.spfilter(c,e,tp,lv) + return c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_XYZ) and c:IsRank(lv) + and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler():GetLevel()) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not (c:IsRelateToEffect(e) and c:IsFaceup()) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c:GetLevel()):GetFirst() + if sc and Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then + sc:CompleteProcedure() + Duel.Overlay(sc,c+c:GetEquipGroup(),true) + end +end \ No newline at end of file diff --git a/pre-release/c101302010.lua b/pre-release/c101302010.lua new file mode 100644 index 0000000000..c39f015e47 --- /dev/null +++ b/pre-release/c101302010.lua @@ -0,0 +1,68 @@ +--終刻竜機Ⅶ-エララ +--Doom-Z Seven - Elara +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --Set 1 "Doom-Z" Spell/Trap directly from your Deck + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.settg) + e1a:SetOperation(s.setop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1b) + local e1c=e1a:Clone() + e1c:SetCode(EVENT_DESTROYED) + e1c:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return r&REASON_EFFECT>0 end) + c:RegisterEffect(e1c) + --Special Summon 1 WIND Machine Xyz Monster from your Extra Deck and attach this card and all cards equipped to it to that monster + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetRange(LOCATION_MZONE) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(function(e) return e:GetHandler():GetEquipCount()>0 end) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) +end +s.listed_series={SET_DOOM_Z} +function s.setfilter(c) + return c:IsSetCard(SET_DOOM_Z) and c:IsSpellTrap() and c:IsSSetable() +end +function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end +end +function s.setop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) + local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) + if #g>0 then + Duel.SSet(tp,g) + end +end +function s.spfilter(c,e,tp,lv) + return c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_XYZ) and c:IsRank(lv) + and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler():GetLevel()) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not (c:IsRelateToEffect(e) and c:IsFaceup()) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c:GetLevel()):GetFirst() + if sc and Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then + sc:CompleteProcedure() + Duel.Overlay(sc,c+c:GetEquipGroup(),true) + end +end \ No newline at end of file diff --git a/pre-release/c101302011.lua b/pre-release/c101302011.lua new file mode 100644 index 0000000000..94fc2ca5b1 --- /dev/null +++ b/pre-release/c101302011.lua @@ -0,0 +1,98 @@ +--獄神機Doom-Z +--Power Patron Machine Doom-Z +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --You cannot Special Summon from the Extra Deck, except Xyz Monsters + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetRange(LOCATION_MZONE) + e1:SetTargetRange(1,0) + e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_XYZ) end) + c:RegisterEffect(e1) + aux.addContinuousLizardCheck(c,LOCATION_MZONE,function(e,c) return not c:IsOriginalType(TYPE_XYZ) end) + --Special Summon from your Extra Deck, 1 "Doom-Z" Xyz Monster or "Jupiter the Power Patron of Destruction" by using another Effect monster as material + 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:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1,id) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) + --Add 1 "Doom-Z" card from your Deck to your hand + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_DESTROYED) + e3:SetCountLimit(1,{id,1}) + e3:SetTarget(s.thtg) + e3:SetOperation(s.thop) + c:RegisterEffect(e3) +end +s.listed_series={SET_DOOM_Z} +s.listed_names={101302044} --"Jupiter the Power Patron of Destruction" +function s.xyzmatfilter(c,e,tp) + local mustg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) + return #mustg<=1 and c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:HasLevel() + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetLevel(),mustg) +end +function s.spfilter(c,e,tp,mc,lv,mustg) + return c:IsType(TYPE_XYZ) and (c:IsSetCard(SET_DOOM_Z) or c:IsCode(101302044)) + and c:IsRank(lv) and mc:IsCanBeXyzMaterial(c,tp) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) + and (#mustg<=0 or mustg:IsContains(mc)) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local c=e:GetHandler() + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc~=c and s.xyzmatfilter(chkc,e,tp)end + if chk==0 then return Duel.IsExistingTarget(s.xyzmatfilter,tp,LOCATION_MZONE,0,1,c,e,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + Duel.SelectTarget(tp,s.xyzmatfilter,tp,LOCATION_MZONE,0,1,1,c,e,tp) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,c,1,tp,LOCATION_MZONE) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if not (tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) and not tc:IsImmuneToEffect(e)) then return end + local mustg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(tc),tp,nil,nil,REASON_XYZ) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetLevel(),mustg):GetFirst() + if sc then + sc:SetMaterial(tc) + Duel.Overlay(sc,tc) + if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)==0 then return end + sc:CompleteProcedure() + local c=e:GetHandler() + if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.Equip(tp,c,sc) then + --Equip limit + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetValue(1) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + c:RegisterEffect(e1) + end + end +end +function s.thfilter(c) + return c:IsSetCard(SET_DOOM_Z) and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + 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 +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + 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 \ No newline at end of file diff --git a/pre-release/c101302044.lua b/pre-release/c101302044.lua new file mode 100644 index 0000000000..e28d6cfd0a --- /dev/null +++ b/pre-release/c101302044.lua @@ -0,0 +1,95 @@ +--壊獄神ユピテル +--Jupiter the Power Patron of Destruction +--Scripted by Hatter +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + --Xyz Summon procedure: 3 Level 10 monsters + Xyz.AddProcedure(c,nil,10,3,function(c) return c:GetEquipCount()>=3 end,aux.Stringid(id,0),3,s.altprocop) + --You can equip any number of appropriate Equip Spells from your GY to this card + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) + e1:SetTarget(s.eqtg) + e1:SetOperation(s.eqop) + c:RegisterEffect(e1) + --Gains 3000 ATK while it has an Xyz Monster as material + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e2:SetCode(EFFECT_UPDATE_ATTACK) + e2:SetRange(LOCATION_MZONE) + e2:SetCondition(function(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsType,1,nil,TYPE_XYZ) end) + e2:SetValue(3000) + c:RegisterEffect(e2) + --Special Summon 1 "Doom-Z" monster from your GY, then you can destroy 1 card on the field + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1) + e3:SetCost(Cost.DetachFromSelf(1)) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) +end +s.listed_names={id} +s.listed_series={SET_DOOM_Z} +function s.altprocop(e,tp,chk) + if chk==0 then return not Duel.HasFlagEffect(tp,id) end + return Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,EFFECT_FLAG_OATH,1) +end +function s.eqfilter(c,tp,ec) + return c:IsEquipSpell() and c:CheckEquipTarget(ec) and c:CheckUniqueOnField(tp) +end +function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp,e:GetHandler()) end + Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,LOCATION_GRAVE) +end +function s.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsFacedown() or not c:IsRelateToEffect(e) then return end + local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) + if ft==0 then return end + local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_GRAVE,0,nil,tp,c) + if #g==0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local sg=g:Select(tp,1,math.min(ft,#g),nil) + if #sg>0 then + for tc in sg:Iter() do + Duel.Equip(tp,tc,c,true,true) + end + Duel.EquipComplete() + end +end +function s.spfilter(c,e,tp) + return c:IsSetCard(SET_DOOM_Z) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +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) + Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_EITHER,LOCATION_ONFIELD) +end +function s.spop(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,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) + if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 + and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>0 + and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local dg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) + if #dg>0 then + Duel.HintSelection(dg) + Duel.BreakEffect() + Duel.Destroy(dg,REASON_EFFECT) + end + end +end diff --git a/pre-release/c101302045.lua b/pre-release/c101302045.lua new file mode 100644 index 0000000000..c619825d69 --- /dev/null +++ b/pre-release/c101302045.lua @@ -0,0 +1,87 @@ +--終刻龍機ⅩⅡ-ドラストリウス +--Doom-Z End - Drastrius +--Scripted by Hatter +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + --Xyz Summon procedure: 3 Level 8 monsters + Xyz.AddProcedure(c,nil,8,3) + --The first time this card would be destroyed by battle each turn, it is not destroyed + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1) + e1:SetValue(function(e,re,r) return (r&REASON_BATTLE|REASON_EFFECT)>0 end) + c:RegisterEffect(e1) + --You can equip 1 other face-up monster on the field to this card + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_EQUIP) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_SPSUMMON_SUCCESS) + e2:SetCountLimit(1,id) + e2:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) + e2:SetTarget(s.eqtg) + e2:SetOperation(s.eqop) + c:RegisterEffect(e2) + aux.AddEREquipLimit(c,nil,aux.TRUE,Card.EquipByEffectAndLimitRegister,e2) + --Negate an opponent's monster effect activated on the field or in the GY + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_DISABLE+CATEGORY_EQUIP) + e3:SetType(EFFECT_TYPE_QUICK_O) + e3:SetCode(EVENT_CHAINING) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1,{id,1}) + e3:SetCondition(s.discon) + e3:SetCost(Cost.DetachFromSelf(1)) + e3:SetTarget(s.distg) + e3:SetOperation(s.disop) + c:RegisterEffect(e3) + aux.AddEREquipLimit(c,nil,function(ec,c,tp) return ec:IsControler(1-tp) end,Card.EquipByEffectAndLimitRegister,e3) +end +s.listed_series={SET_DOOM_Z} +function s.eqfilter(c,tp) + return c:IsFaceup() and (c:IsControler(tp) or c:IsAbleToChangeControler()) +end +function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler(),tp) end + Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,PLAYER_EITHER,LOCATION_MZONE) +end +function s.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsFacedown() or not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local ec=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c,tp):GetFirst() + if ec then + Duel.HintSelection(ec) + c:EquipByEffectAndLimitRegister(e,tp,ec) + end +end +function s.discon(e,tp,eg,ep,ev,re,r,rp,chk) + local trig_loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) + return ep==1-tp and re:IsMonsterEffect() and trig_loc&(LOCATION_MZONE|LOCATION_GRAVE)>0 and Duel.IsChainDisablable(ev) +end +function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,tp,0) + Duel.SetPossibleOperationInfo(0,CATEGORY_EQUIP,nil,1,1-tp,LOCATION_MZONE) +end +function s.disop(e,tp,eg,ep,ev,re,r,rp) + if not Duel.NegateEffect(ev) then return end + local c=e:GetHandler() + if not c:IsRelateToEffect(e) or c:IsFacedown() then return end + local g=Duel.GetMatchingGroup(s.eqfilter,tp,0,LOCATION_MZONE,c,tp) + if #g==0 or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local ec=g:Select(tp,1,1,nil):GetFirst() + if ec then + Duel.HintSelection(ec) + Duel.BreakEffect() + c:EquipByEffectAndLimitRegister(e,tp,ec) + end +end diff --git a/pre-release/c101302046.lua b/pre-release/c101302046.lua new file mode 100644 index 0000000000..ad84af1172 --- /dev/null +++ b/pre-release/c101302046.lua @@ -0,0 +1,79 @@ +--終刻獄徒 ディアクトロス +--Doom-Z Break Diactorus +--Scripted by Hatter +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + --Xyz Summon procedure: 2 Level 4 monsters + Xyz.AddProcedure(c,nil,4,2) + --You can destroy 1 "Doom-Z" card in your hand or face-up field, then you can destroy 1 monster on the field + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetCountLimit(1,id) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) + c:RegisterEffect(e1) + --You can add to your hand, or send to the GY, 1 Equip Spell from your Deck + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_TOGRAVE) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_DESTROYED) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(s.thtgcon) + e2:SetTarget(s.thtgtg) + e2:SetOperation(s.thtgop) + c:RegisterEffect(e2) +end +s.listed_names={CARD_MEDIUS_THE_INNOCENT} +s.listed_series={SET_DOOM_Z} +function s.desfilter(c) + return c:IsSetCard(SET_DOOM_Z) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) +end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_HAND|LOCATION_ONFIELD) + Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_EITHER,LOCATION_MZONE) +end +function s.desop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,nil) + if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 + and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)>0 + and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local dg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) + if #dg>0 then + Duel.HintSelection(dg) + Duel.BreakEffect() + Duel.Destroy(dg,REASON_EFFECT) + end + end +end +function s.thtgconfilter(c) + return (c:IsSetCard(SET_DOOM_Z) and c:IsMonster()) or c:IsCode(CARD_MEDIUS_THE_INNOCENT) +end +function s.thtgcon(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + return c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:GetOverlayGroup():IsExists(s.thtgconfilter,1,nil) +end +function s.thtgfilter(c) + return c:IsEquipSpell() and (c:IsAbleToHand() or c:IsAbleToGrave()) +end +function s.thtgtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thtgfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) +end +function s.thtgop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,3)) + local g=Duel.SelectMatchingCard(tp,s.thtgfilter,tp,LOCATION_DECK,0,1,1,nil) + if #g>0 then + aux.ToHandOrElse(g,tp) + end +end \ No newline at end of file diff --git a/pre-release/c101302057.lua b/pre-release/c101302057.lua new file mode 100644 index 0000000000..a3de63f896 --- /dev/null +++ b/pre-release/c101302057.lua @@ -0,0 +1,94 @@ +--終刻撃針 +--Doom-Z Raider +--scripted by Naim +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) + --Destroy 1 other "Doom-Z" card in your hand or face-up field, then add to your hand, or Special Summon, 1 "Doom-Z" monster from your Deck + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_SZONE) + e1:SetCountLimit(1,id) + e1:SetTarget(s.desthsptg) + e1:SetOperation(s.desthspop) + c:RegisterEffect(e1) + --Destroy 1 face-up monster on the field + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_DESTROY) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e2:SetCode(EVENT_DESTROYED) + e2:SetCountLimit(1,id) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return r&REASON_EFFECT>0 end) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) + c:RegisterEffect(e2) +end +s.listed_series={SET_DOOM_Z} +function s.desfilter(c,e,tp) + if not (c:IsSetCard(SET_DOOM_Z) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND))) then return false end + return Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c) +end +function s.thspfilter(c,e,tp,exc) + return c:IsSetCard(SET_DOOM_Z) and c:IsMonster() + and (c:IsAbleToHand() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp,exc)>0)) +end +function s.desthsptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,e:GetHandler(),e,tp) end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND|LOCATION_ONFIELD) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) +end +function s.desthspop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,c,e,tp) + if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 then + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) + local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + if sc then + Duel.BreakEffect() + aux.ToHandOrElse(sc,tp, + function() + return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) + end, + function() + Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) + end, + aux.Stringid(id,3) + ) + end + end + --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,4)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetTargetRange(1,0) + 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,function(e,c) return not c:IsOriginalType(TYPE_XYZ) end) +end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end + if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) +end +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) then + Duel.Destroy(tc,REASON_EFFECT) + end +end \ No newline at end of file diff --git a/pre-release/c101302058.lua b/pre-release/c101302058.lua new file mode 100644 index 0000000000..594519672c --- /dev/null +++ b/pre-release/c101302058.lua @@ -0,0 +1,115 @@ +--終刻起動『D.O.O.M.D.U.R.G.』 +--Doom-Z Command "D.O.O.M.D.U.R.G" +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + aux.AddEquipProcedure(c) + --Inflict 500 damage to the equipped monster's controller during the Standby Phase + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DAMAGE) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e1:SetCode(EVENT_PHASE|PHASE_STANDBY) + e1:SetRange(LOCATION_SZONE) + e1:SetCountLimit(1) + e1:SetCondition(function(e) return e:GetHandler():GetEquipTarget() end) + e1:SetTarget(s.damtg) + e1:SetOperation(s.damop) + c:RegisterEffect(e1) + --Your opponent cannot target this card with card effects + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) + e2:SetValue(aux.tgoval) + --Destroy 1 other face-up card you control, also this card gains ATK equal to its own Level/Rank x 100, it can attack directly and if it battles destroy it at the end of the Damage Step + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE) + e3:SetType(EFFECT_TYPE_QUICK_O) + e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP) + e3:SetCode(EVENT_FREE_CHAIN) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1) + e3:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP|TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e3:SetCondition(aux.StatChangeDamageStepCondition) + e3:SetTarget(s.desatktg) + e3:SetOperation(s.desatkop) + --Grant the above effects to a "Doom-Z" monster equipped with this card + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) + e4:SetRange(LOCATION_SZONE) + e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e4:SetTarget(function(e,c) return e:GetHandler():GetEquipTarget()==c and c:IsSetCard(SET_DOOM_Z) end) + e4:SetLabelObject(e2) + c:RegisterEffect(e4) + local e5=e4:Clone() + e5:SetLabelObject(e3) + c:RegisterEffect(e5) + --Grant the above protection effect (e2) to a WIND Machine Xyz Monster that has it as material + local e6=e2:Clone() + e6:SetType(EFFECT_TYPE_XMATERIAL) + e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e6:SetRange(LOCATION_MZONE) + c:RegisterEffect(e6) + --Grant the above destruction+atk change effect (e3) to a WIND Machine Xyz Monster that has it as material + local e7=e3:Clone() + e7:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O) + e7:SetRange(LOCATION_MZONE) + e7:SetCondition(function(e) local c=e:GetHandler() return c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_MACHINE) end) + c:RegisterEffect(e7) +end +s.listed_series={SET_DOOM_Z} +function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + local p=e:GetHandler():GetEquipTarget():GetControler() + Duel.SetTargetPlayer(p) + Duel.SetTargetParam(500) + Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,1,p,500) +end +function s.damop(e,tp,eg,ep,ev,re,r,rp) + Duel.Damage(e:GetHandler():GetEquipTarget():GetControler(),500,REASON_EFFECT) +end +function s.desatktg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + local dg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,c) + if chk==0 then return #dg>0 end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,tp,0) + local atk=(c:HasLevel() and c:GetLevel() or c:GetRank())*100 + Duel.SetPossibleOperationInfo(0,CATEGORY_ATKCHANGE,nil,1,tp,atk) +end +function s.desatkop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local exc=c:IsRelateToEffect(e) and c or nil + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local desg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,1,exc) + if #desg==0 then return end + Duel.HintSelection(desg) + if Duel.Destroy(desg,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then + if c:IsFaceup() then + local atk=(c:HasLevel() and c:GetLevel() or c:GetRank())*100 + --This card gains ATK equal to its own Level/Rank x 100 + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetValue(atk) + e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) + c:RegisterEffect(e1) + end + --It can attack directly + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,2)) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetProperty(EFFECT_FLAG_CLIENT_HINT) + e2:SetCode(EFFECT_DIRECT_ATTACK) + e2:SetReset(RESETS_STANDARD_PHASE_END) + c:RegisterEffect(e2) + --If it battles, destroy it at the end of the Damage Step + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e3:SetCode(EVENT_DAMAGE_STEP_END) + e3:SetCondition(function(e) return e:GetHandler():IsRelateToBattle() end) + e3:SetOperation(function(e) Duel.Hint(HINT_CARD,0,c:GetOriginalCodeRule()) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end) + e3:SetReset(RESETS_STANDARD_PHASE_END) + c:RegisterEffect(e3) + end +end \ No newline at end of file diff --git a/pre-release/c101302059.lua b/pre-release/c101302059.lua new file mode 100644 index 0000000000..b53ebc14e5 --- /dev/null +++ b/pre-release/c101302059.lua @@ -0,0 +1,72 @@ +--破滅なる予幻視 +--Theorealize Overdrive +--Scripted by Hatter +local s,id=GetID() +function s.initial_effect(c) + --Special Summon 1 "Medius the Pure" from your GY or banishment + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetCountLimit(1,id) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) + --Change the Level of 1 face-up monster you control + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_LVCHANGE) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_GRAVE) + e2:SetCountLimit(1,{id,1}) + e2:SetCost(Cost.SelfBanish) + e2:SetTarget(s.lvtg) + e2:SetOperation(s.lvop) + c:RegisterEffect(e2) +end +s.listed_names={CARD_MEDIUS_THE_INNOCENT} +function s.spfilter(c,e,tp) + return c:IsCode(CARD_MEDIUS_THE_INNOCENT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup() +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,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) + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) then + Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) + end +end +function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:HasLevel() and chkc:IsFaceup() end + if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.HasLevel),tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + local tc=Duel.SelectTarget(tp,aux.FaceupFilter(Card.HasLevel),tp,LOCATION_MZONE,0,1,1,nil):GetFirst() + local lv=Duel.AnnounceNumberRange(tp,1,10,tc:GetLevel()) + e:SetLabel(lv) + Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,tc,1,tp,0) +end +function s.lvop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if not (tc:IsFaceup() and tc:HasLevel() and tc:IsRelateToEffect(e)) then return end + local lv=e:GetLabel() + if lv>0 and not tc:IsLevel(lv) then + --Its Level becomes the declared Level until the end of this turn + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_CHANGE_LEVEL) + e1:SetValue(lv) + e1:SetReset(RESETS_STANDARD_PHASE_END) + tc:RegisterEffect(e1) + end +end \ No newline at end of file diff --git a/pre-release/c101302060.lua b/pre-release/c101302060.lua new file mode 100644 index 0000000000..aa64d256fc --- /dev/null +++ b/pre-release/c101302060.lua @@ -0,0 +1,87 @@ +--アルトメギア・ムーヴメント-血統- +--Artmage Movement -Lineage- +--Scripted by Hatter +local s,id=GetID() +function s.initial_effect(c) + --Special Summon 1 "Artmage" monster from your Deck in Defense Position, with a different name from the cards you control + 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:SetCountLimit(1,id) + e1:SetCondition(function(e,tp) return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0) end) + e1:SetCost(s.cost) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) + --Add 1 "Artmage" Trap from your GY or banishment to your hand + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TOHAND) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_TO_GRAVE) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(s.thcon) + e2:SetCost(s.cost) + e2:SetTarget(s.thtg) + e2:SetOperation(s.thop) + c:RegisterEffect(e2) + --Checks to see if non-Fusion Monsters were Summoned from the Extra Deck + Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsType(TYPE_FUSION) end) +end +s.listed_series={74733322} --"Artmage Academic Arcane Arts Acropolis" +s.listed_series={SET_ARTMEGIA} +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end + --You cannot Special Summon from the Extra Deck the turn you activate this effect, except Fusion Monsters + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,2)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetTargetRange(1,0) + e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION) end) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) +end +function s.spfilter(c,e,tp,...) + return c:IsSetCard(SET_ARTMEGIA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not (... and c:IsCode(...)) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then + if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end + local codes=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,nil):GetClass(Card.GetCode) + return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,table.unpack(codes)) + end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then + local codes=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,nil):GetClass(Card.GetCode) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,table.unpack(codes)) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) + end + end +end +function s.thcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CODE)==74733322 +end +function s.thfilter(c) + return c:IsSetCard(SET_ARTMEGIA) and c:IsTrap() and c:IsFaceup() and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.SendtoHand(g,nil,REASON_EFFECT) + end +end \ No newline at end of file diff --git a/pre-release/c101302071.lua b/pre-release/c101302071.lua new file mode 100644 index 0000000000..07b59f8d33 --- /dev/null +++ b/pre-release/c101302071.lua @@ -0,0 +1,60 @@ +--あないみじや玉の緒ふたつ +--Tragic Twin Threads +--scripted by pyrQ +local s,id=GetID() +function s.initial_effect(c) + --Equip only to a monster you control that was Special Summoned from the Extra Deck + aux.AddEquipProcedure(c,0,aux.FilterBoolFunction(Card.IsSummonLocation,LOCATION_EXTRA)) + --Destroy it, also the equipped monster, and if you do, take damage equal to the total original ATK of the destroyed monsters, then inflict damage to your opponent equal to the damage you took + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetRange(LOCATION_SZONE) + e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) + e1:SetCondition(s.descon) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) + c:RegisterEffect(e1) +end +function s.desconfilter(c,tp,atk) + return c:IsSummonPlayer(1-tp) and c:IsSummonLocation(LOCATION_EXTRA) and c:GetAttack()>atk +end +function s.descon(e,tp,eg,ep,ev,re,r,rp) + local ec=e:GetHandler():GetEquipTarget() + return ec and eg:IsExists(s.desconfilter,1,nil,tp,ec:GetAttack()) +end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local ec=e:GetHandler():GetEquipTarget() + local g=eg:Filter(s.desconfilter,nil,tp,ec:GetAttack()):Match(Card.IsCanBeEffectTarget,nil,e) + if chkc then return g:IsContains(chkc) end + if chk==0 then return #g>0 end + local tg=nil + if #g==1 then + tg=g + else + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + tg=g:Select(tp,1,1,nil) + end + Duel.SetTargetCard(tg) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg+ec,2,tp,0) + Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,tg:GetSum(Card.GetBaseAttack)) +end +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + local g=Group.FromCards(e:GetHandler():GetEquipTarget()) + if tc:IsRelateToEffect(e) then + g:AddCard(tc) + end + if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 then + local dam=Duel.GetOperatedGroup():GetSum(Card.GetBaseAttack) + if dam==0 then return end + local val=Duel.Damage(tp,dam,REASON_EFFECT) + if val>0 then + Duel.BreakEffect() + Duel.Damage(1-tp,val,REASON_EFFECT) + end + end +end \ No newline at end of file diff --git a/pre-release/c101302074.lua b/pre-release/c101302074.lua new file mode 100644 index 0000000000..759abfc62d --- /dev/null +++ b/pre-release/c101302074.lua @@ -0,0 +1,96 @@ +--終刻決壊 +--Doom-Z Destruction +--scripted by Naim +local s,id=GetID() +function s.initial_effect(c) + --Equip this card to 1 "Doom-Z" Xyz Monster you control + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetCost(aux.RemainFieldCost) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) + --Equip 1 "Doom-Z" monster from your Deck to a monster on the field + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_EQUIP) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_DESTROYED) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return r&REASON_EFFECT>0 end) + e2:SetTarget(s.eqptg) + e2:SetOperation(s.eqpop) + c:RegisterEffect(e2) +end +s.listed_series={SET_DOOM_Z} +function s.xyzfilter(c) + return c:IsSetCard(SET_DOOM_Z) and c:IsType(TYPE_XYZ) and c:IsFaceup() +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.xyzfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Equip(tp,c,tc) then + --Your opponent cannot add cards from the Deck to the hand, except by drawing them + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_CANNOT_TO_HAND) + e1:SetRange(LOCATION_SZONE) + e1:SetTargetRange(0,LOCATION_DECK) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + c:RegisterEffect(e1) + --Equip limit + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e2:SetCode(EFFECT_EQUIP_LIMIT) + e2:SetValue(function(e,c) return c==tc end) + e2:SetReset(RESET_EVENT|RESETS_STANDARD) + c:RegisterEffect(e2) + else + c:CancelToGrave(false) + end +end +function s.eqfilter(c,tp) + return c:IsSetCard(SET_DOOM_Z) and c:IsMonster() and c:CheckUniqueOnField(tp) and not c:IsForbidden() +end +function s.eqptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local c=e:GetHandler() + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) + and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK,0,1,nil,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK) +end +function s.eqpop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if not (tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local ec=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() + if ec and Duel.Equip(tp,ec,tc) then + --Equip limit + local e1=Effect.CreateEffect(ec) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetValue(function(e,c) return c==tc end) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + ec:RegisterEffect(e1) + end +end \ No newline at end of file diff --git a/pre-release/c101302075.lua b/pre-release/c101302075.lua new file mode 100644 index 0000000000..eeb50d8ec7 --- /dev/null +++ b/pre-release/c101302075.lua @@ -0,0 +1,95 @@ +--アルトメギア・ペリペティア-激動- +--Artmage Peripeteia -Turmoil- +--Scripted by Hatter +local s,id=GetID() +function s.initial_effect(c) + --Return 1 "Artmage" monster you control to the hand/Extra Deck + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_TOHAND+CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E+TIMING_MAIN_END+TIMING_STANDBY_PHASE) + e1:SetCost(s.cost) + e1:SetTarget(s.rthtetg) + e1:SetOperation(s.rthteop) + c:RegisterEffect(e1) + --Add 1 "Artmage" Spell from your GY or banishment to your hand + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TOHAND) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_TO_GRAVE) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(s.thcon) + e2:SetCost(s.cost) + e2:SetTarget(s.thtg) + e2:SetOperation(s.thop) + c:RegisterEffect(e2) + --Checks to see if non-Fusion Monsters were Summoned from the Extra Deck + Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsType(TYPE_FUSION) end) +end +s.listed_series={74733322} --"Artmage Academic Arcane Arts Acropolis" +s.listed_series={SET_ARTMEGIA} +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end + --You cannot Special Summon from the Extra Deck the turn you activate this effect, except Fusion Monsters + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,2)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetTargetRange(1,0) + e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION) end) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) +end +function s.rthtefilter(c,tp) + return c:IsSetCard(SET_ARTMEGIA) and (c:IsAbleToHand() or c:IsAbleToExtra()) + and c:IsFaceup() and (not tp or Duel.GetMZoneCount(tp,c)>0) +end +function s.rthtetg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingTarget(Card.IsCanBeSpecialSummoned,tp,0,LOCATION_GRAVE,1,nil,e,0,tp,false,false) + and Duel.IsExistingMatchingCard(s.rthtefilter,tp,LOCATION_MZONE,0,1,nil,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectTarget(tp,Card.IsCanBeSpecialSummoned,tp,0,LOCATION_GRAVE,1,1,nil,e,0,tp,false,false) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_MZONE) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_MZONE) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) +end +function s.rthteop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,3)) + local g=Duel.SelectMatchingCard(tp,s.rthtefilter,tp,LOCATION_MZONE,0,1,1,nil) + if #g==0 then return end + Duel.HintSelection(g) + if Duel.SendtoHand(g,nil,REASON_EFFECT)>0 + and g:GetFirst():IsLocation(LOCATION_HAND|LOCATION_EXTRA) + and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and tc:IsRelateToEffect(e) + and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then + --Its effects are negated + tc:NegateEffects(e:GetHandler()) + end +end +function s.thcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CODE)==74733322 +end +function s.thfilter(c) + return c:IsSetCard(SET_ARTMEGIA) and c:IsSpell() and c:IsFaceup() and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.SendtoHand(g,nil,REASON_EFFECT) + end +end \ No newline at end of file diff --git a/pre-release/c101302106.lua b/pre-release/c101302106.lua index 1c2bff4300..72d419b6e3 100644 --- a/pre-release/c101302106.lua +++ b/pre-release/c101302106.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --A targeted "D/D" Effect Monster gains an effect until the end of this turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -82,4 +82,4 @@ end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/rush/c160215037.lua b/rush/c160215037.lua new file mode 100644 index 0000000000..d7ae390b80 --- /dev/null +++ b/rush/c160215037.lua @@ -0,0 +1,3 @@ +--セレブローズ・ラグジュアリ・マジシャンズ +--Celeb Rose Luxury Magicians +Duel.LoadCardScriptAlias(160013042) diff --git a/rush/c160215038.lua b/rush/c160215038.lua new file mode 100644 index 0000000000..4440b37957 --- /dev/null +++ b/rush/c160215038.lua @@ -0,0 +1,3 @@ +--セレブローズ・ファビュラス・マジシャン +--Celeb Rose Fabulous Magician +Duel.LoadCardScriptAlias(160013041) diff --git a/rush/c160215039.lua b/rush/c160215039.lua new file mode 100644 index 0000000000..d40df6bfc5 --- /dev/null +++ b/rush/c160215039.lua @@ -0,0 +1,3 @@ +--セレブローズ・インコグニート・マジシャン +--Celeb Rose Incognito Magician +Duel.LoadCardScriptAlias(160019041) diff --git a/rush/c160215041.lua b/rush/c160215041.lua new file mode 100644 index 0000000000..b53ba74fd4 --- /dev/null +++ b/rush/c160215041.lua @@ -0,0 +1,3 @@ +--セレブローズ・インフルエンサーズ +--Celeb Rose Influencers +Duel.LoadCardScriptAlias(160016044) diff --git a/rush/c160215042.lua b/rush/c160215042.lua new file mode 100644 index 0000000000..8e75c5cf71 --- /dev/null +++ b/rush/c160215042.lua @@ -0,0 +1,3 @@ +--セレブローズ・ゴシップ・マジシャン +--Celeb Rose Gossip Magician +Duel.LoadCardScriptAlias(160015039) diff --git a/rush/c160215043.lua b/rush/c160215043.lua new file mode 100644 index 0000000000..281e962e92 --- /dev/null +++ b/rush/c160215043.lua @@ -0,0 +1,3 @@ +--セレブローズ・ゴシップ・ウィッチ +--Celeb Rose Gossip Witch +Duel.LoadCardScriptAlias(160015038) diff --git a/rush/c160215044.lua b/rush/c160215044.lua new file mode 100644 index 0000000000..030c36c67a --- /dev/null +++ b/rush/c160215044.lua @@ -0,0 +1,3 @@ +--セレブローズ・マジシャン +--Celeb Rose Magician +Duel.LoadCardScriptAlias(160013012) \ No newline at end of file diff --git a/rush/c160215045.lua b/rush/c160215045.lua new file mode 100644 index 0000000000..5f6b756070 --- /dev/null +++ b/rush/c160215045.lua @@ -0,0 +1,3 @@ +--セレブローズ・ウィッチ +--Celeb Rose Witch +Duel.LoadCardScriptAlias(160013011) \ No newline at end of file diff --git a/rush/c160215046.lua b/rush/c160215046.lua new file mode 100644 index 0000000000..d8753fdfa6 --- /dev/null +++ b/rush/c160215046.lua @@ -0,0 +1,3 @@ +--セレブローズ・ウォーロック +--Celeb Rose Warlock +Duel.LoadCardScriptAlias(160210046) \ No newline at end of file diff --git a/rush/c160215047.lua b/rush/c160215047.lua new file mode 100644 index 0000000000..32e5669b33 --- /dev/null +++ b/rush/c160215047.lua @@ -0,0 +1,3 @@ +--セレブローズ・ソーサラー +--Celeb Rose Sorcerer +Duel.LoadCardScriptAlias(160013010) \ No newline at end of file diff --git a/rush/c160215048.lua b/rush/c160215048.lua new file mode 100644 index 0000000000..a3ad9eae54 --- /dev/null +++ b/rush/c160215048.lua @@ -0,0 +1,3 @@ +--セレブローズ・エンチャンター +--Celeb Rose Enchanter +Duel.LoadCardScriptAlias(160210050) \ No newline at end of file diff --git a/rush/c160215049.lua b/rush/c160215049.lua new file mode 100644 index 0000000000..db73da40c5 --- /dev/null +++ b/rush/c160215049.lua @@ -0,0 +1,3 @@ +--セレブローズ・メイジ +--Celeb Rose Mage +Duel.LoadCardScriptAlias(160013009) \ No newline at end of file diff --git a/rush/c160215050.lua b/rush/c160215050.lua new file mode 100644 index 0000000000..6bb901f422 --- /dev/null +++ b/rush/c160215050.lua @@ -0,0 +1,3 @@ +--フセレブローズ・ウィズ +--Celeb Rose Wiz +Duel.LoadCardScriptAlias(160015008) \ No newline at end of file diff --git a/rush/c160215057.lua b/rush/c160215057.lua new file mode 100644 index 0000000000..e3725a1c6c --- /dev/null +++ b/rush/c160215057.lua @@ -0,0 +1,3 @@ +--環幻楽鬼神トランスゴッドブレス +--Divinebreath the Orchestral Music Fiend +Duel.LoadCardScriptAlias(160208018) \ No newline at end of file diff --git a/rush/c160215058.lua b/rush/c160215058.lua new file mode 100644 index 0000000000..734c0f0dfc --- /dev/null +++ b/rush/c160215058.lua @@ -0,0 +1,3 @@ +--環幻楽鬼フルオルケストラ +--Full Orchestra the Music Fiend +Duel.LoadCardScriptAlias(160208019) \ No newline at end of file diff --git a/rush/c160215059.lua b/rush/c160215059.lua new file mode 100644 index 0000000000..604cba9f94 --- /dev/null +++ b/rush/c160215059.lua @@ -0,0 +1,3 @@ +--環幻楽姫アクションメロディ +--Axetion Melody the Music Princess +Duel.LoadCardScriptAlias(160208020) \ No newline at end of file diff --git a/rush/c160215060.lua b/rush/c160215060.lua new file mode 100644 index 0000000000..79e090d368 --- /dev/null +++ b/rush/c160215060.lua @@ -0,0 +1,3 @@ +--斧楽姫チューンフルートマホーク +--Tune Flutomahawk the Music Princess +Duel.LoadCardScriptAlias(160208020) \ No newline at end of file diff --git a/rush/c160215063.lua b/rush/c160215063.lua new file mode 100644 index 0000000000..848baaa69b --- /dev/null +++ b/rush/c160215063.lua @@ -0,0 +1,3 @@ +--神楽鬼ファーゴッド・フィンガー +--Digisoon the Music Fiend +Duel.LoadCardScriptAlias(160004029) \ No newline at end of file diff --git a/rush/c160215064.lua b/rush/c160215064.lua new file mode 100644 index 0000000000..64b9ac5fde --- /dev/null +++ b/rush/c160215064.lua @@ -0,0 +1,3 @@ +--重楽鬼アンサンブルファイター +--Ensembullfighter the Music Fiend +Duel.LoadCardScriptAlias(160004028) \ No newline at end of file diff --git a/rush/c160215065.lua b/rush/c160215065.lua new file mode 100644 index 0000000000..cbcccc3a0b --- /dev/null +++ b/rush/c160215065.lua @@ -0,0 +1,3 @@ +--振楽姫チューバルディッシュ +--Tubardiche the Music Princess +Duel.LoadCardScriptAlias(160208025) \ No newline at end of file diff --git a/rush/c160215067.lua b/rush/c160215067.lua new file mode 100644 index 0000000000..2dd5e8c01e --- /dev/null +++ b/rush/c160215067.lua @@ -0,0 +1,3 @@ +--冠狙楽姫トロンボウ +--Trombow the Music Princess +Duel.LoadCardScriptAlias(160211071) \ No newline at end of file diff --git a/rush/c160215072.lua b/rush/c160215072.lua new file mode 100644 index 0000000000..b5fe43a0b6 --- /dev/null +++ b/rush/c160215072.lua @@ -0,0 +1,55 @@ +--希望のリーチェ +--Ritty the Hopeful +--scripted by YoshiDuels +local s,id=GetID() +function s.initial_effect(c) + -- Mill and add to hand + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DECKDES+CATEGORY_TOHAND) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1) + e1:SetCondition(s.condition) + e1:SetCost(s.cost) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) +end +function s.condition(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsStatus(STATUS_SUMMON_TURN) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=10 +end +function s.cfilter(c) + return c:IsMonster() and c:IsAbleToDeckOrExtraAsCost() +end +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end + Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) +end +function s.thfilter(c) + return c:IsLocation(LOCATION_GRAVE) and c:IsAbleToHand() +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + --Requirement + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) + local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil) + if #g==0 then return end + local tc=g:GetFirst() + Duel.HintSelection(g) + if Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_COST)==0 then return end + --Effect + Duel.DiscardDeck(tp,3,REASON_EFFECT) + local g=Duel.GetOperatedGroup() + if tc:IsRitualMonster() and g:FilterCount(s.thfilter,nil)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local sg=g:FilterSelect(tp,s.thfilter,1,1,nil) + if #sg>0 then + Duel.SendtoHand(sg,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,sg) + end + end +end \ No newline at end of file diff --git a/rush/c160215093.lua b/rush/c160215093.lua new file mode 100644 index 0000000000..762a474d66 --- /dev/null +++ b/rush/c160215093.lua @@ -0,0 +1,3 @@ +--歴戦の暗黒騎士ガイア +--Battletested Gaia The Fierce Knight +Duel.LoadCardScriptAlias(160014032) \ No newline at end of file diff --git a/rush/c160215094.lua b/rush/c160215094.lua new file mode 100644 index 0000000000..03129f86d1 --- /dev/null +++ b/rush/c160215094.lua @@ -0,0 +1,3 @@ +--歴戦のカース・オブ・ドラゴン +--Veteran Curse of Dragon +Duel.LoadCardScriptAlias(160014031) \ No newline at end of file diff --git a/rush/c160215114.lua b/rush/c160215114.lua new file mode 100644 index 0000000000..ec9d386e0e --- /dev/null +++ b/rush/c160215114.lua @@ -0,0 +1,3 @@ +--なほいとをかしまいひめ +--Ever-Grace Princess Mai +Duel.LoadCardScriptAlias(160215014) diff --git a/rush/c160215115.lua b/rush/c160215115.lua new file mode 100644 index 0000000000..04d71361a2 --- /dev/null +++ b/rush/c160215115.lua @@ -0,0 +1,3 @@ +--なほいとをかしまりひめ +--Ever-Grace Princess Mari +Duel.LoadCardScriptAlias(160215015) diff --git a/rush/c160215124.lua b/rush/c160215124.lua new file mode 100644 index 0000000000..04179528e7 --- /dev/null +++ b/rush/c160215124.lua @@ -0,0 +1,3 @@ +--いとをかししあわせにっき +--Grace Happiness Diary +Duel.LoadCardScriptAlias(160215024) diff --git a/rush/c160452026.lua b/rush/c160452026.lua new file mode 100644 index 0000000000..adc65878fc --- /dev/null +++ b/rush/c160452026.lua @@ -0,0 +1,3 @@ +--カードディフェンダー +--Card Defender +Duel.LoadCardScriptAlias(160020024) diff --git a/rush/c160452027.lua b/rush/c160452027.lua new file mode 100644 index 0000000000..41f3e2a4ab --- /dev/null +++ b/rush/c160452027.lua @@ -0,0 +1,3 @@ +--竜水の神子 +--Justiciar of the Dragon Stream +Duel.LoadCardScriptAlias(160019029) diff --git a/rush/c160452028.lua b/rush/c160452028.lua new file mode 100644 index 0000000000..826db17524 --- /dev/null +++ b/rush/c160452028.lua @@ -0,0 +1,3 @@ +--セブンスロード・チャームウイッチ +--Sevens Road Charm Witch +Duel.LoadCardScriptAlias(160211062) diff --git a/rush/c160452029.lua b/rush/c160452029.lua new file mode 100644 index 0000000000..6d791a3bff --- /dev/null +++ b/rush/c160452029.lua @@ -0,0 +1,3 @@ +--カオス-黒魔術の儀式 +--Black Magic Ritual +Duel.LoadCardScriptAlias(160323030) diff --git a/rush/c160452030.lua b/rush/c160452030.lua new file mode 100644 index 0000000000..98b70c27f6 --- /dev/null +++ b/rush/c160452030.lua @@ -0,0 +1,3 @@ +--リパルシブ・フォース +--Repulsive Force +Duel.LoadCardScriptAlias(160211038) diff --git a/unofficial/c100000178.lua b/unofficial/c100000178.lua index 876d104f48..580be0497f 100644 --- a/unofficial/c100000178.lua +++ b/unofficial/c100000178.lua @@ -11,13 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) @@ -27,4 +23,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(800) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e:GetHandler():RegisterEffect(e1) -end \ No newline at end of file +end diff --git a/unofficial/c100000179.lua b/unofficial/c100000179.lua index eff49a1dc8..c97f406ba6 100644 --- a/unofficial/c100000179.lua +++ b/unofficial/c100000179.lua @@ -11,13 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) @@ -32,4 +28,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e2:SetCode(EFFECT_DIRECT_ATTACK) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e:GetHandler():RegisterEffect(e2) -end \ No newline at end of file +end diff --git a/unofficial/c100000490.lua b/unofficial/c100000490.lua index 33403e97bf..71f0462544 100644 --- a/unofficial/c100000490.lua +++ b/unofficial/c100000490.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetOperation(s.activate) c:RegisterEffect(e1) end -function s.filter(c,e) +function s.matfilter(c,e) return c:IsFaceup() and c:IsCanBeEffectTarget(e) and not c:IsType(TYPE_TOKEN) end function s.registerxyzmateffect(e,tp) @@ -23,22 +23,22 @@ function s.registerxyzmateffect(e,tp) Duel.RegisterEffect(matEff,tp) return matEff end -function s.xyzfilter(c,mg,fg,minc,maxg) - return c:IsXyzSummonable(mg,fg,minc,maxg) +function s.xyzfilter(c,mg,minc,maxc) + return c:IsXyzSummonable(nil,mg,minc,maxc) end function s.rescon(exg) - return function(sg) - return exg:IsExists(Card.IsXyzSummonable,1,nil,nil,sg,#sg,#sg) + return function(sg,e,tp,g) + return exg:IsExists(Card.IsXyzSummonable,1,nil,nil,sg,#sg,#sg) and sg:IsExists(Card.IsControler,1,nil,1-tp) end end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end - local mg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e) + local mg=Duel.GetMatchingGroup(s.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e) if chk==0 then local matEff=s.registerxyzmateffect(e,tp) local res=Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg) matEff:Reset() - return res + return res and mg:IsExists(Card.IsControler,1,nil,1-tp) end local matEff=s.registerxyzmateffect(e,tp) local exg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg) @@ -51,7 +51,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetTargetCards(e) local matEff=s.registerxyzmateffect(e,tp) - local xyzg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,nil,g,#g,#g) + local xyzg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,g,#g,#g) if #xyzg>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local xyz=xyzg:Select(tp,1,1,nil):GetFirst() @@ -67,4 +67,4 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) else matEff:Reset() end -end \ No newline at end of file +end diff --git a/unofficial/c100000498.lua b/unofficial/c100000498.lua index b0f36c3acb..b79a783996 100644 --- a/unofficial/c100000498.lua +++ b/unofficial/c100000498.lua @@ -14,19 +14,15 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.negcon) - e1:SetCost(s.negcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.negcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP) and Duel.IsChainNegatable(ev) end -function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) @@ -40,4 +36,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp) if re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 then Duel.BreakEffect() end -end \ No newline at end of file +end diff --git a/unofficial/c100000549.lua b/unofficial/c100000549.lua index 4aaea8e51f..024ed7e52c 100644 --- a/unofficial/c100000549.lua +++ b/unofficial/c100000549.lua @@ -11,13 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -29,4 +25,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE+RESET_PHASE+PHASE_END,2) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c111011803.lua b/unofficial/c111011803.lua index 80961c2f93..369851b2a3 100644 --- a/unofficial/c111011803.lua +++ b/unofficial/c111011803.lua @@ -10,14 +10,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_DESTROY) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local tc=eg:GetFirst() @@ -34,4 +30,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) tc:SetStatus(STATUS_SET_TURN,false) end end -end \ No newline at end of file +end diff --git a/unofficial/c111011903.lua b/unofficial/c111011903.lua index efea63fb84..78258585e7 100644 --- a/unofficial/c111011903.lua +++ b/unofficial/c111011903.lua @@ -10,14 +10,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:GetAttack()~=0 @@ -39,4 +35,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c111011904.lua b/unofficial/c111011904.lua index a6f4d18af5..64b4561c4d 100644 --- a/unofficial/c111011904.lua +++ b/unofficial/c111011904.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetHintTiming(0,TIMING_STANDBY_PHASE+TIMINGS_CHECK_MONSTER) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.actg) e2:SetOperation(s.acop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.thfilter(c) return c:IsSpellTrap() and c:IsAbleToHand() @@ -165,4 +165,4 @@ function s.acop(e,tp,eg,ep,ev,re,r,rp,chk) end end end -end \ No newline at end of file +end diff --git a/unofficial/c111011905.lua b/unofficial/c111011905.lua index 391033798b..9d9d65ca4d 100644 --- a/unofficial/c111011905.lua +++ b/unofficial/c111011905.lua @@ -11,14 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0) end @@ -34,4 +30,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) local dg=g:Select(1-tp,ct,ct,nil) Duel.Destroy(dg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511000034.lua b/unofficial/c511000034.lua index 49f96a1621..d75f85a49b 100644 --- a/unofficial/c511000034.lua +++ b/unofficial/c511000034.lua @@ -25,9 +25,9 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetCountLimit(1) e2:SetCondition(s.condition) - e2:SetCost(s.cost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.atktg(e,c) return c==e:GetHandler():GetBattleTarget() @@ -43,10 +43,6 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp) return (a:GetControler()==tp and a:IsRelateToBattle()) or (d and d:GetControler()==tp and d:IsRelateToBattle()) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) local a=Duel.GetAttacker() if Duel.GetTurnPlayer()~=tp then a=Duel.GetAttackTarget() end @@ -69,4 +65,4 @@ end function s.baseval(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler():GetBattleTarget() return c:GetBaseAttack() -end \ No newline at end of file +end diff --git a/unofficial/c511000041.lua b/unofficial/c511000041.lua index 9ac2c0070b..dd15cc4de6 100644 --- a/unofficial/c511000041.lua +++ b/unofficial/c511000041.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.cacon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.catg) e2:SetOperation(s.caop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end @@ -54,4 +54,4 @@ function s.caop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.ChainAttack(tc) end -end \ No newline at end of file +end diff --git a/unofficial/c511000183.lua b/unofficial/c511000183.lua index 601253ca49..6dcea4ed7b 100644 --- a/unofficial/c511000183.lua +++ b/unofficial/c511000183.lua @@ -30,10 +30,10 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_CHAINING) e3:SetCondition(s.negcon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.negtg) e3:SetOperation(s.negop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --battle indestructable local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) @@ -79,4 +79,4 @@ function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.negop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) -end \ No newline at end of file +end diff --git a/unofficial/c511000184.lua b/unofficial/c511000184.lua index 3d6da9ea34..a60d720e2e 100644 --- a/unofficial/c511000184.lua +++ b/unofficial/c511000184.lua @@ -11,9 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_START) e1:SetCondition(s.tbcon) - e1:SetCost(s.tbcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.tbop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -28,10 +28,6 @@ function s.tbcon(e,tp,eg,ep,ev,re,r,rp) if bc==c then bc=Duel.GetAttackTarget() end return bc and bc:IsFaceup() and bc:GetAttack()>c:GetAttack() end -function s.tbcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.tbop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=Duel.GetAttacker() @@ -69,4 +65,4 @@ function s.dfilter(c,atk) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511000192.lua b/unofficial/c511000192.lua index c61e684889..d06814dacd 100644 --- a/unofficial/c511000192.lua +++ b/unofficial/c511000192.lua @@ -39,9 +39,9 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e4:SetCountLimit(1) - e4:SetCost(s.cost) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetOperation(s.op2) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) --Prevent Effect damage local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(20450925,0)) @@ -49,9 +49,9 @@ function s.initial_effect(c) e5:SetCode(EVENT_FREE_CHAIN) e5:SetRange(LOCATION_MZONE) e5:SetCountLimit(1) - e5:SetCost(s.cost) + e5:SetCost(Cost.DetachFromSelf(1)) e5:SetOperation(s.op3) - c:RegisterEffect(e5,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e5) end s.xyz_number=0 function s.xyzfilter(c,xyz,sumtype,tp) @@ -69,10 +69,6 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) Duel.GetControl(bc,tp,PHASE_BATTLE,1) end end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.op2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then @@ -104,4 +100,4 @@ function s.damval(e,re,val,r,rp,rc) else return val end -end \ No newline at end of file +end diff --git a/unofficial/c511000230.lua b/unofficial/c511000230.lua index 8695cf0778..f1775dcf3a 100644 --- a/unofficial/c511000230.lua +++ b/unofficial/c511000230.lua @@ -10,10 +10,10 @@ function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLED) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -39,4 +39,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/unofficial/c511000231.lua b/unofficial/c511000231.lua index c0b60518c1..8a438d5e49 100644 --- a/unofficial/c511000231.lua +++ b/unofficial/c511000231.lua @@ -10,10 +10,10 @@ function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLED) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -39,4 +39,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/unofficial/c511000232.lua b/unofficial/c511000232.lua index 9ea5bb9c53..1a52b9265d 100644 --- a/unofficial/c511000232.lua +++ b/unofficial/c511000232.lua @@ -10,10 +10,10 @@ function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLED) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -39,4 +39,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/unofficial/c511000233.lua b/unofficial/c511000233.lua index 0e136fcf1b..94da5a40ee 100644 --- a/unofficial/c511000233.lua +++ b/unofficial/c511000233.lua @@ -10,10 +10,10 @@ function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLED) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -39,4 +39,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/unofficial/c511000277.lua b/unofficial/c511000277.lua index c4f8476f1e..195bdac313 100644 --- a/unofficial/c511000277.lua +++ b/unofficial/c511000277.lua @@ -93,12 +93,12 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.damcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) e1:SetLabel(e:GetLabel()) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP) end end @@ -114,4 +114,4 @@ end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511000294.lua b/unofficial/c511000294.lua index 5e6fe90250..3282eb6fe3 100644 --- a/unofficial/c511000294.lua +++ b/unofficial/c511000294.lua @@ -39,10 +39,10 @@ function s.initial_effect(c) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) - e4:SetCost(s.descost) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.destg) e4:SetOperation(s.desop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) --Destroy and Special Summon (Battle Phase) local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) @@ -86,10 +86,6 @@ function s.desrepop(e,tp,eg,ep,ev,re,r,rp) tc:SetStatus(STATUS_DESTROY_CONFIRMED,false) Duel.Destroy(tc,REASON_EFFECT+REASON_REPLACE) end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.desfilter(c,e,tp) return Duel.IsExistingMatchingCard(s.xyzfilter,c:GetControler(),LOCATION_EXTRA,0,1,nil,e,tp,c) end @@ -143,4 +139,4 @@ function s.bpop(e,tp,eg,ep,ev,re,r,rp) g=g:Select(tp,ft,ft,nil) end Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) -end \ No newline at end of file +end diff --git a/unofficial/c511000296.lua b/unofficial/c511000296.lua index fd9de74524..5cef578757 100644 --- a/unofficial/c511000296.lua +++ b/unofficial/c511000296.lua @@ -58,10 +58,10 @@ function s.initial_effect(c) e7:SetCode(EVENT_BE_BATTLE_TARGET) e7:SetRange(LOCATION_MZONE) e7:SetCondition(s.nacon) - e7:SetCost(s.nacost) + e7:SetCost(Cost.DetachFromSelf(1)) e7:SetTarget(s.natg) e7:SetOperation(s.naop) - c:RegisterEffect(e7,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e7) --number generic effect local e8=Effect.CreateEffect(c) e8:SetType(EFFECT_TYPE_SINGLE) @@ -124,10 +124,6 @@ function s.nacon(e,tp,eg,ep,ev,re,r,rp) local d=Duel.GetAttackTarget() return d and d:IsControler(tp) end -function s.nacost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.natg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetAttacker():IsOnField() end Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,Duel.GetAttacker():GetAttack()) @@ -136,4 +132,4 @@ function s.naop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateAttack() then Duel.Recover(tp,Duel.GetAttacker():GetAttack(),REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511000369.lua b/unofficial/c511000369.lua index a1e28861a0..7026a583b9 100644 --- a/unofficial/c511000369.lua +++ b/unofficial/c511000369.lua @@ -43,9 +43,9 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetCountLimit(1) e4:SetRange(LOCATION_MZONE) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetOperation(s.regop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) --Cannot be destroyed by battle local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) @@ -184,4 +184,4 @@ function s.stcheck(e,tp,eg,ep,ev,re,r,rp) tc=g:GetNext() end end -end \ No newline at end of file +end diff --git a/unofficial/c511000512.lua b/unofficial/c511000512.lua index a64dbe176d..bef76672d6 100644 --- a/unofficial/c511000512.lua +++ b/unofficial/c511000512.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_DAMAGE_STEP_END) e1:SetCondition(s.condition) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -29,10 +29,6 @@ s.xyz_number=28 function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttackTarget()==nil and Duel.GetAttacker()==e:GetHandler() end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)>0 end Duel.SetTargetPlayer(1-tp) @@ -44,4 +40,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511000513.lua b/unofficial/c511000513.lua index 0b9fd3eaf2..53c08e5a44 100644 --- a/unofficial/c511000513.lua +++ b/unofficial/c511000513.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.desatchtg) e2:SetOperation(s.desatchop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --If this card would be banished, you can detach 1 material from this card instead local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) @@ -55,4 +55,4 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) c:RemoveOverlayCard(tp,1,1,REASON_COST) return true else return false end -end \ No newline at end of file +end diff --git a/unofficial/c511000515.lua b/unofficial/c511000515.lua index e289a2e9cc..2fec8dee3c 100644 --- a/unofficial/c511000515.lua +++ b/unofficial/c511000515.lua @@ -28,9 +28,9 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_DAMAGE_STEP_END) e3:SetCondition(s.atcon) - e3:SetCost(s.atcost) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetOperation(s.atop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --remove local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) @@ -93,10 +93,6 @@ function s.atcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return Duel.GetAttacker()==c and c:CanChainAttack() end -function s.atcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.atop(e,tp,eg,ep,ev,re,r,rp) Duel.ChainAttack() end @@ -122,4 +118,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511000674.lua b/unofficial/c511000674.lua index 2ebcb10001..4150705208 100644 --- a/unofficial/c511000674.lua +++ b/unofficial/c511000674.lua @@ -29,10 +29,10 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) - e4:SetCost(s.cost) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.target) e4:SetOperation(s.operation) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end function s.bttg(e,c) return not c:IsSpecialSummoned() @@ -40,10 +40,6 @@ end function s.atkfilter(e,c) return c:IsSpecialSummoned() end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsSpecialSummoned() and c:IsFaceup() and c:GetAttack()>0 end @@ -60,4 +56,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE+RESET_PHASE+PHASE_END) e:GetHandler():RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c511000675.lua b/unofficial/c511000675.lua index 8b32cacad9..0ae3bb257f 100644 --- a/unofficial/c511000675.lua +++ b/unofficial/c511000675.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.atkfilter(c) return c:IsLevelAbove(5) and c:HasNonZeroAttack() @@ -49,4 +49,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e2) end end -end \ No newline at end of file +end diff --git a/unofficial/c511001247.lua b/unofficial/c511001247.lua index e6ab665c66..d215faf304 100644 --- a/unofficial/c511001247.lua +++ b/unofficial/c511001247.lua @@ -10,14 +10,10 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.spcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) @@ -34,4 +30,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/unofficial/c511001273.lua b/unofficial/c511001273.lua index 5f716870c2..38dcd0a9e0 100644 --- a/unofficial/c511001273.lua +++ b/unofficial/c511001273.lua @@ -14,10 +14,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atkcon) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --to grave local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) @@ -56,10 +56,6 @@ s.xyz_number=37 function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end end @@ -143,4 +139,4 @@ function s.numspop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/unofficial/c511001275.lua b/unofficial/c511001275.lua index 50b8e107de..b44b5bad61 100644 --- a/unofficial/c511001275.lua +++ b/unofficial/c511001275.lua @@ -32,9 +32,9 @@ function s.initial_effect(c) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.con) - e3:SetCost(s.cost) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetOperation(s.op) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --gain atk local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,3)) @@ -98,10 +98,6 @@ end function s.con(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp and Duel.GetAttackTarget()~=e:GetHandler() end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.op(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then @@ -150,4 +146,4 @@ function s.atkop2(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511001338.lua b/unofficial/c511001338.lua index 674d2c3443..d8b982ef1f 100644 --- a/unofficial/c511001338.lua +++ b/unofficial/c511001338.lua @@ -31,10 +31,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(s.descost) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --battle indestructable local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) @@ -75,10 +75,6 @@ function s.mtop(e,tp,eg,ep,ev,re,r,rp) Duel.Overlay(c,g) end end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsDestructable() end if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end @@ -102,4 +98,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511001339.lua b/unofficial/c511001339.lua index ae4969f7d3..6df32f8530 100644 --- a/unofficial/c511001339.lua +++ b/unofficial/c511001339.lua @@ -11,10 +11,13 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_COUNTER) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BE_BATTLE_TARGET) - e1:SetCost(s.cost) + e1:SetCost(Cost.Choice( + {Cost.DetachFromSelf(1),aux.Stringid(id,1)}, + {s.cost,aux.Stringid(id,2)} + )) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Cannot be destroyed by battle, expect with "Number" monsters local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -25,14 +28,7 @@ end s.xyz_number=2 s.counter_place_list={0x1101} function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local op1Con=e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - local op2Con=Duel.GetAttacker():GetCounter(0x1101)>0 - if chk==0 then return op1Con or op2Con end - local op=Duel.SelectEffect(tp,{op1Con,aux.Stringid(id,1)},{op2Con,aux.Stringid(id,2)}) - if op==1 then - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - end - e:SetLabel(op) + if chk==0 then return Duel.GetAttacker():GetCounter(0x1101)>0 end end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end @@ -82,4 +78,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.condition(e) return e:GetHandler():GetCounter(0x1101)>0 -end \ No newline at end of file +end diff --git a/unofficial/c511001363.lua b/unofficial/c511001363.lua index 0842a5bbc1..3ef4671a6f 100644 --- a/unofficial/c511001363.lua +++ b/unofficial/c511001363.lua @@ -1,123 +1,131 @@ ---CX 冀望皇バリアン (Anime) +--CX 冀望皇バリアン (Anime) --CXyz Barian Hope (Anime) ---Rescripted by Larry126 local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,7,3,nil,nil,Xyz.InfiniteMats) c:EnableReviveLimit() + --Xyz Summon procedure: 3+ Level 7 monsters + Xyz.AddProcedure(c,nil,7,3,nil,nil,Xyz.InfiniteMats) + --For this card's Xyz Summon, you can treat all "Number C10X" Xyz Monsters on the field as Level 7 + local e0a=Effect.CreateEffect(c) + e0a:SetType(EFFECT_TYPE_FIELD) + e0a:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e0a:SetCode(EFFECT_XYZ_MATERIAL) + e0a:SetRange(0xff&~LOCATION_MZONE) + e0a:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e0a:SetTarget(s.xyztg) + e0a:SetValue(function(e,ec,rc,tp) return rc==e:GetHandler() end) + c:RegisterEffect(e0a) + local e0b=e0a:Clone() + e0b:SetCode(EFFECT_XYZ_LEVEL) + e0b:SetValue(function(e,mc,rc) return rc==e:GetHandler() and 7,mc:GetLevel() or mc:GetLevel() end) + c:RegisterEffect(e0b) + --This card's ATK is equal to the number of Xyz Materials attached to it x 1000 local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_XYZ_MATERIAL) - e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) - e1:SetRange(0xff&~LOCATION_MZONE) - e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) - e1:SetTarget(s.xyztg) - e1:SetValue(function(e,ec,rc,tp) return rc==e:GetHandler() end) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetRange(LOCATION_MZONE) + e1:SetValue(function(e,ec) return ec:GetOverlayCount()*1000 end) c:RegisterEffect(e1) - local e2=e1:Clone() - e2:SetCode(EFFECT_XYZ_LEVEL) - e2:SetValue(function(e,mc,rc) return rc==e:GetHandler() and 7,mc:GetLevel() or mc:GetLevel() end) + --Activate the effect of 1 Xyz Monster attached to this card that activates by detaching its own Xyz Material(s) + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_MZONE) + e2:SetCost(s.copycost) + e2:SetTarget(s.copytg) + e2:SetOperation(s.copyop) c:RegisterEffect(e2) - --atk - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_UPDATE_ATTACK) - e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e3:SetRange(LOCATION_MZONE) - e3:SetValue(function(e,ec) return ec:GetOverlayCount()*1000 end) - c:RegisterEffect(e3) - --copy - local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_SINGLE) - e4:SetCode(id) - e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e4:SetRange(LOCATION_MZONE) - c:RegisterEffect(e4) - aux.GlobalCheck(s,function() - --Copy - local ge1=Effect.GlobalEffect() - ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - ge1:SetCode(EVENT_ADJUST) - ge1:SetCondition(s.con) - ge1:SetOperation(s.op) - Duel.RegisterEffect(ge1,0) - end) end s.listed_series={SET_NUMBER_C} -function s.cfilter(c) - return c:IsHasEffect(511002571) and c:GetFlagEffect(5110013630)==0 -end -function s.con(e) - return Duel.IsExistingMatchingCard(s.cfilter,0,LOCATION_ALL,LOCATION_ALL,1,nil) +function s.xyztg(e,c) + local no=c.xyz_number + return c:IsFaceup() and no and no>=101 and no<=107 and c:IsSetCard(SET_NUMBER_C) end -function s.op(e) - local g=Duel.GetMatchingGroup(s.cfilter,0,LOCATION_ALL,LOCATION_ALL,nil) - for c in aux.Next(g) do - local effs={c:GetCardEffect(511002571)} - for _,eff in ipairs(effs) do - local te=eff:GetLabelObject() - if te:GetCode()&511001822==511001822 or te:GetLabel()==511001822 then te=te:GetLabelObject() end - local resetflag,resetcount=te:GetReset() - local rm,max,code,flag,hopt=te:GetCountLimit() - local prop1,prop2=te:GetProperty() - local e1=Effect.CreateEffect(c) - if te:GetDescription() then - e1:SetDescription(te:GetDescription()) - end - e1:SetLabelObject(te) - e1:SetType(EFFECT_TYPE_XMATERIAL+te:GetType()&(~EFFECT_TYPE_SINGLE)) - if te:GetCode()>0 then - e1:SetCode(te:GetCode()) - end - e1:SetProperty(prop1|EFFECT_FLAG_CARD_TARGET,prop2) - e1:SetCondition(s.copycon(c)) - e1:SetCost(s.copycost(c)) - if max>0 then - e1:SetCountLimit(max,{code,hopt},flag) - end - if te:GetTarget() then - e1:SetTarget(te:GetTarget()) - end - if te:GetOperation() then - e1:SetOperation(te:GetOperation()) +function s.copyfilter(c,e,tp) + if not c:IsType(TYPE_XYZ) or c:HasFlagEffect(id) then return false end + local effs={c:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:HasDetachCost() then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + return true end - if resetflag>0 and resetcount>0 then - e1:SetReset(resetflag,resetcount) - elseif resetflag>0 then - e1:SetReset(resetflag) - end - c:RegisterEffect(e1,true) - c:RegisterFlagEffect(5110013630,resetflag,prop1,resetcount) end end + return false end -function s.copycon(oc) - return function(e,tp,eg,ep,ev,re,r,rp) - local con=e:GetLabelObject():GetCondition() - return e:GetHandler():IsHasEffect(id) and Duel.IsTurnPlayer(tp) - and oc:GetFlagEffect(id)==0 and (not con or con(e,tp,eg,ep,ev,re,r,rp)) +function s.copycost(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + local b1=c:CheckRemoveOverlayCard(tp,1,REASON_COST) + local b2=Duel.CheckLPCost(tp,400) + if chk==0 then return (b1 or b2) and c:GetOverlayGroup():IsExists(s.copyfilter,1,nil,e,tp) end + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) + local sc=c:GetOverlayGroup():FilterSelect(tp,s.copyfilter,1,1,nil,e,tp):GetFirst() + Duel.Hint(HINT_CARD,0,sc:GetOriginalCodeRule()) + sc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) + local op=Duel.SelectEffect(tp,{b1,aux.Stringid(id,2)},{b2,aux.Stringid(id,3)}) + if op==1 then + Duel.SendtoGrave(sc,REASON_COST) + else + Duel.PayLPCost(tp,400) end + local available_effs={} + local effs={sc:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:HasDetachCost() then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + table.insert(available_effs,eff) + end + end + end + e:SetLabelObject(available_effs) end -function s.copycost(oc) - return function(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local a=c:CheckRemoveOverlayCard(tp,1,REASON_COST) - local b=Duel.CheckLPCost(tp,400) - if chk==0 then return a or b end - Duel.Hint(HINT_CARD,0,oc:GetOriginalCode()) - Duel.SetTargetCard(oc) - Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,0)) - local op=Duel.SelectEffect(tp,{a,aux.Stringid(id,1)},{b,aux.Stringid(id,2)}) - if op==1 then - Duel.SendtoGrave(oc,REASON_COST) - else - Duel.PayLPCost(tp,400) +function s.copytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then + local eff=e:GetLabelObject() + return eff and eff:GetTarget() and eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0,chkc) + end + if chk==0 then return true end + local eff=nil + local available_effs=e:GetLabelObject() + if #available_effs>1 then + local available_effs_desc={} + for _,eff in ipairs(available_effs) do + table.insert(available_effs_desc,eff:GetDescription()) end - oc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) + local op=Duel.SelectOption(tp,table.unpack(available_effs_desc)) + eff=available_effs[op+1] + else + eff=available_effs[1] end + Duel.Hint(HINT_OPSELECTED,1-tp,eff:GetDescription()) + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + e:SetProperty(eff:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local tg=eff:GetTarget() + if tg then + tg(e,tp,eg,ep,ev,re,r,rp,1) + end + eff:SetLabel(e:GetLabel()) + eff:SetLabelObject(e:GetLabelObject()) + e:SetLabelObject(eff) + Duel.ClearOperationInfo(0) end -function s.xyztg(e,c) - local no=c.xyz_number - return c:IsFaceup() and no and no>=101 and no<=107 and c:IsSetCard(SET_NUMBER_C) +function s.copyop(e,tp,eg,ep,ev,re,r,rp) + local eff=e:GetLabelObject() + if not eff then return end + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + local op=eff:GetOperation() + if op then + op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) + end + e:SetLabel(0) + e:SetLabelObject(nil) end \ No newline at end of file diff --git a/unofficial/c511001371.lua b/unofficial/c511001371.lua index 1008150b6c..d6a31631e2 100644 --- a/unofficial/c511001371.lua +++ b/unofficial/c511001371.lua @@ -31,7 +31,7 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.cttg) e3:SetOperation(s.ctop) --destroy @@ -47,7 +47,7 @@ function s.initial_effect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_RANKUP_EFFECT) e5:SetLabelObject(e3) - c:RegisterEffect(e5,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e5) local e6=e5:Clone() e6:SetLabelObject(e4) c:RegisterEffect(e6) @@ -96,4 +96,4 @@ end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511001372.lua b/unofficial/c511001372.lua index eccd10d66e..8663cf9533 100644 --- a/unofficial/c511001372.lua +++ b/unofficial/c511001372.lua @@ -30,7 +30,7 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.target) e3:SetOperation(s.operation) --win @@ -46,7 +46,7 @@ function s.initial_effect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_RANKUP_EFFECT) e5:SetLabelObject(e3) - c:RegisterEffect(e5,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e5) local e6=e5:Clone() e6:SetLabelObject(e4) c:RegisterEffect(e6) @@ -71,4 +71,4 @@ function s.winop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():GetOverlayCount()==0 then Duel.Win(tp,WIN_REASON_DISASTER_LEO) end -end \ No newline at end of file +end diff --git a/unofficial/c511001374.lua b/unofficial/c511001374.lua index 21d8ead76b..48bcc3332f 100644 --- a/unofficial/c511001374.lua +++ b/unofficial/c511001374.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(TIMING_BATTLE_PHASE,TIMING_BATTLE_PHASE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.efftg) e2:SetOperation(s.effop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMBER} s.listed_names={CARD_UNKNOWN} @@ -112,4 +112,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) bc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c511001376.lua b/unofficial/c511001376.lua index 6b961880f5..ca02b1ed97 100644 --- a/unofficial/c511001376.lua +++ b/unofficial/c511001376.lua @@ -31,10 +31,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) - e3:SetCost(s.cost) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --return local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) @@ -43,10 +43,10 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetLabelObject(e3) e4:SetCondition(s.retcon) - e4:SetCost(s.cost) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.rettg) e4:SetOperation(s.retop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) --special summon local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) @@ -84,10 +84,6 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e2) end end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end local sg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP) @@ -124,4 +120,4 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp) Duel.MoveToField(tc,tp,tp,tc:GetPreviousLocation(),tc:GetPreviousPosition(),true,(1<0 and c:CheckRemoveOverlayCard(tp,ct,REASON_COST) end - c:RemoveOverlayCard(tp,ct,ct,REASON_COST) -end function s.indestg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local atk=e:GetHandler():GetAttack() @@ -158,4 +152,4 @@ function s.indesop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) Duel.Damage(p,c:GetAttack(),REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511001430.lua b/unofficial/c511001430.lua index 8f14246648..966e21b998 100644 --- a/unofficial/c511001430.lua +++ b/unofficial/c511001430.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e2:SetCode(511001265) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.damcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Special Summon 1 "Number 103: Raganzero" from your GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -90,4 +90,4 @@ end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511001431.lua b/unofficial/c511001431.lua index 88a49cf339..7ba9878600 100644 --- a/unofficial/c511001431.lua +++ b/unofficial/c511001431.lua @@ -30,14 +30,14 @@ function s.initial_effect(c) e3:SetCategory(CATEGORY_DISABLE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.distg) e3:SetOperation(s.disop) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_RANKUP_EFFECT) e4:SetLabelObject(e3) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) aux.DoubleSnareValidity(c,LOCATION_MZONE) end s.listed_series={SET_NUMBER} @@ -69,4 +69,4 @@ end function s.damval(e,re,val,r,rp,rc) if e:GetHandler():IsPosition(POS_FACEUP_ATTACK) and r&REASON_EFFECT==REASON_EFFECT then return 0 else return val end -end \ No newline at end of file +end diff --git a/unofficial/c511001432.lua b/unofficial/c511001432.lua index 57f15397e9..20508f8f8a 100644 --- a/unofficial/c511001432.lua +++ b/unofficial/c511001432.lua @@ -12,14 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.damcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.damcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) @@ -32,4 +28,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) Duel.Damage(p,ct*400,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511001624.lua b/unofficial/c511001624.lua index 792b3a4737..677b008a7f 100644 --- a/unofficial/c511001624.lua +++ b/unofficial/c511001624.lua @@ -13,14 +13,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and (c:GetSummonType()&SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL @@ -37,4 +33,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Damage(1-tp,tc:GetAttack(),REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511001659.lua b/unofficial/c511001659.lua index 8939a76ac2..1544f87f61 100644 --- a/unofficial/c511001659.lua +++ b/unofficial/c511001659.lua @@ -3,18 +3,18 @@ Duel.LoadCardScript("c32559361.lua") local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,10,3) c:EnableReviveLimit() + --Xyz Summon: 3 Level 10 monsters + Xyz.AddProcedure(c,nil,10,3) --Rank Up Check aux.EnableCheckRankUp(c,nil,nil,1992816) - --battle indestructable + --Cannot be destroyed by battle except with "Number" monsters local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(aux.NOT(aux.TargetBoolFunction(Card.IsSetCard,SET_NUMBER))) c:RegisterEffect(e1) - --damage + --Inflict 500 damage to your opponent for each Xyz Material attached to this card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DAMAGE) @@ -25,32 +25,32 @@ function s.initial_effect(c) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) - --damage2 + --Inflict 800 damage to your opponent for each Xyz Material detached to activate this effect local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DAMAGE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetRange(LOCATION_MZONE) - e3:SetCost(s.damcost) + e3:SetCost(Cost.DetachFromSelf(s.damcost,s.damcost,function(e,og) e:SetLabel(#og) end)) e3:SetTarget(s.damtg2) e3:SetOperation(s.damop2) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) - --material + c:RegisterEffect(e3) + --Attach an opponent's monster this card battles to it as material local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_BATTLED) - e4:SetTarget(s.target) - e4:SetOperation(s.operation) - --atk limit + e4:SetTarget(s.attachtg) + e4:SetOperation(s.attachop) + --While this card has Xyz Material, your opponent cannot target monsters for attacks, except this one local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_FIELD) e5:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e5:SetRange(LOCATION_MZONE) e5:SetTargetRange(0,LOCATION_MZONE) - e5:SetCondition(s.atcon) - e5:SetValue(s.atlimit) + e5:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>0 end) + e5:SetValue(function(e,c) return c~=e:GetHandler() end) local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE) e6:SetCode(EFFECT_RANKUP_EFFECT) @@ -61,24 +61,11 @@ function s.initial_effect(c) c:RegisterEffect(e7) end s.listed_series={SET_NUMBER} -s.listed_names={1992816} +s.listed_names={1992816} --"Number 9: Dyson Sphere" s.xyz_number=9 -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local tc=c:GetBattleTarget() - if chk==0 then return tc and c:IsType(TYPE_XYZ) and not tc:IsType(TYPE_TOKEN) and tc:IsAbleToChangeControler() - and not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsOnField() end -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local tc=c:GetBattleTarget() - if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToBattle() and not tc:IsImmuneToEffect(e) then - Duel.Overlay(c,tc,true) - end -end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():GetOverlayCount()>0 end local ct=e:GetHandler():GetOverlayCount() + if chk==0 then return ct>0 end Duel.SetTargetPlayer(1-tp) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*500) end @@ -87,12 +74,8 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local ct=e:GetHandler():GetOverlayCount() Duel.Damage(p,ct*500,REASON_EFFECT) end -function s.damcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - local g=e:GetHandler():GetOverlayGroup() - local ct=#g - Duel.SendtoGrave(g,REASON_COST) - e:SetLabel(ct) +function s.damcost(e,tp) + return e:GetHandler():GetOverlayCount() end function s.damtg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end @@ -105,9 +88,16 @@ function s.damop2(e,tp,eg,ep,ev,re,r,rp) local ct=e:GetLabel() Duel.Damage(p,ct*800,REASON_EFFECT) end -function s.atcon(e) - return e:GetHandler():GetOverlayCount()>0 +function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + local tc=c:GetBattleTarget() + if chk==0 then return tc and c:IsType(TYPE_XYZ) and not tc:IsType(TYPE_TOKEN) and tc:IsAbleToChangeControler() + and not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsOnField() end +end +function s.attachop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=c:GetBattleTarget() + if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToBattle() and not tc:IsImmuneToEffect(e) then + Duel.Overlay(c,tc,true) + end end -function s.atlimit(e,c) - return c~=e:GetHandler() -end \ No newline at end of file diff --git a/unofficial/c511001692.lua b/unofficial/c511001692.lua index 1bb5042c8d..e2367c8b17 100644 --- a/unofficial/c511001692.lua +++ b/unofficial/c511001692.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end s.listed_series={SET_FLOWER_CARDIAN} function s.filter(c) diff --git a/unofficial/c511001693.lua b/unofficial/c511001693.lua index 4f663bcc39..8d337dcc29 100644 --- a/unofficial/c511001693.lua +++ b/unofficial/c511001693.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end s.listed_series={SET_FLOWER_CARDIAN} function s.filter(c) diff --git a/unofficial/c511001694.lua b/unofficial/c511001694.lua index cffcb33a76..bbcc7e2c12 100644 --- a/unofficial/c511001694.lua +++ b/unofficial/c511001694.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end s.listed_series={SET_FLOWER_CARDIAN} function s.filter(c) diff --git a/unofficial/c511001695.lua b/unofficial/c511001695.lua index a296ddc009..0ee19c42bc 100644 --- a/unofficial/c511001695.lua +++ b/unofficial/c511001695.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end function s.filter(c) local re=c:GetReasonEffect() diff --git a/unofficial/c511001696.lua b/unofficial/c511001696.lua index 439b94802d..c22b2322b2 100644 --- a/unofficial/c511001696.lua +++ b/unofficial/c511001696.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end s.listed_series={SET_FLOWER_CARDIAN} function s.filter(c) diff --git a/unofficial/c511001697.lua b/unofficial/c511001697.lua index 8747b9217f..a60925ec10 100644 --- a/unofficial/c511001697.lua +++ b/unofficial/c511001697.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end s.listed_series={SET_FLOWER_CARDIAN} function s.filter(c) diff --git a/unofficial/c511001698.lua b/unofficial/c511001698.lua index f4f022075e..485fdf0c10 100644 --- a/unofficial/c511001698.lua +++ b/unofficial/c511001698.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end function s.filter(c) local re=c:GetReasonEffect() diff --git a/unofficial/c511001699.lua b/unofficial/c511001699.lua index c0b268e7c5..64c6961e88 100644 --- a/unofficial/c511001699.lua +++ b/unofficial/c511001699.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end s.listed_series={SET_FLOWER_CARDIAN} function s.filter(c) diff --git a/unofficial/c511001700.lua b/unofficial/c511001700.lua index afe2ca7ba3..6f02bc7817 100644 --- a/unofficial/c511001700.lua +++ b/unofficial/c511001700.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) --synchro level local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) diff --git a/unofficial/c511001706.lua b/unofficial/c511001706.lua index 56766bc9e0..e6934fe08c 100644 --- a/unofficial/c511001706.lua +++ b/unofficial/c511001706.lua @@ -33,7 +33,7 @@ function s.initial_effect(c) e4:SetCondition(s.efcon) e4:SetTarget(s.eftg) e4:SetLabelObject(e3) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_series={0x48} s.listed_names={86532744} @@ -61,4 +61,4 @@ function s.eftg(e,c) end function s.atkval(e,c) return e:GetHandler():GetRank()*1000 -end \ No newline at end of file +end diff --git a/unofficial/c511001723.lua b/unofficial/c511001723.lua index 5b4e4c7994..298995a54c 100644 --- a/unofficial/c511001723.lua +++ b/unofficial/c511001723.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end function s.filter(c) local re=c:GetReasonEffect() diff --git a/unofficial/c511001724.lua b/unofficial/c511001724.lua index 51a82a7468..5e7e425c12 100644 --- a/unofficial/c511001724.lua +++ b/unofficial/c511001724.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) --synchro level local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) diff --git a/unofficial/c511001725.lua b/unofficial/c511001725.lua index 6f2f944f87..81c175df5d 100644 --- a/unofficial/c511001725.lua +++ b/unofficial/c511001725.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_CARDIAN) + c:RegisterEffect(e1) end function s.filter(c) local re=c:GetReasonEffect() diff --git a/unofficial/c511001776.lua b/unofficial/c511001776.lua index 9c6f9a10e3..0add3ccc20 100644 --- a/unofficial/c511001776.lua +++ b/unofficial/c511001776.lua @@ -60,10 +60,10 @@ function s.initial_effect(c) e6:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e6:SetRange(LOCATION_MZONE) e6:SetCondition(s.discon) - e6:SetCost(s.discost) + e6:SetCost(Cost.DetachFromSelf(1)) e6:SetTarget(s.distg) e6:SetOperation(s.disop) - c:RegisterEffect(e6,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e6) --battle indestructable local e7=Effect.CreateEffect(c) e7:SetType(EFFECT_TYPE_SINGLE) @@ -141,14 +141,10 @@ function s.discon(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and tg:IsExists(s.disfilter,1,nil,eq) and Duel.IsChainDisablable(ev) end -function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) -end \ No newline at end of file +end diff --git a/unofficial/c511001777.lua b/unofficial/c511001777.lua index 29b845567e..21eecc347f 100644 --- a/unofficial/c511001777.lua +++ b/unofficial/c511001777.lua @@ -45,7 +45,7 @@ function s.initial_effect(c) e5:SetRange(LOCATION_MZONE) e5:SetCountLimit(1) e5:SetCondition(s.spcon) - e5:SetCost(Cost.Detach(1)) + e5:SetCost(Cost.DetachFromSelf(1)) e5:SetTarget(s.sptg) e5:SetOperation(s.spop) -- @@ -62,7 +62,7 @@ function s.initial_effect(c) c:RegisterEffect(e8) local e9=e6:Clone() e9:SetLabelObject(e5) - c:RegisterEffect(e9,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e9) end s.listed_series={SET_NUMBER} s.listed_names={56051086,32446631} @@ -115,4 +115,4 @@ function s.rdop(e,tp,eg,ep,ev,re,r,rp) end function s.atkval(e,c) return e:GetHandler():GetOverlayCount()-1 -end \ No newline at end of file +end diff --git a/unofficial/c511001778.lua b/unofficial/c511001778.lua index 6ff8210af1..57eeef7ab9 100644 --- a/unofficial/c511001778.lua +++ b/unofficial/c511001778.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() diff --git a/unofficial/c511001779.lua b/unofficial/c511001779.lua index 96962a6965..dfcaf263b9 100644 --- a/unofficial/c511001779.lua +++ b/unofficial/c511001779.lua @@ -10,10 +10,10 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -22,10 +22,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=19 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) local g=c:GetMaterial():Filter(Card.IsLocation,nil,LOCATION_GRAVE) return c:IsFaceup() and c:IsType(TYPE_XYZ) and #g>0 @@ -45,4 +41,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Overlay(tc,mat) end end -end \ No newline at end of file +end diff --git a/unofficial/c511001781.lua b/unofficial/c511001781.lua index 36b23a9b8c..12670e0ec4 100644 --- a/unofficial/c511001781.lua +++ b/unofficial/c511001781.lua @@ -58,7 +58,7 @@ function s.initial_effect(c) e5:SetDescription(aux.Stringid(id,3)) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetRange(LOCATION_MZONE) - e5:SetCost(s.lpcost) + e5:SetCost(Cost.AND(Cost.DetachFromSelf(3),s.lpcost)) e5:SetTarget(s.lptg) e5:SetOperation(s.lpop) --spsummon @@ -88,7 +88,7 @@ function s.initial_effect(c) c:RegisterEffect(e10) local e11=e7:Clone() e11:SetLabelObject(e5) - c:RegisterEffect(e11,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e11) local e12=e7:Clone() e12:SetLabelObject(e6) c:RegisterEffect(e12) @@ -163,15 +163,14 @@ function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLP(1-tp)~=1 end end function s.lpcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,3,REASON_COST) and Duel.GetActivityCount(tp,ACTIVITY_ATTACK)==0 end - c:RemoveOverlayCard(tp,3,3,REASON_COST) + if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_ATTACK)==0 end + --You canno declare an attack during the turn you activate this effect local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) + e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e1:SetTargetRange(1,0) - e1:SetReset(RESET_PHASE+PHASE_END) + e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.lpop(e,tp,eg,ep,ev,re,r,rp) @@ -206,4 +205,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,true,POS_FACEUP) sc:CompleteProcedure() end -end \ No newline at end of file +end diff --git a/unofficial/c511001791.lua b/unofficial/c511001791.lua index 89da28adb5..1cf0be6a17 100644 --- a/unofficial/c511001791.lua +++ b/unofficial/c511001791.lua @@ -3,7 +3,7 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Xyz Summon procedure: 2 Level 7 Dragon monsters + --Xyz Summon procedure: 2 Level 7 Dragon monsters Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),7,2) --Pendulum procedure Pendulum.AddProcedure(c,false) @@ -39,7 +39,7 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCondition(function(e) return Duel.IsAbleToEnterBP() and s[1-e:GetHandlerPlayer()]>0 end) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.atktg) e4:SetOperation(s.atkop) c:RegisterEffect(e4) @@ -50,7 +50,7 @@ function s.initial_effect(c) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetCode(EVENT_LEAVE_FIELD) - e5:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end) + e5:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end) e5:SetTarget(s.pentg) e5:SetOperation(s.penop) c:RegisterEffect(e5) diff --git a/unofficial/c511001997.lua b/unofficial/c511001997.lua index 4201fffbca..9ac389d55a 100644 --- a/unofficial/c511001997.lua +++ b/unofficial/c511001997.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(s.descost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --equip local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(93568288,0)) @@ -59,10 +59,6 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsFaceup() and c:IsDestructable() end @@ -128,4 +124,4 @@ function s.eqlimit(e,c) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511001998.lua b/unofficial/c511001998.lua index 719701080e..5dec403aad 100644 --- a/unofficial/c511001998.lua +++ b/unofficial/c511001998.lua @@ -32,11 +32,11 @@ function s.initial_effect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) - e4:SetCost(s.spcost) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetCondition(s.spcon) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) --control or destroy local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_DESTROY) @@ -65,10 +65,6 @@ end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c,e,tp) return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end @@ -111,4 +107,4 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511001999.lua b/unofficial/c511001999.lua index 59460491f8..0899bd6cf9 100644 --- a/unofficial/c511001999.lua +++ b/unofficial/c511001999.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.descost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -23,10 +23,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=15 -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsType(TYPE_XYZ) and (c:IsFaceup() or c:GetOverlayCount()>0) end @@ -51,4 +47,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002001.lua b/unofficial/c511002001.lua index a549a418d5..00c8be5dbe 100644 --- a/unofficial/c511002001.lua +++ b/unofficial/c511002001.lua @@ -1,51 +1,49 @@ ---SNo.39 希望皇ホープONE +--SNo.39 希望皇ホープONE (Manga) +--Number S39: Utopia Prime (Manga) Duel.LoadCardScript("c86532744.lua") local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,4,3,s.ovfilter,aux.Stringid(86532744,1)) c:EnableReviveLimit() - --Banish + --Xyz Summon procedure: 3 Level 4 monsters OR 1 "Number 39: Utopia" you control + Xyz.AddProcedure(c,nil,4,3,s.ovfilter,aux.Stringid(id,0)) + --Cannot be destroyed by battle except with "Number" monsters + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e2:SetValue(function(e,c) return not c:IsSetCard(SET_NUMBER) end) + c:RegisterEffect(e2) + --Banish all monsters your opponent controls, and if you do, inflict damage to your opponent equal to the combined ATK of the banished monsters local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE) - e1:SetDescription(aux.Stringid(95100063,0)) + e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --battle indestructable - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) - e2:SetValue(s.indes) - c:RegisterEffect(e2) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(function(e,tp) return e:GetHandler():GetOverlayCount() end),s.lpcost)) + e1:SetTarget(s.rmtg) + e1:SetOperation(s.rmop) + c:RegisterEffect(e1) end s.xyz_number=39 +s.listed_names={84013237} --"Number 39: Utopia" +s.listed_series={SET_NUMBER} function s.ovfilter(c,tp,lc) - return c:IsFaceup() and c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,84013237) + return c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,84013237) and c:IsFaceup() end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.GetLP(tp)>1 end - Duel.SendtoGrave(c:GetOverlayGroup(),REASON_COST) +function s.lpcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLP(tp)>1 end Duel.SetLP(tp,1) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end local sg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.rmop(e,tp,eg,ep,ev,re,r,rp) local sg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil) if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)>0 then local sum=Duel.GetOperatedGroup():GetSum(Card.GetAttack) Duel.Damage(1-tp,sum,REASON_EFFECT) end end -function s.indes(e,c) - return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file diff --git a/unofficial/c511002046.lua b/unofficial/c511002046.lua index dbf369ac6b..33f1e85d60 100644 --- a/unofficial/c511002046.lua +++ b/unofficial/c511002046.lua @@ -41,7 +41,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetCode(EVENT_FREE_CHAIN) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetCondition(s.atkcon) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.atkop) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(tc) @@ -50,7 +50,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(id) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) - e2:SetCost(s.atkcost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) @@ -62,10 +62,6 @@ function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local d=Duel.GetAttackTarget() return a~=nil and d and d==e:GetHandler() and not e:GetHandler():IsStatus(STATUS_CHAINING) end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.NegateAttack() @@ -84,4 +80,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511002054.lua b/unofficial/c511002054.lua index 89a2c2ffdb..b8a6ddff39 100644 --- a/unofficial/c511002054.lua +++ b/unofficial/c511002054.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(10389142,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.spcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -23,10 +23,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=42 -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,10389143,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) end @@ -83,4 +79,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) local tg=g:Filter(s.desfilter,nil,e:GetLabel()) g:DeleteGroup() Duel.Destroy(tg,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511002058.lua b/unofficial/c511002058.lua index 9a0070dada..7be6acf4b6 100644 --- a/unofficial/c511002058.lua +++ b/unofficial/c511002058.lua @@ -10,10 +10,10 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(95100120,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.adcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.adtg) e1:SetOperation(s.adop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --to defense local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_POSITION) @@ -32,10 +32,6 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.xyz_number=52 -function s.adcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.adtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return e:GetHandler():IsDefenseAbove(100) end end @@ -83,4 +79,4 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002059.lua b/unofficial/c511002059.lua index 37db7b8e9e..c147b2187e 100644 --- a/unofficial/c511002059.lua +++ b/unofficial/c511002059.lua @@ -11,22 +11,20 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) - e1:SetLabel(3) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(3),Cost.HintSelectedEffect)) e1:SetTarget(s.destg1) e1:SetOperation(s.desop1) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --destroy2 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(84417082,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) - e2:SetCost(s.cost) - e2:SetLabel(5) + e2:SetCost(Cost.AND(Cost.DetachFromSelf(5),Cost.HintSelectedEffect)) e2:SetTarget(s.destg2) e2:SetOperation(s.desop2) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --battle indestructable local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) @@ -35,12 +33,6 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.xyz_number=91 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local ct=e:GetLabel() - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,ct,REASON_COST) end - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) - e:GetHandler():RemoveOverlayCard(tp,ct,ct,REASON_COST) -end function s.destg1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil) @@ -61,4 +53,4 @@ function s.desop2(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002060.lua b/unofficial/c511002060.lua index 6940ff9779..c5d6bc2af5 100644 --- a/unofficial/c511002060.lua +++ b/unofficial/c511002060.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -24,10 +24,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=50 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDestructable() end if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end @@ -50,4 +46,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002064.lua b/unofficial/c511002064.lua index 5df4682690..d3852a44d9 100644 --- a/unofficial/c511002064.lua +++ b/unofficial/c511002064.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) aux.GlobalCheck(s,function() s[0]=true local ge1=Effect.CreateEffect(c) @@ -36,10 +36,6 @@ s.xyz_number=82 function s.filter(c) return c:IsFaceup() and (c:IsSetCard(0x528) or c:IsCode(31437713)) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) and not e:GetHandler():IsStatus(STATUS_CHAINING) end @@ -99,4 +95,4 @@ function s.unop(e,tp,eg,ep,ev,re,r,rp) ef:Reset() e:Reset() end -end \ No newline at end of file +end diff --git a/unofficial/c511002075.lua b/unofficial/c511002075.lua index 26e009dd03..0480a39134 100644 --- a/unofficial/c511002075.lua +++ b/unofficial/c511002075.lua @@ -12,14 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.spcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:GetRank()0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsType(TYPE_XYZ) @@ -34,4 +30,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 and Duel.SpecialSummon(g,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then g:GetFirst():CompleteProcedure() end -end \ No newline at end of file +end diff --git a/unofficial/c511002076.lua b/unofficial/c511002076.lua index e4ca7c8659..7dcd997c21 100644 --- a/unofficial/c511002076.lua +++ b/unofficial/c511002076.lua @@ -8,14 +8,10 @@ function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsRankBelow(4) @@ -36,4 +32,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e1) tc=g:GetNext() end -end \ No newline at end of file +end diff --git a/unofficial/c511002077.lua b/unofficial/c511002077.lua index be61301aa6..7cce1b6458 100644 --- a/unofficial/c511002077.lua +++ b/unofficial/c511002077.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -23,10 +23,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=17 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then @@ -41,4 +37,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002079.lua b/unofficial/c511002079.lua index 70ffb3c5d7..5aee5537c5 100644 --- a/unofficial/c511002079.lua +++ b/unofficial/c511002079.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.negcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --effect local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) @@ -46,10 +46,6 @@ function s.initial_effect(c) c:RegisterEffect(e4) end s.listed_series={0xba} -function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,nil) end local g=Duel.GetMatchingGroup(Card.IsNegatable,tp,0,LOCATION_ONFIELD,nil) @@ -143,4 +139,4 @@ function s.endop(e,tp,eg,ep,ev,re,r,rp) end function s.unval(e,te) return te:GetOwnerPlayer()~=e:GetHandlerPlayer() -end \ No newline at end of file +end diff --git a/unofficial/c511002088.lua b/unofficial/c511002088.lua index 6d1f50ad3e..a25b4c34b5 100644 --- a/unofficial/c511002088.lua +++ b/unofficial/c511002088.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(29669359,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Cannot be destroyed by battle by non-"Number" monsters local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -24,10 +24,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=61 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil) @@ -49,4 +45,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002090.lua b/unofficial/c511002090.lua index ad188aceaa..6971415aff 100644 --- a/unofficial/c511002090.lua +++ b/unofficial/c511002090.lua @@ -23,9 +23,9 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(s.lpcost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(s.lpop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --lp - 0 materials local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(52090844,0)) @@ -109,10 +109,6 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp) s.equipop(c,e,tp,tc) end end -function s.lpcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.lpop(e,tp,eg,ep,ev,re,r,rp) Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2) end @@ -144,4 +140,4 @@ function s.lpchk(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002091.lua b/unofficial/c511002091.lua index a5aa2e1176..9c29c484b7 100644 --- a/unofficial/c511002091.lua +++ b/unofficial/c511002091.lua @@ -17,10 +17,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.damcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) @@ -75,4 +75,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002092.lua b/unofficial/c511002092.lua index 7acea091ea..192a477018 100644 --- a/unofficial/c511002092.lua +++ b/unofficial/c511002092.lua @@ -15,9 +15,9 @@ function s.initial_effect(c) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atkcon) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -29,10 +29,6 @@ s.xyz_number=73 function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then @@ -46,4 +42,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002111.lua b/unofficial/c511002111.lua index deb5715dc9..5c3bf350e6 100644 --- a/unofficial/c511002111.lua +++ b/unofficial/c511002111.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.discon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Destroy monster targeted by previous effect when it declares an attack local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(50491121,0)) @@ -83,4 +83,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) and Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.Damage(1-tp,tc:GetPreviousAttackOnField(),REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511002112.lua b/unofficial/c511002112.lua index c872a18bb0..b1564c39d6 100644 --- a/unofficial/c511002112.lua +++ b/unofficial/c511002112.lua @@ -12,14 +12,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end @@ -37,4 +33,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.SetLP(p,Duel.GetLP(p)/2) end end -end \ No newline at end of file +end diff --git a/unofficial/c511002384.lua b/unofficial/c511002384.lua index 285336143d..004c7d8ee6 100644 --- a/unofficial/c511002384.lua +++ b/unofficial/c511002384.lua @@ -10,11 +10,11 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(TIMING_DAMAGE_STEP) - e1:SetCondition(s.atkcon) - e1:SetCost(s.atkcost) + e1:SetCondition(aux.StatChangeDamageStepCondition) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Disable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) @@ -26,11 +26,6 @@ end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_EARTH) and c:GetDefense()>0 end @@ -71,4 +66,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) e2:SetReset(RESET_EVENT+0x57a0000) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/unofficial/c511002482.lua b/unofficial/c511002482.lua index 9dfc15b6df..b0818894a6 100644 --- a/unofficial/c511002482.lua +++ b/unofficial/c511002482.lua @@ -20,14 +20,14 @@ function s.initial_effect(c) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_RANKUP_EFFECT) e3:SetLabelObject(e2) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_NUMBER} s.listed_names={88120966} @@ -52,4 +52,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end Duel.Damage(1-tp,atk,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511002543.lua b/unofficial/c511002543.lua index ff030a8259..b6a719300e 100644 --- a/unofficial/c511002543.lua +++ b/unofficial/c511002543.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.discost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Double Snare local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -24,10 +24,6 @@ function s.initial_effect(c) e2:SetCode(3682106) c:RegisterEffect(e2) end -function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsNegatable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end @@ -71,4 +67,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) e4:SetValue(-atk) tg:RegisterEffect(e4) end -end \ No newline at end of file +end diff --git a/unofficial/c511002571.lua b/unofficial/c511002571.lua index 82a7d4f6ca..9b16f9f542 100644 --- a/unofficial/c511002571.lua +++ b/unofficial/c511002571.lua @@ -3,83 +3,57 @@ Duel.LoadScript("c420.lua") local s,id=GetID() function s.initial_effect(c) - --Activate + --Activate 1 "Tachyon" monster's effect that is activated by detaching its own Xyz Material(s) local e1=Effect.CreateEffect(c) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.activate) + e1:SetCost(Cost.PayLP(500)) + e1:SetTarget(s.efftg) + e1:SetOperation(s.effop) c:RegisterEffect(e1) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.CheckLPCost(tp,500) end - Duel.PayLPCost(tp,500) +function s.runfn(fn,eff,re,tp,chk) + return not fn or fn(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,re,REASON_EFFECT,PLAYER_NONE,chk) end -function s.filter(c,e,tp) - if c:IsFacedown() or not c:IsTachyon() or not c:IsHasEffect(id) then return false end - local eff={c:GetCardEffect(id)} - for _,teh in ipairs(eff) do - local te=teh:GetLabelObject() - if te:GetCode()&511001822==511001822 or te:GetLabel()==511001822 then te=te:GetLabelObject() end - local con=te:GetCondition() - local tg=te:GetTarget() - if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE)) - and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) then return true - end +function s.efffilter(c,e,tp) + if c:IsFacedown() or not c:IsTachyon() then return false end + for _,eff in ipairs({c:GetOwnEffects()}) do + if eff:HasDetachCost() and s.runfn(eff:GetCondition(),eff,e,tp) and s.runfn(eff:GetTarget(),eff,e,tp,0) then return true end end return false 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,e,tp) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.efffilter(chkc,e,tp) end + if chk==0 then return Duel.IsExistingTarget(s.efffilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) - Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) + Duel.SelectTarget(tp,s.efffilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) end -function s.activate(e,tp,eg,ep,ev,re,r,rp) +function s.effop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then - local eff={tc:GetCardEffect(id)} - local te=nil - local acd={} - local ac={} - for _,teh in ipairs(eff) do - local temp=teh:GetLabelObject() - if temp:GetCode()&511001822==511001822 or temp:GetLabel()==511001822 then temp=temp:GetLabelObject() end - local con=temp:GetCondition() - local tg=temp:GetTarget() - if (not con or con(temp,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE)) - and (not tg or tg(temp,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) then - table.insert(ac,teh) - table.insert(acd,temp:GetDescription()) - end - end - if #ac==1 then te=ac[1] elseif #ac>1 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) - op=Duel.SelectOption(tp,table.unpack(acd)) - op=op+1 - te=ac[op] - end - if not te then return end - local teh=te - te=teh:GetLabelObject() - if te:GetCode()&511001822==511001822 or te:GetLabel()==511001822 then te=te:GetLabelObject() end - local tg=te:GetTarget() - if tg then tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,1) end - Duel.BreakEffect() - tc:CreateEffectRelation(te) - Duel.BreakEffect() - local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) - for etc in aux.Next(g) do - etc:CreateEffectRelation(te) - end - local operation=te:GetOperation() - if operation then operation(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,1) end - tc:ReleaseEffectRelation(te) - for etc in aux.Next(g) do - etc:ReleaseEffectRelation(te) + if not tc:IsRelateToEffect(e) then return end + local effs={} + local options={} + for _,eff in ipairs({tc:GetOwnEffects()}) do + if eff:HasDetachCost() then + table.insert(effs,eff) + local eff_chk=s.runfn(eff:GetCondition(),eff,e,tp) and s.runfn(eff:GetTarget(),eff,e,tp,0) + table.insert(options,{eff_chk,eff:GetDescription()}) end end -end \ No newline at end of file + local op=#options==1 and 1 or Duel.SelectEffect(tp,table.unpack(options)) + if not op then return end + local te=effs[op] + if not te then return end + Duel.ClearTargetCard() + s.runfn(te:GetTarget(),te,e,tp,1) + Duel.BreakEffect() + tc:CreateEffectRelation(te) + Duel.BreakEffect() + local tg=Duel.GetTargetCards(te) + tg:ForEach(Card.CreateEffectRelation,te) + s.runfn(te:GetOperation(),te,e,tp,1) + tg:ForEach(Card.ReleaseEffectRelation,te) +end diff --git a/unofficial/c511002591.lua b/unofficial/c511002591.lua index 19e4055d62..ac01fac519 100644 --- a/unofficial/c511002591.lua +++ b/unofficial/c511002591.lua @@ -21,7 +21,7 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetHintTiming(0,TIMING_MAIN_END) e2:SetCondition(s.mtcon) - e2:SetCost(s.mtcost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.mttg) e2:SetOperation(s.mtop) c:RegisterEffect(e2) @@ -33,10 +33,6 @@ end function s.mtcon(e,tp,eg,ep,ev,re,r,rp) return (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE) or Duel.IsAbleToEnterBP() end -function s.mtcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.mtfilter(c) return c:IsFaceup() and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) and c:GetFlagEffect(id)==0 end @@ -82,4 +78,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) local tc=e:GetLabelObject() Duel.Destroy(tc,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511002599.lua b/unofficial/c511002599.lua index 53dc14bfc8..4264008391 100644 --- a/unofficial/c511002599.lua +++ b/unofficial/c511002599.lua @@ -19,9 +19,9 @@ function s.initial_effect(c) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCondition(function(e) return Duel.GetAttacker() and not e:GetHandler():IsStatus(STATUS_CHAINING) end) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) Duel.NegateAttack() end) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMBER} -s.xyz_number=39 \ No newline at end of file +s.xyz_number=39 diff --git a/unofficial/c511002658.lua b/unofficial/c511002658.lua index 48ac9d7d43..d60ec72452 100644 --- a/unofficial/c511002658.lua +++ b/unofficial/c511002658.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -23,10 +23,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=10 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) @@ -43,4 +39,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002727.lua b/unofficial/c511002727.lua index 58efdf2783..f5db2c79bb 100644 --- a/unofficial/c511002727.lua +++ b/unofficial/c511002727.lua @@ -34,9 +34,9 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e4:SetCondition(function(e,tp) return Duel.GetBattleDamage(tp)>=Duel.GetLP(tp) end) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetOperation(s.damop) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_series={SET_NUMBER} s.xyz_number=54 @@ -48,4 +48,4 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_PHASE|PHASE_DAMAGE) Duel.RegisterEffect(e1,tp) Duel.SetLP(tp,100,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511002737.lua b/unofficial/c511002737.lua index 3b8208450a..8e19e0d9f8 100644 --- a/unofficial/c511002737.lua +++ b/unofficial/c511002737.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetCode(511001265) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.damcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -42,4 +42,4 @@ end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511002749.lua b/unofficial/c511002749.lua index 7774d0aceb..3851ce5488 100644 --- a/unofficial/c511002749.lua +++ b/unofficial/c511002749.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --desrep local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) @@ -32,10 +32,6 @@ function s.initial_effect(c) c:RegisterEffect(e4) end s.xyz_number=66 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c,ec) return not ec:IsHasCardTarget(c) end @@ -75,4 +71,4 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SendtoGrave(g,REASON_EFFECT) return true else return false end -end \ No newline at end of file +end diff --git a/unofficial/c511002762.lua b/unofficial/c511002762.lua index 9b7e67e6cd..5aa282294d 100644 --- a/unofficial/c511002762.lua +++ b/unofficial/c511002762.lua @@ -1,40 +1,35 @@ --H-C エクスカリバー +--Heroic Champion - Excalibur (Anime) local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_WARRIOR),4,2) c:EnableReviveLimit() - -- + --Xyz Summon procedure: 2 Level 4 Warrior monsters + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_WARRIOR),4,2) + --This card cannot declare an attack unless your LP are 500 or less local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) - e1:SetCondition(s.atkcon) + e1:SetCondition(function(e) return Duel.GetLP(e:GetHandlerPlayer())>500 end) c:RegisterEffect(e1) - --atkup + --Double this card's ATK until the end of the Battle Phase local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(95486586,0)) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_START) - e2:SetCost(s.cost) - e2:SetOperation(s.op) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - local g=e:GetHandler():GetOverlayGroup() - Duel.SendtoGrave(g,REASON_COST) + e2:SetCost(Cost.DetachFromSelf(function(e,tp) return e:GetHandler():GetOverlayCount() end)) + e2:SetOperation(s.atkop) + c:RegisterEffect(e2) end -function s.op(e,tp,eg,ep,ev,re,r,rp) +function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then + --This card's ATK is doubled, until the end of the Battle Phase local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(c:GetAttack()*2) - e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE+RESET_PHASE+PHASE_BATTLE) + e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE|RESET_PHASE|PHASE_BATTLE) c:RegisterEffect(e1) end end -function s.atkcon(e) - return Duel.GetLP(e:GetHandlerPlayer())>500 -end \ No newline at end of file diff --git a/unofficial/c511002763.lua b/unofficial/c511002763.lua index c3ba900c7b..62727ca4a3 100644 --- a/unofficial/c511002763.lua +++ b/unofficial/c511002763.lua @@ -14,21 +14,15 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCondition(s.atkcon) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),Cost.SoftOncePerBattle(id))) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttackTarget() and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()) and (Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()) end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - and e:GetHandler():GetFlagEffect(id)==0 end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE,0,1) -end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetOverlayCount(tp,1,1)>1 end end @@ -45,4 +39,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/unofficial/c511002764.lua b/unofficial/c511002764.lua index 39d25cf594..31f2aa318c 100644 --- a/unofficial/c511002764.lua +++ b/unofficial/c511002764.lua @@ -10,14 +10,10 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.retcost) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.rettg) e1:SetOperation(s.retop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.retcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST) + c:RegisterEffect(e1) end function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end @@ -37,4 +33,4 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(tp,ct1*500,REASON_EFFECT,true) Duel.Damage(1-tp,ct2*500,REASON_EFFECT,true) Duel.RDComplete() -end \ No newline at end of file +end diff --git a/unofficial/c511002778.lua b/unofficial/c511002778.lua index faf71ab0e0..b0ce423352 100644 --- a/unofficial/c511002778.lua +++ b/unofficial/c511002778.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(96470883,1)) @@ -31,10 +31,6 @@ end function s.mfilter(c,xyz,sumtype,tp) return c:IsRace(RACE_MACHINE,xyz,sumtype,tp) and c:IsAttribute(ATTRIBUTE_EARTH,xyz,sumtype,tp) end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=e:GetHandler() end if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_MZONE,0,1,e:GetHandler()) end @@ -84,4 +80,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(tp,atk,REASON_EFFECT,true) Duel.RDComplete() end -end \ No newline at end of file +end diff --git a/unofficial/c511002829.lua b/unofficial/c511002829.lua index 4eb9c6178b..ba7cba4bea 100644 --- a/unofficial/c511002829.lua +++ b/unofficial/c511002829.lua @@ -10,14 +10,10 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(30741334,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) end @@ -47,4 +43,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) g:AddCard(tc2) Duel.SendtoGrave(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511002830.lua b/unofficial/c511002830.lua index 8476c34d44..5f903cc0f2 100644 --- a/unofficial/c511002830.lua +++ b/unofficial/c511002830.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.ctcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.cttg) e1:SetOperation(s.ctop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --destroy & damage local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(75433814,1)) @@ -34,10 +34,6 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.xyz_number=40 -function s.ctcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end end @@ -84,4 +80,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511002839.lua b/unofficial/c511002839.lua index 5afdd13383..da127bad1e 100644 --- a/unofficial/c511002839.lua +++ b/unofficial/c511002839.lua @@ -10,14 +10,10 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(74416224,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsNegatableMonster,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end @@ -44,4 +40,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) end -end \ No newline at end of file +end diff --git a/unofficial/c511002855.lua b/unofficial/c511002855.lua index 0c74702e77..624a437f74 100644 --- a/unofficial/c511002855.lua +++ b/unofficial/c511002855.lua @@ -2,39 +2,40 @@ --CXyz Coach Lord Ultimatrainer (Anime) local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,9,4) c:EnableReviveLimit() + --Xyz Summon procedure: 4 Level 9 monsters + Xyz.AddProcedure(c,nil,9,4) --Rank Up Check aux.EnableCheckRankUp(c,nil,nil,30741334) - --negate + --Make this card become unaffected by a monster effect local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O) - e1:SetCode(EVENT_CHAINING) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) + e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.uncon) e1:SetOperation(s.unop) c:RegisterEffect(e1) - --draw + --Your opponent draws cards equal to the number of Xyz Materials detached local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW+CATEGORY_DAMAGE) - e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetRange(LOCATION_MZONE) - e2:SetCondition(s.condition) - e2:SetCost(s.cost) + e2:SetCondition(aux.bdocon) + e2:SetCost(Cost.DetachFromSelf(1,function(e,tp) return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK) end,function(e,og) e:SetLabel(#og) end)) e2:SetTarget(s.target) e2:SetOperation(s.operation) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_RANKUP_EFFECT) e3:SetLabelObject(e2) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end -s.listed_names={30741334} +s.listed_names={30741334} --"Coach King Giantrainer" function s.uncon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not re:IsActiveType(TYPE_MONSTER) then return false end @@ -86,26 +87,13 @@ function s.unop(e,tp,eg,ep,ev,re,r,rp) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_IMMUNE_EFFECT) + e2:SetValue(function(e,te) return te:IsMonsterEffect() end) e2:SetReset(RESET_CHAIN) - e2:SetValue(s.efilter) c:RegisterEffect(e2) end end -function s.efilter(e,te) - return te:IsActiveType(TYPE_MONSTER) -end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_DECK) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,ct,REASON_COST) - local ct=Duel.GetOperatedGroup():GetCount() - e:SetLabel(ct) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end + if chk==0 then return Duel.IsPlayerCanDraw(1-tp,1) end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(e:GetLabel()) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,e:GetLabel()) @@ -132,4 +120,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) Duel.BreakEffect() Duel.SendtoGrave(sg,REASON_EFFECT) Duel.ShuffleHand(1-tp) -end \ No newline at end of file +end diff --git a/unofficial/c511002858.lua b/unofficial/c511002858.lua index ad84c9b2d7..95f597365c 100644 --- a/unofficial/c511002858.lua +++ b/unofficial/c511002858.lua @@ -25,10 +25,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) - e3:SetCost(s.descost) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg2) e3:SetOperation(s.desop2) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp @@ -46,10 +46,6 @@ function s.desop1(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(tc,REASON_EFFECT) end end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return (c:GetSummonType()&SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL and c:IsDestructable() end @@ -65,4 +61,4 @@ function s.desop2(e,tp,eg,ep,ev,re,r,rp) if ct>0 then Duel.Damage(1-tp,ct*500,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511002864.lua b/unofficial/c511002864.lua index 9b9fff94db..989349b7de 100644 --- a/unofficial/c511002864.lua +++ b/unofficial/c511002864.lua @@ -10,13 +10,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -32,4 +28,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e3:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) c:RegisterEffect(e3) end -end \ No newline at end of file +end diff --git a/unofficial/c511002866.lua b/unofficial/c511002866.lua index f87e938e14..36aaa774e7 100644 --- a/unofficial/c511002866.lua +++ b/unofficial/c511002866.lua @@ -22,7 +22,7 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) --destroy @@ -33,7 +33,7 @@ function s.initial_effect(c) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.descon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) -- @@ -41,18 +41,17 @@ function s.initial_effect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_RANKUP_EFFECT) e4:SetLabelObject(e2) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) local e5=e4:Clone() e5:SetLabelObject(e3) - c:RegisterEffect(e5,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e5) end s.listed_series={SET_NUMBER} s.listed_names={2407234} s.xyz_number=69 function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end - if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) - and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end + if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) end @@ -86,4 +85,4 @@ end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511002868.lua b/unofficial/c511002868.lua index ccbbabb36b..d8af97368e 100644 --- a/unofficial/c511002868.lua +++ b/unofficial/c511002868.lua @@ -2,24 +2,19 @@ --Raidraptor - Rapid Xyz local s,id=GetID() function s.initial_effect(c) - --Activate + --Immediately after this effect resolves, Xyz Summon 1 "Raidraptor" Xyz Monster using monsters you control 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:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END) - e1:SetCondition(s.xyzcon) + e1:SetCondition(function(_,tp) return Duel.IsBattlePhase() and Duel.IsExistingMatchingCard(Card.IsSpecialSummoned,tp,0,LOCATION_MZONE,1,nil) end) e1:SetTarget(s.xyztg) e1:SetOperation(s.xyzop) c:RegisterEffect(e1) end -s.listed_series={0xba} -function s.cfilter(c) - return c:IsSpecialSummoned() -end -function s.xyzcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsBattlePhase() and Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) -end +s.listed_series={SET_RAIDRAPTOR} function s.xyzfilter(c) return c:IsXyzSummonable() and c:IsSetCard(SET_RAIDRAPTOR) end @@ -31,107 +26,61 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,s.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil):GetFirst() if tc then + --The Summoned monster can activate its effects that activate by detaching an Xyz Material(s) local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) - e1:SetTarget(s.tg) - e1:SetOperation(s.op) - e1:SetReset(RESET_EVENT+RESETS_STANDARD&~RESET_TOFIELD+RESET_PHASE+PHASE_END) + e1:SetCondition(function() return Duel.IsBattlePhase() end) + e1:SetTarget(s.acttg) + e1:SetOperation(s.actop) + e1:SetReset(RESET_EVENT|(RESETS_STANDARD&~RESET_TOFIELD)|RESET_PHASE|PHASE_END) tc:RegisterEffect(e1,true) Duel.XyzSummon(tp,tc) end end -function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() - e:SetCategory(0) - e:SetProperty(0) - if chkc then - if not c:IsHasEffect(id) then return false end - local tgeffs={c:GetCardEffect(id)} - for _,tge in ipairs(tgeffs) do - if tge:GetLabel()==ev then return tge:GetLabelObject():GetTarget()(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end - end - return false + local effs={} + for _,eff in ipairs({c:GetOwnEffects(id)}) do + if eff:HasDetachCost() then table.insert(effs,eff) end end - if chk==0 then - if not c:IsHasEffect(511002571) or not Duel.IsBattlePhase() then return false end - local effs={c:GetCardEffect(511002571)} - for _,teh in ipairs(effs) do - local temp=teh:GetLabelObject() - if temp:GetCode()&511001822==511001822 or temp:GetLabel()==511001822 then temp=temp:GetLabelObject() end - if temp:IsHasType(EFFECT_TYPE_IGNITION) then - e:SetCategory(temp:GetCategory()) - e:SetProperty(temp:GetProperty()) - local con=temp:GetCondition() - local cost=temp:GetCost() - local tg=temp:GetTarget() - if (not con or co(e,tp,eg,ep,ev,re,r,rp)) - and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) - and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)) then - return true - end - end + if chkc then + for _,eff in ipairs(effs) do + if eff:GetFieldID()==e:GetLabel() then return eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end end return false end - local effs={c:GetCardEffect(511002571)} - local acd={} - local ac={} - for _,teh in ipairs(effs) do - local temp=teh:GetLabelObject() - if temp:GetCode()&511001822==511001822 or temp:GetLabel()==511001822 then temp=temp:GetLabelObject() end - if temp:IsHasType(EFFECT_TYPE_IGNITION) then - e:SetCategory(temp:GetCategory()) - e:SetProperty(temp:GetProperty()) - local con=temp:GetCondition() - local cost=temp:GetCost() - local tg=temp:GetTarget() - if (not con or con(e,tp,eg,ep,ev,re,r,rp)) - and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) - and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)) then - table.insert(ac,teh) - table.insert(acd,temp:GetDescription()) - end - end + local options={} + local has_option=false + for _,eff in ipairs(effs) do + e:SetCategory(eff:GetCategory()) + e:SetProperty(eff:GetProperty()) + local con=eff:GetCondition() + local cost=eff:GetCost() + local tg=eff:GetTarget() + local eff_chk=eff:GetCountLimit()>0 + and (not con or con(e,tp,eg,ep,ev,re,r,rp)) + and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) + and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0)) + if eff_chk then has_option=true end + table.insert(options,{eff_chk,eff:GetDescription()}) end - local te=nil - if #ac==1 then te=ac[1] elseif #ac>1 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) - local op=Duel.SelectOption(tp,table.unpack(acd))+1 - te=ac[op] - end - local teh=te - te=teh:GetLabelObject() - if te:GetCode()&511001822==511001822 or te:GetLabel()==511001822 then te=te:GetLabelObject() end + e:SetCategory(0) + e:SetProperty(0) + if chk==0 then return has_option end + local op=#options==1 and 1 or Duel.SelectEffect(tp,table.unpack(options)) + if not op then return end + local te=effs[op] + if not te then return end + e:SetLabel(te:GetFieldID()) e:SetCategory(te:GetCategory()) e:SetProperty(te:GetProperty()) local cost=te:GetCost() if cost then cost(e,tp,eg,ep,ev,re,r,rp,1) end local tg=te:GetTarget() - if tg then tg(e,tp,eg,ep,ev,re,r,rp,1,chkc) end + if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end te:UseCountLimit(tp) - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(id) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) - e1:SetLabel(Duel.GetCurrentChain()) - e1:SetLabelObject(te) - e1:SetReset(RESET_CHAIN) - c:RegisterEffect(e1) + e:SetOperation(te:GetOperation()) end -function s.op(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if c:IsHasEffect(id) then - local tgeffs={c:GetCardEffect(id)} - for _,tge in ipairs(tgeffs) do - if tge:GetLabel()==Duel.GetCurrentChain() then - local te=tge:GetLabelObject() - e:SetCategory(te:GetCategory()) - e:SetProperty(te:GetProperty()) - local operation=te:GetOperation() - if operation then operation(e,tp,eg,ep,ev,re,r,rp) end - end - end - end -end \ No newline at end of file diff --git a/unofficial/c511002870.lua b/unofficial/c511002870.lua index f3d0c76533..d5bcfc7d96 100644 --- a/unofficial/c511002870.lua +++ b/unofficial/c511002870.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.disatkchtg) e2:SetOperation(s.disatkchop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Detach all materials from this to prevent this card's destruction (Battle) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -31,8 +31,7 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) e3:SetCondition(s.indescon) - e3:SetCost(s.indescost) - e3:SetTarget(s.indestg) + e3:SetCost(Cost.DetachFromSelf(s.indescost,s.indescost)) e3:SetOperation(s.indesop) c:RegisterEffect(e3) --Detach all materials from this to prevent this card's destruction (Card effect) @@ -104,14 +103,8 @@ function s.indescon2(e,tp,eg,ep,ev,re,r,rp) local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) return ex and tg and tg:IsContains(e:GetHandler()) end -function s.indescost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local ct=c:GetOverlayCount() - if chk==0 then return ct>0 and c:CheckRemoveOverlayCard(tp,ct,REASON_COST) end - c:RemoveOverlayCard(tp,ct,ct,REASON_COST) -end -function s.indestg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end +function s.indescost(e,tp) + return e:GetHandler():GetOverlayCount() end function s.indesop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -137,4 +130,4 @@ function s.indesop(e,tp,eg,ep,ev,re,r,rp) end c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c511002871.lua b/unofficial/c511002871.lua index 98d53206bf..e4313c22ae 100644 --- a/unofficial/c511002871.lua +++ b/unofficial/c511002871.lua @@ -34,14 +34,14 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_CHAINING) e3:SetCondition(s.condition) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.target) e3:SetOperation(s.operation) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_RANKUP_EFFECT) e4:SetLabelObject(e3) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_series={SET_NUMBER} s.listed_names={2061963} @@ -76,4 +76,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2) end end -end \ No newline at end of file +end diff --git a/unofficial/c511002872.lua b/unofficial/c511002872.lua index 264e0e5eac..e6f2a07905 100644 --- a/unofficial/c511002872.lua +++ b/unofficial/c511002872.lua @@ -33,14 +33,14 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_RANKUP_EFFECT) e4:SetLabelObject(e3) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) end s.listed_series={SET_NUMBER} s.listed_names={59627393} @@ -73,4 +73,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 then Duel.Damage(1-tp,g:GetFirst():GetPreviousAttackOnField(),REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c511002873.lua b/unofficial/c511002873.lua index 6bf2fb912b..a17e6f313c 100644 --- a/unofficial/c511002873.lua +++ b/unofficial/c511002873.lua @@ -1,51 +1,48 @@ ---No.58 Burner visor +--No.58 炎圧鬼バーナー・バイサー (Anime) +--Number 58: Burner Visor (Anime) Duel.LoadCardScript("c93108839.lua") local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,4,2) c:EnableReviveLimit() - --equip + --Xyz Summon procedure: 2 Level 4 monsters + Xyz.AddProcedure(c,nil,4,2) + --Cannot be destroyed by battle except with "Number" monsters local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(93108839,0)) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetCategory(CATEGORY_EQUIP) - e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.eqcost) - e1:SetTarget(s.eqtg) - e1:SetOperation(s.eqop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) - --direct + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetValue(function(e,c) return not c:IsSetCard(SET_NUMBER) end) + c:RegisterEffect(e1) + --Equip this card to 1 face-up monster you control local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_EQUIP) - e2:SetCode(EFFECT_DIRECT_ATTACK) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_EQUIP) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_MZONE) + e2:SetCost(Cost.DetachFromSelf(function(e,tp) return e:GetHandler():GetOverlayCount() end)) + e2:SetTarget(s.eqtg) + e2:SetOperation(s.eqop) c:RegisterEffect(e2) - --damage + --The equipped monster can attack directly local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(93108839,2)) - e3:SetCategory(CATEGORY_DAMAGE) - e3:SetType(EFFECT_TYPE_IGNITION) - e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e3:SetRange(LOCATION_SZONE) - e3:SetCondition(s.damcon) - e3:SetCost(s.damcost) - e3:SetTarget(s.damtg) - e3:SetOperation(s.damop) + e3:SetType(EFFECT_TYPE_EQUIP) + e3:SetCode(EFFECT_DIRECT_ATTACK) c:RegisterEffect(e3) - --battle indestructable + --Inflict 500 damage to your opponent local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_SINGLE) - e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) - e4:SetValue(s.indes) + e4:SetDescription(aux.Stringid(id,1)) + e4:SetCategory(CATEGORY_DAMAGE) + e4:SetType(EFFECT_TYPE_IGNITION) + e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e4:SetRange(LOCATION_SZONE) + e4:SetCondition(s.damcon) + e4:SetCost(s.damcost) + e4:SetTarget(s.damtg) + e4:SetOperation(s.damop) c:RegisterEffect(e4) end s.xyz_number=58 -function s.eqcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - local g=e:GetHandler():GetOverlayGroup() - Duel.SendtoGrave(g,REASON_COST) -end +s.listed_series={SET_NUMBER} function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=e:GetHandler() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 @@ -64,14 +61,14 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp) end if not Duel.Equip(tp,c,tc,false) then return end --eqlimit - local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_SINGLE) - e4:SetCode(EFFECT_EQUIP_LIMIT) - e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e4:SetValue(s.eqlimit) - e4:SetReset(RESET_EVENT+RESETS_STANDARD) - e4:SetLabelObject(tc) - c:RegisterEffect(e4) + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetValue(s.eqlimit) + e1:SetReset(RESET_EVENT+RESETS_STANDARD) + e1:SetLabelObject(tc) + c:RegisterEffect(e1) end function s.eqlimit(e,c) return c==e:GetLabelObject() @@ -94,6 +91,3 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end -function s.indes(e,c) - return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file diff --git a/unofficial/c511002896.lua b/unofficial/c511002896.lua index 3986a57fc4..97a6fdaad7 100644 --- a/unofficial/c511002896.lua +++ b/unofficial/c511002896.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) and Duel.IsBattlePhase() and not (Duel.IsPhase(PHASE_DAMAGE) and Duel.IsDamageCalculated()) end) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Draw 1 card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -77,4 +77,4 @@ end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511002912.lua b/unofficial/c511002912.lua index 34cfcc9ffe..b7a721846d 100644 --- a/unofficial/c511002912.lua +++ b/unofficial/c511002912.lua @@ -10,14 +10,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:GetAttack()>0 @@ -39,4 +35,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c511002913.lua b/unofficial/c511002913.lua index 85fe32df51..80ad7f86b2 100644 --- a/unofficial/c511002913.lua +++ b/unofficial/c511002913.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCondition(s.condition) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -30,10 +30,6 @@ s.xyz_number=94 function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end end @@ -53,4 +49,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511003038.lua b/unofficial/c511003038.lua index e4b2dc9b05..76b21f1ef2 100644 --- a/unofficial/c511003038.lua +++ b/unofficial/c511003038.lua @@ -2,168 +2,112 @@ --Ultimate Full Burst local s,id=GetID() function s.initial_effect(c) - --Activate + --Activate an Xyz monster's effect that is activated by detaching its own Xyz Material(s) local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) - e1:SetCondition(s.condition) - e1:SetTarget(s.target) - e1:SetOperation(s.activate) + e1:SetCondition(function() return Duel.IsBattlePhase() end) + e1:SetTarget(s.acttg) + e1:SetOperation(s.actop) c:RegisterEffect(e1) end -s.listed_series={0x95} -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsBattlePhase() -end -function s.cfilter(c,tp) +s.listed_series={SET_RANK_UP_MAGIC} +function s.actfilter(c,tp) local re=c:GetReasonEffect() return c:IsFaceup() and c:IsSummonPlayer(tp) and c:IsType(TYPE_XYZ) and c:IsXyzSummoned() - and re and re:GetHandler():IsSetCard(SET_RANK_UP_MAGIC) and re:IsActiveType(TYPE_SPELL) + and re and re:GetHandler():IsSetCard(SET_RANK_UP_MAGIC) and re:IsSpellEffect() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local g=eg:Filter(s.cfilter,nil,tp) +function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local g=eg:Filter(s.actfilter,nil,tp) if chkc then return g:IsContains(chkc) end if chk==0 then return g:IsExists(Card.IsCanBeEffectTarget,1,nil,e) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local tc=g:FilterSelect(tp,Card.IsCanBeEffectTarget,1,1,nil,e) Duel.SetTargetCard(tc) end -function s.activate(e,tp,eg,ep,ev,re,r,rp) +function s.actop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then - local fid=e:GetHandler():GetFieldID() - tc:RegisterFlagEffect(51103038,RESET_EVENT+RESETS_STANDARD,0,1,fid) + if tc:IsFaceup() and tc:IsRelateToEffect(e) then + local c=e:GetHandler() + local fid=c:GetFieldID() + tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,fid) if Duel.GetCurrentChain()==1 then - local e1=Effect.CreateEffect(e:GetHandler()) + --Activate that monster's effect immediately after this effect resolves + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_CHAIN_SOLVED) e1:SetRange(LOCATION_MZONE) - e1:SetTarget(s.tg) - e1:SetOperation(s.op) - e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN) + e1:SetTarget(s.efftg) + e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_CHAIN) tc:RegisterEffect(e1,true) end - local e2=Effect.CreateEffect(e:GetHandler()) - e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e2:SetCode(EVENT_PHASE+PHASE_END) - e2:SetCountLimit(1) - e2:SetLabel(fid) - e2:SetLabelObject(tc) - e2:SetCondition(s.descon) - e2:SetOperation(s.desop) - Duel.RegisterEffect(e2,tp) + --During the End Phase, destroy that monster + aux.DelayedOperation(tc,PHASE_END,id,e,tp,function(ag) Duel.Destroy(ag,REASON_EFFECT) end,nil,0) end end -function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() - if chkc then - if not c:IsHasEffect(id) then return false end - local tgeffs={c:GetCardEffect(id)} - for _,tge in ipairs(tgeffs) do - if tge:GetLabel()==ev then return tge:GetLabelObject():GetTarget()(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end - end - return false + local effs={} + for _,eff in ipairs({c:GetOwnEffects(id)}) do + if eff:HasDetachCost() then table.insert(effs,eff) end end - if chk==0 then - if not c:IsHasEffect(511002571) then return false end - local effs={c:GetCardEffect(511002571)} - for _,teh in ipairs(effs) do - local temp=teh:GetLabelObject() - if temp:GetCode()&511001822==511001822 or temp:GetLabel()==511001822 then temp=temp:GetLabelObject() end - e:SetCategory(temp:GetCategory()) - e:SetProperty(temp:GetProperty()) - local con=temp:GetCondition() - local cost=temp:GetCost() - local tg=temp:GetTarget() - if (not con or con(e,tp,eg,ep,ev,re,r,rp)) - and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) - and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)) then - return true - end + if chkc then + for _,eff in ipairs(effs) do + if eff:GetFieldID()==e:GetLabel() then return eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end end return false end - local effs={c:GetCardEffect(511002571)} - local acd={} - local ac={} - for _,teh in ipairs(effs) do - local temp=teh:GetLabelObject() - if temp:GetCode()&511001822==511001822 or temp:GetLabel()==511001822 then temp=temp:GetLabelObject() end - e:SetCategory(temp:GetCategory()) - e:SetProperty(temp:GetProperty()) - local con=temp:GetCondition() - local cost=temp:GetCost() - local tg=temp:GetTarget() - if (not con or con(e,tp,eg,ep,ev,re,r,rp)) + local options={} + local has_option=false + for _,eff in ipairs(effs) do + e:SetCategory(eff:GetCategory()) + e:SetProperty(eff:GetProperty()) + local con=eff:GetCondition() + local cost=eff:GetCost() + local tg=eff:GetTarget() + local eff_chk=(not con or con(e,tp,eg,ep,ev,re,r,rp)) and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) - and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)) then - table.insert(ac,teh) - table.insert(acd,temp:GetDescription()) - end - end - local te=nil - if #ac==1 then te=ac[1] elseif #ac>1 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) - local op=Duel.SelectOption(tp,table.unpack(acd))+1 - te=ac[op] + and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0)) + if eff_chk then has_option=true end + table.insert(options,{eff_chk,eff:GetDescription()}) end - local teh=te - te=teh:GetLabelObject() - if te:GetCode()&511001822==511001822 or te:GetLabel()==511001822 then te=te:GetLabelObject() end + e:SetCategory(0) + e:SetProperty(0) + if chk==0 then return has_option end + local op=#options==1 and 1 or Duel.SelectEffect(tp,table.unpack(options)) + if not op then return end + local te=effs[op] + if not te then return end + e:SetLabel(te:GetFieldID()) e:SetCategory(te:GetCategory()) e:SetProperty(te:GetProperty()) local cost=te:GetCost() if cost then cost(e,tp,eg,ep,ev,re,r,rp,1) end local tg=te:GetTarget() - if tg then tg(e,tp,eg,ep,ev,re,r,rp,1,chkc) end + if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end te:UseCountLimit(tp) - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(id) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) - e1:SetLabel(Duel.GetCurrentChain()) - e1:SetLabelObject(te) - e1:SetReset(RESET_CHAIN) - c:RegisterEffect(e1) + e:SetOperation(s.effop(te:GetOperation())) end -function s.op(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if c:IsHasEffect(id) then - local tgeffs={c:GetCardEffect(id)} - for _,tge in ipairs(tgeffs) do - if tge:GetLabel()==Duel.GetCurrentChain() then - local te=tge:GetLabelObject() - local operation=te:GetOperation() - if operation then operation(e,tp,eg,ep,ev,re,r,rp) end - end +function s.effop(fn) + return function(e,...) + fn(e,...) + local c=e:GetHandler() + if c:IsFaceup() and c:IsRelateToEffect(e) then + Duel.BreakEffect() + --That monster must attack all monsters your opponent controls, once each, during each Battle Phase this turn + local e1=Effect.CreateEffect(e:GetOwner()) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_MUST_ATTACK) + e1:SetReset(RESETS_STANDARD_PHASE_END) + c:RegisterEffect(e1) + local e2=e1:Clone() + e2:SetCode(EFFECT_ATTACK_ALL) + e2:SetValue(1) + c:RegisterEffect(e2) end - end - if c:IsFaceup() and c:IsRelateToEffect(e) then - Duel.BreakEffect() - local e1=Effect.CreateEffect(e:GetOwner()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_MUST_ATTACK) - e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) - c:RegisterEffect(e1) - local e2=Effect.CreateEffect(e:GetOwner()) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_ATTACK_ALL) - e2:SetValue(1) - e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) - c:RegisterEffect(e2) - end - e:Reset() -end -function s.descon(e,tp,eg,ep,ev,re,r,rp) - local tc=e:GetLabelObject() - if tc:GetFlagEffectLabel(51103038)==e:GetLabel() then - return true - else e:Reset() - return false end end -function s.desop(e,tp,eg,ep,ev,re,r,rp) - local tc=e:GetLabelObject() - Duel.Destroy(tc,REASON_EFFECT) -end \ No newline at end of file diff --git a/unofficial/c511003219.lua b/unofficial/c511003219.lua index a11dc2d5da..9cd2e5a253 100644 --- a/unofficial/c511003219.lua +++ b/unofficial/c511003219.lua @@ -3,9 +3,9 @@ --Scripted by The Razgriz local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,3,2) c:EnableReviveLimit() + --Xyz Summon procedure: 2 Level 3 monsters + Xyz.AddProcedure(c,nil,3,2) --Change battle position/attack target local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) @@ -21,7 +21,7 @@ function s.initial_effect(c) e2:SetCode(EVENT_BATTLE_CONFIRM) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.condition) - e2:SetCost(s.cost) + e2:SetCost(Cost.DetachFromSelf(function(e,tp) return e:GetHandler():GetOverlayCount() end)) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) @@ -56,11 +56,6 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return Duel.GetAttacker()~=c and Duel.GetAttackTarget() and Duel.GetAttackTarget()~=c end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - Duel.SendtoGrave(c:GetOverlayGroup(),REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end end @@ -159,4 +154,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end end end -end \ No newline at end of file +end diff --git a/unofficial/c511003224.lua b/unofficial/c511003224.lua index 5cf80dc9b5..7ad3df0a44 100644 --- a/unofficial/c511003224.lua +++ b/unofficial/c511003224.lua @@ -13,19 +13,15 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.xyzcheck(g,tp,xyz) local mg=g:Filter(Card.IsAttribute,nil,ATTRIBUTE_EARTH) return #mg>0 end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if e:GetHandler():IsDefensePos() then @@ -70,4 +66,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) bc:RegisterEffect(e1) c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE,0,1) end -end \ No newline at end of file +end diff --git a/unofficial/c511003236.lua b/unofficial/c511003236.lua index f25e5d7d91..6ae3ade23d 100644 --- a/unofficial/c511003236.lua +++ b/unofficial/c511003236.lua @@ -17,10 +17,10 @@ function s.initial_effect(c) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e1:SetCountLimit(1) e1:SetCondition(s.atkcon) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Always Battle Destroy local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) @@ -60,4 +60,4 @@ function s.tg(e,c) end function s.val(e,re,c) return re:GetOwnerPlayer()~=e:GetHandlerPlayer() -end \ No newline at end of file +end diff --git a/unofficial/c511004123.lua b/unofficial/c511004123.lua index 541af4a192..2857aab27b 100644 --- a/unofficial/c511004123.lua +++ b/unofficial/c511004123.lua @@ -1,18 +1,18 @@ --ライジング・ホープ --Utopia Rising ---Scripted by urielkama, fixed by ML, updated by the Razgriz local s,id=GetID() function s.initial_effect(c) - --Special Summon N39 Utopia from GY and equip with this card + --Special Summon 1 "Number 39: Utopia" from your Graveyard and equip it with this card 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:SetCost(aux.RemainFieldCost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Destroy Summoned monster if this card leaves the field + --When this card leaves the field, destroy the equipped monster local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e2:SetCode(EVENT_LEAVE_FIELD) @@ -23,96 +23,74 @@ s.listed_names={84013237} function s.spfilter(c,e,tp) return c:IsCode(84013237) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +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) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end -function s.eqlimit(e,c) - return e:GetOwner()==c -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) - local tc=g:GetFirst() - if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then - if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end - Duel.HintSelection(g,true) + local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst() + if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 + and c:IsRelateToEffect(e) and not c:IsStatus(STATUS_LEAVE_CONFIRMED) then + Duel.HintSelection(tc,true) Duel.Equip(tp,c,tc) + local eff_id=e:GetFieldID() + tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,eff_id) --Equip Limit local e0=Effect.CreateEffect(tc) e0:SetType(EFFECT_TYPE_SINGLE) - e0:SetCode(EFFECT_EQUIP_LIMIT) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e0:SetReset(RESET_EVENT+RESETS_STANDARD) - e0:SetValue(s.eqlimit) + e0:SetCode(EFFECT_EQUIP_LIMIT) + e0:SetValue(function(e,c) return e:GetOwner()==c end) + e0:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e0) - --Equipped monster gains effects of all other Xyz monsters on your field + --Equipped monster gains the effects of all Xyz Monsters you control that are activated by detaching their own Xyz Material(s) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_ADJUST) - e1:SetRange(LOCATION_MZONE) + e1:SetLabelObject({}) + e1:SetLabel(eff_id) e1:SetOperation(s.copyop) - e1:SetReset(RESET_EVENT+RESETS_STANDARD) - tc:RegisterEffect(e1) - end -end -function s.desop(e,tp,eg,ep,ev,re,r,rp) - local tc=e:GetHandler():GetFirstCardTarget() - if tc and tc:IsLocation(LOCATION_MZONE) then - Duel.Destroy(tc,REASON_EFFECT) + Duel.RegisterEffect(e1,tp) end end function s.copyop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if not c:GetEquipGroup():IsContains(e:GetOwner()) then e:Reset() return end - if c:IsDisabled() then return end - local map={} - for _,eff in ipairs({c:GetCardEffect(511002571)}) do - map[eff:GetLabel()]=true + local c=e:GetOwner() + local tc=c:GetEquipTarget() + local effs=e:GetLabelObject() + --it the card is no longer equipped, reset everything including this effect + if not tc or tc:GetFlagEffectLabel(id)~=e:GetLabel() then + for _,eff in pairs(effs) do eff:Reset() end + return e:Reset() end - for tc in Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsType,TYPE_XYZ),tp,LOCATION_MZONE,0,e:GetHandler()):Iter() do - local code=tc:GetOriginalCode() - if not map[code] then - for _,te in ipairs({tc:GetCardEffect(511002571)}) do - if te:GetLabel()==code then - local teh=te:GetLabelObject() - if teh:GetCode()&511001822==511001822 or teh:GetLabel()==511001822 then teh=teh:GetLabelObject() end - local tec2=teh:Clone() - c:RegisterEffect(tec2) - local tec=te:Clone() - c:RegisterEffect(tec) - local rste=Effect.CreateEffect(e:GetOwner()) - rste:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - rste:SetCode(EVENT_ADJUST) - rste:SetLabelObject({tec2,tec}) - rste:SetLabel(code) - rste:SetOperation(s.resetop) - Duel.RegisterEffect(rste,tp) - end + --reset copied effects that are no longer applicable, or if the equip card is currently negated + local xg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsType,TYPE_XYZ),tp,LOCATION_MZONE,0,tc) + for src_eff,eff in pairs(effs) do + if c:IsDisabled() or not tc:IsCode(84013237) + or src_eff:IsDeleted() or not src_eff:HasDetachCost() + or not xg:IsContains(src_eff:GetHandler()) then + eff:Reset() + effs[src_eff]=nil + end + end + --copy effects that have not been copied already + for xc in xg:Iter() do + for _,eff in ipairs({xc:GetOwnEffects()}) do + if not effs[eff] and eff:HasDetachCost() then + local ce=eff:Clone() + tc:RegisterEffect(ce) + effs[eff]=ce end end end end -function s.codechk(c,code) - if not c:IsFaceup() or not c:IsType(TYPE_XYZ) then return false end - for _,te in ipairs({c:GetCardEffect(511002571)}) do - if te:GetLabel()==code then return true end +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local tc=e:GetHandler():GetFirstCardTarget() + if tc and tc:IsLocation(LOCATION_MZONE) then + Duel.Destroy(tc,REASON_EFFECT) end - return false end -function s.resetop(e,tp,eg,ep,ev,re,r,rp) - local tc=e:GetOwner():GetEquipTarget() - if not tc or tc:IsDisabled() or e:GetOwner():IsDisabled() - or not Duel.IsExistingMatchingCard(s.codechk,tp,LOCATION_MZONE,0,1,tc,e:GetLabel()) then - for _,eff in ipairs(e:GetLabelObject()) do - if eff then - eff:Reset() - end - end - e:Reset() - end -end \ No newline at end of file diff --git a/unofficial/c511009002.lua b/unofficial/c511009002.lua index 7ed30c9097..37dff2e614 100644 --- a/unofficial/c511009002.lua +++ b/unofficial/c511009002.lua @@ -27,10 +27,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e2:SetCondition(s.btcon) - e2:SetCost(s.btcost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.bttg) e2:SetOperation(s.btop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.filter(c) return c:IsSpecialSummoned() and c:HasNonZeroAttack() @@ -78,10 +78,6 @@ end function s.btcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetBattleDamage(tp)>0 or Duel.GetBattleDamage(1-tp)>0 end -function s.btcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.bttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetFlagEffect(id)==0 end e:GetHandler():RegisterFlagEffect(id,RESET_CHAIN,0,1) @@ -115,4 +111,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/unofficial/c511009026.lua b/unofficial/c511009026.lua index 8ee800bf40..1d2b02c4ef 100644 --- a/unofficial/c511009026.lua +++ b/unofficial/c511009026.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(function() return Duel.IsAbleToEnterBP() end) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.tgfilter(c) return c:IsRace(RACE_MACHINE) and not c:IsHasEffect(EFFECT_DIRECT_ATTACK) and c:IsFaceup() diff --git a/unofficial/c511009062.lua b/unofficial/c511009062.lua index a7afc28519..a1ed5d3a8f 100644 --- a/unofficial/c511009062.lua +++ b/unofficial/c511009062.lua @@ -13,18 +13,14 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.condition) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()==PHASE_MAIN1 end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:GetEffectCount(EFFECT_DIRECT_ATTACK)==0 end @@ -44,4 +40,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c511009074.lua b/unofficial/c511009074.lua index bc77583387..25c572f8a0 100644 --- a/unofficial/c511009074.lua +++ b/unofficial/c511009074.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) local e2=Effect.CreateEffect(c) @@ -24,7 +24,7 @@ function s.initial_effect(c) e2:SetCondition(s.efcon) e2:SetTarget(s.eftg) e2:SetLabelObject(e1) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --negate local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -32,13 +32,13 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_MZONE) - e3:SetCost(s.cost) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetCondition(s.discon) e3:SetTarget(s.distg) e3:SetOperation(s.disop) local e4=e2:Clone() e4:SetLabelObject(e3) - c:RegisterEffect(e4,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e4) --Double Snare local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) @@ -54,10 +54,6 @@ end function s.eftg(e,c) return c==e:GetHandler() end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:HasNonZeroAttack() and c:IsLevelAbove(5) end @@ -112,4 +108,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.NegateEffect(ev) end -end \ No newline at end of file +end diff --git a/unofficial/c511009136.lua b/unofficial/c511009136.lua index 62e8706216..0ed7e99063 100644 --- a/unofficial/c511009136.lua +++ b/unofficial/c511009136.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(s.cost,s.cost)) e1:SetTarget(s.target) e1:SetOperation(s.operation) local e2=Effect.CreateEffect(c) @@ -24,7 +24,7 @@ function s.initial_effect(c) e2:SetCondition(s.efcon) e2:SetTarget(s.eftg) e2:SetLabelObject(e1) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_MATERIAL_CHECK) @@ -59,10 +59,8 @@ function s.valcheck(e,c) c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD_DISABLE-RESET_TOFIELD,0,1) end end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local ct=e:GetHandler():GetOverlayCount() - if chk==0 then return ct>0 and e:GetHandler():CheckRemoveOverlayCard(tp,ct,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,ct,ct,REASON_COST) +function s.cost(e,tp) + return e:GetHandler():GetOverlayCount() end function s.filter(c) return c:IsFaceup() and c:IsControlerCanBeChanged() @@ -136,4 +134,4 @@ function s.op(e,tp,eg,ep,ev,re,r,rp) else e:GetLabelObject():SetLabel(0) end -end \ No newline at end of file +end diff --git a/unofficial/c511009321.lua b/unofficial/c511009321.lua index 28bba89dc6..c776ff01ac 100644 --- a/unofficial/c511009321.lua +++ b/unofficial/c511009321.lua @@ -14,18 +14,14 @@ function s.initial_effect(c) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCountLimit(1) e1:SetCondition(s.condition) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end @@ -53,4 +49,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e3:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e3) end -end \ No newline at end of file +end diff --git a/unofficial/c511009340.lua b/unofficial/c511009340.lua index 3a9458def2..1118ccf320 100644 --- a/unofficial/c511009340.lua +++ b/unofficial/c511009340.lua @@ -4,8 +4,9 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Pendulum.AddProcedure(c,false) + --Xyz Summon procedure: 2 Level 7 Dragon monstes Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),7,2) - --pendulum set + --Place 1 Pendulum Monster from your Deck in your Pendulum Zone local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) @@ -14,26 +15,26 @@ function s.initial_effect(c) e1:SetTarget(s.pctg) e1:SetOperation(s.pcop) c:RegisterEffect(e1) - --material check + --Material check local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_MATERIAL_CHECK) e2:SetValue(s.valcheck) e2:SetLabelObject(e2) c:RegisterEffect(e2) - --extra att + --This card can make a second attack during each Battle Phase local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_EXTRA_ATTACK) e3:SetValue(1) - --destroy + --Negate the effects of all face-up Spells/Traps on the field, and if you do, destroy as many other cards on the field as possible, then this card gains 200 ATK for each card destroyed until the end of this turn local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) - e4:SetCost(s.descost) + e4:SetCost(Cost.DetachFromSelf(function(e,tp) return e:GetHandler():GetOverlayCount() end)) e4:SetTarget(s.destg) e4:SetOperation(s.desop) local e5=Effect.CreateEffect(c) @@ -47,8 +48,8 @@ function s.initial_effect(c) c:RegisterEffect(e5) local e6=e5:Clone() e6:SetLabelObject(e4) - c:RegisterEffect(e6,false,EFFECT_MARKER_DETACH_XMAT) - --To Pendulum + c:RegisterEffect(e6) + --Destroy as many cards in your Pendulum Zones as possible (min. 1), and if you do, place this card in your Pendulum Zone local e7=Effect.CreateEffect(c) e7:SetDescription(aux.Stringid(id,2)) e7:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) @@ -75,11 +76,6 @@ function s.pcop(e,tp,eg,ep,ev,re,r,rp) Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - local ct=e:GetHandler():GetOverlayCount() - if chk==0 then return ct>0 and e:GetHandler():CheckRemoveOverlayCard(tp,ct,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,ct,ct,REASON_COST) -end function s.negfilter(c) return c:IsSpellTrap() and c:IsFaceup() and not c:IsDisabled() end @@ -150,4 +146,4 @@ function s.penop(e,tp,eg,ep,ev,re,r,rp) if Duel.Destroy(g,REASON_EFFECT)~=0 and e:GetHandler():IsRelateToEffect(e) then Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) end -end \ No newline at end of file +end diff --git a/unofficial/c511009387.lua b/unofficial/c511009387.lua index d03c569588..5101021655 100644 --- a/unofficial/c511009387.lua +++ b/unofficial/c511009387.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.cost)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --pendulum local e7=Effect.CreateEffect(c) e7:SetDescription(aux.Stringid(90036274,0)) @@ -33,9 +33,8 @@ function s.initial_effect(c) end s.pendulum_level=7 function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) --indes local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) @@ -86,9 +85,8 @@ function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckPendulumZones(tp) end end function s.penop(e,tp,eg,ep,ev,re,r,rp) - if not Duel.CheckPendulumZones(tp) then return false end local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end -end \ No newline at end of file +end diff --git a/unofficial/c511009462.lua b/unofficial/c511009462.lua index f70756e465..1a4d96f980 100644 --- a/unofficial/c511009462.lua +++ b/unofficial/c511009462.lua @@ -13,14 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end @@ -39,4 +35,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,atk,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/unofficial/c511009480.lua b/unofficial/c511009480.lua index a15393e23b..82d8da6213 100644 --- a/unofficial/c511009480.lua +++ b/unofficial/c511009480.lua @@ -1,36 +1,37 @@ --ギャラクシーアイズ FA・フォトン・ドラゴン (Manga) ---Galaxy Eyes Full Armor Photon Dragon (Manga) +--Galaxy-Eyes Full Armor Photon Dragon (Manga) Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT) local s,id=GetID() function s.initial_effect(c) - Xyz.AddProcedure(c,nil,8,3) c:EnableReviveLimit() - --xyz summon + --Xyz Summon procedure: 3 Level 8 monsters + Xyz.AddProcedure(c,nil,8,3) + --You can also Xyz Summon this card by Tributing a "Galaxy-Eyes Photon Dragon" you control that is equipped with 2 Equip Spells and using those Equip Spells as the Xyz Materials local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_SPSUMMON_PROC) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_EXTRA) e1:SetCondition(s.xyzcon) e1:SetTarget(s.xyztg) e1:SetOperation(s.xyzop) e1:SetValue(SUMMON_TYPE_XYZ) c:RegisterEffect(e1) - --destroy + --Destroy 1 monster your opponent controls local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.descon) - e2:SetCost(s.descost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) - --material + c:RegisterEffect(e2) + --Attach any number of equip cards equipped to this card as materials local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) @@ -41,7 +42,7 @@ function s.initial_effect(c) e3:SetTarget(s.mttg) e3:SetOperation(s.mtop) c:RegisterEffect(e3) - --banish + --Banish both that opponent's monster and this card local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,3)) e4:SetCategory(CATEGORY_DISABLE) @@ -50,7 +51,7 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetCode(EVENT_CHAINING) e4:SetCondition(s.rmcon) - e4:SetCost(s.rmcost) + e4:SetCost(Cost.DetachFromSelf(function(e,tp) return e:GetHandler():GetOverlayCount() end)) e4:SetTarget(s.rmtg) e4:SetOperation(s.rmop) c:RegisterEffect(e4) @@ -97,11 +98,6 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp,c) function s.descon(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,0,1,e:GetHandler()) end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) -end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end @@ -135,10 +131,6 @@ function s.rmcon(e,tp,eg,ep,ev,re,r,rp,chk) local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp end -function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,e:GetHandler():GetOverlayGroup():GetCount(),e:GetHandler():GetOverlayGroup():GetCount(),REASON_COST) -end function s.rmtg(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.filter(chkc) end local c=e:GetHandler() @@ -192,4 +184,4 @@ function s.checkop(e,tp,eg,ep,ev,re,r,rp) end end end -end \ No newline at end of file +end diff --git a/unofficial/c511009508.lua b/unofficial/c511009508.lua index 0b01d28b87..e21b64f824 100644 --- a/unofficial/c511009508.lua +++ b/unofficial/c511009508.lua @@ -30,7 +30,7 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e3:SetCondition(s.atkcon) - e3:SetCost(s.atkcost) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) c:RegisterEffect(e3) @@ -68,10 +68,6 @@ end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetBattleTarget() and e:GetHandler():GetBattleTarget():IsControler(1-tp) end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() local bc=c:GetBattleTarget() @@ -166,4 +162,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e2) end end -end \ No newline at end of file +end diff --git a/unofficial/c511009560.lua b/unofficial/c511009560.lua index cb3074ca07..7abc130b33 100644 --- a/unofficial/c511009560.lua +++ b/unofficial/c511009560.lua @@ -13,9 +13,9 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.indcon) - e1:SetCost(s.indcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.indop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --effect local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) @@ -34,10 +34,6 @@ function s.indcon(e,tp,eg,ep,ev,re,r,rp) local ph=Duel.GetCurrentPhase() return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 end -function s.indcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.indop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then @@ -76,15 +72,11 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE+RESET_PHASE+PHASE_END) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then @@ -127,4 +119,4 @@ function s.dirregop(e,tp,eg,ep,ev,re,r,rp) end function s.dircon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(id)~=0 -end \ No newline at end of file +end diff --git a/unofficial/c511009567.lua b/unofficial/c511009567.lua index 551392e609..ba15947f97 100644 --- a/unofficial/c511009567.lua +++ b/unofficial/c511009567.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.rtgtg) e1:SetOperation(s.rtgop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Allow 1 "Raidraptor" monster to attack multiple times in a row local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -23,7 +23,7 @@ function s.initial_effect(c) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.atkcon) - e2:SetCost(s.atkcost) + e2:SetCost(Cost.DetachFromSelf(function(e,tp) return e:GetHandler():GetOverlayCount() end)) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) @@ -48,13 +48,6 @@ function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return ac and ac:IsRelateToBattle() and ac:IsSetCard(SET_RAIDRAPTOR) and ac:IsControler(tp) and ac:CanChainAttack(ac:GetAttackAnnouncedCount()+1,true) end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local ct=c:GetOverlayCount() - if chk==0 then return ct>0 and c:CheckRemoveOverlayCard(tp,ct,REASON_COST) end - local g=c:GetOverlayGroup() - Duel.SendtoGrave(g,REASON_COST) -end function s.rmfilter(c) return c:IsSetCard(SET_RAIDRAPTOR) and c:IsType(TYPE_XYZ) and c:IsAbleToRemove() end @@ -106,4 +99,4 @@ function s.chainatkop(c,ac) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE|PHASE_DAMAGE_CAL) ac:RegisterEffect(e1) -end \ No newline at end of file +end diff --git a/unofficial/c511009951.lua b/unofficial/c511009951.lua index c34495ce27..99df687dd7 100644 --- a/unofficial/c511009951.lua +++ b/unofficial/c511009951.lua @@ -16,7 +16,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,alias) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --to deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(alias,1)) @@ -83,4 +83,4 @@ function s.checkop(e,tp,eg,ep,ev,re,r,rp) if eg:IsExists(s.cfilter,1,nil,tp) then e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) end -end \ No newline at end of file +end diff --git a/unofficial/c511010007.lua b/unofficial/c511010007.lua index 4297d020fc..a0b64c0faf 100644 --- a/unofficial/c511010007.lua +++ b/unofficial/c511010007.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(TIMING_DAMAGE_STEP) e2:SetCondition(s.atkcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=7 s.roll_dice=true @@ -50,4 +50,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE|RESET_PHASE|PHASE_BATTLE) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c511010009.lua b/unofficial/c511010009.lua index 2e02693b48..54ff6a2a38 100644 --- a/unofficial/c511010009.lua +++ b/unofficial/c511010009.lua @@ -34,9 +34,9 @@ function s.initial_effect(c) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.dacon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetOperation(s.daop) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) --Cannot be destroyed by battle, except by "Number" monsters local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) @@ -90,4 +90,4 @@ function s.daop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c511010010.lua b/unofficial/c511010010.lua index 52b04f36b9..42f4a2a993 100644 --- a/unofficial/c511010010.lua +++ b/unofficial/c511010010.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -24,10 +24,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=10 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) @@ -43,5 +39,5 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) end end function s.indes(e,c) -return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file + return not c:IsSetCard(SET_NUMBER) +end diff --git a/unofficial/c511010011.lua b/unofficial/c511010011.lua index cddc6fa48d..1be87ab55e 100644 --- a/unofficial/c511010011.lua +++ b/unofficial/c511010011.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.cost)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE) @@ -26,9 +26,7 @@ function s.initial_effect(c) end s.xyz_number=11 function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) - and e:GetHandler():GetAttackAnnouncedCount()==0 end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH) @@ -51,4 +49,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010020.lua b/unofficial/c511010020.lua index 8ef5e133ea..5f3d046f2e 100644 --- a/unofficial/c511010020.lua +++ b/unofficial/c511010020.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -23,10 +23,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=20 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then @@ -41,4 +37,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010021.lua b/unofficial/c511010021.lua index c37b6d0af3..f5b4d64b23 100644 --- a/unofficial/c511010021.lua +++ b/unofficial/c511010021.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(s.descost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --battle indestructable local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) @@ -34,10 +34,6 @@ s.xyz_number=21 function s.atkval(e,c) return c:GetOverlayCount()*1000 end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.desfilter(c) return c:IsDefensePos() end @@ -52,4 +48,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010025.lua b/unofficial/c511010025.lua index 8aea3553d6..a9c0188ea0 100644 --- a/unofficial/c511010025.lua +++ b/unofficial/c511010025.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --Cannot be destroyed by battle, except with "Number" monsters local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) @@ -32,10 +32,6 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp) if ep==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end return re:IsMonsterEffect() and Duel.IsChainNegatable(ev) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return re:GetHandler():IsCanBeEffectTarget(e) end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) @@ -63,4 +59,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e3) end end -end \ No newline at end of file +end diff --git a/unofficial/c511010032.lua b/unofficial/c511010032.lua index d2b61a0af7..47ab4737dd 100644 --- a/unofficial/c511010032.lua +++ b/unofficial/c511010032.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCondition(s.atcon) - e1:SetCost(s.atcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.attg) e1:SetOperation(s.atop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -31,10 +31,6 @@ function s.atcon(e,tp,eg,ep,ev,re,r,rp) return c==Duel.GetAttacker() and c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and bc:IsMonster() end -function s.atcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.attg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.GetAttackTarget():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK,1-tp) end @@ -61,4 +57,4 @@ function s.atop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010034.lua b/unofficial/c511010034.lua index 8421d4cd99..157799b972 100644 --- a/unofficial/c511010034.lua +++ b/unofficial/c511010034.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -25,10 +25,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=34 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsFaceup() and c:IsAttackPos() and c:IsLevelBelow(4) and c:IsControlerCanBeChanged() end @@ -47,4 +43,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010039.lua b/unofficial/c511010039.lua index e14df67fac..d34a2433f7 100644 --- a/unofficial/c511010039.lua +++ b/unofficial/c511010039.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(s.atkcon) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.DetachFromSelf(1,1,function(e,og) Duel.Overlay(e:GetHandler():GetBattleTarget(),og) end)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -31,18 +31,6 @@ function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local bc=c:GetBattleTarget() return bc and bc:IsType(TYPE_XYZ) and bc:IsFaceup() and bc:IsControler(1-tp) end -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local bc=c:GetBattleTarget() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - local g=c:GetOverlayGroup() - if #g>0 then - local mg=g:Select(tp,1,1,nil) - Duel.SendtoGrave(mg,REASON_COST) - Duel.RaiseSingleEvent(c,EVENT_DETACH_MATERIAL,e,0,0,0,0) - Duel.Overlay(bc,mg) - end -end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetCard(e:GetHandler():GetBattleTarget()) @@ -68,4 +56,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010047.lua b/unofficial/c511010047.lua index 6193298cb2..a8939f9ee3 100644 --- a/unofficial/c511010047.lua +++ b/unofficial/c511010047.lua @@ -21,7 +21,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.dacon) - e2:SetCost(s.dacost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.datg) e2:SetOperation(s.daop) c:RegisterEffect(e2) @@ -30,7 +30,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetValue(s.indes) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.xyz_number=47 function s.matfilter(c) @@ -50,10 +50,6 @@ end function s.dacon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() end -function s.dacost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) end @@ -87,4 +83,4 @@ function s.ftarget(e,c) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010053.lua b/unofficial/c511010053.lua index 990773ff78..dbf47e9d08 100644 --- a/unofficial/c511010053.lua +++ b/unofficial/c511010053.lua @@ -57,10 +57,10 @@ function s.initial_effect(c) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DAMAGE_STEP) e6:SetCode(id+1) - e6:SetCost(s.bdcost) + e6:SetCost(Cost.DetachFromSelf(1)) e6:SetTarget(s.rectg) e6:SetOperation(s.recop) - c:RegisterEffect(e6,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e6) --battle damage local e7=Effect.CreateEffect(c) e7:SetDescription(aux.Stringid(93730230,0)) @@ -71,10 +71,10 @@ function s.initial_effect(c) e7:SetRange(LOCATION_MZONE) e7:SetCountLimit(1) e7:SetCondition(s.bdcon) - e7:SetCost(s.bdcost) + e7:SetCost(Cost.DetachFromSelf(1)) e7:SetTarget(s.bdtg) e7:SetOperation(s.bdop) - c:RegisterEffect(e7,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e7) --93 Summon local e8=Effect.CreateEffect(c) e8:SetDescription(aux.Stringid(64414267,0)) @@ -169,11 +169,6 @@ end function s.bdcon(e,tp,eg,ep,ev,re,r,rp) return ep==tp end -function s.bdcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.bdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) @@ -211,4 +206,4 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) sc:CompleteProcedure() end -end \ No newline at end of file +end diff --git a/unofficial/c511010056.lua b/unofficial/c511010056.lua index ab6caf1384..1f8786f95a 100644 --- a/unofficial/c511010056.lua +++ b/unofficial/c511010056.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.drcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -24,10 +24,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=56 -function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) @@ -45,4 +41,4 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010064.lua b/unofficial/c511010064.lua index 1b96bc9da5..aa0220fae7 100644 --- a/unofficial/c511010064.lua +++ b/unofficial/c511010064.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.spcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -34,10 +34,6 @@ function s.initial_effect(c) end s.listed_names={39972130} s.xyz_number=64 -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,39972130,0,TYPES_TOKEN,-2,0,1,RACE_BEAST,ATTRIBUTE_EARTH) end @@ -63,4 +59,4 @@ function s.ifilter(c) end function s.indcon(e) return Duel.IsExistingMatchingCard(s.ifilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) -end \ No newline at end of file +end diff --git a/unofficial/c511010065.lua b/unofficial/c511010065.lua index 42876fec53..64e3ca6b06 100644 --- a/unofficial/c511010065.lua +++ b/unofficial/c511010065.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.negdamcon) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.negdamtg) e2:SetOperation(s.negdamop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMBER} s.xyz_number=65 diff --git a/unofficial/c511010083.lua b/unofficial/c511010083.lua index f4b68d9643..662f7c92fd 100644 --- a/unofficial/c511010083.lua +++ b/unofficial/c511010083.lua @@ -11,9 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -22,10 +22,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=83 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) local tc=g:GetFirst() @@ -55,4 +51,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010096.lua b/unofficial/c511010096.lua index eca92322ea..b158df34c2 100644 --- a/unofficial/c511010096.lua +++ b/unofficial/c511010096.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.atkcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE) @@ -23,10 +23,6 @@ function s.initial_effect(c) c:RegisterEffect(e6) end s.xyz_number=96 -function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) local at=Duel.GetAttackTarget() if chk==0 then return ((at and at:IsFaceup() and Duel.GetAttacker()==e:GetHandler()) or at==e:GetHandler()) @@ -56,4 +52,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/c511010103.lua b/unofficial/c511010103.lua index ffd345a68f..ceefc52371 100644 --- a/unofficial/c511010103.lua +++ b/unofficial/c511010103.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e2:SetCode(511001265) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_series={SET_NUMBER} s.xyz_number=103 @@ -47,4 +47,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Draw(tp,1,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/unofficial/c511010104.lua b/unofficial/c511010104.lua index ee564cdf40..0fc9cecf6b 100644 --- a/unofficial/c511010104.lua +++ b/unofficial/c511010104.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) -- local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(2061963,1)) @@ -44,10 +44,6 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp,chk) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp and (ph>PHASE_MAIN1 and ph0 then Duel.Overlay(c,g) end -end \ No newline at end of file +end diff --git a/unofficial/c511010207.lua b/unofficial/c511010207.lua index d83653061a..074827e62a 100644 --- a/unofficial/c511010207.lua +++ b/unofficial/c511010207.lua @@ -21,9 +21,9 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetOperation(s.negop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Double Snare aux.DoubleSnareValidity(c,LOCATION_MZONE) --Three attacks @@ -184,4 +184,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c511010238.lua b/unofficial/c511010238.lua index 88e17a870c..351c93285e 100644 --- a/unofficial/c511010238.lua +++ b/unofficial/c511010238.lua @@ -22,14 +22,14 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_RANKUP_EFFECT) e3:SetLabelObject(e2) - c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e3) end s.listed_series={SET_NUMBER} s.listed_names={92365601} @@ -54,4 +54,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,atk,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/unofficial/c511010239.lua b/unofficial/c511010239.lua index a15225479c..84ec41d481 100644 --- a/unofficial/c511010239.lua +++ b/unofficial/c511010239.lua @@ -33,7 +33,7 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e3:SetHintTiming(TIMING_DAMAGE_STEP) e3:SetCondition(s.atkcon) - e3:SetCost(Cost.Detach(1)) + e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) -- @@ -44,7 +44,7 @@ function s.initial_effect(c) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetLabelObject(e3) - c:RegisterEffect(e5,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e5) end s.listed_series={SET_NUMBER} s.listed_names={84013237} @@ -92,4 +92,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) c:RegisterEffect(e1) end end -end \ No newline at end of file +end diff --git a/unofficial/c511010504.lua b/unofficial/c511010504.lua index 6dd5b2180a..7f144a118c 100644 --- a/unofficial/c511010504.lua +++ b/unofficial/c511010504.lua @@ -13,14 +13,10 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsControlerCanBeChanged() @@ -65,4 +61,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e5) end -end \ No newline at end of file +end diff --git a/unofficial/c511010515.lua b/unofficial/c511010515.lua index c8d74ce7a8..190c36e046 100644 --- a/unofficial/c511010515.lua +++ b/unofficial/c511010515.lua @@ -55,10 +55,10 @@ function s.initial_effect(c) e7:SetDescription(aux.Stringid(id,1)) e7:SetType(EFFECT_TYPE_IGNITION) e7:SetRange(LOCATION_MZONE) - e7:SetCost(s.descost) + e7:SetCost(Cost.DetachFromSelf(1)) e7:SetTarget(s.destg) e7:SetOperation(s.desop) - c:RegisterEffect(e7,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e7) end s.listed_series={0x10af} s.listed_names={47198668} @@ -88,10 +88,6 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp) Duel.Overlay(c,g) end end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.cfilter(c) return c:IsFaceup() and c:IsType(TYPE_PENDULUM) end @@ -109,4 +105,4 @@ end function s.desop(e,tp,eg,ep,ev,re,r,rp) local dg=Duel.GetTargetCards(e) Duel.Destroy(dg,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511015129.lua b/unofficial/c511015129.lua index 33242c0c62..8dfac6bc7d 100644 --- a/unofficial/c511015129.lua +++ b/unofficial/c511015129.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) - e2:SetCost(s.cost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.target) e2:SetOperation(s.operation) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) @@ -27,10 +27,6 @@ end function s.filter(c,seq,flag) return c:GetSequence()==4-seq or (flag~=0 and c:IsLocation(LOCATION_MZONE) and (c:GetSequence()==4-seq+1 or c:GetSequence()==4-seq-1)) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local flag=e:GetHandler():GetFlagEffect(id+1) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_ONFIELD,1,nil,e:GetHandler():GetSequence(),flag) end @@ -40,4 +36,4 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_ONFIELD,nil,e:GetHandler():GetSequence(),e:GetHandler():GetFlagEffect(id+1)) Duel.Destroy(g,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511018510.lua b/unofficial/c511018510.lua index d6b6cef483..7ee90f3f01 100644 --- a/unofficial/c511018510.lua +++ b/unofficial/c511018510.lua @@ -1,148 +1,105 @@ --RUM-光波追撃 --Rank-Up-Magic Cipher Pursuit ---cleaned up by MLD local s,id=GetID() function s.initial_effect(c) - --Activate - local re1=Effect.CreateEffect(c) - re1:SetDescription(aux.Stringid(41201386,0)) - re1:SetCategory(CATEGORY_SPECIAL_SUMMON) - re1:SetType(EFFECT_TYPE_ACTIVATE) - re1:SetCode(EVENT_FREE_CHAIN) - re1:SetProperty(EFFECT_FLAG_CARD_TARGET) - re1:SetCondition(s.condition) - re1:SetTarget(s.target) - re1:SetOperation(s.activate) - c:RegisterEffect(re1) -end -s.listed_series={0xe5} -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return math.abs(Duel.GetLP(tp)-Duel.GetLP(1-tp))>=2000 -end -function s.filter1(c,e,tp) - local rk=c:GetRank() - local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) - return #pg<=1 and c:IsFaceup() and c:IsSetCard(SET_CIPHER) and (rk>0 or c:IsStatus(STATUS_NO_LEVEL)) - and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1,pg) + --Special Summon from your Extra Deck, 1 "Cipher" Xyz Monster that is 1 Rank higher than 1 "Cipher" Xyz Monster you control + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(41201386,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCondition(function() return math.abs(Duel.GetLP(0)-Duel.GetLP(1))>=2000 end) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) end -function s.filter2(c,e,tp,mc,rk,pg) +s.listed_series={SET_CIPHER} +function s.spfilter(c,e,tp,mc,rk,pg) if c.rum_limit and not c.rum_limit(mc,e) then return false end - return c:IsType(TYPE_XYZ) and mc:IsType(TYPE_XYZ,c,SUMMON_TYPE_XYZ,tp) and c:IsRank(rk) and c:IsSetCard(SET_CIPHER) and mc:IsCanBeXyzMaterial(c,tp) + return c:IsType(TYPE_XYZ) and mc:IsType(TYPE_XYZ,c,SUMMON_TYPE_XYZ,tp) + and c:IsRank(rk) and c:IsSetCard(SET_CIPHER) and mc:IsCanBeXyzMaterial(c,tp) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and (#pg<=0 or pg:IsContains(mc)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter1(chkc,e,tp) end - if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end +function s.matfilter(c,e,tp) + local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) + return #pg<=1 and c:IsFaceup() and c:IsSetCard(SET_CIPHER) and c:HasRank() + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank()+1,pg) +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_MZONE) and s.matfilter(chkc,e,tp) end + if chk==0 then return Duel.IsExistingTarget(s.matfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) - Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) + Duel.SelectTarget(tp,s.matfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end -function s.activate(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end +function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if not tc or tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end + if tc:IsFacedown() or not tc:IsRelateToEffect(e) + or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) + or not tc:HasRank() then return end local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(tc),tp,nil,nil,REASON_XYZ) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1,pg) - local sc=g:GetFirst() + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1,pg):GetFirst() if sc then sc:SetMaterial(tc) Duel.Overlay(sc,tc) + --You can activate that Xyz Monster's effect that is activated by detaching its own Xyz Material(s) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) - e1:SetTarget(s.tg) - e1:SetOperation(s.op) + e1:SetTarget(s.acttg) + e1:SetOperation(s.actop) e1:SetReset(RESETS_STANDARD&~RESET_TOFIELD) sc:RegisterEffect(e1,true) Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) sc:CompleteProcedure() end end -function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() - if chkc then - if not c:IsHasEffect(id) then return false end - local tgeffs={c:GetCardEffect(id)} - for _,tge in ipairs(tgeffs) do - if tge:GetLabel()==ev then return tge:GetLabelObject():GetTarget()(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end - end - return false + local effs={} + for _,eff in ipairs({c:GetOwnEffects(id)}) do + if eff:HasDetachCost() then table.insert(effs,eff) end end - if chk==0 then - if not c:IsHasEffect(511002571) then return false end - local effs={c:GetCardEffect(511002571)} - for _,teh in ipairs(effs) do - local temp=teh:GetLabelObject() - if temp:GetCode()&511001822==511001822 or temp:GetLabel()==511001822 then temp=temp:GetLabelObject() end - e:SetCategory(temp:GetCategory()) - e:SetProperty(temp:GetProperty()) - local con=temp:GetCondition() - local cost=temp:GetCost() - local tg=temp:GetTarget() - if (not con or con(e,tp,eg,ep,ev,re,r,rp)) - and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) - and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)) then - return true - end + if chkc then + for _,eff in ipairs(effs) do + if eff:GetFieldID()==e:GetLabel() then return eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end end return false end - local effs={c:GetCardEffect(511002571)} - local acd={} - local ac={} - for _,teh in ipairs(effs) do - local temp=teh:GetLabelObject() - if temp:GetCode()&511001822==511001822 or temp:GetLabel()==511001822 then temp=temp:GetLabelObject() end - e:SetCategory(temp:GetCategory()) - e:SetProperty(temp:GetProperty()) - local con=temp:GetCondition() - local cost=temp:GetCost() - local tg=temp:GetTarget() - if (not con or con(e,tp,eg,ep,ev,re,r,rp)) + local options={} + local has_option=false + for _,eff in ipairs(effs) do + e:SetCategory(eff:GetCategory()) + e:SetProperty(eff:GetProperty()) + local con=eff:GetCondition() + local cost=eff:GetCost() + local tg=eff:GetTarget() + local eff_chk=(not con or con(e,tp,eg,ep,ev,re,r,rp)) and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) - and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)) then - table.insert(ac,teh) - table.insert(acd,temp:GetDescription()) - end + and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0)) + if eff_chk then has_option=true end + table.insert(options,{eff_chk,eff:GetDescription()}) end - local te=nil - if #ac==1 then te=ac[1] elseif #ac>1 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) - local op=Duel.SelectOption(tp,table.unpack(acd))+1 - te=ac[op] - end - local teh=te - te=teh:GetLabelObject() - if te:GetCode()&511001822==511001822 or te:GetLabel()==511001822 then te=te:GetLabelObject() end + e:SetCategory(0) + e:SetProperty(0) + if chk==0 then return has_option end + local op=#options==1 and 1 or Duel.SelectEffect(tp,table.unpack(options)) + if not op then return end + local te=effs[op] + if not te then return end + e:SetLabel(te:GetFieldID()) e:SetCategory(te:GetCategory()) e:SetProperty(te:GetProperty()) local cost=te:GetCost() if cost then cost(e,tp,eg,ep,ev,re,r,rp,1) end local tg=te:GetTarget() - if tg then tg(e,tp,eg,ep,ev,re,r,rp,1,chkc) end + if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end te:UseCountLimit(tp) - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(id) - e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) - e1:SetLabel(Duel.GetCurrentChain()) - e1:SetLabelObject(te) - e1:SetReset(RESET_CHAIN) - c:RegisterEffect(e1) + e:SetOperation(function(e,...) + te:GetOperation()(e,...) + e:Reset() + end) end -function s.op(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if c:IsHasEffect(id) then - local tgeffs={c:GetCardEffect(id)} - for _,tge in ipairs(tgeffs) do - if tge:GetLabel()==Duel.GetCurrentChain() then - local te=tge:GetLabelObject() - local operation=te:GetOperation() - if operation then operation(e,tp,eg,ep,ev,re,r,rp) end - end - end - end - e:Reset() -end \ No newline at end of file diff --git a/unofficial/c511020000.lua b/unofficial/c511020000.lua index fa915a7488..3e984fbc67 100644 --- a/unofficial/c511020000.lua +++ b/unofficial/c511020000.lua @@ -11,9 +11,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --atk/def local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) @@ -45,10 +45,6 @@ s.listed_series={0xba} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() and not e:GetHandler():IsHasEffect(EFFECT_ATTACK_ALL) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then @@ -109,4 +105,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,dam,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/unofficial/c511023000.lua b/unofficial/c511023000.lua index 92b08aae37..c1394da064 100644 --- a/unofficial/c511023000.lua +++ b/unofficial/c511023000.lua @@ -13,15 +13,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.copycost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.copytg) e1:SetOperation(s.copyop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.copycost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.copyfilter(c) return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsType(TYPE_TRAPMONSTER) and not c:IsType(TYPE_TOKEN) @@ -38,4 +33,4 @@ function s.copyop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then c:CopyEffect(tc:GetCode(),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1) end -end \ No newline at end of file +end diff --git a/unofficial/c511027117.lua b/unofficial/c511027117.lua index 5cd7078597..d624a2784b 100644 --- a/unofficial/c511027117.lua +++ b/unofficial/c511027117.lua @@ -19,10 +19,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.diszatg) e2:SetOperation(s.diszaop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end function s.desfilter(c,e) return c:GetAttack()==0 and c:IsPosition(POS_FACEUP) and c:IsDestructable(e) and not c:IsImmuneToEffect(e) @@ -57,4 +57,4 @@ function s.diszaop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/unofficial/c511027118.lua b/unofficial/c511027118.lua index d001aaaf93..0e3f7c6598 100644 --- a/unofficial/c511027118.lua +++ b/unofficial/c511027118.lua @@ -3,19 +3,18 @@ --Scripted by The Razgriz local s,id=GetID() function s.initial_effect(c) - Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT) - --Activate + --Negate an effect that was activated by detaching an Xyz Monster's own Xyz Material(s) local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) - e1:SetCondition(s.condition) - e1:SetTarget(s.target) - e1:SetOperation(s.activate) + e1:SetCondition(s.discon) + e1:SetTarget(s.distg) + e1:SetOperation(s.disop) c:RegisterEffect(e1) --Check for effects that detach material aux.GlobalCheck(s,function() - s[0]=nil local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_DETACH_MATERIAL) @@ -29,37 +28,27 @@ function s.checkop(e,tp,eg,ep,ev,re,r,rp) s[0]=Duel.GetChainInfo(cid,CHAININFO_CHAIN_ID) end end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==s[0] and re:GetHandler():IsType(TYPE_XYZ) and Duel.IsChainDisablable(ev) +function s.discon(e,tp,eg,ep,ev,re,r,rp) + return Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==s[0] and re:GetHandler():IsType(TYPE_XYZ) and Duel.IsChainDisablable(ev) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end -function s.activate(e,tp,eg,ep,ev,re,r,rp) +function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) --Cannot detach for the rest of this turn local e2=Effect.CreateEffect(e:GetHandler()) + e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD) + e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e2:SetCode(EFFECT_CANNOT_ACTIVATE) - e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTargetRange(1,1) - e2:SetCondition(s.accon) e2:SetValue(s.aclimit) - e2:SetReset(RESET_PHASE+PHASE_END) + e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) end -function s.accon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsType,TYPE_XYZ),0,LOCATION_MZONE,LOCATION_MZONE,1,nil) -end function s.aclimit(e,re) - local g=Duel.GetMatchingGroup(s.acfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil) - if not re:IsActiveType(TYPE_XYZ) or g:GetMaxGroup(Card.GetRank):IsContains(re:GetHandler()) then return false end - local eff={re:GetHandler():GetCardEffect(511002571)} - for _,ree in ipairs(eff) do - local te=ree:GetLabelObject() - if te:GetCode()&511001822==511001822 or te:GetLabel()==511001822 then te=te:GetLabelObject() end - if re==te then return true end - end - return false -end \ No newline at end of file + local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsType,TYPE_XYZ),0,LOCATION_MZONE,LOCATION_MZONE,nil) + return g:GetMaxGroup(Card.GetRank):IsContains(re:GetHandler()) or not re:HasDetachCost() +end diff --git a/unofficial/c511050008.lua b/unofficial/c511050008.lua index 09efeda766..2adf878155 100644 --- a/unofficial/c511050008.lua +++ b/unofficial/c511050008.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_POSITION) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(Cost.Detach(1)) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.tg) e1:SetOperation(s.op) c:RegisterEffect(e1) @@ -26,4 +26,4 @@ function s.op(e,tp,eg,ep,ev,re,r,rp) if #tc>0 then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,true) end -end \ No newline at end of file +end diff --git a/unofficial/c511310036.lua b/unofficial/c511310036.lua index ebdc08da10..61fbaeb6dc 100644 --- a/unofficial/c511310036.lua +++ b/unofficial/c511310036.lua @@ -2,109 +2,109 @@ --Allure Palace --Scripted by AlphaKretin local s,id=GetID() +local EFFECT_ALLURE_PALACE_ANIME=511310036 function s.initial_effect(c) - --workaround for e4 + --Activate local e0=Effect.CreateEffect(c) - e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e0:SetCode(EVENT_ADJUST) - e0:SetCountLimit(1) - e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_NO_TURN_RESET) - e0:SetRange(LOCATION_ALL) - e0:SetOperation(s.regop) + e0:SetType(EFFECT_TYPE_ACTIVATE) + e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) - --Activate - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_ACTIVATE) - e1:SetCode(EVENT_FREE_CHAIN) - c:RegisterEffect(e1) - --atk&def - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_FIELD) - e2:SetCode(EFFECT_UPDATE_ATTACK) - e2:SetRange(LOCATION_FZONE) - e2:SetTargetRange(LOCATION_MZONE,0) - e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_ALLURE_QUEEN)) - e2:SetValue(500) - c:RegisterEffect(e2) - local e3=e2:Clone() - e3:SetCode(EFFECT_UPDATE_DEFENSE) - c:RegisterEffect(e3) - --become ignition - local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_FIELD) - e4:SetCode(511310036) --hardcode - e4:SetRange(LOCATION_FZONE) - e4:SetTargetRange(LOCATION_MZONE,0) - e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_ALLURE_QUEEN)) - c:RegisterEffect(e4) - --special summon - local e5=Effect.CreateEffect(c) - e5:SetDescription(aux.Stringid(122520,0)) - e5:SetCategory(CATEGORY_SPECIAL_SUMMON) - e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e5:SetCode(EVENT_SUMMON_SUCCESS) - e5:SetRange(LOCATION_FZONE) - e5:SetProperty(EFFECT_FLAG_CARD_TARGET) - e5:SetCondition(s.spcon) - e5:SetTarget(s.sptg) - e5:SetOperation(s.spop) - c:RegisterEffect(e5) - local e6=e5:Clone() - e6:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e6) + --All "Allure Queen" monsters you control gain 500 ATK/DEF + local e1a=Effect.CreateEffect(c) + e1a:SetType(EFFECT_TYPE_FIELD) + e1a:SetCode(EFFECT_UPDATE_ATTACK) + e1a:SetRange(LOCATION_FZONE) + e1a:SetTargetRange(LOCATION_MZONE,0) + e1a:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_ALLURE_QUEEN)) + e1a:SetValue(500) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EFFECT_UPDATE_DEFENSE) + c:RegisterEffect(e1b) + --Also, you can activate their effects that activate by sending themselves to the GY during your Main Phase + local e2a=Effect.CreateEffect(c) + e2a:SetType(EFFECT_TYPE_FIELD) + e2a:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e2a:SetCode(EFFECT_ALLURE_PALACE_ANIME) + e2a:SetRange(LOCATION_FZONE) + e2a:SetTargetRange(1,0) + c:RegisterEffect(e2a) + local e2b=Effect.CreateEffect(c) + e2b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e2b:SetCode(EVENT_ADJUST) + e2b:SetRange(LOCATION_FZONE) + e2b:SetOperation(s.regop) + c:RegisterEffect(e2b) + --Special Summon to your opponent's field, 1 monster with the same name as an "Allure Queen" monster that was Normal or Special Summoned to your field + local e3a=Effect.CreateEffect(c) + e3a:SetDescription(aux.Stringid(id,0)) + e3a:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3a:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e3a:SetCode(EVENT_SUMMON_SUCCESS) + e3a:SetRange(LOCATION_FZONE) + e3a:SetCondition(s.spcon) + e3a:SetTarget(s.sptg) + e3a:SetOperation(s.spop) + c:RegisterEffect(e3a) + local e3b=e3a:Clone() + e3b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e3b) end s.listed_series={SET_ALLURE_QUEEN} -function s.regop(e) - if s.global_check then return end - s.global_check = true - local g=Duel.GetMatchingGroup(Card.IsOriginalSetCard,0,LOCATION_ALL,LOCATION_ALL,nil,SET_ALLURE_QUEEN) - for tc in g:Iter() do - local effs={tc:GetCardEffect(511310036)} - for _,teh in ipairs(effs) do - local eff=teh:GetLabelObject() - local e1=eff:Clone() - e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetCode(0) - e1:SetCondition(s.igcon) - tc:RegisterEffect(e1) +function s.regop(e,tp) + local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_ALLURE_QUEEN),tp,LOCATION_MZONE,0,nil):Match(aux.NOT(Card.HasFlagEffect),nil,id) + if #g==0 then return end + for allure_card in g:Iter() do + local effs={allure_card:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:HasSelfToGraveCost() and eff:GetCode()&(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)>0 then + allure_card:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) + local condition=eff:GetCondition() + --Ignition Effect version of the "Allure Queen" monster's Trigger Effect + local e1=eff:Clone() + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetCode(0) + e1:SetCondition(function(e,tp) return Duel.IsPlayerAffectedByEffect(tp,EFFECT_ALLURE_PALACE_ANIME) and condition(e,tp) end) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + allure_card:RegisterEffect(e1) + end end end end -function s.eqfilter(c,code) - return c:GetFlagEffect(code)~=0 -end -function s.igcon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return c:IsHasEffect(511310036) and #c:GetEquipGroup():Filter(s.eqfilter,nil,c:GetOriginalCode())>0 -end -function s.cfilter(c,tp) - return c:IsFaceup() and c:IsSetCard(SET_ALLURE_QUEEN) and c:IsControler(tp) +function s.spconfilter(c,tp) + return c:IsSetCard(SET_ALLURE_QUEEN) and c:IsControler(tp) and c:IsFaceup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.cfilter,1,nil,tp) + return eg:IsExists(s.spconfilter,1,nil,tp) +end +function s.tgfilter(c,e,tp) + return c:IsCanBeEffectTarget(e) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode()) end function s.spfilter(c,e,tp,code) return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) end -function s.tgfilter(c,e,tp,eg) - return c:IsFaceup() and eg:IsContains(c) and - Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode()) -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_MZONE) and s.tgfilter(chkc,e,tp,eg) end - if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and - Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,eg) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,eg) + local g=eg:Filter(s.spconfilter,nil,tp):Match(s.tgfilter,nil,e,tp) + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and g:IsContains(chkc) and s.tgfilter(chkc,e,tp) end + if chk==0 then return #g>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end + local tg=nil + if #g==1 then + tg=g + else + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + tg=g:Select(tp,1,1,nil) + end + Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if not tc:IsFaceup() or not tc:IsRelateToEffect(e) or - Duel.GetLocationCount(1-tp,LOCATION_MZONE)<1 then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode()) - if #g>0 then - Duel.SpecialSummon(g,0,tp,1-tp,false,false,POS_FACEUP) + if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode()) + if #g>0 then + Duel.SpecialSummon(g,0,tp,1-tp,false,false,POS_FACEUP) + end end end \ No newline at end of file diff --git a/unofficial/c511600191.lua b/unofficial/c511600191.lua index f3f07b04fe..6a3742577c 100644 --- a/unofficial/c511600191.lua +++ b/unofficial/c511600191.lua @@ -1,18 +1,21 @@ --エクシーズ・ウイング --XYZ Wings ---Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsType,TYPE_XYZ)) - --twice per turn + --You can activate the equipped monster's "once per turn" effects that are activated by detaching its own Xyz Material(s) once again per turn local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e1:SetCode(EVENT_ADJUST) - e1:SetRange(LOCATION_SZONE) - e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetEquipTarget():GetFlagEffect(id)>0 end) - e1:SetOperation(s.tptop) + e1:SetType(EFFECT_TYPE_EQUIP) + e1:SetCode(id) c:RegisterEffect(e1) - --damage + aux.GlobalCheck(s,function() + local ge1=Effect.CreateEffect(c) + ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + ge1:SetCode(EVENT_ADJUST) + ge1:SetOperation(s.checkop) + Duel.RegisterEffect(ge1,0) + end) + --Inflict 500 damage to your opponent local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DAMAGE) @@ -23,104 +26,43 @@ function s.initial_effect(c) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) - --Halve Battle Damage + --Any battle damage you take becomes halved local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) - e3:SetCode(EVENT_LEAVE_FIELD) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e3:SetCode(EVENT_LEAVE_FIELD) e3:SetOperation(s.bdop) c:RegisterEffect(e3) - aux.GlobalCheck(s,function() - OPTEffs={} - AffectedEffs={} - local ge1=Effect.CreateEffect(c) - ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - ge1:SetCode(EVENT_CHAINING) - ge1:SetOperation(s.checkop) - Duel.RegisterEffect(ge1,0) - local ge2=Effect.CreateEffect(c) - ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - ge2:SetCode(EVENT_ADJUST) - ge2:SetCountLimit(1) - ge2:SetOperation(s.clear) - Duel.RegisterEffect(ge2,0) - end) end -function s.checkop(e,tp,eg,ep,ev,re,r,rp) - local rc=re:GetHandler() - if not rc:IsHasEffect(511002571) or re:IsHasProperty(EFFECT_FLAG_NO_TURN_RESET) then return end - local effs={rc:GetCardEffect(511002571)} - local chk=true - for _,eff in ipairs(effs) do - local temp=eff:GetLabelObject() - if temp:GetCode()&511001822==511001822 or temp:GetLabel()==511001822 then temp=temp:GetLabelObject() end - if temp==re then - chk=false - end - end - if chk then return end - local _,ctmax,_,ctflag=re:GetCountLimit() - if ctflag&~EFFECT_COUNT_CODE_SINGLE>0 or ctmax~=1 then return end - if rc:GetFlagEffect(id)==0 then - OPTEffs[rc]={} - AffectedEffs[rc]={} - rc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_END,0,1) - end - for _,te in ipairs(OPTEffs[rc]) do - if te==re then return end - end - table.insert(OPTEffs[rc],re) - if ctflag&EFFECT_COUNT_CODE_SINGLE>0 then - for _,eff in ipairs(effs) do - local te=eff:GetLabelObject() - if te:GetCode()&511001822==511001822 or te:GetLabel()==511001822 then te=te:GetLabelObject() end - local _,_,_,ctlflag=te:GetCountLimit() - if ctlflag&EFFECT_COUNT_CODE_SINGLE>0 then - local chk=true - for _,te2 in ipairs(OPTEffs[rc]) do - if te==te2 then chk=false end - end - if chk then - table.insert(OPTEffs[rc],te) - end - end - end - end +s.affected_effects={} +function s.xyzfilter(c) + return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsHasEffect(id) end -function s.clear(e,tp,eg,ep,ev,re,r,rp) - OPTEffs={} - for _,c in pairs(AffectedEffs) do - for _,te in ipairs(c) do - local _,_,ctcode,ctflag,hopt=te:GetCountLimit() - if ctflag&EFFECT_COUNT_CODE_SINGLE>0 then - te:SetCountLimit(1,{ctcode,hopt},ctflag) +function s.checkop(e,tp,eg,ep,ev,re,r,rp) + --affect the effects of Xyz monsters that are equipped + local xg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) + for xc in xg:Iter() do + for _,eff in ipairs({xc:GetOwnEffects()}) do + local usect,ctmax,ctcode,ctflag,hopt=eff:GetCountLimit() + if eff:HasDetachCost() and not eff:IsHasProperty(EFFECT_FLAG_NO_TURN_RESET) + and ctmax==1 and (ctflag&~EFFECT_COUNT_CODE_SINGLE)==0 + and not s.affected_effects[eff] then + eff:SetCountLimit(2,{ctcode,hopt},ctflag) + if usect==0 then eff:UseCountLimit(eff:GetHandlerPlayer()) end + s.affected_effects[eff]=true end end end - AffectedEffs={} -end -function s.tptop(e,tp,eg,ep,ev,re,r,rp) - local eqc=e:GetHandler():GetEquipTarget() - for _,te in ipairs(OPTEffs[eqc]) do - local chk=true - for _,te2 in ipairs(AffectedEffs[eqc]) do - if te2==te then chk=false end - end - if chk then - local _,ctmax,ctcode,ctflag,hopt=te:GetCountLimit() - if ctflag&EFFECT_COUNT_CODE_SINGLE>0 then - te:SetCountLimit(ctmax+1,{ctcode,hopt},ctflag) - else - te:SetCountLimit(ctmax,{ctcode,hopt},ctflag) - end - table.insert(AffectedEffs[eqc],te) + --stop affecting effects that are no longer applicable + for eff in pairs(s.affected_effects) do + if not eff:HasDetachCost() or not xg:IsContains(eff:GetHandler()) then + local usect,_,ctcode,ctflag,hopt=eff:GetCountLimit() + eff:SetCountLimit(1,{ctcode,hopt},ctflag) + if usect<2 then eff:UseCountLimit(eff:GetHandlerPlayer()) end + s.affected_effects[eff]=nil end end end -function s.filter(c,eqc) - return c:GetPreviousTypeOnField()&TYPE_MONSTER==TYPE_MONSTER - and (c:GetReasonCard()==eqc or c:GetReasonEffect() and c:GetReasonEffect():GetHandler()==eqc) -end function s.damcon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() return ec and eg:IsContains(ec) @@ -136,18 +78,14 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(p,d,REASON_EFFECT) end function s.bdop(e,tp,eg,ep,ev,re,r,rp) + --For the rest of this turn, any battle damage you take becomes halved local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CHANGE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CHANGE_DAMAGE) e1:SetTargetRange(1,0) - e1:SetValue(s.val) + e1:SetValue(function(_,_,dam,r) return (r&REASON_BATTLE)~=0 and (dam//2) or dam end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end -function s.val(e,re,dam,r,rp,rc) - if (r&REASON_BATTLE)~=0 then - return math.floor(dam/2) - else return dam end -end \ No newline at end of file diff --git a/unofficial/c511600284.lua b/unofficial/c511600284.lua index 7df3073087..4bd8fda190 100644 --- a/unofficial/c511600284.lua +++ b/unofficial/c511600284.lua @@ -4,12 +4,12 @@ Duel.LoadCardScript("c41309158.lua") local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,4,3) c:EnableReviveLimit() + --Xyz Summon procedure: 3 Level 4 monsters + Xyz.AddProcedure(c,nil,4,3) --Rank Up Check aux.EnableCheckRankUp(c,nil,nil,15914410) - --damage + --Inflict 500 damage to your opponent for each Xyz Material detached local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) @@ -17,26 +17,19 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_BATTLE_DAMAGE) e1:SetRange(LOCATION_MZONE) - e1:SetCondition(s.damcon) - e1:SetCost(s.damcost) + e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp end) + e1:SetCost(Cost.DetachFromSelf(s.damcost,s.damcost,function(e,og) e:SetLabel(#og) end)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_RANKUP_EFFECT) e2:SetLabelObject(e1) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) end s.listed_names={15914410} -function s.damcon(e,tp,eg,ep,ev,re,r,rp) - return ep~=tp -end -function s.damcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local ct=c:GetOverlayCount() - if chk==0 then return c:CheckRemoveOverlayCard(tp,ct,REASON_COST) end - c:RemoveOverlayCard(tp,ct,ct,REASON_COST) - e:SetLabel(ct) +function s.damcost(e,tp) + return e:GetHandler():GetOverlayCount() end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end @@ -48,4 +41,4 @@ end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c511600298.lua b/unofficial/c511600298.lua index 09c734f2f9..859b200b6c 100644 --- a/unofficial/c511600298.lua +++ b/unofficial/c511600298.lua @@ -15,10 +15,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,alias) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(alias,1)) @@ -41,10 +41,6 @@ function s.xyzcheck(g,tp,xyz) local mg=g:Filter(function(c) return not c:IsHasEffect(EFFECT_EQUIP_SPELL_XYZ_MAT) end,nil) return mg:IsExists(s.xyzfilter,1,nil,xyz,tp) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_IGNISTER) end @@ -79,4 +75,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/unofficial/c511600369.lua b/unofficial/c511600369.lua index 6a35853857..1b2a1758d2 100644 --- a/unofficial/c511600369.lua +++ b/unofficial/c511600369.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atcon) - e1:SetCost(s.atcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.attg) e1:SetOperation(s.atop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --change target local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -31,10 +31,6 @@ s.listed_series={0x54} function s.atcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() end -function s.atcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_GAGAGA) and c:GetEffectCount(EFFECT_EXTRA_ATTACK)==0 end @@ -67,4 +63,4 @@ function s.cbop(e,tp,eg,ep,ev,re,r,rp) Duel.CalculateDamage(at,c) end end -end \ No newline at end of file +end diff --git a/unofficial/c511600384.lua b/unofficial/c511600384.lua index 1d00c0cb3e..fa40babe2a 100644 --- a/unofficial/c511600384.lua +++ b/unofficial/c511600384.lua @@ -12,16 +12,12 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(2)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_names={CARD_GALAXYEYES_P_DRAGON} -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST) -end function s.filter(c,e,tp) return c:IsCode(CARD_GALAXYEYES_P_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end @@ -36,4 +32,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/unofficial/c513000017.lua b/unofficial/c513000017.lua index 3a77ca90a8..f02f3e5bb4 100644 --- a/unofficial/c513000017.lua +++ b/unofficial/c513000017.lua @@ -13,10 +13,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --destroy replace local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) @@ -33,11 +33,6 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.xyz_number=101 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end - c:RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c) return c:IsAbleToChangeControler() and not c:IsType(TYPE_TOKEN) end @@ -62,4 +57,4 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) return true else return false end -end \ No newline at end of file +end diff --git a/unofficial/c513000018.lua b/unofficial/c513000018.lua index a6c5f69b49..94cc1ecd22 100644 --- a/unofficial/c513000018.lua +++ b/unofficial/c513000018.lua @@ -12,9 +12,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -24,10 +24,6 @@ function s.initial_effect(c) end s.listed_series={0x48} s.xyz_number=16 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(54719828,1)) local op=Duel.SelectOption(tp,70,71,72) @@ -82,4 +78,4 @@ function s.disoperation(e,tp,eg,ep,ev,re,r,rp) if re:IsActiveType(type) and re:GetHandler():IsControler(1-tp) then Duel.NegateEffect(ev) end -end \ No newline at end of file +end diff --git a/unofficial/c513000059.lua b/unofficial/c513000059.lua index 025557e546..7236b35f3f 100644 --- a/unofficial/c513000059.lua +++ b/unofficial/c513000059.lua @@ -4,18 +4,18 @@ Duel.LoadCardScript("c12744567.lua") local s,id=GetID() function s.initial_effect(c) - --xyz summon - Xyz.AddProcedure(c,nil,5,3) c:EnableReviveLimit() + --Xyz Summon procedure: 3 Level 5 monsters + Xyz.AddProcedure(c,nil,5,3) --Rank Up Check aux.EnableCheckRankUp(c,nil,nil,48739166) - --battle indestructable + --Cannot be destroyed by battle except with "Number" monsters local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(aux.NOT(aux.TargetBoolFunction(Card.IsSetCard,SET_NUMBER))) c:RegisterEffect(e1) - --spsummon + --Special Summon this card from your GY, and if you do, gain LP equal to its original ATK local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER) @@ -25,7 +25,7 @@ function s.initial_effect(c) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) - --material + --Attach 1 monster your opponent controls to this card as material local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_IGNITION) @@ -34,21 +34,21 @@ function s.initial_effect(c) e3:SetTarget(s.target) e3:SetOperation(s.operation) c:RegisterEffect(e3) - --spsummon2 + --Special Summon 1 "Number 101: Silent Honor ARK" from your GY local e4=Effect.CreateEffect(c) - e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetDescription(aux.Stringid(id,2)) + e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetLabelObject(e4) - e4:SetCost(s.spcost) + e4:SetCost(Cost.DetachFromSelf(function(e,tp) return e:GetHandler():GetOverlayCount() end)) e4:SetTarget(s.sptg2) e4:SetOperation(s.spop2) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_RANKUP_EFFECT) e5:SetLabelObject(e4) - c:RegisterEffect(e5,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e5) end s.listed_series={SET_NUMBER} s.listed_names={48739166} @@ -88,12 +88,6 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Recover(p,d,REASON_EFFECT) end end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - local ct=c:GetOverlayCount() - if chk==0 then return ct>0 and c:CheckRemoveOverlayCard(tp,ct,REASON_COST) end - c:RemoveOverlayCard(tp,ct,ct,REASON_COST) -end function s.spfilter(c,e,tp) return c:IsCode(48739166) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end @@ -110,4 +104,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/unofficial/c513000060.lua b/unofficial/c513000060.lua index 3f43bf4efc..f996df237d 100644 --- a/unofficial/c513000060.lua +++ b/unofficial/c513000060.lua @@ -41,7 +41,7 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCondition(s.spcon) - e4:SetCost(Cost.Detach(1)) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) local e5=Effect.CreateEffect(c) @@ -51,7 +51,7 @@ function s.initial_effect(c) c:RegisterEffect(e5) local e6=e5:Clone() e6:SetLabelObject(e4) - c:RegisterEffect(e6,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e6) end s.listed_series={SET_NUMBER} s.listed_names={84013237} @@ -96,4 +96,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Recover(tp,g2:GetFirst():GetAttack()/2,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/unofficial/c513000061.lua b/unofficial/c513000061.lua index dcc2f67dbe..f46648cee8 100644 --- a/unofficial/c513000061.lua +++ b/unofficial/c513000061.lua @@ -24,11 +24,11 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) - e2:SetCost(s.negcost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetCondition(s.negcon) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --battle indestructable local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) @@ -82,10 +82,6 @@ function s.negcon(e,tp,eg,ep,ev,re,r,rp) if eb and tg and tg:IsContains(e:GetHandler()) then return true end return eb and tg and tg:IsContains(e:GetHandler()) end -function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) @@ -101,4 +97,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp) local sum=dg:GetSum(Card.GetAttack) Duel.Damage(1-tp,sum,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c513000062.lua b/unofficial/c513000062.lua index 294790f6a8..7863824054 100644 --- a/unofficial/c513000062.lua +++ b/unofficial/c513000062.lua @@ -24,10 +24,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) - e2:SetCost(s.rmcost) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --battle indestructable local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) @@ -90,10 +90,6 @@ end function s.eqlimit(e,c) return c==e:GetLabelObject() end -function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0) @@ -207,4 +203,4 @@ end function s.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) -end \ No newline at end of file +end diff --git a/unofficial/c513000063.lua b/unofficial/c513000063.lua index b42356bef4..79c15d3cd6 100644 --- a/unofficial/c513000063.lua +++ b/unofficial/c513000063.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetCost(Cost.Detach(1)) + e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) - c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e2) --Equip to a monster you control local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) @@ -205,4 +205,4 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) local op=Duel.SelectEffect(tp,{b1,1002},{b2,1003}) local bg=sg:Filter(Card.IsLocation,nil,op==1 and LOCATION_MZONE or LOCATION_STZONE) Duel.Remove(bg,POS_FACEUP,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c513000141.lua b/unofficial/c513000141.lua index 9ff938e74c..146a84298b 100644 --- a/unofficial/c513000141.lua +++ b/unofficial/c513000141.lua @@ -37,7 +37,7 @@ function s.initial_effect(c) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCode(EVENT_ATTACK_ANNOUNCE) e4:SetCondition(s.descon) - e4:SetCost(s.descost) + e4:SetCost(Cost.DetachFromSelf(1)) e4:SetTarget(s.destg) e4:SetOperation(s.desop) c:RegisterEffect(e4) @@ -90,10 +90,6 @@ end function s.descon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp end -function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsDestructable() end if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end @@ -106,4 +102,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/unofficial/c700000026.lua b/unofficial/c700000026.lua index 55ac674968..a36acb00f5 100644 --- a/unofficial/c700000026.lua +++ b/unofficial/c700000026.lua @@ -12,10 +12,10 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.spcon) - e1:SetCost(s.spcost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) end s.listed_names={id} function s.spcon(e,tp,eg,ep,ev,re,r,rp) @@ -24,10 +24,6 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and tg:IsContains(e:GetHandler()) end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.filter(c,e,tp) return c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 @@ -42,4 +38,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/unofficial/c700000027.lua b/unofficial/c700000027.lua index 8f718d6a2b..811b03bf25 100644 --- a/unofficial/c700000027.lua +++ b/unofficial/c700000027.lua @@ -11,14 +11,10 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) -end -function s.cost(e,tp,ep,eg,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) + c:RegisterEffect(e1) end function s.filter(c,e) return c:HasNonZeroAttack() and (not e or not c:IsImmuneToEffect(e)) @@ -56,4 +52,4 @@ function s.operation(e,tp,ep,eg,ev,re,r,rp) ct=g:GetNext() until rc<=0 or not Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil,e) or not Duel.SelectYesNo(tp,210) -end \ No newline at end of file +end diff --git a/unofficial/c810000081.lua b/unofficial/c810000081.lua index 1e63982f65..3ffc57f68d 100644 --- a/unofficial/c810000081.lua +++ b/unofficial/c810000081.lua @@ -13,11 +13,11 @@ function s.initial_effect(c) e1:SetCode(EVENT_CHAINING) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetRange(LOCATION_MZONE) - e1:SetCost(s.cost) + e1:SetCost(Cost.DetachFromSelf(1)) e1:SetCondition(s.discon) e1:SetTarget(s.distg) e1:SetOperation(s.disop) - c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT) + c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) @@ -26,10 +26,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.xyz_number=3 -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end - e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) -end function s.discon(e,tp,eg,ep,ev,re,r,rp) local tgp,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_LOCATION) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainDisablable(ev) @@ -67,4 +63,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) end function s.indes(e,c) return not c:IsSetCard(SET_NUMBER) -end \ No newline at end of file +end diff --git a/unofficial/proc_unofficial.lua b/unofficial/proc_unofficial.lua index 07d34c1910..ee9b84c074 100644 --- a/unofficial/proc_unofficial.lua +++ b/unofficial/proc_unofficial.lua @@ -258,19 +258,13 @@ end ------------------------------------------------------------- Cardian={} function Cardian.CheckSpCondition(c) - if c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsMonster() then - local eff={c:GetCardEffect(511001692)} - for _,te2 in ipairs(eff) do - local te=te2:GetLabelObject() - if te:GetType()==EFFECT_TYPE_FIELD then - local con=te:GetCondition() - if not con or con(te,c) then - return true - end - else - if te:IsActivatable(te:GetHandlerPlayer(),true,true) then - return true - end + if not (c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsMonster()) then return false end + local effs={c:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:GetCode()&EFFECT_SPSUMMON_PROC==EFFECT_SPSUMMON_PROC then + local con=eff:GetCondition() + if con==nil or con(eff,c) then + return true end end end diff --git a/utility.lua b/utility.lua index 74222e734c..3a1b7e98ec 100644 --- a/utility.lua +++ b/utility.lua @@ -1461,11 +1461,13 @@ function Cost.SelfTribute(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return c:IsReleasable() end Duel.Release(c,REASON_COST) end +local self_tograve_costs={} function Cost.SelfToGrave(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToGraveAsCost() end Duel.SendtoGrave(c,REASON_COST) end +self_tograve_costs[Cost.SelfToGrave]=true function Cost.SelfToHand(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToHandAsCost() end @@ -1481,26 +1483,38 @@ function Cost.SelfToExtra(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return c:IsAbleToExtraAsCost() end Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_COST) end +function Cost.SelfReveal(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return not c:IsPublic() end + Duel.ConfirmCards(1-tp,c) + Duel.ShuffleHand(tp) +end + +local self_discard_costs={} function Cost.SelfDiscard(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsDiscardable() end Duel.SendtoGrave(c,REASON_DISCARD|REASON_COST) end +self_discard_costs[Cost.SelfDiscard]=true function Cost.SelfDiscardToGrave(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsDiscardable() and c:IsAbleToGraveAsCost() end Duel.SendtoGrave(c,REASON_DISCARD|REASON_COST) end -function Cost.SelfReveal(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return not c:IsPublic() end - Duel.ConfirmCards(1-tp,c) - Duel.ShuffleHand(tp) -end +self_tograve_costs[Cost.SelfDiscardToGrave]=true +self_discard_costs[Cost.SelfDiscardToGrave]=true + --Aliases for historical reasons: Cost.SelfRelease=Cost.SelfTribute Auxiliary.bfgcost=Cost.SelfBanish + +function Cost.HintSelectedEffect(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) +end + function Cost.Discard(filter,other,count) count=count or 1 filter=filter and aux.AND(filter,Card.IsDiscardable) or Card.IsDiscardable @@ -1510,46 +1524,49 @@ function Cost.Discard(filter,other,count) Duel.DiscardHand(tp,filter,count,count,REASON_COST|REASON_DISCARD,exclude) end end --- "Detach Xyz Material Cost Generator" --- Generates a function to be used by Effect.SetCost in order to detach --- a number of Xyz Materials from the Effect's handler. --- `min` minimum number of materials to check for detachment. --- `max` maximum number of materials to detach or a function that gets called --- as if by doing max(e,tp) in order to get the value of max detachments. --- `op` optional function that gets called by passing the effect and the operated --- group of just detached materials in order to do some additional handling with --- them. -function Cost.Detach(min,max,op) + +local detach_costs={} +function Cost.DetachFromSelf(min,max,op) max=max or min + + local min_type=type(min) + local max_type=type(max) + do --Perform some sanity checks, simplifies debugging - local max_type=type(max) local op_type=type(op) - if type(min)~="number" then - error("Parameter 1 should be an Integer",2) + if min_type~="number" and min_type~="function" then + error("Parameter 1 should be an Integer|function",2) end if max_type~="number" and max_type~="function" then error("Parameter 2 should be Integer|function",2) end if op_type~="nil" and op_type~="function" then - error("Parameter 2 should be nil|function",2) + error("Parameter 3 should be nil|function",2) end end - return function(e,tp,eg,ep,ev,re,r,rp,chk) + + local function cost_func(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - local nn=c:IsSetCard(SET_NUMERON) and c:IsType(TYPE_XYZ) and Duel.IsPlayerAffectedByEffect(tp,CARD_NUMERON_NETWORK) - local crm=c:CheckRemoveOverlayCard(tp,min,REASON_COST) - if chk==0 then return (nn and c:IsLocation(LOCATION_MZONE)) or crm end - if nn and (not crm or Duel.SelectYesNo(tp,aux.Stringid(CARD_NUMERON_NETWORK,1))) then - --Do not execute `op`, hint at "Numeron Network" being applied - return Duel.Hint(HINT_CARD,tp,CARD_NUMERON_NETWORK) - end - local m=type(max)=="number" and max or max(e,tp) - if c:RemoveOverlayCard(tp,min,m,REASON_COST)>0 and op then + local min_count=min_type=="function" and min(e,tp) or min + local max_count=max_type=="function" and max(e,tp) or max + if chk==0 then return min_count>0 and max_count>=min_count and c:CheckRemoveOverlayCard(tp,min_count,REASON_COST) end + if c:RemoveOverlayCard(tp,min_count,max_count,REASON_COST)>0 and op then op(e,Duel.GetOperatedGroup()) end end + + detach_costs[cost_func]=true + return cost_func end +local function cost_table_check(t) + return function(eff) return t[eff:GetCost()] end +end + +Effect.HasSelfToGraveCost=cost_table_check(self_tograve_costs) +Effect.HasSelfDiscardCost=cost_table_check(self_discard_costs) +Effect.HasDetachCost=cost_table_check(detach_costs) + --Default cost for "You can pay X LP;" function Cost.PayLP(lp_value,pay_until) if not pay_until then @@ -1576,24 +1593,37 @@ function Cost.PayLP(lp_value,pay_until) end end -function Cost.SoftOncePerChain(flag) - return function(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return not c:HasFlagEffect(flag) end - c:RegisterFlagEffect(flag,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1) +local function use_limit_cost(reset,soft) + return function(flag,ct) + ct=ct or 1 + return function(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return (soft and not c:HasFlagEffect(flag,ct)) or (not soft and not Duel.HasFlagEffect(tp,flag,ct)) end + if soft then + c:RegisterFlagEffect(flag,RESET_EVENT|RESETS_STANDARD|reset,0,1) + else + Duel.RegisterFlagEffect(tp,flag,reset,0,1) + end + end end end -function Cost.HardOncePerChain(flag) - return function(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return not Duel.HasFlagEffect(tp,flag) end - Duel.RegisterFlagEffect(tp,flag,RESET_CHAIN,0,1) - end -end +Cost.SoftUseLimitPerChain=use_limit_cost(RESET_CHAIN,true) +Cost.SoftUseLimitPerBattle=use_limit_cost(RESET_PHASE|PHASE_DAMAGE,true) + +Cost.HardUseLimitPerChain=use_limit_cost(RESET_CHAIN) +Cost.HardUseLimitPerBattle=use_limit_cost(RESET_PHASE|PHASE_DAMAGE) + +--since the ct defaults to one, the "once per chain" variants can be aliases +Cost.SoftOncePerChain=Cost.SoftUseLimitPerChain +Cost.SoftOncePerBattle=Cost.SoftUseLimitPerBattle +Cost.HardOncePerChain=Cost.HardUseLimitPerChain +Cost.HardOncePerBattle=Cost.HardUseLimitPerBattle function Cost.AND(...) local fns={...} - return function(e,tp,eg,ep,ev,re,r,rp,chk) + + local function full_cost(e,tp,eg,ep,ev,re,r,rp,chk) --when checking, stop at the first falsy value if chk==0 then for _,fn in ipairs(fns) do @@ -1606,8 +1636,46 @@ function Cost.AND(...) fn(e,tp,eg,ep,ev,re,r,rp,1) end end + + for _,fn in ipairs(fns) do + if detach_costs[fn] then detach_costs[full_cost]=true end + if self_discard_costs[fn] then self_discard_costs[full_cost]=true end + if self_tograve_costs[fn] then self_tograve_costs[full_cost]=true end + end + return full_cost end +function Cost.Choice(...) + --{ { cost_function, desc, additional_check } } + local choices={...} + + local function full_cost(e,tp,eg,ep,ev,re,r,rp,chk) + local ops={} + local has_choice=false + for _,choice in ipairs(choices) do + local fn,desc,additional_check=table.unpack(choice) + local check=fn(e,tp,eg,ep,ev,re,r,rp,0) and (not additional_check or additional_check(e,tp,eg,ep,ev,re,r,rp,0)) + table.insert(ops,{check,desc}) + has_choice=has_choice or check + end + + if chk==0 then return has_choice end + + local op=Duel.SelectEffect(tp,table.unpack(ops)) + choices[op][1](e,tp,eg,ep,ev,re,r,rp,1) + e:SetLabel(op) + end + + detach_costs[full_cost]=true + self_discard_costs[full_cost]=true + for _,choice in ipairs(choices) do + local fn=choice[1] + if not detach_costs[fn] then detach_costs[full_cost]=false end + if not self_discard_costs[fn] then self_discard_costs[full_cost]=false end + end + + return full_cost +end function Card.EquipByEffectLimit(e,c) if e:GetOwner()~=c then return false end