diff --git a/official/c14457896.lua b/official/c14457896.lua index 5ff537eb46..0915dfafdb 100644 --- a/official/c14457896.lua +++ b/official/c14457896.lua @@ -3,7 +3,7 @@ --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) - --equip + --Equip this card to 1 face-up monster on the field local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) - --to hand + --Special Summon 1 Level 7 or higher Insect monster from your hand, ignoring its Summoning conditions local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -50,21 +50,21 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(s.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) - --race + --The equipped monster becomes an Insect monster local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_CHANGE_RACE) e2:SetValue(RACE_INSECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e2) - --cannot attack + --The equipped monster cannot attack Insect monsters local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e3:SetValue(s.atlimit) e3:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e3) - --disable + --The equipped monster's effects that activate by targeting an Insect monster(s) are negated local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_CHAIN_SOLVING) @@ -123,7 +123,8 @@ function s.resop(e,tp,eg,ep,ev,re,r,rp) e:Reset() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) + local c=e:GetHandler() + return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousTypeOnField()&TYPE_EQUIP>0 end function s.spfilter(c,e,tp) return c:IsRace(RACE_INSECT) and c:IsLevelAbove(7) and c:IsMonster() and c:IsCanBeSpecialSummoned(e,0,tp,true,false) diff --git a/official/c21977828.lua b/official/c21977828.lua index db52e05d7e..8a15804933 100644 --- a/official/c21977828.lua +++ b/official/c21977828.lua @@ -2,7 +2,7 @@ --Inzektor Giga-Weevil local s,id=GetID() function s.initial_effect(c) - --equip + --Equip this card to 1 face-up "Inzektor" monster you control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) @@ -12,13 +12,13 @@ function s.initial_effect(c) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) - --equip effect + --While this card is equipped to a monster, that monster's original ATK becomes 2400 local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_SET_BASE_DEFENSE) e2:SetValue(2600) c:RegisterEffect(e2) - --special summon + --Special Summon 1 "Inzektor" monster in your GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -32,15 +32,16 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_INZEKTOR} -function s.filter(c) +function s.eqfilter(c) return c:IsFaceup() and c:IsSetCard(SET_INZEKTOR) 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(tp) and s.filter(chkc) end + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end + and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) - Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -64,7 +65,7 @@ function s.eqlimit(e,c) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET) + return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_INZEKTOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) @@ -75,7 +76,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) 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,0,0) + 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() diff --git a/official/c36870345.lua b/official/c36870345.lua index 911fb47c86..05d13d71f3 100644 --- a/official/c36870345.lua +++ b/official/c36870345.lua @@ -2,7 +2,7 @@ --Dragunity Aklys local s,id=GetID() function s.initial_effect(c) - --equip + --Special Summon 1 "Dragunity" monster from your hand, then equip it with this card. local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP) @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --destroy + --Destroy 1 card on the field local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) @@ -24,20 +24,20 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.listed_series={SET_DRAGUNITY} -function s.filter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsSetCard(SET_DRAGUNITY) 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.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.GetLocationCount(tp,LOCATION_SZONE)>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) - Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0) 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 tc=g:GetFirst() + local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() if not tc then return end Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) local c=e:GetHandler() @@ -59,14 +59,14 @@ function s.eqlimit(e,c) end function s.descon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET) + return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET) 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 true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) + local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() diff --git a/official/c38450736.lua b/official/c38450736.lua index 25a6b02821..f82e9e0a29 100644 --- a/official/c38450736.lua +++ b/official/c38450736.lua @@ -2,7 +2,7 @@ --Inzektor Earwig local s,id=GetID() function s.initial_effect(c) - --equip + --Equip 1 "Inzektor" monster from your hand or GY to this card local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetDescription(aux.Stringid(id,0)) @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetOperation(s.eqop) c:RegisterEffect(e1) aux.AddEREquipLimit(c,nil,s.eqval,s.equipop,e1) - --equip effect + --While this card is equipped to a monster, that monster gains ATK and DEF equal to this card's ATK and DEF local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) @@ -24,7 +24,7 @@ function s.initial_effect(c) e3:SetCode(EFFECT_UPDATE_DEFENSE) e3:SetValue(1000) c:RegisterEffect(e3) - --atkup + --The monster this card was equipped to gains 1000 ATK local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_ATKCHANGE) diff --git a/official/c45078193.lua b/official/c45078193.lua index 7aa9e17f7a..e1f64805c6 100644 --- a/official/c45078193.lua +++ b/official/c45078193.lua @@ -2,52 +2,66 @@ --Cyberdark Cannon local s,id=GetID() function s.initial_effect(c) - --search + --Draw 1 card 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_HAND) - e1:SetCountLimit(1,id) - e1:SetCost(Cost.SelfDiscard) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DRAW) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetCondition(s.drwcon) + e1:SetTarget(s.drwtg) + e1:SetOperation(s.drwop) c:RegisterEffect(e1) - --send to grave + --Add 1 Machine "Cyberdark" monster from your Deck to your hand local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,2)) - e2:SetCategory(CATEGORY_TOGRAVE) - e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE) - e2:SetRange(LOCATION_SZONE) - e2:SetCountLimit(1,{id,1}) - e2:SetCondition(s.gycon) - e2:SetTarget(s.gytg) - e2:SetOperation(s.gyop) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id) + e2:SetCost(Cost.SelfDiscard) + e2:SetTarget(s.thtg) + e2:SetOperation(s.thop) c:RegisterEffect(e2) - --draw + --Send 1 monster from your Deck to the GY local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,0)) - e3:SetCategory(CATEGORY_DRAW) - e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e3:SetProperty(EFFECT_FLAG_DELAY) - e3:SetCode(EVENT_TO_GRAVE) - e3:SetCondition(s.con) - e3:SetTarget(s.tg) - e3:SetOperation(s.op) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_TOGRAVE) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE) + e3:SetRange(LOCATION_SZONE) + e3:SetCountLimit(1,{id,1}) + e3:SetCondition(s.tgcon) + e3:SetTarget(s.tgtg) + e3:SetOperation(s.tgop) c:RegisterEffect(e3) end s.listed_series={SET_CYBERDARK} -function s.filter(c) +function s.drwcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET) +end +function s.drwtg(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.drwop(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 +function s.thfilter(c) return c:IsSetCard(SET_CYBERDARK) and c:IsRace(RACE_MACHINE) 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 tg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) + local tg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #tg>0 then Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) @@ -56,32 +70,18 @@ end function s.tgfilter(c) return c:IsMonster() and c:IsAbleToGrave() end -function s.gycon(e,tp,eg,ep,ev,re,r,rp) +function s.tgcon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() return ec and (ec==Duel.GetAttacker() or ec==Duel.GetAttackTarget()) end -function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk) +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.gyop(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.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end -end -function s.con(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET) -end -function s.tg(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.op(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/c58257569.lua b/official/c58257569.lua index 9cd6d0f363..dc4d02490b 100644 --- a/official/c58257569.lua +++ b/official/c58257569.lua @@ -28,24 +28,22 @@ s.listed_series={SET_RED_EYES} function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE) end -function s.filter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsSetCard(SET_RED_EYES) and c:IsLevelBelow(7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) - Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) - Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0) end function s.operation(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_DECK,0,1,1,nil,e,tp) - if #g>0 then + local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + if tc then local c=e:GetHandler() - local tc=g:GetFirst() if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then Duel.Equip(tp,c,tc,true) local e1=Effect.CreateEffect(c) @@ -55,7 +53,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) e1:SetValue(s.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) - --atkup + --The equipped monster gains 300 ATK local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) @@ -70,10 +68,10 @@ function s.eqlimit(e,c) end function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET) + return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET) end function s.thfilter(c) - return c:IsRace(RACE_DRAGON) and c:GetLevel()==1 and c:IsAbleToHand() + return c:IsRace(RACE_DRAGON) and c:IsLevel(1) 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_DECK,0,1,nil) end diff --git a/official/c79875526.lua b/official/c79875526.lua index d1a38c4d3f..d71bfc591b 100644 --- a/official/c79875526.lua +++ b/official/c79875526.lua @@ -2,7 +2,7 @@ --Attachment Cybern local s,id=GetID() function s.initial_effect(c) - --Equip + --Equip it to 1 Dragon or Machine "Cyber" monster you control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) @@ -12,13 +12,13 @@ function s.initial_effect(c) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) - --Increase ATK + --The equipped monster gains 600 ATK local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(600) c:RegisterEffect(e2) - --Special Summon + --Special Summon 1 other Dragon or Machine "Cyber" monster in your GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -32,16 +32,17 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_CYBER} -function s.filter(c) +function s.eqfilter(c) return c:IsFaceup() and c:IsSetCard(SET_CYBER) and c:IsRace(RACE_DRAGON|RACE_MACHINE) 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(tp) and s.filter(chkc) end + local c=e:GetHandler() + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end + and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) - Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler()) - Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,0,1,1,c) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,c,1,tp,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -64,7 +65,7 @@ function s.eqlimit(e,c) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:IsPreviousLocation(LOCATION_SZONE) and not c:IsReason(REASON_LOST_TARGET) + return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_CYBER) and c:IsRace(RACE_DRAGON|RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) @@ -76,7 +77,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) + 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() diff --git a/official/c81951640.lua b/official/c81951640.lua index 9a565fc6af..1269889f21 100644 --- a/official/c81951640.lua +++ b/official/c81951640.lua @@ -4,7 +4,7 @@ local s,id=GetID() function s.initial_effect(c) aux.AddUnionProcedure(c) - --special summon itself + --Special summon this card from the GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -19,15 +19,17 @@ function s.initial_effect(c) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:GetPreviousLocation()==LOCATION_SZONE and c:IsReason(REASON_DESTROY) and not c:IsReason(REASON_LOST_TARGET) + return c:IsPreviousLocation(LOCATION_SZONE) and c:IsReason(REASON_DESTROY) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET) end function s.target(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.operation(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) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end \ No newline at end of file diff --git a/official/c82562802.lua b/official/c82562802.lua index 07021f74ef..dd5c17d6c2 100644 --- a/official/c82562802.lua +++ b/official/c82562802.lua @@ -2,52 +2,73 @@ --Cyberdark Claw local s,id=GetID() function s.initial_effect(c) - --search S/T + --Add to your hand 1 "Cyberdark" monster from your GY 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_HAND) - e1:SetCountLimit(1,id) - e1:SetCost(Cost.SelfDiscard) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) + 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:SetCode(EVENT_TO_GRAVE) + e1:SetCondition(s.thgycon) + e1:SetTarget(s.thgytg) + e1:SetOperation(s.thgyop) c:RegisterEffect(e1) - --send to grave + --Add 1 "Cyberdark" Spell/Trap from your Deck to your hand local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,2)) - e2:SetCategory(CATEGORY_TOGRAVE) - e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE) - e2:SetRange(LOCATION_SZONE) - e2:SetCountLimit(1,{id,1}) - e2:SetCondition(s.gycon) - e2:SetTarget(s.gytg) - e2:SetOperation(s.gyop) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id) + e2:SetCost(Cost.SelfDiscard) + e2:SetTarget(s.thtg) + e2:SetOperation(s.thop) c:RegisterEffect(e2) - --search monster + --Send 1 monster from your Extra Deck to the GY local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,0)) - e3:SetCategory(CATEGORY_TOHAND) - e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) - e3:SetCode(EVENT_TO_GRAVE) - e3:SetCondition(s.con) - e3:SetTarget(s.tg) - e3:SetOperation(s.op) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_TOGRAVE) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE) + e3:SetRange(LOCATION_SZONE) + e3:SetCountLimit(1,{id,1}) + e3:SetCondition(s.tgcon) + e3:SetTarget(s.tgtg) + e3:SetOperation(s.tgop) c:RegisterEffect(e3) end s.listed_series={SET_CYBERDARK} -function s.filter2(c) +function s.thgyfilter(c) + return c:IsSetCard(SET_CYBERDARK) and c:IsMonster() and c:IsAbleToHand() +end +function s.thgycon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET) +end +function s.thgytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thgyfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.thgyfilter,tp,LOCATION_GRAVE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectTarget(tp,s.thgyfilter,tp,LOCATION_GRAVE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) +end +function s.thgyop(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 +function s.thdeckfilter(c) return c:IsSetCard(SET_CYBERDARK) and c:IsSpellTrap() and c:IsAbleToHand() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.filter2,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.thdeckfilter,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 tg=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_DECK,0,1,1,nil) + local tg=Duel.SelectMatchingCard(tp,s.thdeckfilter,tp,LOCATION_DECK,0,1,1,nil) if #tg>0 then Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) @@ -56,39 +77,18 @@ end function s.tgfilter(c) return c:IsMonster() and c:IsAbleToGrave() end -function s.gycon(e,tp,eg,ep,ev,re,r,rp) +function s.tgcon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() return ec and (ec==Duel.GetAttacker() or ec==Duel.GetAttackTarget()) end -function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_EXTRA,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA) end -function s.gyop(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.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end -end -function s.filter1(c) - return c:IsSetCard(SET_CYBERDARK) and c:IsMonster() and c:IsAbleToHand() -end -function s.con(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET) -end -function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter1(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_GRAVE,0,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) -end -function s.op(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/c94573223.lua b/official/c94573223.lua index b9b8d6e1f3..ecbee61a98 100644 --- a/official/c94573223.lua +++ b/official/c94573223.lua @@ -2,7 +2,7 @@ --Inzektor Giga-Mantis local s,id=GetID() function s.initial_effect(c) - --equip + --Equip this card to 1 face-up "Inzektor" monster you control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) @@ -12,13 +12,13 @@ function s.initial_effect(c) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) - --equip effect + --While this card is equipped to a monster, that monster's original ATK becomes 2400 local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_SET_BASE_ATTACK) e2:SetValue(2400) c:RegisterEffect(e2) - --special summon + --Special Summon 1 "Inzektor" monster in your GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -31,16 +31,18 @@ function s.initial_effect(c) e3:SetOperation(s.spop) c:RegisterEffect(e3) end +s.listed_names={id} s.listed_series={SET_INZEKTOR} -function s.filter(c) +function s.eqfilter(c) return c:IsFaceup() and c:IsSetCard(SET_INZEKTOR) 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(tp) and s.filter(chkc) end + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end + and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) - Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -64,10 +66,10 @@ function s.eqlimit(e,c) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET) + return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET) end function s.spfilter(c,e,tp) - return c:IsSetCard(SET_INZEKTOR) and c:GetCode()~=id and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + return c:IsSetCard(SET_INZEKTOR) 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 @@ -75,7 +77,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) 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,0,0) + 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()