diff --git a/official/c17412721.lua b/official/c17412721.lua index fbc94a4b0b..87ded553a3 100644 --- a/official/c17412721.lua +++ b/official/c17412721.lua @@ -2,66 +2,68 @@ --Elder Entity Norden local s,id=GetID() function s.initial_effect(c) - --fusion material c:EnableReviveLimit() - Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsType,TYPE_XYZ+TYPE_SYNCHRO),2) - --spsummon + --Fusion Materials: 1 Synchro or Xyz Monster + 1 Synchro or Xyz Monster + Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsType,TYPE_SYNCHRO|TYPE_XYZ),2) + --When this card is Special Summoned from the Extra Deck: You can target 1 Level 4 or lower monster in your GY; Special Summon it, but its effects are negated, also banish it when this card leaves the field. You can only use this effect of "Elder Entity Norden" once per turn local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,1)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE+CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetCountLimit(1,id) + e1:SetCondition(function(e) + return e:GetHandler():IsSummonLocation(LOCATION_EXTRA) + end) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --leave field - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) - e2:SetCode(EVENT_LEAVE_FIELD) - e2:SetOperation(s.leave) - c:RegisterEffect(e2) - e1:SetLabelObject(e2) end s.miracle_synchro_fusion=true -function s.filter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc: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 c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_DISABLE) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e1,true) - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_DISABLE_EFFECT) - e2:SetReset(RESET_EVENT|RESETS_STANDARD) - tc:RegisterEffect(e2,true) - Duel.SpecialSummonComplete() - if c:IsRelateToEffect(e) then + local c=e:GetHandler() + --Its effects are negated + tc:NegateEffects(c) + if c:IsRelateToEffect(e) and c:IsFaceup() then c:SetCardTarget(tc) - e:GetLabelObject():SetLabelObject(tc) - c:CreateRelation(tc,RESET_EVENT|RESET_OVERLAY|RESET_TOFIELD|RESET_TURN_SET) + c:CreateRelation(tc,RESET_EVENT|RESET_OVERLAY|RESET_MSCHANGE|RESET_TURN_SET) tc:CreateRelation(c,RESET_EVENT|RESETS_STANDARD|RESET_OVERLAY) + --Also banish it when this card leaves the field + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e1:SetCode(EVENT_LEAVE_FIELD_P) + e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) + --Register the banishing effect only if its effects aren't negated right before it leaves the field + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e1:SetCode(EVENT_LEAVE_FIELD) + e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) + if c:IsRelateToCard(tc) and tc:IsRelateToCard(c) then + c:ReleaseRelation(tc) + Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) + end + e:Reset() + end) + e1:SetReset(RESET_EVENT|(RESET_OVERLAY|RESET_MSCHANGE|RESET_TURN_SET)) + c:RegisterEffect(e1) + end) + e1:SetReset(RESET_EVENT|(RESET_OVERLAY|RESET_MSCHANGE|RESET_TURN_SET)) + c:RegisterEffect(e1) end end -end -function s.leave(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local tc=e:GetLabelObject() - if tc and c:IsRelateToCard(tc) and tc:IsRelateToCard(c) then - Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) - end + Duel.SpecialSummonComplete() end \ No newline at end of file diff --git a/official/c96782886.lua b/official/c96782886.lua index 9925550292..4ef234a98e 100644 --- a/official/c96782886.lua +++ b/official/c96782886.lua @@ -2,40 +2,35 @@ --Mind Master local s,id=GetID() function s.initial_effect(c) - --special summon + --You can pay 800 LP and Tribute 1 Psychic monster; Special Summon 1 Level 4 or lower Psychic monster from your Deck in Attack Position. You can only use this effect of "Mind Master" once per turn 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:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) + e1:SetCountLimit(1,id) + e1:SetCost(Cost.AND(Cost.PayLP(800),s.spcost)) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) c:RegisterEffect(e1) end -s.listed_names={id} -function s.costfilter(c,ft,tp) - return c:IsRace(RACE_PSYCHIC) and not c:IsCode(id) - and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup()) +function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsRace,1,false,aux.ReleaseCheckMMZ,nil,RACE_PSYCHIC) end + local g=Duel.SelectReleaseGroupCost(tp,Card.IsRace,1,1,false,aux.ReleaseCheckMMZ,nil,RACE_PSYCHIC) + Duel.Release(g,REASON_COST) end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if chk==0 then return Duel.CheckLPCost(tp,800) - and ft>-1 and Duel.CheckReleaseGroupCost(tp,s.costfilter,1,false,nil,nil,ft,tp) end - Duel.PayLPCost(tp,800) - local sg=Duel.SelectReleaseGroupCost(tp,s.costfilter,1,1,false,nil,nil,ft,tp) - Duel.Release(sg,REASON_COST) +function s.spfilter(c,e,tp) + return c:IsLevelBelow(4) and c:IsRace(RACE_PSYCHIC) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) end -function s.filter(c,e,tp) - return c:IsRace(RACE_PSYCHIC) and c:IsLevelBelow(4) 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.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +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_DECK,0,1,1,nil,e,tp) - if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK) end + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK) + end end \ No newline at end of file diff --git a/pre-errata/c17412731.lua b/pre-errata/c17412731.lua new file mode 100644 index 0000000000..d0219169d6 --- /dev/null +++ b/pre-errata/c17412731.lua @@ -0,0 +1,65 @@ +--旧神ノーデン +--Elder Entity Norden (Pre-Errata) +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + --Fusion Materials: 1 Synchro or Xyz Monster + 1 Synchro or Xyz Monster + Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsType,TYPE_SYNCHRO|TYPE_XYZ),2) + --When this card is Special Summoned: You can target 1 Level 4 or lower monster in your Graveyard; Special Summon it, but its effects are negated, also banish it when this card leaves the field + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE+CATEGORY_REMOVE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) +end +s.miracle_synchro_fusion=true +function s.spfilter(c,e,tp) + return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc: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) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then + local c=e:GetHandler() + --Its effects are negated + tc:NegateEffects(c) + if c:IsRelateToEffect(e) and c:IsFaceup() then + c:SetCardTarget(tc) + c:CreateRelation(tc,RESET_EVENT|RESET_OVERLAY|RESET_MSCHANGE|RESET_TURN_SET) + tc:CreateRelation(c,RESET_EVENT|RESETS_STANDARD|RESET_OVERLAY) + --Also banish it when this card leaves the field + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e1:SetCode(EVENT_LEAVE_FIELD_P) + e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) + --Register the banishing effect only if its effects aren't negated right before it leaves the field + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e1:SetCode(EVENT_LEAVE_FIELD) + e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) + if c:IsRelateToCard(tc) and tc:IsRelateToCard(c) then + c:ReleaseRelation(tc) + Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) + end + e:Reset() + end) + e1:SetReset(RESET_EVENT|(RESET_OVERLAY|RESET_MSCHANGE|RESET_TURN_SET)) + c:RegisterEffect(e1) + end) + e1:SetReset(RESET_EVENT|(RESET_OVERLAY|RESET_MSCHANGE|RESET_TURN_SET)) + c:RegisterEffect(e1) + end + end + Duel.SpecialSummonComplete() +end \ No newline at end of file diff --git a/pre-errata/c96782896.lua b/pre-errata/c96782896.lua new file mode 100644 index 0000000000..035c05c3fd --- /dev/null +++ b/pre-errata/c96782896.lua @@ -0,0 +1,40 @@ +--メンタルマスター +--Mind Master (Pre-Errata) +local s,id=GetID() +local CARD_MIND_MASTER=96782886 +function s.initial_effect(c) + --You can pay 800 Life Points and Tribute 1 Psychic-Type monster, except "Mind Master", to Special Summon 1 Level 4 or lower Psychic-Type monster from your Deck in face-up Attack Position + 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:SetCost(Cost.AND(Cost.PayLP(800),s.spcost)) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) +end +s.listed_names={CARD_MIND_MASTER} +function s.spcostfilter(c) + return c:IsRace(RACE_PSYCHIC) and not c:IsCode(CARD_MIND_MASTER) +end +function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.spcostfilter,1,false,aux.ReleaseCheckMMZ,nil) end + local g=Duel.SelectReleaseGroupCost(tp,s.spcostfilter,1,1,false,aux.ReleaseCheckMMZ,nil) + Duel.Release(g,REASON_COST) +end +function s.spfilter(c,e,tp) + return c:IsLevelBelow(4) and c:IsRace(RACE_PSYCHIC) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) 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 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) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK) + end +end \ No newline at end of file