diff --git a/unofficial/c100000069.lua b/unofficial/c100000069.lua index 797d63b89d..6c65e1caac 100644 --- a/unofficial/c100000069.lua +++ b/unofficial/c100000069.lua @@ -2,7 +2,7 @@ --Dark Summoning Beast (VG) local s,id=GetID() function s.initial_effect(c) - --spsummon + --Special Summon 1 of Uria, Hamon, or Raviel from your Graveyard local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -21,10 +21,10 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Release(c,REASON_COST) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_ATTACK) - e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE) - e1:SetTargetRange(LOCATION_MZONE,0) - e1:SetReset(RESET_PHASE+PHASE_END) + e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) + e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_PLAYER_TARGET) + e1:SetTargetRange(1,0) + e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.filter(c,e,tp) @@ -32,16 +32,14 @@ function s.filter(c,e,tp) 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_GRAVE) and s.filter(chkc,e,tp) end - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if e:GetHandler():GetSequence()<5 then ft=ft+1 end - if chk==0 then return ft>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end + if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0 and Duel.IsExistingTarget(s.filter,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) end function s.operation(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.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP) end end diff --git a/unofficial/c100000235.lua b/unofficial/c100000235.lua index 884b5626dd..585db7c6c8 100644 --- a/unofficial/c100000235.lua +++ b/unofficial/c100000235.lua @@ -14,56 +14,54 @@ function s.initial_effect(c) sg:KeepAlive() e1:SetLabelObject(sg) --Special Summon the banished Unions - local e3=Effect.CreateEffect(c) - e3:SetCategory(CATEGORY_SPECIAL_SUMMON) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) - e3:SetRange(LOCATION_SZONE) - e3:SetCode(EVENT_SUMMON_SUCCESS) - e3:SetTarget(s.target) - e3:SetOperation(s.operation) - e3:SetLabelObject(sg) + 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:SetRange(LOCATION_SZONE) + e2:SetCode(EVENT_SUMMON_SUCCESS) + e2:SetTarget(s.target) + e2:SetOperation(s.operation) + e2:SetLabelObject(sg) + c:RegisterEffect(e2) + local e3=e2:Clone() + e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) - local e4=e3:Clone() - e4:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e4) end function s.refilter(c) return c:IsType(TYPE_UNION) and c:IsLevelBelow(4) and c:IsAbleToRemove() end function s.retarget(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.refilter,tp,LOCATION_DECK,0,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0) + if chk==0 then return Duel.IsExistingMatchingCard(s.refilter,tp,LOCATION_DECK,0,3,nil) end + Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK) end function s.reactivate(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(s.refilter,tp,LOCATION_DECK,0,nil) + if #g<3 then return end local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local g=Duel.SelectMatchingCard(tp,s.refilter,tp,LOCATION_DECK,0,1,3,nil) - if #g>0 then - Duel.Remove(g,POS_FACEUP,REASON_EFFECT) - local sg=e:GetLabelObject() - if c:GetFlagEffect(id)==0 then - sg:Clear() - c:RegisterFlagEffect(id,RESET_EVENT+0x1680000,0,1) - end - local tc=g:GetFirst() - for tc in aux.Next(g) do - sg:AddCard(tc) - tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1) - end + local rg=g:Select(tp,3,3,nil) + Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) + local sg=e:GetLabelObject() + if c:GetFlagEffect(id)==0 then + sg:Clear() + c:RegisterFlagEffect(id,RESET_EVENT|0x1680000,0,1) + end + local tc=rg:GetFirst() + for tc in aux.Next(rg) do + sg:AddCard(tc) + tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) end end function s.filter(c,e,tp) local g=e:GetLabelObject() - return c:IsFaceup() and c:IsSummonPlayer(tp) and g:IsExists(s.filter2,1,nil,c,e,tp) + return c:IsFaceup() and c:IsControler(tp) and g:IsExists(s.filter2,1,nil,c,e,tp) end function s.filter2(c,eqc,e,tp) return c:GetFlagEffect(id)~=0 and c:ListsCode(eqc:GetCode()) 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 eg:IsExists(s.filter,1,nil,e,tp) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local gc=Duel.GetLocationCount(tp,LOCATION_MZONE) local g=e:GetLabelObject() local gt=eg:Filter(s.filter,nil,e,tp) local gtg=gt:GetFirst() @@ -75,33 +73,48 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) tg:Merge(tdg) end end - local sg=tg:Select(tp,1,gc,nil) - Duel.SetTargetCard(sg) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,gc,0,0) + Duel.SetTargetCard(tg) + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end + if ft>#tg then ft=#tg end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,ft,tp,LOCATION_REMOVED) end function s.operation(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetTargetCards(e) - if Duel.GetLocationCount(tp,LOCATION_MZONE)<#g then return end + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + if ft==0 then return end + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end + local g=nil + local tg=Duel.GetTargetCards(e) + if #tg>ft then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + g=tg:Select(tp,ft,ft,nil) + else + g=tg + end + if #g==0 then return end local c=e:GetHandler() local tc=g:GetFirst() for tc in aux.Next(g) do if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then + --Cannot attack local e1=Effect.CreateEffect(c) + e1:SetDescription(3206) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UNRELEASABLE_SUM) - e1:SetReset(RESET_EVENT+RESETS_STANDARD) - e1:SetValue(1) + e1:SetCode(EFFECT_CANNOT_ATTACK) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1,true) + --Cannot be Tributed local e2=Effect.CreateEffect(c) + e2:SetDescription(3303) + e2:SetProperty(EFFECT_FLAG_CLIENT_HINT) e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_UNRELEASABLE_NONSUM) - e2:SetReset(RESET_EVENT+RESETS_STANDARD) + e2:SetCode(EFFECT_UNRELEASABLE_SUM) + e2:SetReset(RESET_EVENT|RESETS_STANDARD) e2:SetValue(1) tc:RegisterEffect(e2,true) - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_CANNOT_ATTACK) - e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + local e3=e2:Clone() + e3:SetCode(EFFECT_UNRELEASABLE_NONSUM) tc:RegisterEffect(e3,true) end Duel.SpecialSummonComplete() diff --git a/unofficial/c150000034.lua b/unofficial/c150000034.lua index 116368968b..6df929a0ba 100644 --- a/unofficial/c150000034.lua +++ b/unofficial/c150000034.lua @@ -2,58 +2,44 @@ --Illumination local s,id=GetID() function s.initial_effect(c) - --damage + --Activate 1 of these effects for the rest of this turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetOperation(s.activate1) + e1:SetTarget(s.target) + e1:SetOperation(s.activate) c:RegisterEffect(e1) - --destroy - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCode(EVENT_FREE_CHAIN) - e2:SetOperation(s.activate2) - c:RegisterEffect(e2) end -function s.activate1(e,tp,eg,ep,ev,re,r,rp) +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + local op=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2)) + e:SetLabel(op) +end +function s.activate(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e1:SetCode(EVENT_CHAINING) - e1:SetCondition(s.condition1) - e1:SetTarget(s.target) + e1:SetCode(EVENT_CHAIN_SOLVING) + if e:GetLabel()==0 then + --Negate an effect that would negate a Normal or Special Summon + e1:SetCondition(s.condition1) + else + --Negate an effect that would destroy a monster(s) + e1:SetCondition(s.condition2) + end e1:SetOperation(s.operation) e1:SetCountLimit(1) - e1:SetReset(RESET_PHASE+PHASE_END) + e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.condition1(e,tp,eg,ep,ev,re,r,rp) - if tp==ep or not Duel.IsChainNegatable(ev) then return false end - if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end - local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DISABLE_SUMMON) - return ex and tg~=nil and tc+tg:FilterCount(s.cfilter,nil)-#tg>0 -end -function s.activate2(e,tp,eg,ep,ev,re,r,rp) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e1:SetCode(EVENT_CHAINING) - e1:SetCondition(s.condition2) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - e1:SetCountLimit(1) - e1:SetReset(RESET_PHASE+PHASE_END) - Duel.RegisterEffect(e1,tp) + local ex,tg=Duel.GetOperationInfo(ev,CATEGORY_DISABLE_SUMMON) + return ex and tg~=nil and tg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_NORMAL|SUMMON_TYPE_SPECIAL) end function s.condition2(e,tp,eg,ep,ev,re,r,rp) - if tp==ep or not Duel.IsChainNegatable(ev) then return false end - if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) - return ex and tg~=nil and tc+tg:FilterCount(s.cfilter,nil)-#tg>0 -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,0,0) + return ex and tg~=nil and tc+tg:FilterCount(Card.IsMonster,nil)-#tg>0 end function s.operation(e,tp,eg,ep,ev,re,r,rp) - Duel.NegateActivation(ev) + Duel.NegateEffect(ev) end diff --git a/unofficial/c511000117.lua b/unofficial/c511000117.lua index ce35f9542a..5385478c09 100644 --- a/unofficial/c511000117.lua +++ b/unofficial/c511000117.lua @@ -1,18 +1,20 @@ --死霊公爵 ---Duke of Demise +--The Duke of Demise --fixed by Larry126 local s,id=GetID() function s.initial_effect(c) - --fusion material + --Fusion Materials c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,5434080,66989694) - --Battle Indestructable + --Cannot be destroyed by battle local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetRange(LOCATION_MZONE) e1:SetValue(1) c:RegisterEffect(e1) - --maintain + --Maintenance local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) @@ -27,7 +29,7 @@ function s.mtcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function s.mtop(e,tp,eg,ep,ev,re,r,rp) - if Duel.CheckLPCost(tp,500) and Duel.SelectYesNo(tp,aux.Stringid(57496978,0)) then + if Duel.CheckLPCost(tp,500) then Duel.PayLPCost(tp,500) else Duel.Destroy(e:GetHandler(),REASON_COST) diff --git a/unofficial/c511000171.lua b/unofficial/c511000171.lua index 18230d15e6..31de8f8271 100644 --- a/unofficial/c511000171.lua +++ b/unofficial/c511000171.lua @@ -1,40 +1,49 @@ +--マジック・サンクチュアリ --Spell Sanctuary local s,id=GetID() function s.initial_effect(c) - --Activate + --Each player adds 1 Spell from their Deck to their hand local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) + e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --wut - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_FIELD) - e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE) - e2:SetCode(EFFECT_BECOME_QUICK) - e2:SetRange(LOCATION_SZONE) - e2:SetTargetRange(0x3f,0x3f) - e2:SetTarget(aux.TargetBoolFunction(Card.IsSpell)) - c:RegisterEffect(e2) + local e2a=Effect.CreateEffect(c) + e2a:SetType(EFFECT_TYPE_FIELD) + e2a:SetProperty(EFFECT_FLAG_SET_AVAILABLE) + e2a:SetCode(EFFECT_BECOME_QUICK) + e2a:SetRange(LOCATION_SZONE) + e2a:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD) + e2a:SetTarget(function(e,c) return c:IsSpell() and not c:IsType(TYPE_QUICKPLAY) and c:IsFacedown() and Duel.GetTurnPlayer()~=c:GetControler() end) + c:RegisterEffect(e2a) + local e2b=e2a:Clone() + e2b:SetCode(EFFECT_QP_ACT_IN_SET_TURN) + e2b:SetTarget(function(e,c) return c:IsSpell() and not c:IsType(TYPE_QUICKPLAY) and c:IsHasEffect(EFFECT_BECOME_QUICK) and Duel.GetTurnPlayer()~=c:GetControler() end) + c:RegisterEffect(e2b) end function s.filter(c) return c:IsSpell() 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 + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_DECK) +end function s.activate(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end - local g1=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil) - if #g1>0 and Duel.SelectYesNo(tp,aux.Stringid(24140059,0)) then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local sg=g1:Select(tp,1,1,nil) - Duel.SendtoHand(sg,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,sg) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g1=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) + if #g1>0 then + Duel.SendtoHand(g1,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g1) end - local g2=Duel.GetMatchingGroup(s.filter,1-tp,LOCATION_DECK,0,nil) - if #g2>0 and Duel.SelectYesNo(1-tp,aux.Stringid(24140059,0)) then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local sg=g2:Select(1-tp,1,1,nil) - Duel.SendtoHand(sg,nil,REASON_EFFECT) - Duel.ConfirmCards(tp,sg) + Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND) + local g2=Duel.SelectMatchingCard(1-tp,s.filter,1-tp,LOCATION_DECK,0,1,1,nil) + if #g2>0 then + Duel.SendtoHand(g2,nil,REASON_EFFECT) + Duel.ConfirmCards(tp,g2) end end diff --git a/unofficial/c511000248.lua b/unofficial/c511000248.lua index 988495ae4d..562e83a52e 100644 --- a/unofficial/c511000248.lua +++ b/unofficial/c511000248.lua @@ -9,17 +9,23 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_BATTLE_START) c:RegisterEffect(e1) - --Slime's Defense + --Switch the attack target to a "Slime" monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BE_BATTLE_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_SZONE) + e2:SetCondition(s.atkcon) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end +s.listed_series={0x54b} +function s.atkcon(e,tp,eg,ep,ev,re,r,rp) + local d=Duel.GetAttackTarget() + return d and d:IsControler(tp) +end function s.filter(c) return c:IsFaceup() and c:IsSlime() end @@ -27,20 +33,19 @@ function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local g=Group.FromCards(Duel.GetAttacker(),Duel.GetAttackTarget()) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) and not g:IsContains(chkc) end if chk==0 then return e:GetHandler():GetFlagEffect(id)==0 end - e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE,0,0) + e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE,0,0) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() - if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then + if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and not Duel.GetAttacker():IsImmuneToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SELF_ATTACK) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,1) - e1:SetReset(RESET_PHASE+PHASE_DAMAGE) + e1:SetReset(RESET_PHASE|PHASE_DAMAGE) Duel.RegisterEffect(e1,tp) Duel.ChangeAttackTarget(tc) end diff --git a/unofficial/c511000258.lua b/unofficial/c511000258.lua index 08787d3382..55167af1f1 100644 --- a/unofficial/c511000258.lua +++ b/unofficial/c511000258.lua @@ -1,4 +1,5 @@ ---Treasure Cards of Safe Return +--生還の宝札 (Anime) +--Card of Safe Return (Anime) local s,id=GetID() function s.initial_effect(c) --Activate @@ -6,7 +7,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) - --Draw + --Draw 3 cards local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DRAW) @@ -14,25 +15,18 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_SZONE) - e2:SetCondition(s.con) + e2:SetCondition(function(e,tp,eg) return eg:IsExists(Card.IsSummonLocation,1,nil,LOCATION_GRAVE) end) e2:SetTarget(s.tg) e2:SetOperation(s.op) c:RegisterEffect(e2) end -function s.gfilter(c,tp) - return c:IsPreviousLocation(LOCATION_GRAVE) -end -function s.con(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.gfilter,1,nil,tp) -end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end + if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(3) - Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,3) end function s.op(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end diff --git a/unofficial/c511000285.lua b/unofficial/c511000285.lua index 1c09d04d7c..616f8c63f9 100644 --- a/unofficial/c511000285.lua +++ b/unofficial/c511000285.lua @@ -1,52 +1,35 @@ ---Egyptian God Slime ---ジェムナイト·ジルコニア +--神・スライム (Anime) +--Egyptian God Slime (Anime) local s,id=GetID() function s.initial_effect(c) - --fusion material + --Fusion Materials c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,26905245,31709826) - --Revival + --This card's ATK/DEF become the DEF of "Metal Reflect Slime" local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) - e1:SetCode(EVENT_BATTLE_DESTROYED) - e1:SetCondition(s.regcon) - e1:SetOperation(s.regop) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetRange(LOCATION_MZONE) + e1:SetCode(EFFECT_SET_ATTACK) + e1:SetValue(s.atkdefval) c:RegisterEffect(e1) - --change name - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e2:SetCode(EFFECT_CHANGE_CODE) - e2:SetRange(LOCATION_MZONE) - e2:SetValue(31709826) + local e2=e1:Clone() + e2:SetCode(EFFECT_SET_DEFENSE) c:RegisterEffect(e2) - --atk + --Special Summon this card in Defense Position local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - e3:SetOperation(s.atkop) + e3:SetDescription(aux.Stringid(id,0)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e3:SetCode(EVENT_TO_GRAVE) + e3:SetCondition(s.spcon) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) c:RegisterEffect(e3) - --spsummon - local e4=Effect.CreateEffect(c) - e4:SetCategory(CATEGORY_SPECIAL_SUMMON) - e4:SetCategory(CATEGORY_SPECIAL_SUMMON) - e4:SetDescription(aux.Stringid(45894482,0)) - e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER+EFFECT_FLAG_DAMAGE_STEP) - e4:SetCode(id) - e4:SetTarget(s.sptg) - e4:SetOperation(s.spop) - c:RegisterEffect(e4) end -s.listed_names={26905245} +s.listed_names={26905245,31709826} s.material_setcode=0x54b -function s.regcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE) -end -function s.regop(e,tp,eg,ep,ev,re,r,rp) - Duel.RaiseSingleEvent(e:GetHandler(),id,e,r,rp,e:GetHandler():GetPreviousControler(),0) -end -function s.atkop(e,tp,eg,ep,ev,re,r,rp) +function s.atkdefval(e,c) local c=e:GetHandler() local g=c:GetMaterial() local sum=0 @@ -59,24 +42,19 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) end tc=g:GetNext() end - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_SET_ATTACK) - e1:SetValue(sum) - e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE) - c:RegisterEffect(e1) - local e2=e1:Clone() - e2:SetCode(EFFECT_SET_DEFENSE) - c:RegisterEffect(e2) + return sum +end +function s.spcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY) 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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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 - if e:GetHandler():IsRelateToEffect(e) then - Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_DEFENSE) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end diff --git a/unofficial/c511000449.lua b/unofficial/c511000449.lua index 3e45dd2c3d..2d0f7b8418 100644 --- a/unofficial/c511000449.lua +++ b/unofficial/c511000449.lua @@ -1,53 +1,50 @@ +--ファイヤー・トラップ --Fire Trap local s,id=GetID() function s.initial_effect(c) - --Negate + --Negate that effect and destroy that card local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) - --Draw + --Draw 1 card local e2=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) - e2:SetCondition(s.drcon) + e2:SetCondition(function(e) return e:GetHandler():IsReason(REASON_EFFECT) end) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) c:RegisterEffect(e2) end -function s.cfilter(c) - return c:IsOnField() and c:IsSpellTrap() +function s.cfilter(c,tp) + return c:IsContinuousTrap() and c:IsFaceup() and c:IsControler(tp) and c:IsOnField() end function s.condition(e,tp,eg,ep,ev,re,r,rp) - if tp==ep or not Duel.IsChainNegatable(ev) then return false end - if not re:IsActiveType(TYPE_SPELL+TYPE_TRAP)then return false end + if tp==ep or not Duel.IsChainDisablable(ev) then return false end local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) - return ex and tg~=nil and tc+tg:FilterCount(s.cfilter,nil)-#tg>0 + return ex and tg~=nil and tc+tg:FilterCount(s.cfilter,nil,tp)-#tg>0 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,0,0) - if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then + Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) + local rc=re:GetHandler() + if rc:IsDestructable() and rc:IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) - Duel.NegateActivation(ev) - if re:GetHandler():IsRelateToEffect(re) then + if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end -function s.drcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsReason(REASON_DESTROY) - and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) - and e:GetHandler():IsPreviousPosition(POS_FACEDOWN) -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/unofficial/c511000615.lua b/unofficial/c511000615.lua index 646b7bad4c..d8ae9513a5 100644 --- a/unofficial/c511000615.lua +++ b/unofficial/c511000615.lua @@ -1,25 +1,26 @@ +--シンクロ・バリア・フォース --Synchro Barrier Force local s,id=GetID() function s.initial_effect(c) - --Negate + --Negate an effect that would destroy a card on the field, then inflict damage local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DAMAGE) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) - if not Duel.IsChainNegatable(ev) then return false end + if not Duel.IsChainDisablable(ev) then return false end local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) - return ex and tg~=nil and tc>0 + return ex and tg~=nil and tc+tg:FilterCount(Card.IsOnField,nil)-#tg>0 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,0,0) + Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) local dam=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,0,nil)*500 Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(dam) @@ -29,8 +30,10 @@ function s.filter(c) return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) end function s.operation(e,tp,eg,ep,ev,re,r,rp) - Duel.NegateActivation(ev) - local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) - local dam=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,0,nil)*500 - Duel.Damage(p,dam,REASON_EFFECT) + if Duel.NegateEffect(ev) then + Duel.BreakEffect() + local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) + local dam=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,0,nil)*500 + Duel.Damage(p,dam,REASON_EFFECT) + end end diff --git a/unofficial/c511000631.lua b/unofficial/c511000631.lua index d640080e44..8d64998fef 100644 --- a/unofficial/c511000631.lua +++ b/unofficial/c511000631.lua @@ -1,8 +1,8 @@ --フラットLV4 ---Flat LV4 +--Flat Lv 4 local s,id=GetID() function s.initial_effect(c) - --Activate + --Each player can Special Summon 1 Level 4 monster from their Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -21,26 +21,30 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.filter(c,e,tp) - return c:GetLevel()==4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + return c:IsLevel(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 true end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,1-tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) - and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g1=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) - Duel.SpecialSummonStep(g1:GetFirst(),0,tp,tp,false,false,POS_FACEUP) + if #g1>0 then + Duel.SpecialSummonStep(g1:GetFirst(),0,tp,tp,false,false,POS_FACEUP) + end end if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,1-tp,LOCATION_DECK,0,1,nil,e,1-tp) and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON) local g2=Duel.SelectMatchingCard(1-tp,s.filter,1-tp,LOCATION_DECK,0,1,1,nil,e,1-tp) - Duel.SpecialSummonStep(g2:GetFirst(),0,1-tp,1-tp,false,false,POS_FACEUP) + if #g2>0 then + Duel.SpecialSummonStep(g2:GetFirst(),0,1-tp,1-tp,false,false,POS_FACEUP) + end end Duel.SpecialSummonComplete() end diff --git a/unofficial/c511000915.lua b/unofficial/c511000915.lua index e88c2374ff..22a12d0a31 100644 --- a/unofficial/c511000915.lua +++ b/unofficial/c511000915.lua @@ -1,8 +1,10 @@ ---Toon Mask +--トゥーン・マスク (Anime) +--Toon Mask (Anime) local s,id=GetID() function s.initial_effect(c) - --Activate + --Special Summon 1 Toon version from your hand or Deck local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_SUMMON_SUCCESS) @@ -11,12 +13,6 @@ function s.initial_effect(c) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - local e2=e1:Clone() - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e2) - local e3=e1:Clone() - e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) - c:RegisterEffect(e3) end --[Toon]=original s.list={ @@ -25,6 +21,7 @@ s.list={ [31733941]=CARD_REDEYES_B_DRAGON, [7171149]=83104731, [28112535]=81480460, +[28711704]=5405694, [61190918]=78193831, [79875176]=11384280, [83629030]=CARD_CYBER_DRAGON, @@ -32,35 +29,40 @@ s.list={ [90960358]=CARD_DARK_MAGICIAN_GIRL, [42386471]=69140098, [15270885]=78658564, +[64116319]=CARD_HARPIE_LADY, [16392422]=10189126, [65458948]=65570596, [91842653]=CARD_SUMMONED_SKULL } +function s.cfilter(c,tp) + return c:IsType(TYPE_TOON) and Duel.GetMZoneCount(tp,c)>0 +end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsType,1,false,nil,nil,TYPE_TOON) end - local g=Duel.SelectReleaseGroupCost(tp,Card.IsType,1,1,false,nil,nil,TYPE_TOON) + if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,tp) end + local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,tp) Duel.Release(g,REASON_COST) end function s.toonfilter(c,code,e,tp) - return (c.toonVersion==code or s.list[c:GetCode()]==code) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) + return (c.toonVersion==code or s.list[c:GetCode()]==code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.condition(e,tp,eg,ep,ev,re,r,rp) - return tp~=ep and #eg==1 and Duel.GetCurrentChain()==0 + local tc=eg:GetFirst() + return tp~=ep and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local tc=eg:GetFirst() - if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #eg==1 - and Duel.IsExistingMatchingCard(s.toonfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,tc:GetCode(),e,tp) end + if chk==0 then return Duel.IsExistingMatchingCard(s.toonfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,tc:GetCode(),e,tp) end Duel.SetTargetCard(tc) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() + local tc=eg:GetFirst() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - if not tc then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.toonfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,tc:GetCode(),e,tp) - if #g>0 then - Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) + if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.toonfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,tc:GetCode(),e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) + end end end diff --git a/unofficial/c511001251.lua b/unofficial/c511001251.lua index dbce166f1f..a8f575ca3b 100644 --- a/unofficial/c511001251.lua +++ b/unofficial/c511001251.lua @@ -1,15 +1,14 @@ ---トゥーン・キングダム +--トゥーン・キングダム (VG) --Toon Kingdom (VG) local s,id=GetID() function s.initial_effect(c) - --activate + --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetTarget(s.target) - e1:SetOperation(s.activate) + e1:SetCost(s.cost) c:RegisterEffect(e1) - --change name + --Name becomes "Toon World" while on the field local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) @@ -17,45 +16,36 @@ function s.initial_effect(c) e2:SetRange(LOCATION_SZONE) e2:SetValue(15259703) c:RegisterEffect(e2) - --destroy replace - local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) - e4:SetCode(EFFECT_DESTROY_REPLACE) - e4:SetRange(LOCATION_SZONE) - e4:SetTarget(s.destg) - e4:SetValue(s.desval) - e4:SetOperation(s.desop) - c:RegisterEffect(e4) + --Destruction replacement for Toon monsters + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) + e3:SetCode(EFFECT_DESTROY_REPLACE) + e3:SetRange(LOCATION_SZONE) + e3:SetTarget(s.destg) + e3:SetValue(s.desval) + c:RegisterEffect(e3) end s.listed_names={15259703} -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.GetDecktopGroup(tp,5):IsExists(Card.IsAbleToRemove,5,nil) end -end -function s.activate(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetDecktopGroup(tp,5) + if chk==0 then return g:IsExists(Card.IsAbleToRemoveAsCost,5,nil) end Duel.DisableShuffleCheck() - Duel.Remove(g,POS_FACEUP,REASON_EFFECT) + Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.dfilter(c,tp) - return c:IsFaceup() and c:IsLocation(LOCATION_ONFIELD) + return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsType(TYPE_TOON) and c:IsControler(tp) and c:IsReason(REASON_BATTLE) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then - local count=eg:FilterCount(s.dfilter,nil,tp) - e:SetLabel(count) - return count>0 and Duel.GetDecktopGroup(tp,count):IsExists(Card.IsAbleToRemove,count,nil) - end - return Duel.SelectYesNo(tp,aux.Stringid(43175858,0)) + local g=Duel.GetDecktopGroup(tp,1) + if chk==0 then return eg:IsExists(s.dfilter,1,nil,tp) + and g:IsExists(Card.IsAbleToRemove,1,nil) end + if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then + Duel.DisableShuffleCheck() + Duel.Remove(g,POS_FACEUP,REASON_EFFECT|REASON_REPLACE) + return true + else return false end end function s.desval(e,c) - return c:IsFaceup() and c:IsLocation(LOCATION_ONFIELD) - and c:IsType(TYPE_TOON) and c:IsControler(e:GetHandlerPlayer()) and c:IsReason(REASON_BATTLE) -end -function s.desop(e,tp,eg,ep,ev,re,r,rp) - local count=e:GetLabel() - local g=Duel.GetDecktopGroup(tp,count) - Duel.DisableShuffleCheck() - Duel.Remove(g,POS_FACEUP,REASON_EFFECT) + return s.dfilter(c,e:GetHandlerPlayer()) end diff --git a/unofficial/c511001901.lua b/unofficial/c511001901.lua index c13a4b8767..0c3e54d470 100644 --- a/unofficial/c511001901.lua +++ b/unofficial/c511001901.lua @@ -1,8 +1,10 @@ +--シールド・ウォール --Shield Wall local s,id=GetID() function s.initial_effect(c) - --Activate + --Special Summon 4 "Shield Tokens" local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) @@ -23,19 +25,28 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) for i=1,4 do local token=Duel.CreateToken(tp,id+1) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE) + --Cannot attack local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UNRELEASABLE_SUM) + e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e1:SetValue(1) - e1:SetReset(RESET_EVENT+RESETS_STANDARD) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) token:RegisterEffect(e1,true) + --Cannot be tributed for a Tribute Summon local e2=Effect.CreateEffect(e:GetHandler()) - e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) - e2:SetCode(EVENT_CHANGE_POS) - e2:SetOperation(s.desop) - e2:SetReset(RESET_EVENT+RESETS_STANDARD) - token:RegisterEffect(e2) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_UNRELEASABLE_SUM) + e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e2:SetValue(1) + e2:SetReset(RESET_EVENT|RESETS_STANDARD) + token:RegisterEffect(e2,true) + --If changed to Attack Position, destroy it + local e3=Effect.CreateEffect(e:GetHandler()) + e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) + e3:SetCode(EVENT_CHANGE_POS) + e3:SetOperation(s.desop) + e3:SetReset(RESET_EVENT|RESETS_STANDARD) + token:RegisterEffect(e3) end Duel.SpecialSummonComplete() end diff --git a/unofficial/c511002379.lua b/unofficial/c511002379.lua index 3639eeda36..c99edcf99f 100644 --- a/unofficial/c511002379.lua +++ b/unofficial/c511002379.lua @@ -1,4 +1,4 @@ ---摩天楼 -スカイスクレイパー- +--摩天楼 -スカイスクレイパー- (Anime) --Skyscraper (Anime) local s,id=GetID() function s.initial_effect(c) @@ -7,29 +7,29 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) - --atk up + --That battling "Elemental HERO" monster gains 1000 ATK during damage calculation only 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:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetCondition(s.atkcon) e2:SetTarget(s.atktg) e2:SetValue(s.atkval) c:RegisterEffect(e2) end -s.listed_series={0x3008} +s.listed_series={SET_ELEMENTAL_HERO} function s.atkcon(e) s[0]=false return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and Duel.GetAttackTarget() and Duel.GetAttacker() end function s.atktg(e,c) - return (c==Duel.GetAttacker() and c:IsSetCard(0x3008)) or (c==Duel.GetAttackTarget() and c:IsSetCard(0x3008)) + return (c==Duel.GetAttacker() and c:IsSetCard(SET_ELEMENTAL_HERO)) or (c==Duel.GetAttackTarget() and c:IsSetCard(SET_ELEMENTAL_HERO)) end function s.atkval(e,c) local d=Duel.GetAttackTarget() if d==c then d=Duel.GetAttacker() end - if s[0] or c:GetAttack()1 end -function s.filter(c,e,tp) - return c:IsCode(CARD_STARDUST_DRAGON) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) - and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 +function s.spfilter(c,e,tp) + return c:IsCode(CARD_STARDUST_DRAGON) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 + and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_SYNCHRO) - return #pg<=0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) + return #pg<=0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) - if re:GetHandler():IsRelateToEffect(re) then + local rc=re:GetHandler() + if rc:IsDestructable() and rc:IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.activate(e,tp,eg,ep,ev,re,r,rp) - local tc=re:GetHandler() - if not tc:IsDisabled() then - Duel.NegateEffect(ev) - local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_SYNCHRO) - if tc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and #pg<=0 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() - if tc then - Duel.BreakEffect() - Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP) - tc:CompleteProcedure() - end + local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_SYNCHRO) + if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 and #pg<=0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() + if tc then + Duel.BreakEffect() + Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP) + tc:CompleteProcedure() end end end diff --git a/unofficial/c511002532.lua b/unofficial/c511002532.lua index a2b5e48d2e..d842c4fa65 100644 --- a/unofficial/c511002532.lua +++ b/unofficial/c511002532.lua @@ -3,8 +3,9 @@ --fixed by Larry126 local s,id=GetID() function s.initial_effect(c) - --Activate + --Each player can Special Summon 1 Spellcaster monster from their Deck local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) @@ -21,7 +22,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2)) local p=tp if Duel.IsExistingMatchingCard(s.spfilter,1-tp,LOCATION_DECK,0,1,nil,e,1-tp) - and Duel.SelectYesNo(1-tp,aux.Stringid(102380,0)) then + and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then Duel.PayLPCost(1-tp,math.floor(Duel.GetLP(1-tp)/2)) p=tp+1 end @@ -29,8 +30,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) 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.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) - and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummon(1-tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end local p=e:GetLabel() if p~=tp then p=PLAYER_ALL diff --git a/unofficial/c511002990.lua b/unofficial/c511002990.lua index 5c4376afb7..1a5a9317c9 100644 --- a/unofficial/c511002990.lua +++ b/unofficial/c511002990.lua @@ -1,9 +1,11 @@ ---Victim's Darkness +--身代わりの闇 (Anime) +--Dark Sacrifice (Anime) local s,id=GetID() function s.initial_effect(c) - -- + --Send 1 Level 3 or lower DARK monster from your Deck to the Graveyard and negate that Spell/Trap Card's effect local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_NEGATE) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) @@ -15,7 +17,7 @@ function s.cfilter(c) return c:IsOnField() and c:IsMonster() end function s.condition(e,tp,eg,ep,ev,re,r,rp) - if tp==ep or not Duel.IsChainNegatable(ev) then return false end + if tp==ep or not Duel.IsChainDisablable(ev) then return false end if not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) return ex and tg~=nil and tc+tg:FilterCount(s.cfilter,nil)-#tg>0 @@ -26,12 +28,12 @@ end function s.target(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) - Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end function s.operation(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 and Duel.SendtoGrave(g,REASON_EFFECT)>0 then - Duel.NegateActivation(ev) + Duel.NegateEffect(ev) end end diff --git a/unofficial/c511007022.lua b/unofficial/c511007022.lua index 57deb4345a..8cac27a3a3 100644 --- a/unofficial/c511007022.lua +++ b/unofficial/c511007022.lua @@ -15,37 +15,32 @@ function s.initial_effect(c) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DRAW) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetCode(EVENT_TO_GRAVE) - e2:SetCondition(function(e) return e:GetHandler():IsReason(REASON_DESTROY) end) + e2:SetCode(EVENT_DESTROYED) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) --Double Snare - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE) - e3:SetRange(LOCATION_MZONE) - e3:SetCondition(s.discon) - e3:SetCode(3682106) - c:RegisterEffect(e3) + aux.DoubleSnareValidity(c,LOCATION_MZONE) end function s.discon(e) return e:GetHandler():IsAttackPos() end function s.disfilter(c,p) - return c:IsControler(p) and c:IsFaceup() and c:IsRace(RACE_MACHINE) + return c:IsControler(p) and c:IsLocation(LOCATION_MZONE) end function s.disop(e,tp,eg,ep,ev,re,r,rp) if re:IsMonsterEffect() or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) - if g:IsExists(s.disfilter,1,nil,tp) and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,1)) then - Duel.NegateEffect(ev) + if #g==1 and g:IsExists(s.disfilter,1,nil,tp) and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,1)) then + if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then + Duel.Destroy(re:GetHandler(),REASON_EFFECT) + end end end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end +function s.target(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) diff --git a/unofficial/c511018028.lua b/unofficial/c511018028.lua index 3d6bfc5398..2f8ad916a7 100644 --- a/unofficial/c511018028.lua +++ b/unofficial/c511018028.lua @@ -25,7 +25,6 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.material_setcode={SET_HERO,SET_ELEMENTAL_HERO} -s.listed_series={SET_HERO,SET_ELEMENTAL_HERO} s.listed_names={21844576,58932615} function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end diff --git a/unofficial/c511027035.lua b/unofficial/c511027035.lua index 9d83b4533e..04e88684d7 100644 --- a/unofficial/c511027035.lua +++ b/unofficial/c511027035.lua @@ -57,7 +57,7 @@ end function s.cfilter(c,tp) local val=0 if c:GetFlagEffect(584)>0 then val=c:GetFlagEffectLabel(584) end - return c:GetLevel()>val and c:IsFaceup() and c:IsSetCard(SET_FORTUNE_LADY) and c:IsControler(tp) + return c:GetLevel()>val and c:IsFaceup() and c:IsSetCard(SET_FORTUNE_LADY) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) end function s.damcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) diff --git a/unofficial/c511027036.lua b/unofficial/c511027036.lua index 4b964dc381..4d2fac6aef 100644 --- a/unofficial/c511027036.lua +++ b/unofficial/c511027036.lua @@ -42,7 +42,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then local tpe=tc:GetType() if (tpe&TYPE_TOKEN)~=0 then return end - local dg=Duel.GetMatchingGroup(Card.IsOriginalCodeRule,tc:GetControler(),LOCATION_DECK,0,nil,tc:GetOriginalCodeRule()) + local dg=Duel.GetMatchingGroup(Card.IsOriginalCodeRule,tc:GetPreviousControler(),LOCATION_DECK,0,nil,tc:GetOriginalCodeRule()) Duel.Destroy(dg,REASON_EFFECT) end end diff --git a/unofficial/c511600052.lua b/unofficial/c511600052.lua index 6680aebe91..4ed341d35d 100644 --- a/unofficial/c511600052.lua +++ b/unofficial/c511600052.lua @@ -1,18 +1,17 @@ --エルフの聖剣士 (Anime) --Celtic Guard of Noble Arms (Anime) --scripted by Larry126 -Duel.LoadScript("c420.lua") local s,id=GetID() function s.initial_effect(c) - --cannot attack + --Cannot attack while you have any cards in your hand local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCondition(s.atcon) c:RegisterEffect(e1) - --spsummon + --Special Summon 1 Level 4 EARTH Warrior monster from your hand local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(45531624,0)) + e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) @@ -20,11 +19,11 @@ function s.initial_effect(c) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) - --draw + --Draw cards equal to the number of Level 4 EARTH Warrior monsters you control local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DRAW) - e3:SetDescription(aux.Stringid(45531624,1)) - e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCondition(s.drcon) @@ -36,7 +35,7 @@ function s.atcon(e) return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)>=1 end function s.spfilter(c,e,tp) - return c:IsElf() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + return c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_WARRIOR) 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 @@ -55,16 +54,15 @@ function s.drcon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp end function s.drfilter(c) - return c:IsFaceup() and c:IsElf() + return c:IsFaceup() and c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_WARRIOR) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) - local ct=Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_MZONE,0,nil) - if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end + if chk==0 then return true end Duel.SetTargetPlayer(tp) - Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct) + Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_MZONE,0,nil)) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local d=Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_MZONE,0,nil) Duel.Draw(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/unofficial/c513000076.lua b/unofficial/c513000076.lua index 98f652013a..a0913c4dd1 100644 --- a/unofficial/c513000076.lua +++ b/unofficial/c513000076.lua @@ -58,19 +58,20 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) end end function s.descon2(e) - return not Duel.IsEnvironment(27564031) + return not (Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,27564031),e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) + or Duel.IsEnvironment(27564031)) end function s.repfilter(c) - return c:IsMonster() and c:IsSetCard(SET_MALEFIC) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) + return c:IsMonster() and c:IsSetCard(SET_MALEFIC) and c:IsAbleToRemove() and aux.SpElimFilter(c,true) end function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsReason(REASON_REPLACE) - and Duel.IsExistingMatchingCard(s.repfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end + and Duel.IsExistingMatchingCard(s.repfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,c) end if Duel.SelectEffectYesNo(tp,c,96) then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local g=Duel.SelectMatchingCard(tp,s.repfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) - Duel.Remove(g,POS_FACEUP,REASON_COST) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) + local g=Duel.SelectMatchingCard(tp,s.repfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,c) + Duel.Remove(g,POS_FACEUP,REASON_EFFECT|REASON_REPLACE) return true else return false end end diff --git a/unofficial/c513000142.lua b/unofficial/c513000142.lua index 7c6dc0f215..3a56c2c70a 100644 --- a/unofficial/c513000142.lua +++ b/unofficial/c513000142.lua @@ -1,15 +1,13 @@ --リバイバルスライム (Anime) --Revival Jam (Anime) --Scripted by GameMaster (GM) -local s,id,alias=GetID() +local s,id=GetID() function s.initial_effect(c) - alias=c:GetOriginalCodeRule() - --Revival + --Special Summon this card in Defense Position local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(alias,0)) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_TO_GRAVE) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) @@ -17,12 +15,12 @@ function s.initial_effect(c) c:RegisterEffect(e1) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE and e:GetHandler():IsReason(REASON_DESTROY) + local c=e:GetHandler() + return c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY) 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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) + if chk==0 then return true end + Duel.SetOperationInfo(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()