diff --git a/anime/c511000585.lua b/anime/c511000585.lua deleted file mode 100644 index 892f70e..0000000 --- a/anime/c511000585.lua +++ /dev/null @@ -1,51 +0,0 @@ ---Level Jar -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_DRAW) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -function s.filter(c) - return not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsAbleToDeck() -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local rg1=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil) - Duel.SendtoDeck(rg1,nil,2,REASON_EFFECT) - rg1=Duel.GetOperatedGroup():Match(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) - local rg2=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) - Duel.SendtoDeck(rg2,nil,2,REASON_EFFECT) - rg2=Duel.GetOperatedGroup():Match(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) - Duel.BreakEffect() - if #rg1>0 then - Duel.ShuffleDeck(tp) - end - if #rg2>0 then - Duel.ShuffleDeck(1-tp) - end - local sum1=rg1:GetSum(Card.GetLevel) - local sum2=rg2:GetSum(Card.GetLevel) - Duel.Draw(tp,sum1,REASON_EFFECT) - local d1=Duel.GetOperatedGroup() - Duel.Draw(1-tp,sum2,REASON_EFFECT) - local d2=Duel.GetOperatedGroup() - Duel.BreakEffect() - Duel.ConfirmCards(1-tp,d1) - Duel.ConfirmCards(tp,d2) - tc1=rg1:GetFirst() - tc2=rg2:GetFirst() - local check1=#(d1&rg1)>0 - local check2=#(d2&rg2)>0 - Duel.BreakEffect() - if not check1 then - Duel.SendtoGrave(d1,REASON_EFFECT+REASON_DISCARD) - end - if not check2 then - Duel.SendtoGrave(d2,REASON_EFFECT+REASON_DISCARD) - end - Duel.BreakEffect() - Duel.ShuffleHand(tp) - Duel.ShuffleHand(1-tp) -end \ No newline at end of file diff --git a/anime/c511000589.lua b/anime/c511000589.lua deleted file mode 100644 index c7c0693..0000000 --- a/anime/c511000589.lua +++ /dev/null @@ -1,32 +0,0 @@ ---占術姫コインノーマ (Anime) ---Prediction Princess Coinorma (Anime) -local s,id=GetID() -function s.initial_effect(c) - --Special Summon 1 Level 4 or lower Flip monster - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -function s.filter(c,e,tp) - return c:IsLevelBelow(4) and c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) -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.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp) - if #g>0 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local sg=g:Select(tp,1,1,nil) - Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) - Duel.ConfirmCards(1-tp,sg) - end -end diff --git a/anime/c511000592.lua b/anime/c511000592.lua deleted file mode 100644 index 3f08d5a..0000000 --- a/anime/c511000592.lua +++ /dev/null @@ -1,33 +0,0 @@ ---Petalelf the Sibyl -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -function s.filter(c) - return c:IsFaceup() and c:IsAttackPos() -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) end - local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) - Duel.SetOperationInfo(0,CATEGORY_POSITION,g,#g,0,0) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) - Duel.ChangePosition(g,POS_FACEUP_DEFENSE) - local e4=Effect.CreateEffect(e:GetHandler()) - e4:SetType(EFFECT_TYPE_FIELD) - e4:SetCode(EFFECT_CANNOT_CHANGE_POSITION) - e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE) - e4:SetRange(LOCATION_SZONE) - e4:SetTargetRange(0,LOCATION_MZONE) - e4:SetReset(RESET_PHASE+PHASE_END) - Duel.RegisterEffect(e4,tp) -end \ No newline at end of file diff --git a/anime/c511000637.lua b/anime/c511000637.lua deleted file mode 100644 index fdb5ebf..0000000 --- a/anime/c511000637.lua +++ /dev/null @@ -1,49 +0,0 @@ ---アシニグライ ---Ashingray ---updated by ClaireStanfield -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_HANDES) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetTarget(s.tg) - e1:SetOperation(s.op) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) - --special summon - local e2=Effect.CreateEffect(c) - e2:SetCategory(CATEGORY_SPECIAL_SUMMON) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetCode(EVENT_BATTLE_DESTROYED) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) - c:RegisterEffect(e2) -end -s.listed_names={id} -function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end - Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1) -end -function s.op(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0) - local sg=g:Select(1-tp,1,1,nil) - Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT) -end -function s.filter(c,e,tp) - return c:IsCode(id) 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.IsExistingMatchingCard(s.filter,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) - 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_FACEDOWN_DEFENSE) - end -end \ No newline at end of file diff --git a/anime/c511000721.lua b/anime/c511000721.lua deleted file mode 100644 index 8512192..0000000 --- a/anime/c511000721.lua +++ /dev/null @@ -1,30 +0,0 @@ ---Foaming Beauty -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_ATKCHANGE) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end - if chk==0 then return true end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) - local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) and tc:IsFaceup() then - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetReset(RESET_EVENT+RESETS_STANDARD) - e1:SetValue(-1000) - tc:RegisterEffect(e1) - end -end \ No newline at end of file diff --git a/anime/c511000988.lua b/anime/c511000988.lua deleted file mode 100644 index 22888cf..0000000 --- a/anime/c511000988.lua +++ /dev/null @@ -1,36 +0,0 @@ ---闇道化師と化したマサヒロ ---Masahiro the Dark Clown -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -s.illegal=true -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local c=e:GetHandler() - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsType(TYPE_FLIP) end - if chk==0 then return true end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) - Duel.SelectTarget(tp,Card.IsType,tp,LOCATION_GRAVE,0,1,1,nil,TYPE_FLIP) -end -function s.cfilter(c) - return c:IsType(TYPE_FLIP) and c:GetOriginalCode()~=id -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local tc=Duel.GetFirstTarget() - if c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) then - if not tc:IsOriginalCode(id) then - c:ReplaceEffect(tc:GetOriginalCode(),RESET_EVENT|RESETS_STANDARD) - end - if not tc:IsOriginalCode(id) or Duel.IsExistingTarget(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) then - Duel.RaiseSingleEvent(c,EVENT_FLIP,e,r,rp,ep,ev) - end - end -end \ No newline at end of file diff --git a/anime/c511001728.lua b/anime/c511001728.lua deleted file mode 100644 index 4b76932..0000000 --- a/anime/c511001728.lua +++ /dev/null @@ -1,20 +0,0 @@ ---Flamesaurus -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_LEVEL) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e1:SetReset(RESET_EVENT+RESETS_STANDARD) - e1:SetValue(1) - c:RegisterEffect(e1) -end \ No newline at end of file diff --git a/anime/c511002679.lua b/anime/c511002679.lua deleted file mode 100644 index bb0ad56..0000000 --- a/anime/c511002679.lua +++ /dev/null @@ -1,23 +0,0 @@ ---ポイズンマミー -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(43716289,0)) - e1:SetCategory(CATEGORY_DAMAGE) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end - Duel.SetTargetPlayer(1-tp) - Duel.SetTargetParam(400) - Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,400) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - Duel.Damage(p,d,REASON_EFFECT) -end \ No newline at end of file diff --git a/anime/c511002680.lua b/anime/c511002680.lua deleted file mode 100644 index 565023a..0000000 --- a/anime/c511002680.lua +++ /dev/null @@ -1,26 +0,0 @@ ---ポイズンマミー -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(43716289,0)) - e1:SetCategory(CATEGORY_POSITION) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDefensePos() end - if chk==0 then return Duel.IsExistingTarget(Card.IsDefensePos,tp,0,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) - local g=Duel.SelectTarget(tp,Card.IsDefensePos,tp,0,LOCATION_MZONE,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_POSITION,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) and not tc:IsAttackPos() then - Duel.ChangePosition(tc,0,0,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) - end -end \ No newline at end of file diff --git a/anime/c511002895.lua b/anime/c511002895.lua deleted file mode 100644 index 7e29db1..0000000 --- a/anime/c511002895.lua +++ /dev/null @@ -1,57 +0,0 @@ ---銀河魔鏡士 -local s,id=GetID() -function s.initial_effect(c) - --recover - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(98263709,0)) - e1:SetCategory(CATEGORY_RECOVER) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e1:SetTarget(s.rectg) - e1:SetOperation(s.recop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) - --set - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(76321376,0)) - e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetCode(EVENT_DESTROYED) - e2:SetTarget(s.settg) - e2:SetOperation(s.setop) - c:RegisterEffect(e2) -end -function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end - Duel.SetTargetPlayer(tp) - Duel.SetTargetParam(800) - Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,800) -end -function s.recop(e,tp,eg,ep,ev,re,r,rp) - local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - Duel.Recover(p,d,REASON_EFFECT) -end -function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return (c:IsMSetable(true,nil) or not Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_MSET)) - and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:GetFlagEffect(id)==0 end -end -function s.setop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if not c:IsRelateToEffect(e) then return end - Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEDOWN_DEFENSE,true) - Duel.RaiseEvent(c,EVENT_MSET,e,REASON_EFFECT,tp,tp,0) - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e1:SetReset(RESET_EVENT+RESETS_REDIRECT) - e1:SetValue(LOCATION_REMOVED) - c:RegisterEffect(e1,true) - c:RegisterFlagEffect(id,RESET_EVENT+0x4760000,0,0) - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON) - e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) - c:RegisterEffect(e2) -end \ No newline at end of file diff --git a/anime/c511003007.lua b/anime/c511003007.lua deleted file mode 100644 index 3f6c52d..0000000 --- a/anime/c511003007.lua +++ /dev/null @@ -1,32 +0,0 @@ ---ライトロード・ハンター ライコウ -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(21502796,0)) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetCategory(CATEGORY_DECKDES+CATEGORY_DESTROY) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsOnField() end - if chk==0 then return true end - if Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) - and Duel.SelectYesNo(tp,aux.Stringid(21502796,1)) then - 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,1,0,0) - end - Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then - Duel.Destroy(tc,REASON_EFFECT) - Duel.BreakEffect() - end - Duel.DiscardDeck(tp,3,REASON_EFFECT) -end \ No newline at end of file diff --git a/anime/c511008013.lua b/anime/c511008013.lua deleted file mode 100644 index c87a577..0000000 --- a/anime/c511008013.lua +++ /dev/null @@ -1,22 +0,0 @@ ---Chewbone Jr. ---Scripted by Snrk -local s,id=GetID() -function s.initial_effect(c) - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TODECK) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) - e1:SetTarget(s.target) - e1:SetOperation(s.activate) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chk==0 then return true end - Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) -end -function s.activate(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if c:IsRelateToEffect(e) then - Duel.SendtoDeck(c,nil,2,REASON_EFFECT) - end -end \ No newline at end of file diff --git a/anime/c511011003.lua b/anime/c511011003.lua deleted file mode 100644 index 66a3341..0000000 --- a/anime/c511011003.lua +++ /dev/null @@ -1,34 +0,0 @@ ---Chewbone (Anime) ---scripted by Keddy -local s,id=GetID() -function s.initial_effect(c) - --flip - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetTarget(s.sptg) - e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) -end -s.listed_names={511008013} -function s.spfilter(c,e,tp) - return c:IsCode(511008013) 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(1-tp,LOCATION_MZONE)>0 - 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) -end -function s.spop(e,tp,eg,ep,ev,re,r,rp) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if ft<=0 then return end - if ft>3 then ft=3 end - if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,ft,nil,e,tp) - if #g>0 then - Duel.SpecialSummon(g,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) - end -end \ No newline at end of file diff --git a/constant_ext.lua b/constant_ext.lua index a8453de..cffb677 100644 --- a/constant_ext.lua +++ b/constant_ext.lua @@ -11,6 +11,7 @@ EFFECT_FUSION_MATERIAL_COUNT = 3003000082 EFFECT_MR3_PENDULUM = 1000 EFFECT_SUMMONABLE_CARD = 1001 EFFECT_EQUIPPED_ITSELF = 1002 +EFFECT_XYZ_MATERIAL_CUSTOM = 2002000252 --Effect Flags CUSTOM_LINK_MAT_RESTRICTION = 73941492+TYPE_LINK diff --git a/custom_set_codes.lua b/custom_set_codes.lua index d0cfbff..cf85881 100644 --- a/custom_set_codes.lua +++ b/custom_set_codes.lua @@ -40,6 +40,9 @@ if not CustomArchetype then CustomArchetype.Pikeru={81383947,75917088,58015506,74270067} Card.IsSetPikeru=MakeCheck({SET_PIKERU},CustomArchetype.Pikeru) + + CustomArchetype.Stellarnova={100447044} + Card.IsStellarnova=MakeCheck({SET_STELLARNOVA},CustomArchetype.Stellarnova) CustomArchetype.Curran={46128076,2316186} Card.IsSetCurran=MakeCheck({SET_Curran},CustomArchetype.Curran) diff --git a/init.lua b/init.lua index 2f9e9ec..c578536 100644 --- a/init.lua +++ b/init.lua @@ -7,6 +7,7 @@ Duel.LoadScript("proc_fusion_spell_ext.lua") Duel.LoadScript("proc_fusion_ext.lua") Duel.LoadScript("proc_ritual_ext.lua") Duel.LoadScript("proc_synchro_ext.lua") +Duel.LoadScript("proc_xyz_ext.lua") Duel.LoadScript("proc_pendulum_ext.lua") Duel.LoadScript("proc_link_ext.lua") Duel.LoadScript("custom_set_codes.lua") diff --git a/miscellaneous/c25165047.lua b/miscellaneous/c25165047.lua deleted file mode 100644 index c5db447..0000000 --- a/miscellaneous/c25165047.lua +++ /dev/null @@ -1,81 +0,0 @@ ---ライフ・ストリーム・ドラゴン ---Life Stream Dragon -local s,id=GetID() -function s.initial_effect(c) - --synchro summon - Synchro.AddProcedure(c,nil,1,1,aux.FilterSummonCode(2403771),1,1) - c:EnableReviveLimit() - --change lp - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_SPSUMMON_SUCCESS) - e1:SetCondition(s.lpcon) - e1:SetOperation(s.lpop) - c:RegisterEffect(e1) - --damage reduce - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_FIELD) - e2:SetCode(EFFECT_CHANGE_DAMAGE) - e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetRange(LOCATION_MZONE) - e2:SetTargetRange(1,0) - e2:SetValue(s.damval) - c:RegisterEffect(e2) - local e3=e2:Clone() - e3:SetCode(EFFECT_NO_EFFECT_DAMAGE) - c:RegisterEffect(e3) - --Destroy replace - local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) - e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e4:SetRange(LOCATION_MZONE) - e4:SetCode(EFFECT_DESTROY_REPLACE) - e4:SetTarget(s.desreptg) - c:RegisterEffect(e4) - --double tuner check - local e5=Effect.CreateEffect(c) - e5:SetType(EFFECT_TYPE_SINGLE) - e5:SetCode(EFFECT_MATERIAL_CHECK) - e5:SetValue(s.valcheck) - c:RegisterEffect(e5) -end -s.material={2403771} -s.listed_names={2403771} -s.material_setcode={0xc2} -s.synchro_nt_required=1 -function s.lpcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) -end -function s.lpop(e,tp,eg,ep,ev,re,r,rp) - Duel.SetLP(tp,4000) -end -function s.damval(e,re,val,r,rp,rc) - if r&REASON_EFFECT~=0 then return 0 end - return val -end -function s.repfilter(c) - return c:IsType(TYPE_EQUIP) and c:IsAbleToRemoveAsCost() -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_GRAVE,0,1,nil) end - if Duel.SelectEffectYesNo(tp,c,96) then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local g=Duel.SelectMatchingCard(tp,s.repfilter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.Remove(g,POS_FACEUP,REASON_COST) - return true - else return false end -end -function s.valcheck(e,c) - local g=c:GetMaterial() - if g:IsExists(Card.IsType,2,nil,TYPE_TUNER) then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) - e1:SetCode(21142671) - e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END) - c:RegisterEffect(e1) - end -end \ No newline at end of file diff --git a/miscellaneous/c27200200.lua b/miscellaneous/c27200200.lua deleted file mode 100644 index db88c0f..0000000 --- a/miscellaneous/c27200200.lua +++ /dev/null @@ -1,122 +0,0 @@ ---Stellarknight Troivernum -local s,id=GetID() -function s.initial_effect(c) - c:EnableReviveLimit() - Link.AddProcedure(c,s.mfilter,2,nil,s.matcheck) - --immune - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e1:SetRange(LOCATION_MZONE) - e1:SetCode(EFFECT_IMMUNE_EFFECT) - e1:SetCondition(s.econ) - e1:SetValue(s.efilter) - c:RegisterEffect(e1) - --to hand - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetProperty(EFFECT_FLAG_DELAY) - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetCountLimit(1,id) - e2:SetCondition(s.thcon1) - e2:SetTarget(s.thtg) - e2:SetOperation(s.thop) - c:RegisterEffect(e2) - --to hand again - local e3=e2:Clone() - e3:SetCategory(CATEGORY_SPECIAL_SUMMON) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e3:SetRange(LOCATION_MZONE) - e3:SetCondition(s.thcon2) - c:RegisterEffect(e3) - --spsummon - local e4=Effect.CreateEffect(c) - e4:SetDescription(aux.Stringid(id,2)) - e4:SetCategory(CATEGORY_SPECIAL_SUMMON) - e4:SetType(EFFECT_TYPE_QUICK_O) - e4:SetCode(EVENT_FREE_CHAIN) - e4:SetProperty(EFFECT_FLAG_CARD_TARGET) - e4:SetRange(LOCATION_MZONE) - e4:SetCountLimit(1,{id,0}) - e4:SetCost(s.spcost1) - e4:SetTarget(s.sptg1) - e4:SetOperation(s.spop1) - c:RegisterEffect(e4) -end -function s.mfilter(c,lc,sumtype,tp) - return c:IsLevelAbove(1) and not c:IsType(TYPE_TOKEN,lc,sumtype,tp) -end -function s.matcheck(g,lc,sumtype,tp) - return g:GetClassCount(Card.GetLevel)==1 -end -function s.econ(e) - return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) -end -function s.efilter(e,te) - return te:IsActiveType(TYPE_XYZ) -end -function s.thcon1(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and c:GetMaterial():IsExists(s.pmfilter,1,nil,c) -end -function s.pmfilter(c,sc) - return c:IsSetCard(0x9c) -end -function s.seqcfilter(c,tp,lg) - return c:IsSetCard(0x9c) and c:IsType(TYPE_XYZ) and lg:IsContains(c) -end -function s.thcon2(e,tp,eg,ep,ev,re,r,rp) - local lg=e:GetHandler():GetLinkedGroup() - return eg:IsExists(s.seqcfilter,1,nil,tp,lg) -end - -function s.filter(c,e,tp) - return (c:IsCode(2002000003) or c:IsCode(2002000121) or c:IsSetCard(0x9c)) - and c:IsType(TYPE_SPELL+TYPE_TRAP) - and c:IsAbleToHand() -end -function s.thtg(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 - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) -end -function s.thop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) - if g:GetCount()>0 then - Duel.SendtoHand(g,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,g) - end -end - -function s.cfilter(c,g,tp,zone) - return c:IsSetCard(0x9c) and g:IsContains(c) - and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_TOFIELD,zone)>0 -end -function s.spcost1(e,tp,eg,ep,ev,re,r,rp,chk) - local lg=e:GetHandler():GetLinkedGroup() - local zone=e:GetHandler():GetLinkedZone(tp) - if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,lg,tp,zone) end - local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,lg,tp,zone) - Duel.Release(g,REASON_COST) - e:SetLabelObject(g:GetFirst()) -end -function s.spfilter1(c,e,tp) - return c:IsCanBeSpecialSummoned(e,0,tp,false,false) -end -function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local cc=e:GetLabelObject() - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) - and chkc~=cc and s.spfilter1(chkc,e,tp) end - if chk==0 then return Duel.IsExistingTarget(s.spfilter1,tp,LOCATION_GRAVE,0,1,cc,e,tp) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectTarget(tp,s.spfilter1,tp,LOCATION_GRAVE,0,1,1,cc,e,tp) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) -end -function s.spop1(e,tp,eg,ep,ev,re,r,rp) - local zone=e:GetHandler():GetLinkedZone(tp) - local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone) - end -end \ No newline at end of file diff --git a/miscellaneous/c67030233.lua b/miscellaneous/c67030233.lua deleted file mode 100644 index 72a95a8..0000000 --- a/miscellaneous/c67030233.lua +++ /dev/null @@ -1,139 +0,0 @@ ---セイヴァー・デモン・ドラゴン ---Majestic Red Dragon -local s,id=GetID() -function s.initial_effect(c) - --synchro summon - c:EnableReviveLimit() - Synchro.AddMajesticProcedure(c,aux.FilterBoolFunction(Card.IsCode,21159309),true,aux.FilterBoolFunction(Card.IsCode,70902743),true,Synchro.NonTuner(nil),false) - --destroy - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_DESTROY) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) - e1:SetCode(EVENT_BATTLED) - e1:SetCondition(s.descon) - e1:SetTarget(s.destg) - e1:SetOperation(s.desop) - c:RegisterEffect(e1) - --negate - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE) - e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) - e2:SetCountLimit(1) - e2:SetRange(LOCATION_MZONE) - e2:SetTarget(s.distg) - e2:SetOperation(s.disop) - c:RegisterEffect(e2) - -- --to extra & Special summon - -- local e3=Effect.CreateEffect(c) - -- e3:SetDescription(aux.Stringid(id,2)) - -- e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) - -- e3:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON) - -- e3:SetRange(LOCATION_MZONE) - -- e3:SetProperty(EFFECT_FLAG_CARD_TARGET) - -- e3:SetCountLimit(1) - -- e3:SetCode(EVENT_PHASE+PHASE_END) - -- e3:SetTarget(s.sptg) - -- e3:SetOperation(s.spop) - -- c:RegisterEffect(e3) - --cannot be destroyed - local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_SINGLE) - e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e4:SetRange(LOCATION_MZONE) - e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) - e4:SetValue(1) - c:RegisterEffect(e4) - --double tuner check - local e5=Effect.CreateEffect(c) - e5:SetType(EFFECT_TYPE_SINGLE) - e5:SetCode(EFFECT_MATERIAL_CHECK) - e5:SetValue(s.valcheck) - c:RegisterEffect(e5) - aux.EnableMajesticReturn(c,nil,nil,nil,nil) -end -s.listed_names={70902743,21159309} -s.majestic_base={70902743} -s.synchro_nt_required=1 -function s.descon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler()==Duel.GetAttacker() -end -function s.desfilter(c) - return c:IsDefensePos() -end -function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end - local g=Duel.GetMatchingGroup(Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) -end -function s.desop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,nil) - Duel.Destroy(g,REASON_EFFECT) -end -function s.disfilter(c) - return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled() -end -function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.disfilter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.disfilter,tp,0,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) - local g=Duel.SelectTarget(tp,s.disfilter,tp,0,LOCATION_MZONE,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) -end -function s.disop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - local c=e:GetHandler() - if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsDisabled() then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_DISABLE) - e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) - tc:RegisterEffect(e1) - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_DISABLE_EFFECT) - e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) - tc:RegisterEffect(e2) - if tc:IsImmuneToEffect(e1) or tc:IsImmuneToEffect(e2) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end - Duel.AdjustInstantly(tc) - local atk=tc:GetAttack() - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_UPDATE_ATTACK) - e3:SetValue(atk) - e3:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE+RESET_PHASE+PHASE_END) - c:RegisterEffect(e3) - end -end -function s.spfilter(c,e,tp) - return c:IsCode(70902743) 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 true 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_TODECK,e:GetHandler(),1,0,0) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) -end -function s.spop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - local c=e:GetHandler() - if c:GetOriginalType()&0x802040~=0 and Duel.SendtoDeck(c,nil,0,REASON_EFFECT)~=0 - and c:IsLocation(LOCATION_EXTRA) and tc and tc:IsRelateToEffect(e) then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) - end -end -function s.valcheck(e,c) - local g=c:GetMaterial() - if g:IsExists(Card.IsType,2,nil,TYPE_TUNER) then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) - e1:SetCode(21142671) - e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END) - c:RegisterEffect(e1) - end -end \ No newline at end of file diff --git a/miscellaneous/c7841112.lua b/miscellaneous/c7841112.lua deleted file mode 100644 index 3464518..0000000 --- a/miscellaneous/c7841112.lua +++ /dev/null @@ -1,155 +0,0 @@ ---セイヴァー・スター・ドラゴン ---Majestic Star Dragon -local s,id=GetID() -function s.initial_effect(c) - --synchro summon - c:EnableReviveLimit() - Synchro.AddMajesticProcedure(c,aux.FilterBoolFunction(Card.IsCode,21159309),true,aux.FilterBoolFunction(Card.IsCode,CARD_STARDUST_DRAGON),true,Synchro.NonTuner(nil),false) - --Negate - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) - e1:SetType(EFFECT_TYPE_QUICK_O) - e1:SetCode(EVENT_CHAINING) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) - e1:SetRange(LOCATION_MZONE) - e1:SetCondition(s.negcon) - e1:SetCost(s.negcost) - e1:SetTarget(s.negtg) - e1:SetOperation(s.negop) - c:RegisterEffect(e1) - --negate - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_DISABLE) - e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) - e2:SetCountLimit(1) - e2:SetRange(LOCATION_MZONE) - e2:SetTarget(s.distg) - e2:SetOperation(s.disop) - c:RegisterEffect(e2) - --activate limit - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e3:SetCode(EVENT_CHAINING) - e3:SetRange(LOCATION_MZONE) - e3:SetOperation(s.alop) - c:RegisterEffect(e3) - --to extra & Special summon - -- local e4=Effect.CreateEffect(c) - -- e4:SetDescription(aux.Stringid(id,2)) - -- e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) - -- e4:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON) - -- e4:SetRange(LOCATION_MZONE) - -- e4:SetProperty(EFFECT_FLAG_CARD_TARGET) - -- e4:SetCountLimit(1) - -- e4:SetCode(EVENT_PHASE+PHASE_END) - -- e4:SetTarget(s.sptg) - -- e4:SetOperation(s.spop) - -- c:RegisterEffect(e4) - --double tuner check - local e5=Effect.CreateEffect(c) - e5:SetType(EFFECT_TYPE_SINGLE) - e5:SetCode(EFFECT_MATERIAL_CHECK) - e5:SetValue(s.valcheck) - c:RegisterEffect(e5) - --to extra & Special summon - aux.EnableMajesticReturn(c,nil,nil,nil,nil) -end -s.material={21159309,CARD_STARDUST_DRAGON} -s.listed_names={21159309,CARD_STARDUST_DRAGON} -s.synchro_nt_required=1 -function s.negcon(e,tp,eg,ep,ev,re,r,rp) - return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep==1-tp and Duel.IsChainNegatable(ev) -end -function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsReleasable() end - Duel.Release(e:GetHandler(),REASON_COST) -end -function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end - Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) - local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) -end -function s.negop(e,tp,eg,ep,ev,re,r,rp) - if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then - Duel.SendtoGrave(eg,REASON_EFFECT) - end - local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) - Duel.Destroy(g,REASON_EFFECT) -end -function s.disfilter(c) - return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled() -end -function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.disfilter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.disfilter,tp,0,LOCATION_MZONE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) - local g=Duel.SelectTarget(tp,s.disfilter,tp,0,LOCATION_MZONE,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) -end -function s.disop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - local c=e:GetHandler() - if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_DISABLE) - e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) - tc:RegisterEffect(e1) - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_DISABLE_EFFECT) - e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) - tc:RegisterEffect(e2) - Duel.MajesticCopy(c,tc) - end -end -function s.alop(e,tp,eg,ep,ev,re,r,rp) - if re:GetOwner()==e:GetOwner() and not re:IsHasProperty(EFFECT_FLAG_INITIAL) then - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e1:SetCode(EFFECT_CANNOT_ACTIVATE) - e1:SetRange(LOCATION_MZONE) - e1:SetTargetRange(1,1) - e1:SetValue(s.aclimit) - e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) - e:GetHandler():RegisterEffect(e1) - end -end -function s.aclimit(e,re,tp) - return re:GetOwner()==e:GetOwner() and not re:IsHasProperty(EFFECT_FLAG_INITIAL) -end -function s.spfilter(c,e,tp) - return c:IsCode(CARD_STARDUST_DRAGON) 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 true 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_TODECK,e:GetHandler(),1,0,0) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) -end -function s.spop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - local c=e:GetHandler() - if c:IsRelateToEffect(e) and c:IsAbleToExtra() and Duel.SendtoDeck(c,nil,0,REASON_EFFECT)~=0 - and c:IsLocation(LOCATION_EXTRA) and tc and tc:IsRelateToEffect(e) then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) - end -end -function s.valcheck(e,c) - local g=c:GetMaterial() - if g:IsExists(Card.IsType,2,nil,TYPE_TUNER) then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) - e1:SetCode(21142671) - e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END) - c:RegisterEffect(e1) - end -end \ No newline at end of file diff --git a/official/c16940215.lua b/official/c16940215.lua index 059fd3c..65864c6 100644 --- a/official/c16940215.lua +++ b/official/c16940215.lua @@ -2,6 +2,7 @@ --Naturia Vein --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --Negate Spell/Trap Card activation diff --git a/official/c18326736.lua b/official/c18326736.lua index 87845ed..90cdf5f 100644 --- a/official/c18326736.lua +++ b/official/c18326736.lua @@ -1,10 +1,11 @@ --星守の騎士 プトレマイオス --Tellarknight Ptolemaeus --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --xyz summon - Xyz.AddProcedure(c,nil,4,2,nil,nil,99) + Xyz.AddProcedure(c,nil,4,2,nil,nil,Xyz.InfiniteMats) c:EnableReviveLimit() --spsummon local e1=Effect.CreateEffect(c) diff --git a/official/c19605133.lua b/official/c19605133.lua index 81d2650..7f7ad5b 100644 --- a/official/c19605133.lua +++ b/official/c19605133.lua @@ -2,6 +2,7 @@ --Naturia Ladybug --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --Special Summon diff --git a/official/c2091298.lua b/official/c2091298.lua index b9e772e..a19fb92 100644 --- a/official/c2091298.lua +++ b/official/c2091298.lua @@ -1,6 +1,7 @@ --セイクリッド・ビーハイブ --Constellar Praespe --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --xyz summon diff --git a/official/c21105106.lua b/official/c21105106.lua index 2d2293f..6510c6b 100644 --- a/official/c21105106.lua +++ b/official/c21105106.lua @@ -1,6 +1,7 @@ --sophiaの影霊衣 --Nekroz of Sophia --modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -25,7 +26,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.AND(s.discon,aux.NekrozOuroCheck)) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(aux.AND(s.discost2,Cost.SelfTribute)) c:RegisterEffect(c2) --remove local e3=Effect.CreateEffect(c) @@ -68,6 +69,12 @@ function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) g:AddCard(e:GetHandler()) Duel.SendtoGrave(g,REASON_DISCARD+REASON_COST) end +function s.discost2(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) + local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil) + Duel.SendtoGrave(g,REASON_DISCARD+REASON_COST) +end function s.disop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,1)) diff --git a/official/c21495657.lua b/official/c21495657.lua index 30ee5db..866109b 100644 --- a/official/c21495657.lua +++ b/official/c21495657.lua @@ -21,10 +21,15 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,id) - e3:SetCondition(s.condition) + e3:SetCondition(Condition.IsPendulumSummoned) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,CUSTOM_REGISTER_ZEFRA) + c:RegisterEffect(e3) + local e4=e3:Clone() + e4:SetCode(EVENT_SPSUMMON_SUCCESS) + e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP) + e4:SetCondition(s.condition) + c:RegisterEffect(e4) end s.listed_series={SET_YANG_ZING,SET_ZEFRA} s.listed_names={id} @@ -34,7 +39,7 @@ function s.splimit(e,c,sump,sumtype,sumpos,targetp) return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end function s.condition(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM) or e:GetHandler():IsPreviousLocation(LOCATION_DECK) + return e:GetHandler():IsPreviousLocation(LOCATION_DECK) end function s.filter(c) return c:IsFaceup() and (c:IsSetCard(SET_YANG_ZING) or c:IsSetCard(SET_ZEFRA)) and not c:IsType(TYPE_TUNER) and not c:IsCode(id) diff --git a/official/c22617205.lua b/official/c22617205.lua index b22478e..bf172ef 100644 --- a/official/c22617205.lua +++ b/official/c22617205.lua @@ -31,8 +31,8 @@ function s.initial_effect(c) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) - e4:SetCondition(function(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM) end) - c:RegisterEffect(e4,false,CUSTOM_REGISTER_ZEFRA) + e4:SetCondition(Condition.IsPendulumSummoned) + c:RegisterEffect(e4) end s.listed_series={SET_TELLARKNIGHT,SET_ZEFRA} function s.splimit(e,c,sump,sumtype,sumpos,targetp) diff --git a/official/c23166823.lua b/official/c23166823.lua index c6e78ec..3838803 100644 --- a/official/c23166823.lua +++ b/official/c23166823.lua @@ -26,8 +26,8 @@ function s.initial_effect(c) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) - e4:SetCondition(s.condition) - c:RegisterEffect(e4,false,CUSTOM_REGISTER_ZEFRA) + e4:SetCondition(Condition.IsPendulumSummoned) + c:RegisterEffect(e4) end s.listed_series={SET_RITUAL_BEAST,SET_ZEFRA} s.listed_names={id} @@ -35,9 +35,6 @@ function s.splimit(e,c,sump,sumtype,sumpos,targetp) if c:IsSetCard(SET_RITUAL_BEAST) or c:IsSetCard(SET_ZEFRA) then return false end return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM) -end function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_ZEFRA) and c:IsType(TYPE_PENDULUM) and not c:IsCode(id) and c:IsAbleToHand() end diff --git a/official/c25857246.lua b/official/c25857246.lua index cd8a8d5..2ca24e4 100644 --- a/official/c25857246.lua +++ b/official/c25857246.lua @@ -2,6 +2,7 @@ --Nekroz of Valkyrus --modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -27,7 +28,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.AND(s.atkcon,aux.NekrozOuroCheck)) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(aux.AND(s.rmcost,Cost.SelfTribute)) c:RegisterEffect(c2) --draw local e3=Effect.CreateEffect(c) @@ -58,6 +59,12 @@ function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) end +function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil) + Duel.Remove(g,POS_FACEUP,REASON_COST) +end function s.atkop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateAttack() then Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1) diff --git a/official/c26329679.lua b/official/c26329679.lua index 72a5088..a69c103 100644 --- a/official/c26329679.lua +++ b/official/c26329679.lua @@ -1,6 +1,7 @@ --セイクリッド・オメガ --Constellar Omega --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving diff --git a/official/c26674724.lua b/official/c26674724.lua index 8964331..9293adc 100644 --- a/official/c26674724.lua +++ b/official/c26674724.lua @@ -2,6 +2,7 @@ --Nekroz of Brionac --modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -19,7 +20,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) - e2:SetCost(s.thcost) + e2:SetCost(Cost.SelfDiscard) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) @@ -27,7 +28,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.NekrozOuroCheck) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(Cost.SelfTribute) c:RegisterEffect(c2) --todeck local e3=Effect.CreateEffect(c) @@ -46,10 +47,6 @@ s.listed_names={id} function s.mat_filter(c) return not c:IsCode(id) end -function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsDiscardable() end - Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) -end function s.thfilter(c) return c:IsSetCard(0xb4) and not c:IsCode(id) and c:IsMonster() and c:IsAbleToHand() end diff --git a/official/c29253591.lua b/official/c29253591.lua index d623c9e..e44e689 100644 --- a/official/c29253591.lua +++ b/official/c29253591.lua @@ -1,6 +1,7 @@ --ドラグニティ-クーゼ --Dragunity Couse --scripted by Naim + local s,id=GetID() function s.initial_effect(c) --synchro limit diff --git a/official/c29432356.lua b/official/c29432356.lua index 93e91e9..415733f 100644 --- a/official/c29432356.lua +++ b/official/c29432356.lua @@ -2,6 +2,7 @@ --Zefraath --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/official/c29942771.lua b/official/c29942771.lua index 03c702c..6265e06 100644 --- a/official/c29942771.lua +++ b/official/c29942771.lua @@ -3,6 +3,7 @@ -- Scripted by Hatter --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) -- Send 1 "Naturia" card to the GY diff --git a/official/c32354768.lua b/official/c32354768.lua index b967ad9..e2c26bd 100644 --- a/official/c32354768.lua +++ b/official/c32354768.lua @@ -1,5 +1,6 @@ --セフィラの神託 --Oracle of Zefra + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/official/c32687071.lua b/official/c32687071.lua index 1a04410..e673ccc 100644 --- a/official/c32687071.lua +++ b/official/c32687071.lua @@ -1,5 +1,6 @@ --アモルファージ・ノーテス --Amorphage Sloth + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/official/c33300669.lua b/official/c33300669.lua index 3d6acc6..2e97388 100644 --- a/official/c33300669.lua +++ b/official/c33300669.lua @@ -1,5 +1,6 @@ --アモルファージ・キャヴム --Amorphage Envy + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/official/c34079868.lua b/official/c34079868.lua index 532a55d..c44bca4 100644 --- a/official/c34079868.lua +++ b/official/c34079868.lua @@ -1,5 +1,6 @@ --真竜剣士マスターP --Master Peace, the True Dracoslayer + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/official/c34522216.lua b/official/c34522216.lua index b005dcc..7416342 100644 --- a/official/c34522216.lua +++ b/official/c34522216.lua @@ -1,5 +1,6 @@ --アモルファージ・ガストル --Amorphage Gluttony + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/official/c36982581.lua b/official/c36982581.lua index 4b55099..3d29257 100644 --- a/official/c36982581.lua +++ b/official/c36982581.lua @@ -2,6 +2,7 @@ --Gishki Nekromirror --scripted by pyrQ --modified by Dikeido~ for The Underground + local s,id=GetID() function s.initial_effect(c) --Ritual Summon 1 Ritual Monster diff --git a/official/c38167722.lua b/official/c38167722.lua index 34c37c3..8faf5b2 100644 --- a/official/c38167722.lua +++ b/official/c38167722.lua @@ -1,4 +1,5 @@ --Dark Spirit Art - Yoku + local s,id=GetID() function s.initial_effect(c) --Activate @@ -21,7 +22,7 @@ function s.charmer_filter(c,att) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local fg=Group.CreateGroup() - for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2002000130)}) do + for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2202500154)}) do fg:AddCard(pe:GetHandler()) end if chk==0 then @@ -49,7 +50,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) fc=fg:Select(tp,1,1,nil) end Duel.Hint(HINT_CARD,0,fc:GetCode()) - fc:RegisterFlagEffect(2002000130,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) + fc:RegisterFlagEffect(2202500154,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) Duel.SendtoGrave(tc,REASON_COST) end end diff --git a/official/c38495396.lua b/official/c38495396.lua index ab1b64e..c11fc8d 100644 --- a/official/c38495396.lua +++ b/official/c38495396.lua @@ -1,6 +1,7 @@ --セイクリッド・トレミスM7 --Constellar Ptolemy M7 --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --xyz summon diff --git a/official/c39468724.lua b/official/c39468724.lua index 67a9d69..813cac1 100644 --- a/official/c39468724.lua +++ b/official/c39468724.lua @@ -4,6 +4,7 @@ --modified for CrimsonAlpha --Substitute ID + local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving @@ -22,7 +23,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) - e2:SetCost(s.cost) + e2:SetCost(Cost.SelfDiscard) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) @@ -30,7 +31,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.NekrozOuroCheck) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(Cost.SelfTribute) c:RegisterEffect(c2) --Negate the activation of monster effect local e3=Effect.CreateEffect(c) @@ -53,11 +54,6 @@ s.listed_series={0xb4} --Cannot include level 10 monsters for its ritual summon function s.mat_filter(c) return c:GetLevel()~=10 -end - --Discard itself as cost -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsDiscardable() end - Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) end --Check for "Nekroz" monsters to tribute function s.filter(c) diff --git a/official/c42589641.lua b/official/c42589641.lua index 60420fe..9ce1b2e 100644 --- a/official/c42589641.lua +++ b/official/c42589641.lua @@ -1,6 +1,7 @@ --星輝士 トライヴェール --Stellarknight Triverr --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --xyz summon diff --git a/official/c42945701.lua b/official/c42945701.lua index 9dcacc5..0651076 100644 --- a/official/c42945701.lua +++ b/official/c42945701.lua @@ -1,4 +1,5 @@ --Fire Spirit Art - Kurenai + local s,id=GetID() function s.initial_effect(c) --Activate @@ -20,7 +21,7 @@ function s.charmer_filter(c,att) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local fg=Group.CreateGroup() - for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2002000130)}) do + for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2202500154)}) do fg:AddCard(pe:GetHandler()) end e:SetLabel(1) @@ -52,7 +53,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) fc=fg:Select(tp,1,1,nil) end Duel.Hint(HINT_CARD,0,fc:GetCode()) - fc:RegisterFlagEffect(2002000130,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) + fc:RegisterFlagEffect(2202500154,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) Duel.SendtoGrave(tc,REASON_COST) end end diff --git a/official/c4538826.lua b/official/c4538826.lua index 5eabe96..5bf3e22 100644 --- a/official/c4538826.lua +++ b/official/c4538826.lua @@ -1,6 +1,7 @@ --終焉龍 カオス・エンペラー --Chaos Emperor, the Dragon of Armageddon --Scripted by Eerie Code + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/official/c47579719.lua b/official/c47579719.lua index f5fe24a..dcdbc01 100644 --- a/official/c47579719.lua +++ b/official/c47579719.lua @@ -1,5 +1,6 @@ --セイクリッド・ヒアデス --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --xyz summon diff --git a/official/c5037726.lua b/official/c5037726.lua index 1115864..9640798 100644 --- a/official/c5037726.lua +++ b/official/c5037726.lua @@ -1,4 +1,5 @@ --Light Spirit Art - Hijiri + local s,id=GetID() function s.initial_effect(c) --Activate @@ -20,7 +21,7 @@ function s.charmer_filter(c,att) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local fg=Group.CreateGroup() - for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2002000130)}) do + for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2202500154)}) do fg:AddCard(pe:GetHandler()) end e:SetLabel(1) @@ -40,7 +41,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if #fg>0 then if ft>0 and Duel.IsExistingMatchingCard(s.charmer_filter,tp,LOCATION_DECK,0,1,nil,ATTRIBUTE_LIGHT) then if #g>0 then - if Duel.SelectYesNo(tp,aux.Stringid(2002000130,2)) then + if Duel.SelectYesNo(tp,aux.Stringid(2202500154,2)) then g=Duel.GetMatchingGroup(s.charmer_filter,tp,LOCATION_DECK,0,nil,ATTRIBUTE_LIGHT) end else @@ -60,7 +61,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) fc=fg:Select(tp,1,1,nil) end Duel.Hint(HINT_CARD,0,fc:GetCode()) - fc:RegisterFlagEffect(2002000130,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) + fc:RegisterFlagEffect(2202500154,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) Duel.SendtoGrave(tc,REASON_COST) end end diff --git a/official/c51124303.lua b/official/c51124303.lua index 6ce0a77..192e7ce 100644 --- a/official/c51124303.lua +++ b/official/c51124303.lua @@ -1,5 +1,6 @@ --影霊衣の万華鏡 --Nekroz Kaleidoscope + local s,id=GetID() function s.initial_effect(c) --Ritual Summon any number of "Nekroz" Ritual Monsters whose Levels exactly equal the Level of the sent/tributed monster diff --git a/official/c52068432.lua b/official/c52068432.lua index 47e85aa..f998c72 100644 --- a/official/c52068432.lua +++ b/official/c52068432.lua @@ -2,6 +2,7 @@ --Nekroz of Trishula --modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -22,7 +23,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) e2:SetCondition(s.negcon) - e2:SetCost(s.negcost) + e2:SetCost(Cost.SelfDiscard) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) c:RegisterEffect(e2) @@ -30,7 +31,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.AND(s.negcon,aux.NekrozOuroCheck)) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(Cost.SelfTribute) c:RegisterEffect(c2) --remove local e3=Effect.CreateEffect(c) @@ -56,10 +57,6 @@ function s.negcon(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return g and g:IsExists(s.tfilter,1,nil,tp) and Duel.IsChainNegatable(ev) end -function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsDiscardable() end - Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) -end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) diff --git a/official/c52846880.lua b/official/c52846880.lua index 9e61c8c..20f429a 100644 --- a/official/c52846880.lua +++ b/official/c52846880.lua @@ -2,6 +2,7 @@ --Nekroz of Catastor --modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -20,7 +21,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_HAND) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,id) - e2:SetCost(s.spcost) + e2:SetCost(Cost.SelfDiscard) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) @@ -28,7 +29,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.NekrozOuroCheck) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(Cost.SelfTribute) c:RegisterEffect(c2) --destroy local e3=Effect.CreateEffect(c) @@ -47,10 +48,6 @@ s.listed_names={id} function s.mat_filter(c) return not c:IsCode(id) end -function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsDiscardable() end - Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) -end function s.spfilter(c,e,tp) return c:IsSetCard(0xb4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end diff --git a/official/c56638325.lua b/official/c56638325.lua index 3bd4486..78e082f 100644 --- a/official/c56638325.lua +++ b/official/c56638325.lua @@ -1,5 +1,6 @@ --星輝士 デルタテロス --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --xyz summon diff --git a/official/c57777714.lua b/official/c57777714.lua index 60628ad..5ff25e3 100644 --- a/official/c57777714.lua +++ b/official/c57777714.lua @@ -27,8 +27,8 @@ function s.initial_effect(c) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) - e4:SetCondition(s.condition) - c:RegisterEffect(e4,false,CUSTOM_REGISTER_ZEFRA) + e4:SetCondition(Condition.IsPendulumSummoned) + c:RegisterEffect(e4) end s.listed_series={SET_RITUAL_BEAST,SET_ZEFRA} s.listed_names={id} diff --git a/official/c58016954.lua b/official/c58016954.lua index 51ed5c6..685e66c 100644 --- a/official/c58016954.lua +++ b/official/c58016954.lua @@ -22,10 +22,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,id) - e3:SetCondition(s.condition1) + e3:SetCondition(Condition.IsPendulumSummoned) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,CUSTOM_REGISTER_ZEFRA) + c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_TO_GRAVE) e4:SetCondition(aux.TRUE) diff --git a/official/c58858807.lua b/official/c58858807.lua index 3c5264a..7e3daab 100644 --- a/official/c58858807.lua +++ b/official/c58858807.lua @@ -6,7 +6,7 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Xyz Summon procedure - Xyz.AddProcedure(c,nil,4,2,nil,nil,99) + Xyz.AddProcedure(c,nil,4,2,nil,nil,Xyz.InfiniteMats) --Add 1 "tellarknight" and/or 1 "Constellar" card from the GY to the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) @@ -15,7 +15,7 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) - e1:SetCondition(function(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) end) + e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) @@ -25,7 +25,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(aux.CostWithReplace((aux.dxmcostgen(1,1,nil)),CARD_CONSTELLARKNIGHT_TROIVERNUM,nil,s.applycost)) + e2:SetCost(aux.CostWithReplace(Cost.DetachFromSelf(1),CARD_CONSTELLARKNIGHT_TROIVERNUM,nil,s.applycost)) e2:SetTarget(s.applytg) e2:SetOperation(s.applyop) c:RegisterEffect(e2) @@ -50,59 +50,137 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(tg,nil,REASON_EFFECT) end end -function s.rmvfilter(c,tp) - if not (c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsAbleToRemoveAsCost() - and c:IsHasEffect(id)) then - return false - end - local eff=c:GetCardEffect(id) - local te=eff:GetLabelObject() - local con=te:GetCondition() - local tg=te:GetTarget() - if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) - and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) then - return true +-- function s.rmvfilter(c,tp) + -- if not (c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsAbleToRemoveAsCost() + -- and c:IsHasEffect(id)) then + -- return false + -- end + -- local eff=c:GetCardEffect(id) + -- local te=eff:GetLabelObject() + -- local con=te:GetCondition() + -- local tg=te:GetTarget() + -- if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) + -- and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) then + -- return true + -- end + -- return false +-- end +-- function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) + -- local c=e:GetHandler() + -- if chk==0 then return Duel.IsExistingMatchingCard(s.rmvfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,tp) end + -- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + -- local sc=Duel.SelectMatchingCard(tp,s.rmvfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,tp):GetFirst() + -- Duel.Remove(sc,POS_FACEUP,REASON_COST) + -- sc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) + -- e:SetLabelObject(sc:GetCardEffect(id):GetLabelObject()) +-- end +-- function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + -- local te=e:GetLabelObject() + -- local tg=te and te:GetTarget() or nil + -- if chkc then return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end + -- if chk==0 then return true end + -- e:SetLabel(te:GetLabel()) + -- e:SetLabelObject(te:GetLabelObject()) + -- e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + -- if tg then + -- tg(e,tp,eg,ep,ev,re,r,rp,1) + -- end + -- e:SetLabelObject(te) + -- Duel.ClearOperationInfo(0) +-- end +-- function s.applyop(e,tp,eg,ep,ev,re,r,rp) + -- local te=e:GetLabelObject() + -- if not te then return end + -- local sc=te:GetHandler() + -- if sc:GetFlagEffect(id)==0 then + -- e:SetLabel(0) + -- e:SetLabelObject(nil) + -- return + -- end + -- e:SetLabel(te:GetLabel()) + -- e:SetLabelObject(te:GetLabelObject()) + -- local op=te:GetOperation() + -- if op then + -- op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) + -- end + -- e:SetLabel(0) + -- e:SetLabelObject(nil) +-- end + +function s.rmfilter(c,e,tp) + if not (c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsMonster() and c:IsAbleToRemoveAsCost()) then return false end + local effs={c:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:GetCode()==EVENT_SUMMON_SUCCESS then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + return true + end + end end return false end function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return Duel.IsExistingMatchingCard(s.rmvfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,tp) end + if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local sc=Duel.SelectMatchingCard(tp,s.rmvfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,tp):GetFirst() - Duel.Remove(sc,POS_FACEUP,REASON_COST) - sc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) - e:SetLabelObject(sc:GetCardEffect(id):GetLabelObject()) + local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + Duel.Remove(rc,POS_FACEUP,REASON_COST) + local available_effs={} + local effs={rc:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:GetCode()==EVENT_SUMMON_SUCCESS then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + table.insert(available_effs,eff) + end + end + end + e:SetLabelObject(available_effs) end function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local te=e:GetLabelObject() - local tg=te and te:GetTarget() or nil - if chkc then return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end + if chkc then + local eff=e:GetLabelObject() + return eff and eff:GetTarget() and eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0,chkc) + end if chk==0 then return true end - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) - e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local eff=nil + local available_effs=e:GetLabelObject() + if #available_effs>1 then + local available_effs_desc={} + for _,eff in ipairs(available_effs) do + table.insert(available_effs_desc,eff:GetDescription()) + end + local op=Duel.SelectOption(tp,table.unpack(available_effs_desc)) + eff=available_effs[op+1] + else + eff=available_effs[1] + end + Duel.Hint(HINT_OPSELECTED,1-tp,eff:GetDescription()) + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + e:SetProperty(eff:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local tg=eff:GetTarget() if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end - e:SetLabelObject(te) + eff:SetLabel(e:GetLabel()) + eff:SetLabelObject(e:GetLabelObject()) + e:SetLabelObject(eff) Duel.ClearOperationInfo(0) end function s.applyop(e,tp,eg,ep,ev,re,r,rp) - local te=e:GetLabelObject() - if not te then return end - local sc=te:GetHandler() - if sc:GetFlagEffect(id)==0 then - e:SetLabel(0) - e:SetLabelObject(nil) - return - end - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) - local op=te:GetOperation() + local eff=e:GetLabelObject() + if not eff then return end + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + local op=eff:GetOperation() if op then op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) end e:SetLabel(0) e:SetLabelObject(nil) -end \ No newline at end of file +end diff --git a/official/c58990362.lua b/official/c58990362.lua index 474d700..77373b2 100644 --- a/official/c58990362.lua +++ b/official/c58990362.lua @@ -21,10 +21,10 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,id) - e3:SetCondition(s.condition1) + e3:SetCondition(Condition.IsPendulumSummoned) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,CUSTOM_REGISTER_ZEFRA) + c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_DESTROYED) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP) @@ -36,9 +36,6 @@ function s.splimit(e,c,sump,sumtype,sumpos,targetp) if c:IsSetCard(SET_YANG_ZING) or c:IsSetCard(SET_ZEFRA) then return false end return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end -function s.condition1(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM) -end function s.condition2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) diff --git a/official/c6283472.lua b/official/c6283472.lua index 0809566..6d1b70b 100644 --- a/official/c6283472.lua +++ b/official/c6283472.lua @@ -1,5 +1,6 @@ --アモルファージ・ヒュペル --Amorphage Pride + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/official/c64414267.lua b/official/c64414267.lua index 6d5b130..f00a3a0 100644 --- a/official/c64414267.lua +++ b/official/c64414267.lua @@ -1,6 +1,7 @@ --煉獄の騎士 ヴァトライムス --Darktellarknight Batlamyus --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --Xyz Summon diff --git a/official/c6540606.lua b/official/c6540606.lua index 93247bb..d89cf55 100644 --- a/official/c6540606.lua +++ b/official/c6540606.lua @@ -1,4 +1,5 @@ --Water Spirit Art - Aoi + local s,id=GetID() function s.initial_effect(c) --Activate @@ -21,7 +22,7 @@ function s.charmer_filter(c,att) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local fg=Group.CreateGroup() - for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2002000130)}) do + for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2202500154)}) do fg:AddCard(pe:GetHandler()) end if chk==0 then @@ -49,7 +50,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) fc=fg:Select(tp,1,1,nil) end Duel.Hint(HINT_CARD,0,fc:GetCode()) - fc:RegisterFlagEffect(2002000130,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) + fc:RegisterFlagEffect(2202500154,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) Duel.SendtoGrave(tc,REASON_COST) end end diff --git a/official/c69072185.lua b/official/c69072185.lua index 491d200..902d68d 100644 --- a/official/c69072185.lua +++ b/official/c69072185.lua @@ -1,5 +1,6 @@ --アモルファージ・イリテュム --Amorphage Goliath + local s,id=GetID() function s.initial_effect(c) --Pendulum Summon procedure diff --git a/official/c70156997.lua b/official/c70156997.lua index 99b547a..3a9cf18 100644 --- a/official/c70156997.lua +++ b/official/c70156997.lua @@ -1,4 +1,5 @@ --Earth Spirit Art - Kurogane + local s,id=GetID() function s.initial_effect(c) --Activate @@ -20,7 +21,7 @@ function s.charmer_filter(c,att) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local fg=Group.CreateGroup() - for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2002000130)}) do + for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2202500154)}) do fg:AddCard(pe:GetHandler()) end e:SetLabel(1) @@ -40,7 +41,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if #fg>0 then if ft>0 and Duel.IsExistingMatchingCard(s.charmer_filter,tp,LOCATION_DECK,0,1,nil,ATTRIBUTE_EARTH) then if #g>0 then - if Duel.SelectYesNo(tp,aux.Stringid(2002000130,2)) then + if Duel.SelectYesNo(tp,aux.Stringid(2202500154,2)) then g=Duel.GetMatchingGroup(s.charmer_filter,tp,LOCATION_DECK,0,nil,ATTRIBUTE_EARTH) end else @@ -60,7 +61,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) fc=fg:Select(tp,1,1,nil) end Duel.Hint(HINT_CARD,0,fc:GetCode()) - fc:RegisterFlagEffect(2002000130,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) + fc:RegisterFlagEffect(2202500154,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) Duel.SendtoGrave(tc,REASON_COST) end e:SetLabelObject(tc) diff --git a/official/c70335319.lua b/official/c70335319.lua index cb17836..de6ba12 100644 --- a/official/c70335319.lua +++ b/official/c70335319.lua @@ -1,6 +1,7 @@ --ゴッドアイズ・ファントム・ドラゴン --All-Eyes Phantom Dragon --Scripted by AlphaKretin + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/official/c70917315.lua b/official/c70917315.lua index e72760c..c475b57 100644 --- a/official/c70917315.lua +++ b/official/c70917315.lua @@ -1,5 +1,6 @@ --アモルファージ・ルクス --Amorphage Lechery + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/official/c7305060.lua b/official/c7305060.lua index 91d4f0a..2a4bbd9 100644 --- a/official/c7305060.lua +++ b/official/c7305060.lua @@ -1,5 +1,6 @@ --アモルファージ・プレスト --Amorphage Greed + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/official/c73964868.lua b/official/c73964868.lua index ea4b915..ba74a3c 100644 --- a/official/c73964868.lua +++ b/official/c73964868.lua @@ -1,5 +1,6 @@ --セイクリッド・プレアデス --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --xyz summon diff --git a/official/c74122412.lua b/official/c74122412.lua index 4ba3352..5495f4a 100644 --- a/official/c74122412.lua +++ b/official/c74122412.lua @@ -2,6 +2,7 @@ --Nekroz of Gungnir --modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving @@ -20,7 +21,7 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) - e2:SetCost(s.indcost) + e2:SetCost(Cost.SelfDiscard) e2:SetTarget(s.indtg) e2:SetOperation(s.indop) c:RegisterEffect(e2) @@ -28,7 +29,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.NekrozOuroCheck) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(Cost.SelfTribute) c:RegisterEffect(c2) --Destroy 1 card on the field local e3=Effect.CreateEffect(c) @@ -49,10 +50,6 @@ s.listed_series={0xb4} function s.mat_filter(c) return c:GetLevel()~=7 end -function s.indcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsDiscardable() end - Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) -end function s.filter(c) return c:IsFaceup() and c:IsSetCard(0xb4) end diff --git a/official/c7478431.lua b/official/c7478431.lua index cb5ea01..011b7d6 100644 --- a/official/c7478431.lua +++ b/official/c7478431.lua @@ -2,6 +2,7 @@ --Naturia Sunflower --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --Negate effect activation diff --git a/official/c74875003.lua b/official/c74875003.lua index 16ce6c5..ab593bf 100644 --- a/official/c74875003.lua +++ b/official/c74875003.lua @@ -1,5 +1,6 @@ --ラーの使徒 --Ra's Disciple + local s,id=GetID() function s.initial_effect(c) c:SetLimitOnField(3,id) diff --git a/official/c79333300.lua b/official/c79333300.lua index 4b9fe6a..bee7210 100644 --- a/official/c79333300.lua +++ b/official/c79333300.lua @@ -1,4 +1,5 @@ --Wind Spirit Art - Miyabi + local s,id=GetID() function s.initial_effect(c) --Activate @@ -24,7 +25,7 @@ function s.filter(c,e) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local fg=Group.CreateGroup() - for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2002000130)}) do + for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,2202500154)}) do fg:AddCard(pe:GetHandler()) end if chk==0 then @@ -52,7 +53,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) fc=fg:Select(tp,1,1,nil) end Duel.Hint(HINT_CARD,0,fc:GetCode()) - fc:RegisterFlagEffect(2002000130,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) + fc:RegisterFlagEffect(2202500154,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) Duel.SendtoGrave(tc,REASON_COST) end end diff --git a/official/c79794767.lua b/official/c79794767.lua index 6768c31..8f64bfd 100644 --- a/official/c79794767.lua +++ b/official/c79794767.lua @@ -1,5 +1,6 @@ --アモルファージ・オルガ --Amorphage Wrath + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/official/c80280737.lua b/official/c80280737.lua index 131aabe..f115b41 100644 --- a/official/c80280737.lua +++ b/official/c80280737.lua @@ -1,5 +1,6 @@ --バスター・モード --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/official/c88240999.lua b/official/c88240999.lua index eb5284b..88deff4 100644 --- a/official/c88240999.lua +++ b/official/c88240999.lua @@ -2,6 +2,7 @@ --Nekroz of Decisive Armor --modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -23,7 +24,7 @@ function s.initial_effect(c) e2:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMINGS_CHECK_MONSTER) e2:SetCountLimit(1,id) e2:SetCondition(s.adcon) - e2:SetCost(s.adcost) + e2:SetCost(Cost.SelfDiscard) e2:SetTarget(s.adtg) e2:SetOperation(s.adop) c:RegisterEffect(e2) @@ -31,7 +32,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.NekrozOuroCheck) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(Cost.SelfTribute) c:RegisterEffect(c2) --destroy local e3=Effect.CreateEffect(c) @@ -52,10 +53,6 @@ end function s.adcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() end -function s.adcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsDiscardable() end - Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) -end function s.filter(c) return c:IsFaceup() and c:IsSetCard(0xb4) end diff --git a/official/c88332693.lua b/official/c88332693.lua index 8696636..d972470 100644 --- a/official/c88332693.lua +++ b/official/c88332693.lua @@ -1,5 +1,6 @@ --バスター・モード・ゼロ --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/official/c89463537.lua b/official/c89463537.lua index b015a68..9ffde69 100644 --- a/official/c89463537.lua +++ b/official/c89463537.lua @@ -2,6 +2,7 @@ --Nekroz of Unicore --modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -20,7 +21,7 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) - e2:SetCost(s.cost) + e2:SetCost(Cost.SelfDiscard) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) @@ -28,7 +29,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.NekrozOuroCheck) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(Cost.SelfTribute) c:RegisterEffect(c2) --disable local e3=Effect.CreateEffect(c) @@ -41,10 +42,6 @@ function s.initial_effect(c) end s.listed_series={0xb4} s.listed_names={id} -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsDiscardable() end - Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) -end function s.filter(c) return c:IsSetCard(0xb4) and not c:IsCode(id) and c:IsAbleToHand() end diff --git a/official/c9236985.lua b/official/c9236985.lua index 9529487..d6a0bf5 100644 --- a/official/c9236985.lua +++ b/official/c9236985.lua @@ -1,6 +1,7 @@ --リチュアの写魂鏡 --Gishki Photomirror --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --Ritual Summon any "Gishki" Ritual Monster diff --git a/official/c9272381.lua b/official/c9272381.lua index f67e7a7..92d5f78 100644 --- a/official/c9272381.lua +++ b/official/c9272381.lua @@ -1,10 +1,11 @@ --星輝士 セイクリッド・ダイヤ --Stellarknight Constellar Diamond --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) --xyz summon - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_LIGHT),5,3,s.ovfilter,aux.Stringid(id,0),99) + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_LIGHT),5,3,s.ovfilter,aux.Stringid(id,0),Xyz.InfiniteMats) c:EnableReviveLimit() -- local e1=Effect.CreateEffect(c) diff --git a/official/c93454062.lua b/official/c93454062.lua index 3f0c717..cfe3c4b 100644 --- a/official/c93454062.lua +++ b/official/c93454062.lua @@ -3,6 +3,7 @@ -- Scripted by Hatter --Modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) -- Special Summon 1 "Naturia" monster diff --git a/official/c93469007.lua b/official/c93469007.lua index d679a43..9543397 100644 --- a/official/c93469007.lua +++ b/official/c93469007.lua @@ -1,4 +1,5 @@ --バスター・バースト + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/official/c94212438.lua b/official/c94212438.lua new file mode 100644 index 0000000..2d54fbe --- /dev/null +++ b/official/c94212438.lua @@ -0,0 +1,173 @@ +--ウィジャ盤 +--Destiny Board +-- modified by CrimsonAlpha +local s,id=GetID() +function s.initial_effect(c) + --Activate + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetHintTiming(0,TIMING_END_PHASE) + c:RegisterEffect(e1) + --place card + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e2:SetRange(LOCATION_SZONE) + e2:SetCode(EVENT_PHASE+PHASE_END) + e2:SetCountLimit(1) + e2:SetLabel(id) + e2:SetCondition(s.plcon) + e2:SetOperation(s.plop) + e2:SetValue(s.extraop) + c:RegisterEffect(e2) + --tograve + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e3:SetRange(LOCATION_SZONE) + e3:SetCode(EVENT_LEAVE_FIELD) + e3:SetCondition(s.tgcon) + e3:SetOperation(s.tgop) + c:RegisterEffect(e3) + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e4:SetCode(EVENT_LEAVE_FIELD) + e4:SetOperation(s.tgop) + c:RegisterEffect(e4) + --win + local e5=Effect.CreateEffect(c) + e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e5:SetCode(EVENT_ADJUST) + e5:SetRange(LOCATION_SZONE) + e5:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) + e5:SetOperation(s.winop) + c:RegisterEffect(e5) +end +s.listed_names={id} +s.listed_series={SET_SPIRIT_MESSAGE} +function s.spturnfilter(c) + return c:IsStatus(STATUS_SPSUMMON_TURN) +end +function s.plcon(e,tp,eg,ep,ev,re,r,rp) + return Duel.IsTurnPlayer(1-tp) and e:GetHandler():GetFlagEffect(id)<4 +end +function s.plfilter(c,code) + return c:IsCode(code) and not c:IsForbidden() +end +function s.plop(e,tp,eg,ep,ev,re,r,rp) + if Duel.IsPlayerAffectedByEffect(tp,CARD_DARK_SANCTUARY) then return s.extraop(e,tp,eg,ep,ev,re,r,rp) end + local c=e:GetHandler() + local ct=1 + if not c:IsRelateToEffect(e) then return end + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + if Duel.IsPlayerAffectedByEffect(tp,2002000244) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsStatus,STATUS_SPSUMMON_TURN),tp,0,LOCATION_MZONE,1,nil) + and Duel.SelectYesNo(tp,aux.Stringid(2002000244,2)) then + ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsStatus,STATUS_SPSUMMON_TURN),tp,0,LOCATION_MZONE,nil)+1 + end + local cid=CARDS_SPIRIT_MESSAGE[c:GetFlagEffect(id)+1] + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) + -- + local g=Group.CreateGroup() + local sg=Group.CreateGroup() + local list={} + if ct>4 then ct=4 end + for i=1,ct do + cid=CARDS_SPIRIT_MESSAGE[c:GetFlagEffect(id)+i] + g=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,cid) + if #g>0 then + sg:AddCard(g:GetFirst()) + list[i]=g:GetFirst() + end + end + if #sg>0 then + for i=1,ct do + Duel.MoveToField(list[i],tp,tp,LOCATION_SZONE,POS_FACEUP,true) + c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,0) + end + end +end +function s.extraop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local ct=1 + if Duel.IsPlayerAffectedByEffect(tp,2002000244) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsStatus,STATUS_SPSUMMON_TURN),tp,0,LOCATION_MZONE,1,nil) + and Duel.SelectYesNo(tp,aux.Stringid(2002000244,2)) then + ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsStatus,STATUS_SPSUMMON_TURN),tp,0,LOCATION_MZONE,nil)+1 + end + if not c:IsRelateToEffect(e) then return end + local cid=CARDS_SPIRIT_MESSAGE[c:GetFlagEffect(id)+1] + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) + local g=Group.CreateGroup() + local sg=Group.CreateGroup() + local list={} + if ct>4 then ct=4 end + for i=1,ct do + cid=CARDS_SPIRIT_MESSAGE[c:GetFlagEffect(id)+i] + Debug.Message(cid) + g=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,cid) + if #g>0 then + sg:AddCard(g:GetFirst()) + list[i]=g:GetFirst() + end + end + if #sg>0 then + for i=1,ct do + cid=CARDS_SPIRIT_MESSAGE[c:GetFlagEffect(id)+1] + tc=list[i] + if Duel.IsPlayerCanSpecialSummonMonster(tp,cid,0,TYPE_MONSTER|TYPE_NORMAL,0,0,1,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,tp,181) + and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and (Duel.GetLocationCount(tp,LOCATION_SZONE)<1 or Duel.SelectYesNo(tp,aux.Stringid(CARD_DARK_SANCTUARY,0))) then + tc:AddMonsterAttribute(TYPE_NORMAL,ATTRIBUTE_DARK,RACE_FIEND,1,0,0) + Duel.SpecialSummonStep(tc,181,tp,tp,true,false,POS_FACEUP) + tc:AddMonsterAttributeComplete() + --immune + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetRange(LOCATION_MZONE) + e1:SetCode(EFFECT_IMMUNE_EFFECT) + e1:SetValue(s.efilter) + e1:SetReset(RESET_EVENT|RESET_TODECK|RESET_TOHAND|RESET_TOGRAVE|RESET_REMOVE) + tc:RegisterEffect(e1) + --cannot be target + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_IGNORE_BATTLE_TARGET) + e2:SetValue(1) + e2:SetReset(RESET_EVENT|RESET_TODECK|RESET_TOHAND|RESET_TOGRAVE|RESET_REMOVE) + tc:RegisterEffect(e2) + Duel.SpecialSummonComplete() + c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,0) + elseif tc and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then + Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) + c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,0) + end + cid=CARDS_SPIRIT_MESSAGE[c:GetFlagEffect(id)+i] + end + end +end +function s.efilter(e,te) + local tc=te:GetHandler() + return not tc:IsCode(id) +end +function s.cfilter1(c,tp) + return c:IsControler(tp) and (c:IsCode(id) or c:IsSetCard(SET_SPIRIT_MESSAGE)) +end +function s.cfilter2(c) + return c:IsFaceup() and (c:IsCode(id) or c:IsSetCard(SET_SPIRIT_MESSAGE)) +end +function s.tgcon(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.cfilter1,1,nil,tp) +end +function s.tgop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_ONFIELD,0,nil) + Duel.SendtoGrave(g,REASON_EFFECT) +end +function s.cfilter3(c) + return c:IsFaceup() and c:IsCode(table.unpack(CARDS_SPIRIT_MESSAGE)) +end +function s.winop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(s.cfilter3,tp,LOCATION_ONFIELD,0,e:GetHandler()) + if g:GetClassCount(Card.GetCode)==4 then + Duel.Win(tp,WIN_REASON_DESTINY_BOARD) + end +end \ No newline at end of file diff --git a/official/c95308449.lua b/official/c95308449.lua index 4ff1c4d..7266a4a 100644 --- a/official/c95308449.lua +++ b/official/c95308449.lua @@ -1,5 +1,6 @@ --終焉のカウントダウン --Final Countdown + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/official/c95401059.lua b/official/c95401059.lua index 46f0c0c..6d7d960 100644 --- a/official/c95401059.lua +++ b/official/c95401059.lua @@ -1,7 +1,6 @@ --オルシャドール-セフィラルーツ --Shaddoll Zefracore --Modified for CrimsonAlpha - local s,id=GetID() function s.initial_effect(c) --pendulum summon @@ -22,10 +21,10 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,id) - e3:SetCondition(s.condition1) + e3:SetCondition(Condition.IsPendulumSummoned) e3:SetTarget(s.target) e3:SetOperation(s.operation) - c:RegisterEffect(e3,false,CUSTOM_REGISTER_ZEFRA) + c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_TO_GRAVE) e4:SetCondition(aux.TRUE) @@ -37,9 +36,6 @@ function s.splimit(e,c,sump,sumtype,sumpos,targetp) if c:IsSetCard(SET_SHADDOLL) or c:IsSetCard(SET_ZEFRA) then return false end return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end -function s.condition1(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM) -end function s.filter(c,e,tp) return c:IsSetCard(SET_ZEFRA) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end diff --git a/official/c96223501.lua b/official/c96223501.lua index 51cf8ad..787a32b 100644 --- a/official/c96223501.lua +++ b/official/c96223501.lua @@ -31,8 +31,8 @@ function s.initial_effect(c) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) - e4:SetCondition(function(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM) end) - c:RegisterEffect(e4,false,CUSTOM_REGISTER_ZEFRA) + e4:SetCondition(Condition.IsPendulumSummoned) + c:RegisterEffect(e4) end s.listed_series={SET_TELLARKNIGHT,SET_ZEFRA} function s.splimit(e,c,sump,sumtype,sumpos,targetp) diff --git a/official/c99185129.lua b/official/c99185129.lua index 54e470b..831f25a 100644 --- a/official/c99185129.lua +++ b/official/c99185129.lua @@ -2,6 +2,7 @@ --Nekroz of Clausolas --modified for CrimsonAlpha + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -20,7 +21,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_HAND) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCountLimit(1,id) - e2:SetCost(s.thcost) + e2:SetCost(Cost.SelfDiscard) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) @@ -28,7 +29,7 @@ function s.initial_effect(c) c2:SetRange(LOCATION_MZONE) c2:SetCountLimit(1,{id,2}) c2:SetCondition(aux.NekrozOuroCheck) - c2:SetCost(aux.SelfTributeCost) + c2:SetCost(Cost.SelfTribute) c:RegisterEffect(c2) --Negate effects and decrease ATK local e3=Effect.CreateEffect(c) @@ -46,10 +47,6 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={0xb4} -function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsDiscardable() end - Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) -end function s.thfilter(c) return c:IsSetCard(0xb4) and c:IsSpellTrap() and c:IsAbleToHand() end diff --git a/proc_fusion_spell_ext.lua b/proc_fusion_spell_ext.lua index 9822479..e903aad 100644 --- a/proc_fusion_spell_ext.lua +++ b/proc_fusion_spell_ext.lua @@ -1,3 +1,16 @@ +--The function generates a default Fusion Summon effect. By default it's usable for Spells/Traps, usage in monsters requires changing type and code afterwards. +--c card that uses the effect +--fusfilter filter for the monster to be Fusion Summoned +--matfilter restriction on the default materials returned by GetFusionMaterial +--extrafil function that returns a group of extra cards that can be used as fusion materials, and as second optional parameter the additional filter function +--extraop function called right before sending the monsters to the graveyard as material +--gc mandatory card or function returning a group to be used (for effects like Soprano) +--stage2 function called after the monster has been summoned +--exactcount +--location location where to summon fusion monsters from (default LOCATION_EXTRA) +--chkf FUSPROC flags for the fusion summon +--desc summon effect description + local geff=Effect.GlobalEffect() geff:SetType(EFFECT_TYPE_FIELD) geff:SetCode(EFFECT_EXTRA_FUSION_MATERIAL) diff --git a/proc_ritual_ext.lua b/proc_ritual_ext.lua index 7b52019..75baa17 100644 --- a/proc_ritual_ext.lua +++ b/proc_ritual_ext.lua @@ -57,12 +57,20 @@ function Ritual.UseExtraLocationCountLimit(c,rc,tp) end end end +function Ritual.GetExtraLocation(c,rc,tp) + local extra_loc_eff=Ritual.GetExtraLocationEffect(c,rc) + local extra_loc=extra_loc_eff:GetTargetRange() + if not extra_loc then return LOCATION_NOTHAND end + return extra_loc +end function Ritual.ExtraLocFilter(c,filter,_type,e,tp,m,m2,forcedselection,specificmatfilter,lv,requirementfunc,sumpos,booltype,reqfunc) if not (c:IsOriginalType(TYPE_RITUAL) and c:IsOriginalType(TYPE_MONSTER)) or (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,sumpos) then return false end local extra_loc_eff,used=Ritual.ExtraLocationOPTCheck(c,e:GetHandler(),tp) if not extra_loc_eff or extra_loc_eff and used then return false end if extra_loc_eff:GetProperty()&EFFECT_FLAG_GAIN_ONLY_ONE_PER_TURN>0 and Duel.HasFlagEffect(tp,EFFECT_FLAG_GAIN_ONLY_ONE_PER_TURN) then return false end - + local extra_loc=Ritual.GetExtraLocation(c,e:GetHandler(),tp) + if not c:IsLocation(extra_loc) then return false end + local lv=(lv and (type(lv)=="function" and lv(c)) or lv) or c:GetLevel() lv=math.max(1,lv) Ritual.SummoningLevel=lv diff --git a/users/CrimsonAlpha_002/c2002000001.lua b/users/CrimsonAlpha_002/c2002000001.lua index f34324b..5f830f4 100644 --- a/users/CrimsonAlpha_002/c2002000001.lua +++ b/users/CrimsonAlpha_002/c2002000001.lua @@ -1,4 +1,5 @@ --Amorphageum, the True King of Blight + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000002.lua b/users/CrimsonAlpha_002/c2002000002.lua index 3dd010d..5d5aba7 100644 --- a/users/CrimsonAlpha_002/c2002000002.lua +++ b/users/CrimsonAlpha_002/c2002000002.lua @@ -2,6 +2,7 @@ --3+ Pyro Monsters --This card is always treated as a "Blaze Accelerator" card.) --When your opponent activates a card or effect, while you have a "Volcanic" card on your hand (Quick Effect): You can negate the activation, and if you do that, destroy it, and if you do that, send 1 "Volcanic" card from your hand to the GY. You can only use this effect of "Volcanic Blaze Dragon" once per turn. + local s,id=GetID() function s.initial_effect(c) Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_PYRO),3) diff --git a/users/CrimsonAlpha_002/c2002000004.lua b/users/CrimsonAlpha_002/c2002000004.lua index 13f1141..353f4cc 100644 --- a/users/CrimsonAlpha_002/c2002000004.lua +++ b/users/CrimsonAlpha_002/c2002000004.lua @@ -8,7 +8,7 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetRange(LOCATION_MZONE+LOCATION_HAND) + e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,{id,1}) e1:SetCost(s.thcost) e1:SetTarget(s.thtg) diff --git a/users/CrimsonAlpha_002/c2002000005.lua b/users/CrimsonAlpha_002/c2002000005.lua index 7ecbb6a..3cbf1df 100644 --- a/users/CrimsonAlpha_002/c2002000005.lua +++ b/users/CrimsonAlpha_002/c2002000005.lua @@ -1,5 +1,6 @@ --Volcanic Nemo --If this card is sent to the GY with a card effect: Inflict 300 damage to your opponent. If this card is sent to the GY by the effect of a "Blaze Accelerator" card: You can Special Summon 1 Level 4 or Lower "Volcanic" monster from your Deck, except "Volcanic Nemo". You can only use this effect of "Volcanic Nemo" once per turn. + local s,id=GetID() function s.initial_effect(c) --damage diff --git a/users/CrimsonAlpha_002/c2002000006.lua b/users/CrimsonAlpha_002/c2002000006.lua index 76bafd8..7e83c16 100644 --- a/users/CrimsonAlpha_002/c2002000006.lua +++ b/users/CrimsonAlpha_002/c2002000006.lua @@ -1,4 +1,5 @@ --True King Cytopathy + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000007.lua b/users/CrimsonAlpha_002/c2002000007.lua index 506701e..8d944d4 100644 --- a/users/CrimsonAlpha_002/c2002000007.lua +++ b/users/CrimsonAlpha_002/c2002000007.lua @@ -1,4 +1,5 @@ --Crimson-scarfed Shinobird + local s,id=GetID() function s.initial_effect(c) --xyz summon diff --git a/users/CrimsonAlpha_002/c2002000008.lua b/users/CrimsonAlpha_002/c2002000008.lua index 7d4f782..8c8efc3 100644 --- a/users/CrimsonAlpha_002/c2002000008.lua +++ b/users/CrimsonAlpha_002/c2002000008.lua @@ -1,4 +1,5 @@ --Aussa the Terrene Charmer + local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving diff --git a/users/CrimsonAlpha_002/c2002000009.lua b/users/CrimsonAlpha_002/c2002000009.lua index 37c62ea..6c19431 100644 --- a/users/CrimsonAlpha_002/c2002000009.lua +++ b/users/CrimsonAlpha_002/c2002000009.lua @@ -1,4 +1,5 @@ --Wroughtreiver + local s,id=GetID() function s.initial_effect(c) --Special Summon this card diff --git a/users/CrimsonAlpha_002/c2002000010.lua b/users/CrimsonAlpha_002/c2002000010.lua index c694f83..35ebe14 100644 --- a/users/CrimsonAlpha_002/c2002000010.lua +++ b/users/CrimsonAlpha_002/c2002000010.lua @@ -4,6 +4,7 @@ -- are negated and it's ATK and DEF becomes 0. You can banish this card and 2 monsters in your -- GY with the same Attribute; Special Summon 1 "Familiar-Possessed" monster from your Deck -- or GY. You can only use each effect of "Charming Spirit Art - Shokan" once per turn. + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000011.lua b/users/CrimsonAlpha_002/c2002000011.lua index c294e3c..cb879b1 100644 --- a/users/CrimsonAlpha_002/c2002000011.lua +++ b/users/CrimsonAlpha_002/c2002000011.lua @@ -11,10 +11,10 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) - e1:SetTarget(s.thtg) - e1:SetOperation(s.thop) + e1:SetCost(s.cost) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) @@ -29,17 +29,32 @@ function s.initial_effect(c) e4:SetCondition(s.regcon) e4:SetOperation(s.regop) c:RegisterEffect(e4) + Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not c:IsSummonLocation(LOCATION_EXTRA) end) + end s.listed_names={74875003,CARD_RA,10000020,10000000} +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end + --Cannot Special Summon monsters from the Extra Deck + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetTargetRange(1,0) + e1:SetTarget(function(_,c) return c:IsLocation(LOCATION_EXTRA) end) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) +end function s.thfilter(c) return (c:IsCode(CARD_RA,10000020,10000000) or c:ListsCode(CARD_RA,10000020,10000000)) and c:IsAbleToHand() and not c:IsOriginalCode(id) end -function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end -function s.thop(e,tp,eg,ep,ev,re,r,rp) +function s.operation(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) if #g>0 then @@ -57,20 +72,22 @@ end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() - if rc:IsSummonType(SUMMON_TYPE_TRIBUTE) and rc:IsAttribute(ATTRIBUTE_DIVINE) - and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then - local g=rc:GetMaterial() - local atk=0 - local def=0 - for gc in aux.Next(g) do - atk=atk+gc:GetBaseAttack() - def=def+gc:GetBaseDefense() - end - if atk>4000 then atk=4000 end - if def>4000 then def=4000 end + if rc:IsSummonType(SUMMON_TYPE_TRIBUTE) and rc:IsAttribute(ATTRIBUTE_DIVINE) then + -- and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + -- local g=rc:GetMaterial() + -- local atk=0 + -- local def=0 + -- for gc in aux.Next(g) do + -- atk=atk+gc:GetBaseAttack() + -- def=def+gc:GetBaseDefense() + -- end + -- if atk>4000 then atk=4000 end + -- if def>4000 then def=4000 end + local atk=rc:GetBaseAttack()+4000 + local def=rc:GetBaseDefense()+4000 local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetDescription(aux.Stringid(id,1)) + e1:SetDescription(aux.Stringid(id,2)) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_SET_BASE_ATTACK) e1:SetValue(atk) diff --git a/users/CrimsonAlpha_002/c2002000013.lua b/users/CrimsonAlpha_002/c2002000013.lua index 180ca5b..916649a 100644 --- a/users/CrimsonAlpha_002/c2002000013.lua +++ b/users/CrimsonAlpha_002/c2002000013.lua @@ -1,5 +1,6 @@ --Volcanic Stinger --If your opponent adds a card(s) to their hand while you control a "Blaze Accelerator", except during the Draw Phase: You can Special Summon this card from your hand, and if you do, send the added card to the GY, also inflict 300 damage to your opponent. If this card is sent to the GY by the effect of a "Blaze Accelerator" card: You can send 2 "Volcanic Stingers" from your hand and/or Deck to the GY; banish the top 3 cards of your opponent's Deck. You can only use each effect of "Volcanic Stinger" once per turn. + local s,id=GetID() function s.initial_effect(c) --destroy drawn diff --git a/users/CrimsonAlpha_002/c2002000014.lua b/users/CrimsonAlpha_002/c2002000014.lua index 663cd6a..2b2bf31 100644 --- a/users/CrimsonAlpha_002/c2002000014.lua +++ b/users/CrimsonAlpha_002/c2002000014.lua @@ -1,4 +1,5 @@ --Mysti, Aide of the True Dracoslayer + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000015.lua b/users/CrimsonAlpha_002/c2002000015.lua index ac86a2b..7665e40 100644 --- a/users/CrimsonAlpha_002/c2002000015.lua +++ b/users/CrimsonAlpha_002/c2002000015.lua @@ -1,4 +1,5 @@ --Clear Wing Synchro Dragon/Assault Mode + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000016.lua b/users/CrimsonAlpha_002/c2002000016.lua index a303dd1..9d584ca 100644 --- a/users/CrimsonAlpha_002/c2002000016.lua +++ b/users/CrimsonAlpha_002/c2002000016.lua @@ -1,4 +1,5 @@ --Chosen of the Tistina + local s,id=GetID() function s.initial_effect(c) --Special Summon this card diff --git a/users/CrimsonAlpha_002/c2002000017.lua b/users/CrimsonAlpha_002/c2002000017.lua index c331488..1763a9d 100644 --- a/users/CrimsonAlpha_002/c2002000017.lua +++ b/users/CrimsonAlpha_002/c2002000017.lua @@ -1,4 +1,5 @@ --Warding Spirt Art - Kekkai + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000018.lua b/users/CrimsonAlpha_002/c2002000018.lua index ad8bb5f..d7db063 100644 --- a/users/CrimsonAlpha_002/c2002000018.lua +++ b/users/CrimsonAlpha_002/c2002000018.lua @@ -1,4 +1,5 @@ --Buster Synchron + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000019.lua b/users/CrimsonAlpha_002/c2002000019.lua index d32d10d..1a54d79 100644 --- a/users/CrimsonAlpha_002/c2002000019.lua +++ b/users/CrimsonAlpha_002/c2002000019.lua @@ -1,4 +1,5 @@ --Contraalto the Melodious Vocalist + local s,id=GetID() function s.initial_effect(c) --Xyz Summon Procedure diff --git a/users/CrimsonAlpha_002/c2002000020.lua b/users/CrimsonAlpha_002/c2002000020.lua index 687588e..50fb0ba 100644 --- a/users/CrimsonAlpha_002/c2002000020.lua +++ b/users/CrimsonAlpha_002/c2002000020.lua @@ -1,4 +1,5 @@ --Ember, Apprentice of the True Dracoslayer + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000021.lua b/users/CrimsonAlpha_002/c2002000021.lua index cdcfccc..40cb2f8 100644 --- a/users/CrimsonAlpha_002/c2002000021.lua +++ b/users/CrimsonAlpha_002/c2002000021.lua @@ -1,4 +1,5 @@ --Ceremonial Spirt Art - Gishiki + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000022.lua b/users/CrimsonAlpha_002/c2002000022.lua index f964258..9625c54 100644 --- a/users/CrimsonAlpha_002/c2002000022.lua +++ b/users/CrimsonAlpha_002/c2002000022.lua @@ -1,4 +1,5 @@ --Sword Saint of the Ice Barrier + local s,id=GetID() function s.initial_effect(c) c:SetSPSummonOnce(id) diff --git a/users/CrimsonAlpha_002/c2002000023.lua b/users/CrimsonAlpha_002/c2002000023.lua index f00cf7a..8794212 100644 --- a/users/CrimsonAlpha_002/c2002000023.lua +++ b/users/CrimsonAlpha_002/c2002000023.lua @@ -7,6 +7,7 @@ -- Monster you control leaves the field; You can Special Summon the -- Fusion Material Monsters listed on that card from your hand, Deck or -- GY. You can only use this effect of "Hyper Neo Space" once per turn. + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000024.lua b/users/CrimsonAlpha_002/c2002000024.lua index a8e479f..37b668e 100644 --- a/users/CrimsonAlpha_002/c2002000024.lua +++ b/users/CrimsonAlpha_002/c2002000024.lua @@ -1,4 +1,5 @@ --Winged Serpent of the Mist Valley + local s,id=GetID() function s.initial_effect(c) Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_WIND),2,2) diff --git a/users/CrimsonAlpha_002/c2002000025.lua b/users/CrimsonAlpha_002/c2002000025.lua index fbaf8ab..6738114 100644 --- a/users/CrimsonAlpha_002/c2002000025.lua +++ b/users/CrimsonAlpha_002/c2002000025.lua @@ -45,7 +45,8 @@ function s.econ(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function s.efilter(e,te) - return (te:IsActiveType(TYPE_MONSTER) and te:GetHandler():IsAttribute(ATTRIBUTE_LIGHT)) + return (te:IsActiveType(TYPE_MONSTER) + and (te:GetHandler():IsAttribute(ATTRIBUTE_LIGHT)) or te:GetHandler():IsType(TYPE_FLIP))) and te:IsActivated() and te:GetOwner()~=e:GetOwner() end function s.adtg(e,c) diff --git a/users/CrimsonAlpha_002/c2002000026.lua b/users/CrimsonAlpha_002/c2002000026.lua index aa8f9ad..959a98c 100644 --- a/users/CrimsonAlpha_002/c2002000026.lua +++ b/users/CrimsonAlpha_002/c2002000026.lua @@ -1,4 +1,5 @@ --W Nebula Homeworld + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000027.lua b/users/CrimsonAlpha_002/c2002000027.lua index d6e4a7b..eeb0903 100644 --- a/users/CrimsonAlpha_002/c2002000027.lua +++ b/users/CrimsonAlpha_002/c2002000027.lua @@ -1,4 +1,5 @@ --Cyber End Overdragon + local s,id=GetID() function s.initial_effect(c) --fusion material diff --git a/users/CrimsonAlpha_002/c2002000028.lua b/users/CrimsonAlpha_002/c2002000028.lua index af694f4..957a851 100644 --- a/users/CrimsonAlpha_002/c2002000028.lua +++ b/users/CrimsonAlpha_002/c2002000028.lua @@ -1,4 +1,5 @@ --Stardust Xceed Dragon + local s,id=GetID() function s.initial_effect(c) c:SetSPSummonOnce(id) diff --git a/users/CrimsonAlpha_002/c2002000029.lua b/users/CrimsonAlpha_002/c2002000029.lua index 509a885..c4e5767 100644 --- a/users/CrimsonAlpha_002/c2002000029.lua +++ b/users/CrimsonAlpha_002/c2002000029.lua @@ -1,4 +1,5 @@ --Majestic Radiant Dragon + local s,id=GetID() function s.initial_effect(c) --code diff --git a/users/CrimsonAlpha_002/c2002000030.lua b/users/CrimsonAlpha_002/c2002000030.lua index f2aca8e..2a30eae 100644 --- a/users/CrimsonAlpha_002/c2002000030.lua +++ b/users/CrimsonAlpha_002/c2002000030.lua @@ -1,4 +1,5 @@ --Majestic Synchron + local s,id=GetID() function s.initial_effect(c) --synchro summon diff --git a/users/CrimsonAlpha_002/c2002000031.lua b/users/CrimsonAlpha_002/c2002000031.lua index 23db25e..5443245 100644 --- a/users/CrimsonAlpha_002/c2002000031.lua +++ b/users/CrimsonAlpha_002/c2002000031.lua @@ -1,4 +1,5 @@ --Star Shine Shred + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000032.lua b/users/CrimsonAlpha_002/c2002000032.lua index 96aca43..5dfdf56 100644 --- a/users/CrimsonAlpha_002/c2002000032.lua +++ b/users/CrimsonAlpha_002/c2002000032.lua @@ -1,4 +1,5 @@ --Majestic Rose Dragon + local s,id=GetID() function s.initial_effect(c) --synchro summon @@ -85,7 +86,7 @@ function s.desop(opt) end end function s.filter(c) - return aux.disfilter1(c) or aux.nzatk(c) + return c:IsNegatableMonster() or aux.nzatk(c) end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end diff --git a/users/CrimsonAlpha_002/c2002000033.lua b/users/CrimsonAlpha_002/c2002000033.lua index 6a634ac..f1aade7 100644 --- a/users/CrimsonAlpha_002/c2002000033.lua +++ b/users/CrimsonAlpha_002/c2002000033.lua @@ -1,4 +1,5 @@ --Majestic Tool Dragon + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000034.lua b/users/CrimsonAlpha_002/c2002000034.lua index a9cdd29..cb9218d 100644 --- a/users/CrimsonAlpha_002/c2002000034.lua +++ b/users/CrimsonAlpha_002/c2002000034.lua @@ -1,4 +1,5 @@ --Majestic Fairy Dragon + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000036.lua b/users/CrimsonAlpha_002/c2002000036.lua index 979c1e9..9e3d6b7 100644 --- a/users/CrimsonAlpha_002/c2002000036.lua +++ b/users/CrimsonAlpha_002/c2002000036.lua @@ -1,4 +1,5 @@ --Gishki Nekrovance + local s,id=GetID() function s.initial_effect(c) local rparams={handler=c,lvtype=RITPROC_GREATER,desc=aux.Stringid(id,1),forcedselection=s.forcedselection,extrafil=s.extrafil,extratg=s.extratg} diff --git a/users/CrimsonAlpha_002/c2002000037.lua b/users/CrimsonAlpha_002/c2002000037.lua index 5094e2a..a50e6a2 100644 --- a/users/CrimsonAlpha_002/c2002000037.lua +++ b/users/CrimsonAlpha_002/c2002000037.lua @@ -1,4 +1,5 @@ --Proto Aquamirror + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000038.lua b/users/CrimsonAlpha_002/c2002000038.lua index e52f837..c5b0c3a 100644 --- a/users/CrimsonAlpha_002/c2002000038.lua +++ b/users/CrimsonAlpha_002/c2002000038.lua @@ -1,4 +1,5 @@ --Evigishki Hydra + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000039.lua b/users/CrimsonAlpha_002/c2002000039.lua index 1e2931e..522f916 100644 --- a/users/CrimsonAlpha_002/c2002000039.lua +++ b/users/CrimsonAlpha_002/c2002000039.lua @@ -1,4 +1,5 @@ --Gishki Curse + local s,id=GetID() function s.initial_effect(c) --ritual level diff --git a/users/CrimsonAlpha_002/c2002000040.lua b/users/CrimsonAlpha_002/c2002000040.lua index 01bb825..977d503 100644 --- a/users/CrimsonAlpha_002/c2002000040.lua +++ b/users/CrimsonAlpha_002/c2002000040.lua @@ -1,4 +1,5 @@ --Evisgishki Recollection + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000041.lua b/users/CrimsonAlpha_002/c2002000041.lua index ea91af8..617a9fd 100644 --- a/users/CrimsonAlpha_002/c2002000041.lua +++ b/users/CrimsonAlpha_002/c2002000041.lua @@ -1,4 +1,5 @@ --Infestation Core + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000042.lua b/users/CrimsonAlpha_002/c2002000042.lua index 14ce01e..6016de2 100644 --- a/users/CrimsonAlpha_002/c2002000042.lua +++ b/users/CrimsonAlpha_002/c2002000042.lua @@ -1,4 +1,5 @@ --Malignant Infestation + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000043.lua b/users/CrimsonAlpha_002/c2002000043.lua index 7419f71..ec5c9fc 100644 --- a/users/CrimsonAlpha_002/c2002000043.lua +++ b/users/CrimsonAlpha_002/c2002000043.lua @@ -1,4 +1,5 @@ --Stellarswarm Roach + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000044.lua b/users/CrimsonAlpha_002/c2002000044.lua index 148959e..35ed849 100644 --- a/users/CrimsonAlpha_002/c2002000044.lua +++ b/users/CrimsonAlpha_002/c2002000044.lua @@ -2,7 +2,7 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - Xyz.AddProcedure(c,nil,10,2,s.ovfilter,aux.Stringid(id,0),99,s.xyzop) + Xyz.AddProcedure(c,nil,10,2,s.ovfilter,aux.Stringid(id,0),Xyz.InfiniteMats,s.xyzop) --Unaffected by activated effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) @@ -20,7 +20,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) - e2:SetCost(aux.dxmcostgen(1,1,nil)) + e2:SetCost(Cost.Detach(1,1,nil)) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) diff --git a/users/CrimsonAlpha_002/c2002000045.lua b/users/CrimsonAlpha_002/c2002000045.lua index d27c668..6b282ab 100644 --- a/users/CrimsonAlpha_002/c2002000045.lua +++ b/users/CrimsonAlpha_002/c2002000045.lua @@ -1,4 +1,5 @@ --Infestation Assault + local s,id=GetID() function s.initial_effect(c) --Activate and (you can) Special Summon from the hand and Deck diff --git a/users/CrimsonAlpha_002/c2002000046.lua b/users/CrimsonAlpha_002/c2002000046.lua index 30cf182..22c1425 100644 --- a/users/CrimsonAlpha_002/c2002000046.lua +++ b/users/CrimsonAlpha_002/c2002000046.lua @@ -1,4 +1,5 @@ --Steelswarm Ant + local s,id=GetID() function s.initial_effect(c) --Add Pseudo-PendulumProc diff --git a/users/CrimsonAlpha_002/c2002000047.lua b/users/CrimsonAlpha_002/c2002000047.lua index d92091f..4232079 100644 --- a/users/CrimsonAlpha_002/c2002000047.lua +++ b/users/CrimsonAlpha_002/c2002000047.lua @@ -1,4 +1,5 @@ --Flamvell Oracle + local s,id=GetID() function s.initial_effect(c) --Excavate and Special Summon from your Deck diff --git a/users/CrimsonAlpha_002/c2002000048.lua b/users/CrimsonAlpha_002/c2002000048.lua index d03b2c2..487af8a 100644 --- a/users/CrimsonAlpha_002/c2002000048.lua +++ b/users/CrimsonAlpha_002/c2002000048.lua @@ -1,4 +1,5 @@ --Flamvell Rites Master + local s,id=GetID() function s.initial_effect(c) --send to gy diff --git a/users/CrimsonAlpha_002/c2002000049.lua b/users/CrimsonAlpha_002/c2002000049.lua index aec5b7d..a228524 100644 --- a/users/CrimsonAlpha_002/c2002000049.lua +++ b/users/CrimsonAlpha_002/c2002000049.lua @@ -1,4 +1,5 @@ --Flamvell Ogre + local s,id=GetID() function s.initial_effect(c) --special summon diff --git a/users/CrimsonAlpha_002/c2002000050.lua b/users/CrimsonAlpha_002/c2002000050.lua index 5455909..56bd425 100644 --- a/users/CrimsonAlpha_002/c2002000050.lua +++ b/users/CrimsonAlpha_002/c2002000050.lua @@ -1,4 +1,5 @@ --Flamvell Rising Falco + local s,id=GetID() function s.initial_effect(c) --spsummon diff --git a/users/CrimsonAlpha_002/c2002000051.lua b/users/CrimsonAlpha_002/c2002000051.lua deleted file mode 100644 index 56bdd6a..0000000 --- a/users/CrimsonAlpha_002/c2002000051.lua +++ /dev/null @@ -1,216 +0,0 @@ ---Dragunity Knight Exallion -local s,id=GetID() -function s.initial_effect(c) - --pendulum summon - Pendulum.AddProcedure(c) - --s/t synchro - local e3a=Effect.CreateEffect(c) - e3a:SetDescription(aux.Stringid(id,1)) - e3a:SetType(EFFECT_TYPE_SINGLE) - e3a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) - e3a:SetCode(CUSTOM_ST_SYNCHRO) - e3a:SetLabel(id) - e3a:SetValue(s.synval) - -- c:RegisterEffect(e3a) - --s/t synchro: effect gain - local e3b=Effect.CreateEffect(c) - e3b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) - e3b:SetRange(LOCATION_PZONE) - e3b:SetTargetRange(LOCATION_MZONE,0) - e3b:SetTarget(s.eftg) - e3b:SetLabelObject(e3a) - c:RegisterEffect(e3b) - --Can be treated as a non-Tuner for a Synchro Summon - local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_SINGLE) - e4:SetDescription(aux.Stringid(id,2)) - e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e4:SetCode(EFFECT_NONTUNER) - e4:SetRange(LOCATION_MZONE) - c:RegisterEffect(e4) - --equip itself - local e5=Effect.CreateEffect(c) - e5:SetDescription(aux.Stringid(id,3)) - e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) - e5:SetCode(EVENT_TO_DECK) - e5:SetCountLimit(1,{id,0}) - e5:SetCondition(s.eqcon) - e5:SetTarget(s.eqtg) - e5:SetOperation(s.eqop) - c:RegisterEffect(e5) - local e6=e5:Clone() - e6:SetCode(EVENT_TO_GRAVE) - e6:SetCondition(aux.TRUE) - c:RegisterEffect(e6) - local e7=e5:Clone() - e7:SetDescription(aux.Stringid(id,5)) - e7:SetCode(EVENT_TO_DECK) - e7:SetTarget(s.pentg) - e7:SetOperation(s.penop) - c:RegisterEffect(e7) - local e8=e7:Clone() - e8:SetCode(EVENT_TO_GRAVE) - e8:SetCondition(aux.TRUE) - c:RegisterEffect(e8) - --Atk up - local eq1=Effect.CreateEffect(c) - eq1:SetType(EFFECT_TYPE_EQUIP) - eq1:SetCode(EFFECT_UPDATE_ATTACK) - eq1:SetValue(500) - c:RegisterEffect(eq1) - --indes - local eq2=Effect.CreateEffect(c) - eq2:SetType(EFFECT_TYPE_EQUIP) - eq2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) - eq2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) - eq2:SetValue(1) - c:RegisterEffect(eq2) - --Destruction replacement for the equipped monster - local eq3=Effect.CreateEffect(c) - eq3:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS) - eq3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) - eq3:SetCode(EFFECT_DESTROY_REPLACE) - eq3:SetTarget(s.reptg) - eq3:SetOperation(s.repop) - c:RegisterEffect(eq3) -end -s.listed_series={SET_DRAGUNITY} --- {Pendulum Effect: Synchro Summon using Dragunity monsters in the S/T Zone] -function s.eftg(e,c) - return c:IsType(TYPE_MONSTER) - and c:IsSetCard(SET_DRAGUNITY) -end -function s.synval(e,c,sc) - if c:IsLocation(LOCATION_SZONE) then - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(CUSTOM_ST_SYNCHRO+EFFECT_SYNCHRO_CHECK) - e1:SetLabel(id) - e1:SetTarget(s.synchktg) - c:RegisterEffect(e1) - return true - else return false end -end -function s.chk(c) - if not c:IsHasEffect(CUSTOM_ST_SYNCHRO+EFFECT_SYNCHRO_CHECK) then return false end - local te={c:GetCardEffect(CUSTOM_ST_SYNCHRO+EFFECT_SYNCHRO_CHECK)} - for i=1,#te do - local e=te[i] - if e:GetLabel()~=id then return false end - end - return true -end -function s.chk2(c) - if not c:IsHasEffect(CUSTOM_ST_SYNCHRO) or c:IsHasEffect(CUSTOM_ST_SYNCHRO+EFFECT_SYNCHRO_CHECK) then return false end - local te={c:GetCardEffect(CUSTOM_ST_SYNCHRO)} - for i=1,#te do - local e=te[i] - if e:GetLabel()==id then return true end - end - return false -end -function s.synchktg(e,c,sg,tg,ntg,tsg,ntsg) - if c then - local res=true - if sg:IsExists(s.chk,1,c) or (not tg:IsExists(s.chk2,1,c) and not ntg:IsExists(s.chk2,1,c) - and not sg:IsExists(s.chk2,1,c)) then return false end - local trg=tg:Filter(s.chk,nil) - local ntrg=ntg:Filter(s.chk,nil) - return res,trg,ntrg - else - return true - end -end --- {Monster Effect: Special Summon} -function s.costfilter(c,lv) - local clv=c:GetLevel() - return clv>0 and clv0 - and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) -end -function s.spop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local lv=e:GetLabel() - local clv=c:GetLevel() - if c:IsRelateToEffect(e) and c:IsFaceup() then - Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) - lv=clv-lv - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_CHANGE_LEVEL) - e1:SetValue(lv) - e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE) - c:RegisterEffect(e1) - end -end --- {Monster Effect: Equip self} -function s.eqcon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return c:IsLocation(LOCATION_EXTRA) -end -function s.eqlimit(e,c) - return e:GetOwner()==c -end -function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local c=e:GetHandler() - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end - if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) - Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_EQUIP,c,1,0,0) - if c:IsLocation(LOCATION_GRAVE) then - Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0) - end -end -function s.eqop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end - local tc=Duel.GetFirstTarget() - if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then - Duel.Equip(tp,c,tc,true) - --Add Equip limit - local e1=Effect.CreateEffect(tc) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_EQUIP_LIMIT) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e1:SetReset(RESET_EVENT+RESETS_STANDARD) - e1:SetValue(s.eqlimit) - c:RegisterEffect(e1) - end -end -function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return (r&REASON_EFFECT)~=0 - and not c:IsReason(REASON_REPLACE) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end - return Duel.SelectEffectYesNo(e:GetOwnerPlayer(),c,96) -end -function s.repop(e,tp,eg,ep,ev,re,r,rp) - Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE) -end - -function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.CheckPendulumZones(tp) end -end -function s.penop(e,tp,eg,ep,ev,re,r,rp) - if not Duel.CheckPendulumZones(tp) then return end - local c=e:GetHandler() - if c:IsRelateToEffect(e) then - Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) - end -end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000052.lua b/users/CrimsonAlpha_002/c2002000052.lua index 73207cb..23e60ed 100644 --- a/users/CrimsonAlpha_002/c2002000052.lua +++ b/users/CrimsonAlpha_002/c2002000052.lua @@ -1,4 +1,5 @@ --Dragunity Bayonet + local s,id=GetID() function s.initial_effect(c) --Add Pseudo-PendulumProc diff --git a/users/CrimsonAlpha_002/c2002000053.lua b/users/CrimsonAlpha_002/c2002000053.lua deleted file mode 100644 index f2e50be..0000000 --- a/users/CrimsonAlpha_002/c2002000053.lua +++ /dev/null @@ -1,105 +0,0 @@ ---Dragunity Imperator of Gusto -local s,id=GetID() -function s.initial_effect(c) - --search - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetCountLimit(1,{id,0}) - e1:SetTarget(s.thtg) - e1:SetOperation(s.thop) - c:RegisterEffect(e1) - local e2=e1:Clone() - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - c:RegisterEffect(e2) - --Equip 1 WIND Dragon or Winged Beast Tuner monster to itself - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetCategory(CATEGORY_EQUIP) - e3:SetType(EFFECT_TYPE_IGNITION) - e3:SetRange(LOCATION_MZONE) - e3:SetCountLimit(1,{id,1}) - e3:SetCost(s.eqcost) - e3:SetTarget(s.eqtg) - e3:SetOperation(s.eqop) - c:RegisterEffect(e3) -end -function s.filter(c) - return c:IsAbleToHand() - and c:IsAttribute(ATTRIBUTE_WIND) - and c:IsType(TYPE_TUNER) - and (c:IsRace(RACE_DRAGON) or c:IsRace(RACE_WINGEDBEAST)) -end -function s.thtg(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) -end -function s.thop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) - if #g>0 then - Duel.SendtoHand(g,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,g) - local code=g:GetFirst():GetCode() - -- g:GetFirst():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) - --Cannot Normal Summon/Set or Special Summon that monster, or monsters with the same name for the rest of this turn - local e1=Effect.CreateEffect(e:GetHandler()) - -- e1:SetDescription(aux.Stringid(id,2)) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e1:SetTargetRange(1,0) - e1:SetTarget(function(e,c) return c:IsCode(code) end) - e1:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(e1,tp) - end -end -function s.cfilter(c) - return c:IsDiscardable() -end -function s.eqcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end - Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler()) -end -function s.eqfilter(c,ec) - return c:IsAttribute(ATTRIBUTE_WIND) - and c:IsType(TYPE_TUNER) - and (c:IsRace(RACE_DRAGON) or c:IsRace(RACE_WINGEDBEAST))and not c:IsForbidden() -end -function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end - Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK) -end -function s.eqop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) - local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,c) - if #g>0 then - Duel.Equip(tp,g:GetFirst(),c) - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_EQUIP_LIMIT) - e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) - e1:SetReset(RESET_EVENT+RESETS_STANDARD) - e1:SetValue(s.eqlimit) - e1:SetLabelObject(c) - g:GetFirst():RegisterEffect(e1) - --Cannot be Special Summoned this turn - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,2)) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) - e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e2:SetReset(RESETS_STANDARD_PHASE_END) - g:GetFirst():RegisterEffect(e2) - end - -end -function s.eqlimit(e,c) - return c==e:GetLabelObject() -end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000054.lua b/users/CrimsonAlpha_002/c2002000054.lua index 1335130..b2672e5 100644 --- a/users/CrimsonAlpha_002/c2002000054.lua +++ b/users/CrimsonAlpha_002/c2002000054.lua @@ -1,4 +1,5 @@ --Daigusto Pilica, the Valorous + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000055.lua b/users/CrimsonAlpha_002/c2002000055.lua index beb3e1b..130f820 100644 --- a/users/CrimsonAlpha_002/c2002000055.lua +++ b/users/CrimsonAlpha_002/c2002000055.lua @@ -1,4 +1,5 @@ --Gusto Rampengling + local s,id=GetID() function s.initial_effect(c) --Add Pseudo-PendulumProc diff --git a/users/CrimsonAlpha_002/c2002000056.lua b/users/CrimsonAlpha_002/c2002000056.lua index f06d4e7..a1efb26 100644 --- a/users/CrimsonAlpha_002/c2002000056.lua +++ b/users/CrimsonAlpha_002/c2002000056.lua @@ -1,4 +1,5 @@ --Wynn, Charmer of Gusto + local s,id=GetID() function s.initial_effect(c) --Set 1 "Gusto" Spell/Trap or "Quill Pen of Gulldos" from your Deck diff --git a/users/CrimsonAlpha_002/c2002000057.lua b/users/CrimsonAlpha_002/c2002000057.lua index 68e79a3..62af245 100644 --- a/users/CrimsonAlpha_002/c2002000057.lua +++ b/users/CrimsonAlpha_002/c2002000057.lua @@ -1,4 +1,5 @@ --Gusto Strike + local s,id=GetID() function s.initial_effect(c) --activate diff --git a/users/CrimsonAlpha_002/c2002000058.lua b/users/CrimsonAlpha_002/c2002000058.lua index a55a8eb..75287a2 100644 --- a/users/CrimsonAlpha_002/c2002000058.lua +++ b/users/CrimsonAlpha_002/c2002000058.lua @@ -1,4 +1,5 @@ --Charge of Gusto + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000059.lua b/users/CrimsonAlpha_002/c2002000059.lua index 931e108..12d8e68 100644 --- a/users/CrimsonAlpha_002/c2002000059.lua +++ b/users/CrimsonAlpha_002/c2002000059.lua @@ -1,4 +1,5 @@ --Naturia Bee + local s,id=GetID() function s.initial_effect(c) --Add Pseudo-PendulumProc diff --git a/users/CrimsonAlpha_002/c2002000060.lua b/users/CrimsonAlpha_002/c2002000060.lua index f1e1bda..9f2cee6 100644 --- a/users/CrimsonAlpha_002/c2002000060.lua +++ b/users/CrimsonAlpha_002/c2002000060.lua @@ -1,4 +1,5 @@ --Naturia Phoenix + local s,id=GetID() function s.initial_effect(c) --synchro summon diff --git a/users/CrimsonAlpha_002/c2002000062.lua b/users/CrimsonAlpha_002/c2002000062.lua index be5e3fc..bd64f34 100644 --- a/users/CrimsonAlpha_002/c2002000062.lua +++ b/users/CrimsonAlpha_002/c2002000062.lua @@ -1,4 +1,5 @@ --Naturia Tamer Wendi + local s,id=GetID() function s.initial_effect(c) --pendulum summon @@ -71,7 +72,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local sg=aux.SelectUnselectGroup(g,e,tp,3,3,s.tgcheck,1,tp,HINTMSG_ATOHAND) Duel.SetTargetCard(sg) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,3,tp,0) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,1,tp,0) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,2,tp,0) end diff --git a/users/CrimsonAlpha_002/c2002000063.lua b/users/CrimsonAlpha_002/c2002000063.lua index 5efcee1..a7ca024 100644 --- a/users/CrimsonAlpha_002/c2002000063.lua +++ b/users/CrimsonAlpha_002/c2002000063.lua @@ -1,4 +1,5 @@ --Naturia Reforestation + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000064.lua b/users/CrimsonAlpha_002/c2002000064.lua index 1192037..bb8f2c4 100644 --- a/users/CrimsonAlpha_002/c2002000064.lua +++ b/users/CrimsonAlpha_002/c2002000064.lua @@ -1,4 +1,5 @@ --Constellar Seyfert + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000065.lua b/users/CrimsonAlpha_002/c2002000065.lua index 105a891..a2d97e8 100644 --- a/users/CrimsonAlpha_002/c2002000065.lua +++ b/users/CrimsonAlpha_002/c2002000065.lua @@ -1,4 +1,5 @@ --Constellar Vylon + local s,id=GetID() function s.initial_effect(c) --Add Pseudo-PendulumProc diff --git a/users/CrimsonAlpha_002/c2002000066.lua b/users/CrimsonAlpha_002/c2002000066.lua index ba2780f..1576943 100644 --- a/users/CrimsonAlpha_002/c2002000066.lua +++ b/users/CrimsonAlpha_002/c2002000066.lua @@ -1,4 +1,5 @@ --Constellar Cluster + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000067.lua b/users/CrimsonAlpha_002/c2002000067.lua index 806e053..626975f 100644 --- a/users/CrimsonAlpha_002/c2002000067.lua +++ b/users/CrimsonAlpha_002/c2002000067.lua @@ -1,4 +1,5 @@ --Constellar Counterattack + local s,id=GetID() function s.initial_effect(c) --Activate(effect) diff --git a/users/CrimsonAlpha_002/c2002000068.lua b/users/CrimsonAlpha_002/c2002000068.lua index 25b7360..742546d 100644 --- a/users/CrimsonAlpha_002/c2002000068.lua +++ b/users/CrimsonAlpha_002/c2002000068.lua @@ -1,4 +1,5 @@ -- Gem-Knight Angel Quartz + local s,id=GetID() local params = {nil,nil,function(e,tp,mg) return Group.CreateGroup(),s.fcheck end} function s.initial_effect(c) diff --git a/users/CrimsonAlpha_002/c2002000069.lua b/users/CrimsonAlpha_002/c2002000069.lua index 7e42877..31177c2 100644 --- a/users/CrimsonAlpha_002/c2002000069.lua +++ b/users/CrimsonAlpha_002/c2002000069.lua @@ -1,4 +1,5 @@ --Gem-Carbuncle + local s,id=GetID() function s.initial_effect(c) --pseudo-pendulum diff --git a/users/CrimsonAlpha_002/c2002000070.lua b/users/CrimsonAlpha_002/c2002000070.lua index 474558d..9543085 100644 --- a/users/CrimsonAlpha_002/c2002000070.lua +++ b/users/CrimsonAlpha_002/c2002000070.lua @@ -1,4 +1,5 @@ --Gem-Knights' Lapis & Lazuli + local s,id=GetID() function s.initial_effect(c) --Special summon itself from hand diff --git a/users/CrimsonAlpha_002/c2002000071.lua b/users/CrimsonAlpha_002/c2002000071.lua index 232b1c5..4fa5aa2 100644 --- a/users/CrimsonAlpha_002/c2002000071.lua +++ b/users/CrimsonAlpha_002/c2002000071.lua @@ -1,4 +1,5 @@ --Gem-Knight Void Morionette + local s,id=GetID() function s.initial_effect(c) --Fusion Material diff --git a/users/CrimsonAlpha_002/c2002000073.lua b/users/CrimsonAlpha_002/c2002000073.lua index 1cf4537..f425ead 100644 --- a/users/CrimsonAlpha_002/c2002000073.lua +++ b/users/CrimsonAlpha_002/c2002000073.lua @@ -1,4 +1,5 @@ --Vylon Scout + local s,id=GetID() function s.initial_effect(c) --Special Summon diff --git a/users/CrimsonAlpha_002/c2002000074.lua b/users/CrimsonAlpha_002/c2002000074.lua index 5857efa..746e0f3 100644 --- a/users/CrimsonAlpha_002/c2002000074.lua +++ b/users/CrimsonAlpha_002/c2002000074.lua @@ -1,4 +1,5 @@ --Vylon Irregulus + local s,id=GetID() function s.initial_effect(c) aux.AddUnionProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,SET_VYLON),false,false) diff --git a/users/CrimsonAlpha_002/c2002000075.lua b/users/CrimsonAlpha_002/c2002000075.lua index de7e7cd..d7ad9ad 100644 --- a/users/CrimsonAlpha_002/c2002000075.lua +++ b/users/CrimsonAlpha_002/c2002000075.lua @@ -1,4 +1,5 @@ --Vylon Omicron + local s,id=GetID() function s.initial_effect(c) --Synchro Summon procedure diff --git a/users/CrimsonAlpha_002/c2002000076.lua b/users/CrimsonAlpha_002/c2002000076.lua index 0f0fad5..f37bbc0 100644 --- a/users/CrimsonAlpha_002/c2002000076.lua +++ b/users/CrimsonAlpha_002/c2002000076.lua @@ -1,4 +1,5 @@ --Vylon Bit + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000077.lua b/users/CrimsonAlpha_002/c2002000077.lua index f55008f..6bf4654 100644 --- a/users/CrimsonAlpha_002/c2002000077.lua +++ b/users/CrimsonAlpha_002/c2002000077.lua @@ -14,16 +14,16 @@ function s.initial_effect(c) e1:SetValue(1) e1:SetCondition(s.actcon) c:RegisterEffect(e1) - --When synchro summoned, destroy up to 3 of opponent's cards + --to hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_REMOVE) + e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetCountLimit(1,{id,0}) - e2:SetCondition(s.descon) - e2:SetTarget(s.destg) - e2:SetOperation(s.desop) + e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e2:SetCountLimit(1,id) + e2:SetTarget(s.thtg) + e2:SetOperation(s.thop) c:RegisterEffect(e2) --Special Summon 1 "Jurrac Meteor" local e3=Effect.CreateEffect(c) @@ -39,24 +39,25 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_names={17548456} +s.listed_series={SET_JURRAC} function s.actcon(e) - return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() + local bc=Duel.GetBattleMonster(e:GetHandlerPlayer()) + return bc and bc:IsFaceup() and bc:IsSetCard(SET_JURRAC) end -function s.descon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) +function s.thfilter(c) + return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsMonster() and c:IsAbleToHand() end -function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end - local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and chkc:IsControler(tp) and s.thfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end -function s.desop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) - if #g>0 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local sg=g:Select(tp,1,3,nil) - Duel.HintSelection(sg) - Duel.Destroy(sg,REASON_EFFECT) +function s.thop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) then + Duel.SendtoHand(tc,nil,REASON_EFFECT) end end function s.exspcon(e,tp,eg,ep,ev,re,r,rp) diff --git a/users/CrimsonAlpha_002/c2002000078.lua b/users/CrimsonAlpha_002/c2002000078.lua index eb514c6..11c97cb 100644 --- a/users/CrimsonAlpha_002/c2002000078.lua +++ b/users/CrimsonAlpha_002/c2002000078.lua @@ -1,4 +1,5 @@ --Noellia, Sacred Spirit of the Nekroz + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000079.lua b/users/CrimsonAlpha_002/c2002000079.lua index a2263b4..331f7b9 100644 --- a/users/CrimsonAlpha_002/c2002000079.lua +++ b/users/CrimsonAlpha_002/c2002000079.lua @@ -1,4 +1,5 @@ --Nekroz of Mind Augus + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000081.lua b/users/CrimsonAlpha_002/c2002000081.lua index ddade59..67e2ef1 100644 --- a/users/CrimsonAlpha_002/c2002000081.lua +++ b/users/CrimsonAlpha_002/c2002000081.lua @@ -1,4 +1,5 @@ --Freezing Winds of the Nekroz + local s,id=GetID() function s.initial_effect(c) --Activate(effect) diff --git a/users/CrimsonAlpha_002/c2002000082.lua b/users/CrimsonAlpha_002/c2002000082.lua index 407040a..d050317 100644 --- a/users/CrimsonAlpha_002/c2002000082.lua +++ b/users/CrimsonAlpha_002/c2002000082.lua @@ -29,6 +29,7 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_ZEFRA} +s.listed_names={29432356} function s.filter(c,e,tp) return (c:IsSetCard(SET_ZEFRA) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,false,false) @@ -69,7 +70,40 @@ function s.getmats(c,tp) return c:GetMaterial():IsExists(s.mtfilter,1,nil) and c:GetControler()==tp end function s.pzcon(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.getmats,1,nil,tp) + if not eg:IsExists(s.getmats,1,nil,tp) then return end + local tribute_chk=eg:IsExists(s.getmats,1,nil,tp) and eg:GetFirst():IsSummonType(SUMMON_TYPE_TRIBUTE) + local ritual_chk=eg:IsExists(s.getmats,1,nil,tp) and eg:GetFirst():IsSummonType(SUMMON_TYPE_RITUAL) + local extra_chk=eg:IsExists(s.getmats,1,nil,tp) and eg:GetFirst():IsPreviousLocation(LOCATION_EXTRA) + local synchro_chk,xyz_chk,link_chk,fusion_chk,special_chk=false,false,false,false,false + if not (tribute_chk or ritual_chk or extra_chk) then return end + if extra_chk or extra_chk~=false then + -- Extra Deck Mechanics + synchro_chk= eg:GetFirst():IsSummonType(SUMMON_TYPE_SYNCHRO) + xyz_chk=eg:GetFirst():IsSummonType(SUMMON_TYPE_XYZ) + link_chk=eg:GetFirst():IsSummonType(SUMMON_TYPE_LINK) + fusion_chk=eg:GetFirst():IsSummonType(SUMMON_TYPE_FUSION) + -- Contact Fusion + if not fusion_chk and eg:GetFirst():IsType(TYPE_FUSION) then + fusion_chk=extra_chk + end + -- Special Summon from Extra Deck using Zefras as fodders + if not synchro_chk and eg:GetFirst():IsType(TYPE_SYNCHRO) then + synchro_chk=extra_chk + end + if not xyz_chk and eg:GetFirst():IsType(TYPE_XYZ) then + xyz_chk=extra_chk + end + if not link_chk and eg:GetFirst():IsType(TYPE_LINK) then + link_chk=extra_chk + end + -- Zefraath / Zefratorah Metaltron / Odd-Eyes Raging Dragon Tyrant / etc... + -- Main Deck Pendulum Monsters that are Special Summoned from the Extra Deck + if not fusion_chk and not synchro_chk and not xyz_chk and not link_chk then + special_chk=extra_chk + end + end + return tribute_chk or ritual_chk or special_chk + or fusion_chk or synchro_chk or xyz_chk or link_chk end function s.tgfilter(c,tp) return c:IsSetCard(SET_ZEFRA) diff --git a/users/CrimsonAlpha_002/c2002000083.lua b/users/CrimsonAlpha_002/c2002000083.lua index 000e4e5..843f83a 100644 --- a/users/CrimsonAlpha_002/c2002000083.lua +++ b/users/CrimsonAlpha_002/c2002000083.lua @@ -1,11 +1,12 @@ --Zefratorah Metaltron local s,id=GetID() function s.initial_effect(c) - local rparams= {handler=c, - lvtype=RITPROC_EQUAL, - desc=aux.Stringid(84388461,1), - forcedselection=function(e,tp,g,sc)return g:IsContains(e:GetHandler()) end} - local rittg,ritop=Ritual.Target(rparams),Ritual.Operation(rparams) + c:SetUniqueOnField(1,0,id) + -- local rparams= {handler=c, + -- lvtype=RITPROC_EQUAL, + -- desc=aux.Stringid(84388461,1), + -- forcedselection=function(e,tp,g,sc)return g:IsContains(e:GetHandler()) end} + -- local rittg,ritop=Ritual.Target(rparams),Ritual.Operation(rparams) --pendulum summon Pendulum.AddProcedure(c) --Special Summon from Deck @@ -36,10 +37,10 @@ function s.initial_effect(c) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_FREE_CHAIN) e5:SetRange(LOCATION_MZONE) - e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetCountLimit(1) - e5:SetTarget(s.target(rittg,ritop)) - e5:SetOperation(s.operation(rittg,ritop)) + e5:SetCost(s.applycost) + e5:SetTarget(s.applytg) + e5:SetOperation(s.applyop) c:RegisterEffect(e5) --to deck local e6=Effect.CreateEffect(c) @@ -51,12 +52,17 @@ function s.initial_effect(c) e6:SetProperty(EFFECT_FLAG_CARD_TARGET) e6:SetHintTiming(0,TIMING_END_PHASE) e6:SetCountLimit(1,{id,2}) - -- e6:SetCondition(s.tdcon) + e6:SetCondition(s.tdcon) e6:SetTarget(s.tdtg) e6:SetOperation(s.tdop) c:RegisterEffect(e6) end s.listed_series={SET_ZEFRA} +function s.desfilter(c,e,tp) + return c:IsSetCard(SET_ZEFRA) + and ( c:IsLocation(LOCATION_HAND) + or c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() ) +end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ZEFRA) and c:IsLevelBelow(6) @@ -65,9 +71,15 @@ end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local loc=LOCATION_HAND+LOCATION_ONFIELD - if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then loc=LOCATION_ONFIELD end + if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then + if Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_ZEFRA),tp,LOCATION_MZONE,0,1,nil) then + loc=LOCATION_MZONE + else + return + end + end if chk==0 then - return Duel.IsExistingMatchingCard(nil,tp,loc,0,1,nil) + return Duel.IsExistingMatchingCard(s.desfilter,tp,loc,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end local g=Duel.GetMatchingGroup(nil,tp,loc,0,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) @@ -78,9 +90,15 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if not c:IsRelateToEffect(e) then return end local loc=LOCATION_HAND+LOCATION_ONFIELD local op=nil - if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then loc=LOCATION_ONFIELD end + if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then + if Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_ZEFRA),tp,LOCATION_MZONE,0,1,nil) then + loc=LOCATION_MZONE + else + return + end + end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectMatchingCard(tp,nil,tp,loc,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,loc,0,1,1,nil,e,tp) if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() @@ -134,77 +152,77 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,c) g:DeleteGroup() end -function s.filter(c,tp) - if not (c:IsSetCard(SET_ZEFRA) and c:IsType(TYPE_PENDULUM) - and c:IsHasEffect(id)) then - return false - end - if c:IsCode(84388461) and c:IsHasEffect(id) then return true end - local eff=c:GetCardEffect(id) - local te=eff:GetLabelObject() - local con=te:GetCondition() - local tg=te:GetTarget() - if (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) then - return true - end - return false -end -function s.target(rittg,ritop) - return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local c=e:GetHandler() - if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE|LOCATION_DECK,0,1,nil,tp) end - local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE|LOCATION_DECK,0,1,1,nil,tp):GetFirst() - if sc then - Duel.SendtoExtraP(sc,tp,REASON_EFFECT) - sc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) - e:SetLabelObject(sc:GetCardEffect(id):GetLabelObject()) - if sc:IsCode(84388461) and rittg(e,tp,eg,ep,ev,re,r,rp,0) then - e:SetLabel(sc:GetCode()) - return rittg(e,tp,eg,ep,ev,re,r,rp,0) - end - local te=e:GetLabelObject() - local tg=te and te:GetTarget() or nil - if chkc then return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) - e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) - if tg then - tg(e,tp,eg,ep,ev,re,r,rp,1) - end - e:SetLabelObject(te) - Duel.ClearOperationInfo(0) - end - end -end -function s.operation(rittg,ritop) - return function(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local tc=e:GetLabel() - -- Zefrasaber work-around - if tc==84388461 and rittg(e,tp,eg,ep,ev,re,r,rp,0) then - ritop(e,tp,eg,ep,ev,re,r,rp) - return - end - local te=e:GetLabelObject() - if not te then return end - local sc=te:GetHandler() - if sc:GetFlagEffect(id)==0 then - e:SetLabel(0) - e:SetLabelObject(nil) - return - end - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) - local op=te:GetOperation() - if op then - op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) - end - e:SetLabel(0) - e:SetLabelObject(nil) - -- Deprecated - -- s.actlimit(e,tp,eg,ep,ev,re,r,rp) - end -end +-- function s.filter(c,tp) + -- if not (c:IsSetCard(SET_ZEFRA) and c:IsType(TYPE_PENDULUM) + -- and c:IsHasEffect(id)) then + -- return false + -- end + -- if c:IsCode(84388461) and c:IsHasEffect(id) then return true end + -- local eff=c:GetCardEffect(id) + -- local te=eff:GetLabelObject() + -- local con=te:GetCondition() + -- local tg=te:GetTarget() + -- if (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) then + -- return true + -- end + -- return false +-- end +-- function s.target(rittg,ritop) + -- return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + -- local c=e:GetHandler() + -- if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE|LOCATION_DECK,0,1,nil,tp) end + -- local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE|LOCATION_DECK,0,1,1,nil,tp):GetFirst() + -- if sc then + -- Duel.SendtoExtraP(sc,tp,REASON_EFFECT) + -- sc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) + -- e:SetLabelObject(sc:GetCardEffect(id):GetLabelObject()) + -- if sc:IsCode(84388461) and rittg(e,tp,eg,ep,ev,re,r,rp,0) then + -- e:SetLabel(sc:GetCode()) + -- return rittg(e,tp,eg,ep,ev,re,r,rp,0) + -- end + -- local te=e:GetLabelObject() + -- local tg=te and te:GetTarget() or nil + -- if chkc then return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end + -- e:SetLabel(te:GetLabel()) + -- e:SetLabelObject(te:GetLabelObject()) + -- e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + -- if tg then + -- tg(e,tp,eg,ep,ev,re,r,rp,1) + -- end + -- e:SetLabelObject(te) + -- Duel.ClearOperationInfo(0) + -- end + -- end +-- end +-- function s.operation(rittg,ritop) + -- return function(e,tp,eg,ep,ev,re,r,rp) + -- local c=e:GetHandler() + -- local tc=e:GetLabel() + -- -- Zefrasaber work-around + -- if tc==84388461 and rittg(e,tp,eg,ep,ev,re,r,rp,0) then + -- ritop(e,tp,eg,ep,ev,re,r,rp) + -- return + -- end + -- local te=e:GetLabelObject() + -- if not te then return end + -- local sc=te:GetHandler() + -- if sc:GetFlagEffect(id)==0 then + -- e:SetLabel(0) + -- e:SetLabelObject(nil) + -- return + -- end + -- e:SetLabel(te:GetLabel()) + -- e:SetLabelObject(te:GetLabelObject()) + -- local op=te:GetOperation() + -- if op then + -- op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) + -- end + -- e:SetLabel(0) + -- e:SetLabelObject(nil) + -- -- Deprecated + -- -- s.actlimit(e,tp,eg,ep,ev,re,r,rp) + -- end +-- end function s.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) if not Duel.CheckLocation(1-tp,LOCATION_PZONE,0) and not Duel.CheckLocation(1-tp,LOCATION_PZONE,1) then return end @@ -270,4 +288,77 @@ end function s.splimfilter(e,c) return c:IsType(TYPE_PENDULUM) and not c:IsSetCard(SET_ZEFRA) +end + +function s.filter(c,e,tp,eg,ep,ev,re,r,rp,chk) + if not (c:IsSetCard(SET_ZEFRA) and c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_MONSTER)) then return false end + local effs={c:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:HasPendulumSummonCondition() then + local tg=eff:GetTarget() + if not tg or tg(e,tp,eg,ep,ev,re,r,rp,0) then + return true + end + end + end + return false +end +function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp,eg,ep,ev,re,r,rp,chk) end + local rc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp,chk):GetFirst() + Duel.SendtoExtraP(rc,tp,REASON_COST) + local available_effs={} + local effs={rc:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:HasPendulumSummonCondition() then + local tg=eff:GetTarget() + if not tg or tg(e,tp,eg,ep,ev,re,r,rp,0) then + table.insert(available_effs,eff) + end + end + end + e:SetLabelObject(available_effs) +end +function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then + local eff=e:GetLabelObject() + return eff and eff:GetTarget() and eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0,chkc) + end + if chk==0 then return true end + local eff=nil + local available_effs=e:GetLabelObject() + if #available_effs>1 then + local available_effs_desc={} + for _,eff in ipairs(available_effs) do + table.insert(available_effs_desc,eff:GetDescription()) + end + local op=Duel.SelectOption(tp,table.unpack(available_effs_desc)) + eff=available_effs[op+1] + else + eff=available_effs[1] + end + Duel.Hint(HINT_OPSELECTED,1-tp,eff:GetDescription()) + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + e:SetProperty(eff:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local tg=eff:GetTarget() + if tg then + tg(e,tp,eg,ep,ev,re,r,rp,1) + end + eff:SetLabel(e:GetLabel()) + eff:SetLabelObject(e:GetLabelObject()) + e:SetLabelObject(eff) + Duel.ClearOperationInfo(0) +end +function s.applyop(e,tp,eg,ep,ev,re,r,rp) + local eff=e:GetLabelObject() + if not eff then return end + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + local op=eff:GetOperation() + if op then + op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) + end + e:SetLabel(0) + e:SetLabelObject(nil) end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000084.lua b/users/CrimsonAlpha_002/c2002000084.lua index 2604046..f17a4d8 100644 --- a/users/CrimsonAlpha_002/c2002000084.lua +++ b/users/CrimsonAlpha_002/c2002000084.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) + -- e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) diff --git a/users/CrimsonAlpha_002/c2002000085.lua b/users/CrimsonAlpha_002/c2002000085.lua index c6c2228..a70c385 100644 --- a/users/CrimsonAlpha_002/c2002000085.lua +++ b/users/CrimsonAlpha_002/c2002000085.lua @@ -13,6 +13,7 @@ function s.initial_effect(c) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) + e2:SetCountLimit(1,{id,0}) e2:SetCost(s.thcost) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) @@ -32,16 +33,14 @@ function s.cfilter(c) return c:IsSetCard(SET_ZEFRA) and c:IsPublic() and c:IsAbleToDeckAsCost() end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_REMOVED|LOCATION_EXTRA,0,1,nil) end - local tc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_REMOVED|LOCATION_EXTRA,0,1,1,nil):GetFirst() + if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED|LOCATION_EXTRA,0,1,nil) end + local tc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED|LOCATION_EXTRA,0,1,1,nil):GetFirst() Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST) end - function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,LOCATION_GRAVE) - end function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() diff --git a/users/CrimsonAlpha_002/c2002000086.lua b/users/CrimsonAlpha_002/c2002000086.lua index 6d335ad..2ef3d9b 100644 --- a/users/CrimsonAlpha_002/c2002000086.lua +++ b/users/CrimsonAlpha_002/c2002000086.lua @@ -1,4 +1,5 @@ --Constellarknight Troivernum + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000087.lua b/users/CrimsonAlpha_002/c2002000087.lua index 6efd2a9..8aa4e82 100644 --- a/users/CrimsonAlpha_002/c2002000087.lua +++ b/users/CrimsonAlpha_002/c2002000087.lua @@ -1,4 +1,5 @@ --Constellarknight Pleaides + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000088.lua b/users/CrimsonAlpha_002/c2002000088.lua index c48ad1f..e2ef181 100644 --- a/users/CrimsonAlpha_002/c2002000088.lua +++ b/users/CrimsonAlpha_002/c2002000088.lua @@ -1,4 +1,5 @@ --Tellarknight Orionis + local s,id=GetID() function s.initial_effect(c) --Special Summon itself from the hand or GY @@ -72,7 +73,9 @@ function s.selfspop(e,tp,eg,ep,ev,re,r,rp) end end function s.thfilter(c) - return (c:IsSetCard(SET_TELLARKNIGHT) or c:IsSetCard(SET_STELLARNOVA)) and c:IsTrap() and c:IsAbleToHand() + return c:IsAbleToHand() + and (c:IsSetCard(SET_TELLARKNIGHT) and c:IsTrap()) + or (c:IsSetCard(SET_STELLARNOVA) or c:IsStellarnova()) end function s.exfilter(c) return c:IsXyzSummonable() diff --git a/users/CrimsonAlpha_002/c2002000089.lua b/users/CrimsonAlpha_002/c2002000089.lua index 86c9674..530d184 100644 --- a/users/CrimsonAlpha_002/c2002000089.lua +++ b/users/CrimsonAlpha_002/c2002000089.lua @@ -1,4 +1,5 @@ --Purging Light of the Yang Zing + local s,id=GetID() function s.initial_effect(c) --activate diff --git a/users/CrimsonAlpha_002/c2002000091.lua b/users/CrimsonAlpha_002/c2002000091.lua index ba2cf0a..c486b14 100644 --- a/users/CrimsonAlpha_002/c2002000091.lua +++ b/users/CrimsonAlpha_002/c2002000091.lua @@ -33,29 +33,30 @@ end function s.counterfilter(c) return not c:IsSummonLocation(LOCATION_EXTRA) - or c:IsType(TYPE_SYNCHRO) - or c:IsCode(id) + or (c:IsType(TYPE_SYNCHRO) + or c:IsCode(id)) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end - local e1=Effect.CreateEffect(e:GetHandler()) + local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) + e1:SetDescription(aux.Stringid(id,2)) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) - e1:SetReset(RESET_PHASE+PHASE_END) + e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,2),nil) --lizard check aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter) end -function s.lizfilter(e,c) - return not c:IsOriginalType(TYPE_SYNCHRO) -end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA) end +function s.lizfilter(e,c) + return not c:IsOriginalType(TYPE_SYNCHRO) +end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end @@ -72,6 +73,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,e,tp) local ct=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),g:GetClassCount(Card.GetAttribute)) if ct<=0 then return end @@ -90,15 +92,6 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) -- tc:RegisterEffect(e2) -- end end - --Cannot Special Summon from the Extra Deck, except Synchro Monsters - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,2)) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e1:SetTargetRange(1,0) - e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_SYNCHRO) end) - Duel.RegisterEffect(e1,tp) end -- function s.slevel(e,c) -- local lv=e:GetHandler():GetLevel() diff --git a/users/CrimsonAlpha_002/c2002000092.lua b/users/CrimsonAlpha_002/c2002000092.lua index 0ba2f13..c5890a2 100644 --- a/users/CrimsonAlpha_002/c2002000092.lua +++ b/users/CrimsonAlpha_002/c2002000092.lua @@ -1,4 +1,5 @@ --Secret Treasures of the Yang Zing + local s,id=GetID() function s.initial_effect(c) --Activate and (you can) Special Summon from the Deck diff --git a/users/CrimsonAlpha_002/c2002000093.lua b/users/CrimsonAlpha_002/c2002000093.lua index de31915..3dfc686 100644 --- a/users/CrimsonAlpha_002/c2002000093.lua +++ b/users/CrimsonAlpha_002/c2002000093.lua @@ -1,4 +1,5 @@ --Shaddoll Core Fusion + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000095.lua b/users/CrimsonAlpha_002/c2002000095.lua index 873d19c..a51432f 100644 --- a/users/CrimsonAlpha_002/c2002000095.lua +++ b/users/CrimsonAlpha_002/c2002000095.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetTarget(Fusion.SummonEffTG(table.unpack(params))) e1:SetOperation(Fusion.SummonEffOP(table.unpack(params))) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) --effect gain local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -24,6 +24,7 @@ function s.initial_effect(c) e2:SetOperation(s.effop) c:RegisterEffect(e2) end +s.listed_series={SET_SHADDOLL} function s.efffilter(c) return c:IsSetCard(SET_SHADDOLL) and c:IsType(TYPE_FUSION) @@ -50,82 +51,87 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,{id,1}) - e1:SetCost(s.cost) - e1:SetOperation(s.operation) + e1:SetCost(s.applycost) + e1:SetTarget(s.applytg) + e1:SetOperation(s.applyop) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1) end end function s.filter(c,e,tp) - if not (c:IsSetCard(SET_SHADDOLL) and c:IsType(TYPE_MONSTER) - and c:IsHasEffect(TYPE_FLIP) and c:IsAbleToGraveAsCost()) then - return false - end - local eff={c:GetCardEffect(TYPE_FLIP)} - for _,teh in ipairs(eff) do - local te=teh:GetLabelObject() - local con=te:GetCondition() - local tg=te:GetTarget() - if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) - and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) then return true end + if not (c:IsSetCard(SET_SHADDOLL) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_FLIP) and c:IsAbleToGraveAsCost()) then return false end + local effs={c:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:IsHasType(EFFECT_TYPE_FLIP) then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + return true + end + end end return false end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.applycost(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 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) - e:SetLabelObject(g) - Group.KeepAlive(g) - Duel.SendtoGrave(g,REASON_COST) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local tc=e:GetLabelObject():GetFirst() - tc:CreateEffectRelation(e) - if tc and tc:IsRelateToEffect(e) then - local eff={tc:GetCardEffect(TYPE_FLIP)} - local te=nil - local acd={} - local ac={} - for _,teh in ipairs(eff) do - local temp=teh:GetLabelObject() - local con=temp:GetCondition() - local tg=temp:GetTarget() - if (not con or con(temp,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) - and (not tg or tg(temp,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) then - table.insert(ac,teh) - table.insert(acd,temp:GetDescription()) - end - end - if #ac==1 then te=ac[1] elseif #ac>1 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) - op=Duel.SelectOption(tp,table.unpack(acd)) - op=op+1 - te=ac[op] - end - if not te then return end - Duel.ClearTargetCard() - local teh=te - te=teh:GetLabelObject() - local tg=te:GetTarget() - local op=te:GetOperation() - if tg then tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,1) end - Duel.BreakEffect() - tc:CreateEffectRelation(te) - Duel.BreakEffect() - local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) - if g then - for etc in aux.Next(g) do - etc:CreateEffectRelation(te) + local rc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + Duel.SendtoGrave(rc,REASON_COST) + local available_effs={} + local effs={rc:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:IsHasType(EFFECT_TYPE_FLIP) then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + table.insert(available_effs,eff) end end - if op then op(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,1) end - tc:ReleaseEffectRelation(te) - if g then - for etc in aux.Next(g) do - etc:ReleaseEffectRelation(te) - end + end + e:SetLabelObject(available_effs) +end +function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then + local eff=e:GetLabelObject() + return eff and eff:GetTarget() and eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0,chkc) + end + if chk==0 then return true end + local eff=nil + local available_effs=e:GetLabelObject() + if #available_effs>1 then + local available_effs_desc={} + for _,eff in ipairs(available_effs) do + table.insert(available_effs_desc,eff:GetDescription()) end + local op=Duel.SelectOption(tp,table.unpack(available_effs_desc)) + eff=available_effs[op+1] + else + eff=available_effs[1] + end + Duel.Hint(HINT_OPSELECTED,1-tp,eff:GetDescription()) + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + e:SetProperty(eff:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local tg=eff:GetTarget() + if tg then + tg(e,tp,eg,ep,ev,re,r,rp,1) + end + eff:SetLabel(e:GetLabel()) + eff:SetLabelObject(e:GetLabelObject()) + e:SetLabelObject(eff) + Duel.ClearOperationInfo(0) +end +function s.applyop(e,tp,eg,ep,ev,re,r,rp) + local eff=e:GetLabelObject() + if not eff then return end + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + local op=eff:GetOperation() + if op then + op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) end - Group.DeleteGroup(e:GetLabelObject()) + e:SetLabel(0) + e:SetLabelObject(nil) end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000096.lua b/users/CrimsonAlpha_002/c2002000096.lua index 673ca95..c794b46 100644 --- a/users/CrimsonAlpha_002/c2002000096.lua +++ b/users/CrimsonAlpha_002/c2002000096.lua @@ -1,4 +1,5 @@ --Sinister Shaddoll Chains + local s,id=GetID() function s.initial_effect(c) --Activate(effect) diff --git a/users/CrimsonAlpha_002/c2002000097.lua b/users/CrimsonAlpha_002/c2002000097.lua index 85d7c79..f019e33 100644 --- a/users/CrimsonAlpha_002/c2002000097.lua +++ b/users/CrimsonAlpha_002/c2002000097.lua @@ -1,4 +1,5 @@ --Shaddoll Wyvern + local s,id=GetID() function s.initial_effect(c) --FLIP: Destroy 1 "Shaddoll" to Special Summon a "Shaddoll" with a different Attribute @@ -10,7 +11,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) --Spell Immunity local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/users/CrimsonAlpha_002/c2002000098.lua b/users/CrimsonAlpha_002/c2002000098.lua index 305fa94..00a0edd 100644 --- a/users/CrimsonAlpha_002/c2002000098.lua +++ b/users/CrimsonAlpha_002/c2002000098.lua @@ -1,4 +1,5 @@ -- Ritual Beast Training + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000099.lua b/users/CrimsonAlpha_002/c2002000099.lua index 5ef3820..7229756 100644 --- a/users/CrimsonAlpha_002/c2002000099.lua +++ b/users/CrimsonAlpha_002/c2002000099.lua @@ -1,5 +1,6 @@ -- Ritual Beast Barrier -- When a Spell/Trap Card, or monster effect, is activated: You Banish 1 "Ritual Beast" card in your GY; negate the activation, and if you do, banish it face-down. If this card is banished from your GY: You can return 5 "Ritual Beast" cards into the Deck, from among your cards that are banished cards and/or in the GY, except "Ritual Beast Barrier"; Draw 1 card. You can only use 1 "Ritual Beast Barrier" effect per turn, and only once that turn. + local s,id=GetID() function s.initial_effect(c) --Activate(effect) diff --git a/users/CrimsonAlpha_002/c2002000100.lua b/users/CrimsonAlpha_002/c2002000100.lua index 8e7722d..d694eb4 100644 --- a/users/CrimsonAlpha_002/c2002000100.lua +++ b/users/CrimsonAlpha_002/c2002000100.lua @@ -1,4 +1,5 @@ -- Ritual Beast Ulti-Cannafalcos + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000101.lua b/users/CrimsonAlpha_002/c2002000101.lua index 378f4ec..5e79b3d 100644 --- a/users/CrimsonAlpha_002/c2002000101.lua +++ b/users/CrimsonAlpha_002/c2002000101.lua @@ -1,11 +1,14 @@ --Spiritual Beast Tamers of Valor and Shade local s,id=GetID() function s.initial_effect(c) + c:EnableReviveLimit() c:SetUniqueOnField(1,0,id) - --fusion material + --Pendulum Summon procedure + Pendulum.AddProcedure(c) + --Contact Fusion procedure c:EnableReviveLimit() - Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_RITUAL_BEAST),2) - Fusion.AddContactProc(c,s.contactfil,s.contactop,s.splimit) + Fusion.AddProcMixN(c,true,true,{aux.FilterBoolFunctionEx(Card.IsSetCard,SET_RITUAL_BEAST),aux.FilterBoolFunctionEx(Card.IsSetCard,SET_ZEFRA)},2) + Fusion.AddContactProc(c,s.contactfil,s.contactop,s.splimit,nil,1) --pos local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) @@ -41,17 +44,17 @@ function s.initial_effect(c) e3:SetOperation(s.rmop) c:RegisterEffect(e3) --pendulum set - local e4=Effect.CreateEffect(c) - e4:SetDescription(aux.Stringid(id,3)) - e4:SetType(EFFECT_TYPE_QUICK_O) - e4:SetCode(EVENT_FREE_CHAIN) - e4:SetRange(LOCATION_MZONE) - e4:SetProperty(EFFECT_FLAG_CARD_TARGET) - e4:SetHintTiming(0,TIMING_END_PHASE) - e4:SetCountLimit(1,{id,2}) - e4:SetTarget(s.pentg) - e4:SetOperation(s.penop) - c:RegisterEffect(e4) + local e5=Effect.CreateEffect(c) + e5:SetDescription(aux.Stringid(id,3)) + e5:SetType(EFFECT_TYPE_QUICK_O) + e5:SetCode(EVENT_FREE_CHAIN) + e5:SetRange(LOCATION_MZONE) + e5:SetProperty(EFFECT_FLAG_CARD_TARGET) + e5:SetHintTiming(0,TIMING_END_PHASE) + e5:SetCountLimit(1,{id,2}) + e5:SetTarget(s.pentg) + e5:SetOperation(s.penop) + c:RegisterEffect(e5) end s.listed_series={SET_RITUAL_BEAST} s.material_setcode={SET_RITUAL_BEAST} @@ -68,12 +71,10 @@ end --- function s.posfilter(c,e) return c:IsRelateToEffect(e) - and c:IsSetCard(SET_RITUAL_BEAST) and c:IsPosition(POS_DEFENSE) end function s.poscon(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(aux.FaceupFilter(Card.IsSetCard,SET_RITUAL_BEAST),1,nil) - and eg:IsExists(aux.FilterBoolFunctionEx(Card.IsPosition,POS_DEFENSE),1,nil) + return eg:IsExists(aux.FilterBoolFunctionEx(Card.IsPosition,POS_DEFENSE),1,nil) end function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsRelateToEffect(e) end @@ -87,13 +88,12 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp) Duel.ChangePosition(g,POS_FACEUP_ATTACK) end --- -function s.rmfilter(c) - return c:IsSetCard(SET_RITUAL_BEAST) - and c:IsType(TYPE_MONSTER) - and c:IsAbleToRemove() +function s.filter(c) + return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() + and (c:IsSetCard(SET_RITUAL_BEAST) or c:IsSetCard(SET_ZEFRA)) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local rg=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) + local rg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE) @@ -110,6 +110,11 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end end --- +function s.rmfilter(c) + return c:IsType(TYPE_MONSTER) + and (c:IsSetCard(SET_RITUAL_BEAST) and c:IsAbleToRemove() + or (c:IsType(TYPE_PENDULUM) and c:IsSetCard(SET_ZEFRA) and not c:IsForbidden())) +end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK) @@ -118,14 +123,21 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_DECK,0,1,1,nil) local tc=g:GetFirst() - if tc then + if tc:IsType(TYPE_PENDULUM) and tc:IsSetCard(SET_ZEFRA) then + -- ask first + if Duel.SelectYesNo(tp,aux.Stringid(id,4)) then + Duel.SendtoExtraP(tc,tp,REASON_EFFECT) + else + Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) + end + else Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end --- function s.spfilter(c,e,tp) - return c:IsSetCard(SET_RITUAL_BEAST) - and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) + return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) + and (c:IsSetCard(SET_RITUAL_BEAST) or c:IsSetCard(SET_ZEFRA)) end function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return false end diff --git a/users/CrimsonAlpha_002/c2002000102.lua b/users/CrimsonAlpha_002/c2002000102.lua index a6a31bc..628fb02 100644 --- a/users/CrimsonAlpha_002/c2002000102.lua +++ b/users/CrimsonAlpha_002/c2002000102.lua @@ -1,4 +1,5 @@ --Apoqliphort Administrator + local s,id=GetID() function s.initial_effect(c) c:EnableUnsummonable() diff --git a/users/CrimsonAlpha_002/c2002000103.lua b/users/CrimsonAlpha_002/c2002000103.lua index fade906..ac5b3a3 100644 --- a/users/CrimsonAlpha_002/c2002000103.lua +++ b/users/CrimsonAlpha_002/c2002000103.lua @@ -6,6 +6,7 @@ -- Monster Zones, except during the turn this card was sent to the GY: You can banish this card -- from your GY; Special Summon 2 "Qliphort Tokens" (Machine/EARTH/Level 4/ATK 1800/DEF 1000). -- You can only activate 1 "Apoqliphort Advent" once per turn. + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000104.lua b/users/CrimsonAlpha_002/c2002000104.lua index 11c51e8..cfe771e 100644 --- a/users/CrimsonAlpha_002/c2002000104.lua +++ b/users/CrimsonAlpha_002/c2002000104.lua @@ -1,4 +1,5 @@ --Qliphort Datamiel + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000105.lua b/users/CrimsonAlpha_002/c2002000105.lua index 598eceb..5c93ae9 100644 --- a/users/CrimsonAlpha_002/c2002000105.lua +++ b/users/CrimsonAlpha_002/c2002000105.lua @@ -4,6 +4,7 @@ --● Target up to 2 "Qli" cards in your Pendulum Zones; Special Summon them. --● Place up to 2 face-up "Qli" Pendulum Monsters from your Extra Deck to your Pendulum Zones. --You cannot Special Summon monsters during the turn you activate this card, except "Qli" monsters. You can only activate 1 "Qlient Re-Access" once per turn. + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000107.lua b/users/CrimsonAlpha_002/c2002000107.lua index 43f78b5..f1e85bb 100644 --- a/users/CrimsonAlpha_002/c2002000107.lua +++ b/users/CrimsonAlpha_002/c2002000107.lua @@ -1,4 +1,5 @@ --Enveloping Void + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000108.lua b/users/CrimsonAlpha_002/c2002000108.lua index a42752f..7416103 100644 --- a/users/CrimsonAlpha_002/c2002000108.lua +++ b/users/CrimsonAlpha_002/c2002000108.lua @@ -1,4 +1,4 @@ ---Spiritual Beast Gusto Falco +--Spiritual Beast Falco local s,id=GetID() function s.initial_effect(c) c:SetSPSummonOnce(id) @@ -28,16 +28,8 @@ function s.initial_effect(c) local e3=e2:Clone() e3:SetCode(EVENT_SUMMON_SUCCESS) c:RegisterEffect(e3) - --Can be treated as level 3 for a Synchro Summon - local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_SINGLE) - e4:SetRange(LOCATION_ONFIELD) - e4:SetCode(EFFECT_SYNCHRO_LEVEL) - e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) - e4:SetValue(s.slevel) - c:RegisterEffect(e4) end -s.listed_series={SET_RITUAL_BEAST,SET_RITUAL_BEAST_TAMER,SET_GUSTO} +s.listed_series={SET_RITUAL_BEAST,SET_RITUAL_BEAST_TAMER} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 end @@ -58,13 +50,13 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end function s.tkntg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsPlayerCanSpecialSummonMonster(tp,2002000109,SET_RITUAL_BEAST_TAMER|SET_GUSTO,0x4011,200,1000,2,RACE_PSYCHIC,ATTRIBUTE_WIND) end + and Duel.IsPlayerCanSpecialSummonMonster(tp,2002000109,SET_RITUAL_BEAST_TAMER,0x4011,200,1000,2,RACE_PSYCHIC,ATTRIBUTE_WIND) end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) end function s.tknop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsPlayerCanSpecialSummonMonster(tp,2002000109,SET_RITUAL_BEAST_TAMER|SET_GUSTO,0x4011,200,1000,2,RACE_PSYCHIC,ATTRIBUTE_WIND) then + and Duel.IsPlayerCanSpecialSummonMonster(tp,2002000109,SET_RITUAL_BEAST_TAMER,0x4011,200,1000,2,RACE_PSYCHIC,ATTRIBUTE_WIND) then local token=Duel.CreateToken(tp,2002000109) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE) local e1=Effect.CreateEffect(e:GetHandler()) @@ -97,5 +89,5 @@ function s.slevel(e,c) end function s.matlimit(e,c) if not c then return false end - return not (c:IsSetCard(SET_RITUAL_BEAST) or c:IsSetCard(SET_GUSTO)) + return not c:IsSetCard(SET_RITUAL_BEAST) end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000111.lua b/users/CrimsonAlpha_002/c2002000111.lua index e6ba516..915fd1b 100644 --- a/users/CrimsonAlpha_002/c2002000111.lua +++ b/users/CrimsonAlpha_002/c2002000111.lua @@ -1,4 +1,5 @@ --Orcustrion the Knightmare Guardragon + local s,id=GetID() function s.initial_effect(c) --link summon diff --git a/users/CrimsonAlpha_002/c2002000112.lua b/users/CrimsonAlpha_002/c2002000112.lua index c3cd5c7..f2ddf08 100644 --- a/users/CrimsonAlpha_002/c2002000112.lua +++ b/users/CrimsonAlpha_002/c2002000112.lua @@ -1,4 +1,5 @@ --Silver Wing Magician + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000113.lua b/users/CrimsonAlpha_002/c2002000113.lua index 805945b..6cae95b 100644 --- a/users/CrimsonAlpha_002/c2002000113.lua +++ b/users/CrimsonAlpha_002/c2002000113.lua @@ -1,5 +1,6 @@ --超魔導破壊剣士-ブラック・パラディン --Dark Paladin of the Destruction Sword + local s,id=GetID() function s.initial_effect(c) --fusion material diff --git a/users/CrimsonAlpha_002/c2002000114.lua b/users/CrimsonAlpha_002/c2002000114.lua index c73b7c9..635ca0f 100644 --- a/users/CrimsonAlpha_002/c2002000114.lua +++ b/users/CrimsonAlpha_002/c2002000114.lua @@ -1,4 +1,5 @@ --Majestyx the True Dracomaiden + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000115.lua b/users/CrimsonAlpha_002/c2002000115.lua index 733dbf3..bc68f74 100644 --- a/users/CrimsonAlpha_002/c2002000115.lua +++ b/users/CrimsonAlpha_002/c2002000115.lua @@ -1,4 +1,5 @@ --Scarlight Red Dragon Archfiend/Assault Mode + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000116.lua b/users/CrimsonAlpha_002/c2002000116.lua index d561faa..8a0701e 100644 --- a/users/CrimsonAlpha_002/c2002000116.lua +++ b/users/CrimsonAlpha_002/c2002000116.lua @@ -1,6 +1,7 @@ --Volcanic Trigger --(This card is always treated as a "Blaze Accelerator" card.) --During the Main or Battle Phase (Quick Effect): You can send this card from your hand or field to the GY. If this card is sent to the GY: Inflict 300 damage to your opponent. If this card is sent to the GY by the effect of a "Blaze Accelerator" card: You can send 1 "Volcanic" monster from your hand or Deck to the GY, except "Volcanic Trigger". You can only use this effect of "Volcanic Trigger" once per turn. + local s,id=GetID() function s.initial_effect(c) --suicide diff --git a/users/CrimsonAlpha_002/c2002000117.lua b/users/CrimsonAlpha_002/c2002000117.lua index bf46a11..d1dec7c 100644 --- a/users/CrimsonAlpha_002/c2002000117.lua +++ b/users/CrimsonAlpha_002/c2002000117.lua @@ -1,4 +1,5 @@ --Red-Eyes Zombie Necro Dragon/Assault Mode + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000118.lua b/users/CrimsonAlpha_002/c2002000118.lua index e9b9138..81661f2 100644 --- a/users/CrimsonAlpha_002/c2002000118.lua +++ b/users/CrimsonAlpha_002/c2002000118.lua @@ -1,4 +1,5 @@ --Blue-Eyes Alternative Shining Dragon + local s,id=GetID() function s.initial_effect(c) --synchro summon diff --git a/users/CrimsonAlpha_002/c2002000119.lua b/users/CrimsonAlpha_002/c2002000119.lua index 357e4d0..e07d889 100644 --- a/users/CrimsonAlpha_002/c2002000119.lua +++ b/users/CrimsonAlpha_002/c2002000119.lua @@ -1,4 +1,5 @@ --Artifact Twin Scythe + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000120.lua b/users/CrimsonAlpha_002/c2002000120.lua index dfd50c8..e79f7ca 100644 --- a/users/CrimsonAlpha_002/c2002000120.lua +++ b/users/CrimsonAlpha_002/c2002000120.lua @@ -1,4 +1,5 @@ --True King's Pathogenesis + local s,id=GetID() function s.initial_effect(c) --activate diff --git a/users/CrimsonAlpha_002/c2002000122.lua b/users/CrimsonAlpha_002/c2002000122.lua index d2b5604..97980b5 100644 --- a/users/CrimsonAlpha_002/c2002000122.lua +++ b/users/CrimsonAlpha_002/c2002000122.lua @@ -1,5 +1,6 @@ --Make Shift Blaze Accelerator --Discard 1 card; send 1 "Volcanic" monster from your Deck to the GY. If a "Blaze Accelerator" card(s) you control would be destroyed, you can banish this card from your GY instead. You can only activate 1 "Make Shift Blaze Accelerator" once per turn. + local s,id=GetID() function s.initial_effect(c) --send diff --git a/users/CrimsonAlpha_002/c2002000123.lua b/users/CrimsonAlpha_002/c2002000123.lua index cb21ac4..d011d66 100644 --- a/users/CrimsonAlpha_002/c2002000123.lua +++ b/users/CrimsonAlpha_002/c2002000123.lua @@ -1,4 +1,5 @@ --Venin, the Corroding True Dracoverlord + local s,id=GetID() function s.initial_effect(c) Pendulum.AddProcedure(c) diff --git a/users/CrimsonAlpha_002/c2002000124.lua b/users/CrimsonAlpha_002/c2002000124.lua index 474d4ef..3344e06 100644 --- a/users/CrimsonAlpha_002/c2002000124.lua +++ b/users/CrimsonAlpha_002/c2002000124.lua @@ -1,4 +1,5 @@ --Eria the Blizzard Charmer + local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving diff --git a/users/CrimsonAlpha_002/c2002000125.lua b/users/CrimsonAlpha_002/c2002000125.lua index 3d67bee..46a782a 100644 --- a/users/CrimsonAlpha_002/c2002000125.lua +++ b/users/CrimsonAlpha_002/c2002000125.lua @@ -1,5 +1,6 @@ --Omega Blaze Accelerator --When this card is activated: Add 1 "Volcanic" monster from your Deck to your hand. Each time your opponent takes damage from a card effect, place 1 Blaze Counter on this card. "Volcanic" monsters you control gain 100 ATK for each Blaze Counter on this card. During the Main Phase: You can send this card to the GY; Special Summon 1 "Volcanic" monster from your hand or Deck, whose Level is less than or equal to the number of Blaze Counters this card had on the field, ignoring its Summoning Conditions. You can only activate 1 "Omega Blaze Accelerator" once per turn. + local s,id=GetID() function s.initial_effect(c) c:EnableCounterPermit(COUNTER_BLAZE) diff --git a/users/CrimsonAlpha_002/c2002000126.lua b/users/CrimsonAlpha_002/c2002000126.lua index bb51165..469f85a 100644 --- a/users/CrimsonAlpha_002/c2002000126.lua +++ b/users/CrimsonAlpha_002/c2002000126.lua @@ -1,4 +1,5 @@ --Artifact Manifestation + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000127.lua b/users/CrimsonAlpha_002/c2002000127.lua index 11f96f3..ff38dfe 100644 --- a/users/CrimsonAlpha_002/c2002000127.lua +++ b/users/CrimsonAlpha_002/c2002000127.lua @@ -1,4 +1,5 @@ --Skyscraper - Toon City + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000128.lua b/users/CrimsonAlpha_002/c2002000128.lua index 7d73723..c35f028 100644 --- a/users/CrimsonAlpha_002/c2002000128.lua +++ b/users/CrimsonAlpha_002/c2002000128.lua @@ -1,4 +1,5 @@ --Beloved Aid of the Destruction Swordsman + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000129.lua b/users/CrimsonAlpha_002/c2002000129.lua index 6aba8ed..c713a05 100644 --- a/users/CrimsonAlpha_002/c2002000129.lua +++ b/users/CrimsonAlpha_002/c2002000129.lua @@ -1,4 +1,5 @@ --Eldritch Countdown + local s,id=GetID() function s.initial_effect(c) --Final Countdown enhancement diff --git a/users/CrimsonAlpha_002/c2002000130.lua b/users/CrimsonAlpha_002/c2002000130.lua index 8e92053..c6e2512 100644 --- a/users/CrimsonAlpha_002/c2002000130.lua +++ b/users/CrimsonAlpha_002/c2002000130.lua @@ -1,4 +1,5 @@ --Elemental Conflux + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000131.lua b/users/CrimsonAlpha_002/c2002000131.lua index a6ab5a7..348e539 100644 --- a/users/CrimsonAlpha_002/c2002000131.lua +++ b/users/CrimsonAlpha_002/c2002000131.lua @@ -1,5 +1,6 @@ --Volcanic Seeker --If your opponent takes damage from a card effect while this card is in the GY: You can Special Summon this card from your GY, then inflict 300 damage to your opponent. If this card is sent to the GY by the effect of a "Blaze Accelerator" card: You can destroy 1 random card in your opponent's hand. You can only use this effect of "Volcanic Seeker" once per turn. + local s,id=GetID() function s.initial_effect(c) --special summon diff --git a/users/CrimsonAlpha_002/c2002000132.lua b/users/CrimsonAlpha_002/c2002000132.lua index 43d1b59..6b340b0 100644 --- a/users/CrimsonAlpha_002/c2002000132.lua +++ b/users/CrimsonAlpha_002/c2002000132.lua @@ -1,4 +1,5 @@ --Blue-Eyes Ultimate Toon Dragon + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000133.lua b/users/CrimsonAlpha_002/c2002000133.lua index 40b4408..743cc84 100644 --- a/users/CrimsonAlpha_002/c2002000133.lua +++ b/users/CrimsonAlpha_002/c2002000133.lua @@ -1,4 +1,5 @@ --Descend! Elemental HERO Terra Firma! + local s,id=GetID() function s.initial_effect(c) --Change its name to "Polymerization" diff --git a/users/CrimsonAlpha_002/c2002000134.lua b/users/CrimsonAlpha_002/c2002000134.lua index 085fb05..36440f8 100644 --- a/users/CrimsonAlpha_002/c2002000134.lua +++ b/users/CrimsonAlpha_002/c2002000134.lua @@ -1,4 +1,5 @@ --Vesicaru, the Festering True Dracolord + local s,id=GetID() function s.initial_effect(c) Pendulum.AddProcedure(c) diff --git a/users/CrimsonAlpha_002/c2002000135.lua b/users/CrimsonAlpha_002/c2002000135.lua index c38ea00..cf9c5ef 100644 --- a/users/CrimsonAlpha_002/c2002000135.lua +++ b/users/CrimsonAlpha_002/c2002000135.lua @@ -1,4 +1,5 @@ --Toon Fusion + local s,id=GetID() function s.initial_effect(c) local e1=Fusion.CreateSummonEff(c,aux.FilterBoolFunction(Card.IsSetCard,SET_TOON),nil,s.fextra,s.extraop,nil,nil,nil,nil,nil,nil,nil,nil,nil,s.extratg) diff --git a/users/CrimsonAlpha_002/c2002000136.lua b/users/CrimsonAlpha_002/c2002000136.lua index cf93741..e342970 100644 --- a/users/CrimsonAlpha_002/c2002000136.lua +++ b/users/CrimsonAlpha_002/c2002000136.lua @@ -1,4 +1,5 @@ --Odd-Eyes Hyperlink Dragon + local s,id=GetID() local TYPES=TYPE_FUSION+TYPE_RITUAL+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM function s.initial_effect(c) diff --git a/users/CrimsonAlpha_002/c2002000137.lua b/users/CrimsonAlpha_002/c2002000137.lua index 4b6a0d9..5245faa 100644 --- a/users/CrimsonAlpha_002/c2002000137.lua +++ b/users/CrimsonAlpha_002/c2002000137.lua @@ -7,11 +7,14 @@ function s.initial_effect(c) c:RegisterEffect(e0) --extra summon local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetCondition(s.sumcon) - e1:SetTarget(s.sumtg) - e1:SetOperation(s.sumop) + e1:SetCountLimit(1,id) + e1:SetCost(s.cost) + e1:SetCondition(s.condition) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) @@ -23,19 +26,33 @@ function s.initial_effect(c) e3:SetCondition(s.regcon) e3:SetOperation(s.regop) c:RegisterEffect(e3) + Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not c:IsSummonLocation(LOCATION_EXTRA) end) end s.listed_names={74875003,CARD_RA,10000020,10000000} -function s.sumcon(e,tp,eg,ep,ev,re,r,rp) +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end + --Cannot Special Summon monsters from the Extra Deck + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetTargetRange(1,0) + e1:SetTarget(function(_,c) return c:IsLocation(LOCATION_EXTRA) end) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) +end +function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsPlayerCanAdditionalSummon(tp) end -function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanSummon(tp) end end function s.extg(e,c) return c:IsCode(CARD_RA,10000020,10000000) or c:ListsCode(CARD_RA,10000020,10000000) end -function s.sumop(e,tp,eg,ep,ev,re,r,rp) +function s.operation(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) @@ -56,7 +73,7 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp) --immune local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetDescription(aux.Stringid(id,1)) + e1:SetDescription(aux.Stringid(id,2)) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_IMMUNE_EFFECT) @@ -70,15 +87,17 @@ function s.immcon(e) end function s.efilter(e,te) if te:IsActiveType(TYPE_MONSTER) and te:IsActivated() and te:GetHandler()~=e:GetHandler() then - local lv=e:GetHandler():GetLevel() + -- local lv=e:GetHandler():GetLevel() + -- local ec=te:GetOwner() + -- if ec:IsType(TYPE_LINK) then + -- return ec:GetLink()<=lv + -- elseif ec:IsType(TYPE_XYZ) then + -- return ec:GetOriginalRank()<=lv + -- else + -- return ec:GetOriginalLevel()<=lv + -- end local ec=te:GetOwner() - if ec:IsType(TYPE_LINK) then - return ec:GetLink()<=lv - elseif ec:IsType(TYPE_XYZ) then - return ec:GetOriginalRank()<=lv - else - return ec:GetOriginalLevel()<=lv - end + return ec:GetAttribute(TYPE_DIVINE) else return false end diff --git a/users/CrimsonAlpha_002/c2002000138.lua b/users/CrimsonAlpha_002/c2002000138.lua index 06dd8b3..8ef55f8 100644 --- a/users/CrimsonAlpha_002/c2002000138.lua +++ b/users/CrimsonAlpha_002/c2002000138.lua @@ -1,5 +1,6 @@ --Volcanic Dart --If this card is sent to the GY with a card effect: Inflict 300 damage to your opponent. If this card is sent to the GY by the effect of a "Blaze Accelerator" card: You can add 1 "Volcanic" or "Blaze Accelerator" card from your Deck to your hand, except "Volcanic Dart". You can only use this effect of "Volcanic Dart" once per turn. + local s,id=GetID() function s.initial_effect(c) --damage diff --git a/users/CrimsonAlpha_002/c2002000139.lua b/users/CrimsonAlpha_002/c2002000139.lua index 020f7eb..586d06b 100644 --- a/users/CrimsonAlpha_002/c2002000139.lua +++ b/users/CrimsonAlpha_002/c2002000139.lua @@ -1,5 +1,6 @@ --Advanced Tactics --Special Summon 1 Level 10 monster that requires 3 or more Tributes to be Normal Summoned/Set from your hand in face-down Defense Position, ignoring its Summoning Conditions, and if you do, add 1 monster with the same name from your Deck. You can treat the Summoned monster as 3 Tributes for the Tribute Summon of a monster during this turn. For the rest of this turn after you activate this card, you cannot Special Summon from the Extra Deck. You can only activate 1 "Advanced Tactics" once per turn. + local s,id=GetID() function s.initial_effect(c) -- diff --git a/users/CrimsonAlpha_002/c2002000140.lua b/users/CrimsonAlpha_002/c2002000140.lua index ffce7a4..bf7431d 100644 --- a/users/CrimsonAlpha_002/c2002000140.lua +++ b/users/CrimsonAlpha_002/c2002000140.lua @@ -1,6 +1,7 @@ --Volcanic Mine --(This is always treated as a "Blaze Accelerator" card.) --If this card is sent from the field to the GY (by battle or card effect): You can send 1 "Volcanic" monster from your hand or Deck to the GY, then inflict 500 damage to your opponent. You can only use this effect of "Volcanic Mine" once per turn. + local s,id=GetID() function s.initial_effect(c) --search diff --git a/users/CrimsonAlpha_002/c2002000141.lua b/users/CrimsonAlpha_002/c2002000141.lua index e1e0b6d..5ea598b 100644 --- a/users/CrimsonAlpha_002/c2002000141.lua +++ b/users/CrimsonAlpha_002/c2002000141.lua @@ -1,5 +1,6 @@ --Terra Firma Magna Slash! --When a card or effect is activated, while you control "Elemental HERO Terra Firma": You can negate the activation, and if you do, destroy it, then you can look at your opponent's hand, and if you do that, return 1 card from your opponent's hand, field or GY, to the Deck. You can only activate 1 "Terra Firma Magna Slash!" once per turn + local s,id=GetID() function s.initial_effect(c) --Activate(effect) diff --git a/users/CrimsonAlpha_002/c2002000142.lua b/users/CrimsonAlpha_002/c2002000142.lua index ae7abd8..204e098 100644 --- a/users/CrimsonAlpha_002/c2002000142.lua +++ b/users/CrimsonAlpha_002/c2002000142.lua @@ -1,4 +1,5 @@ --Exodo Necroflame + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000143.lua b/users/CrimsonAlpha_002/c2002000143.lua index 22925ab..a542d25 100644 --- a/users/CrimsonAlpha_002/c2002000143.lua +++ b/users/CrimsonAlpha_002/c2002000143.lua @@ -1,4 +1,5 @@ --Possessed Spirit Art - Kaijo + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000144.lua b/users/CrimsonAlpha_002/c2002000144.lua index af70570..9bf2364 100644 --- a/users/CrimsonAlpha_002/c2002000144.lua +++ b/users/CrimsonAlpha_002/c2002000144.lua @@ -1,4 +1,5 @@ --Paradox Synchron + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000145.lua b/users/CrimsonAlpha_002/c2002000145.lua index 3bcc8a3..a084021 100644 --- a/users/CrimsonAlpha_002/c2002000145.lua +++ b/users/CrimsonAlpha_002/c2002000145.lua @@ -1,4 +1,5 @@ --Gersemi the Nordic Ascendant + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000146.lua b/users/CrimsonAlpha_002/c2002000146.lua index 630c767..011c99d 100644 --- a/users/CrimsonAlpha_002/c2002000146.lua +++ b/users/CrimsonAlpha_002/c2002000146.lua @@ -1,4 +1,5 @@ --Cyber Dragon Fünf + local s,id=GetID() function s.initial_effect(c) --search diff --git a/users/CrimsonAlpha_002/c2002000147.lua b/users/CrimsonAlpha_002/c2002000147.lua index cc6e0e7..fbc179a 100644 --- a/users/CrimsonAlpha_002/c2002000147.lua +++ b/users/CrimsonAlpha_002/c2002000147.lua @@ -1,4 +1,5 @@ --Ascension of the Destruction Swordsmaster + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000148.lua b/users/CrimsonAlpha_002/c2002000148.lua index d29e1e8..f5275b4 100644 --- a/users/CrimsonAlpha_002/c2002000148.lua +++ b/users/CrimsonAlpha_002/c2002000148.lua @@ -1,4 +1,5 @@ --Infector Pain, the True Dracoverlord + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000150.lua b/users/CrimsonAlpha_002/c2002000150.lua index 17c3553..5c1b2ef 100644 --- a/users/CrimsonAlpha_002/c2002000150.lua +++ b/users/CrimsonAlpha_002/c2002000150.lua @@ -1,4 +1,5 @@ --Injection Fairy Annie + local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) diff --git a/users/CrimsonAlpha_002/c2002000151.lua b/users/CrimsonAlpha_002/c2002000151.lua index 53dd3a4..25aae33 100644 --- a/users/CrimsonAlpha_002/c2002000151.lua +++ b/users/CrimsonAlpha_002/c2002000151.lua @@ -1,4 +1,5 @@ --Injection Fairy Lizzie + local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) diff --git a/users/CrimsonAlpha_002/c2002000152.lua b/users/CrimsonAlpha_002/c2002000152.lua index fde8d0e..fd82092 100644 --- a/users/CrimsonAlpha_002/c2002000152.lua +++ b/users/CrimsonAlpha_002/c2002000152.lua @@ -1,4 +1,5 @@ --Injection Fairy Caroline + local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) diff --git a/users/CrimsonAlpha_002/c2002000153.lua b/users/CrimsonAlpha_002/c2002000153.lua index 9f6437a..e863115 100644 --- a/users/CrimsonAlpha_002/c2002000153.lua +++ b/users/CrimsonAlpha_002/c2002000153.lua @@ -1,4 +1,5 @@ --Injection Fairy Mary + local s,id=GetID() function s.initial_effect(c) c:AddSetcodesRule(0x990) diff --git a/users/CrimsonAlpha_002/c2002000154.lua b/users/CrimsonAlpha_002/c2002000154.lua index 503b1d3..e67a68d 100644 --- a/users/CrimsonAlpha_002/c2002000154.lua +++ b/users/CrimsonAlpha_002/c2002000154.lua @@ -16,25 +16,24 @@ function s.initial_effect(c) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) - --attack again + --lingering: pierce+double damage local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) - e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e2:SetCode(EVENT_BATTLE_DESTROYED) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) - e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) - e2:SetCondition(s.atkcon) - e2:SetOperation(s.atkop) + e2:SetCountLimit(1,{id,1}) + e2:SetOperation(s.lingop) c:RegisterEffect(e2) end -s.listed_series={0x990} +s.listed_series={SET_INJECTION_FAIRY} function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsPublic() and c:GetFlagEffect(id)==0 end c:RegisterFlagEffect(id,RESET_CHAIN,0,1) end function s.filter(c) - return c:IsSetCard(0x990) and c:IsFaceup() and c:IsAbleToHand() and not c:IsCode(id) + return c:IsSetCard(SET_INJECTION_FAIRY) and c:IsFaceup() and c:IsAbleToHand() and not c:IsCode(id) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end @@ -60,10 +59,41 @@ end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local des=eg:GetFirst() local rc=des:GetReasonCard() - return des:IsType(TYPE_MONSTER) and rc:IsRelateToBattle() and rc:IsSetCard(0x990) + return des:IsType(TYPE_MONSTER) and rc:IsRelateToBattle() and rc:IsSetCard(SET_INJECTION_FAIRY) and rc:CanChainAttack() and rc:IsStatus(STATUS_OPPO_BATTLE) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) Duel.ChainAttack() end +function s.pietg(e,c) + return c:IsSetCard(SET_INJECTION_FAIRY) +end +function s.lingop(e,tp,eg,ep,ev,re,r,rp) + --double attack + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_EXTRA_ATTACK) + e1:SetTargetRange(LOCATION_MZONE,0) + e1:SetTarget(s.pietg) + e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) + e1:SetValue(1) + Duel.RegisterEffect(e1,tp) + --pierce + -- local e1=Effect.CreateEffect(e:GetHandler()) + -- e1:SetType(EFFECT_TYPE_FIELD) + -- e1:SetCode(EFFECT_PIERCE) + -- e1:SetTargetRange(LOCATION_MZONE,0) + -- e1:SetTarget(s.pietg) + -- e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) + -- Duel.RegisterEffect(e1,tp) + -- --double battle damage + -- local e2=Effect.CreateEffect(e:GetHandler()) + -- e2:SetType(EFFECT_TYPE_FIELD) + -- e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) + -- e2:SetTargetRange(LOCATION_MZONE,0) + -- e2:SetCondition(s.damcon) + -- e2:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE)) + -- e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) + -- Duel.RegisterEffect(e2,tp) +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000155.lua b/users/CrimsonAlpha_002/c2002000155.lua index 82d3b65..adefa6b 100644 --- a/users/CrimsonAlpha_002/c2002000155.lua +++ b/users/CrimsonAlpha_002/c2002000155.lua @@ -1,4 +1,5 @@ --Injection Fairy Trixie + local s,id=GetID() function s.initial_effect(c) c:AddSetcodesRule(0x990) diff --git a/users/CrimsonAlpha_002/c2002000156.lua b/users/CrimsonAlpha_002/c2002000156.lua index 5afdaa3..1bc58b0 100644 --- a/users/CrimsonAlpha_002/c2002000156.lua +++ b/users/CrimsonAlpha_002/c2002000156.lua @@ -1,4 +1,5 @@ --Infection Fairy Julia + local s,id=GetID() function s.initial_effect(c) c:AddSetcodesRule(0x990) diff --git a/users/CrimsonAlpha_002/c2002000157.lua b/users/CrimsonAlpha_002/c2002000157.lua index 42be1e9..dd2dc87 100644 --- a/users/CrimsonAlpha_002/c2002000157.lua +++ b/users/CrimsonAlpha_002/c2002000157.lua @@ -1,4 +1,5 @@ --Injection Fairy Head Nurse Juno + local s,id=GetID() function s.initial_effect(c) c:AddSetcodesRule(0x990) diff --git a/users/CrimsonAlpha_002/c2002000158.lua b/users/CrimsonAlpha_002/c2002000158.lua index e081c57..8148a18 100644 --- a/users/CrimsonAlpha_002/c2002000158.lua +++ b/users/CrimsonAlpha_002/c2002000158.lua @@ -1,4 +1,5 @@ --Grim Pact with Exodia + local s,id=GetID() function s.initial_effect(c) local e1=Ritual.AddProcGreater{handler=c, diff --git a/users/CrimsonAlpha_002/c2002000159.lua b/users/CrimsonAlpha_002/c2002000159.lua index 14d73ae..69c4123 100644 --- a/users/CrimsonAlpha_002/c2002000159.lua +++ b/users/CrimsonAlpha_002/c2002000159.lua @@ -2,6 +2,7 @@ --This card can be used as a substitute for any 1 Fusion Material whose name is specifically listed on the Fusion Monster Card, but the other Fusion Material(s) must be correct. You can reveal 1 "HERO" Fusion Monster from your Extra Deck; Special Summon 1 monster from your Deck whose name is specifically listed on that card as Fusion Material, then you can apply this effect. --● Fusion Summon 1 "HERO" Fusion Monster from your Extra Deck, by banishing Fusion Materials you control, including this card. --You can only use this effect of "Elemental HERO Prisman Prime" once per turn. + local s,id=GetID() function s.initial_effect(c) --fusion substitute diff --git a/users/CrimsonAlpha_002/c2002000160.lua b/users/CrimsonAlpha_002/c2002000160.lua index 0f86a29..a8e12c0 100644 --- a/users/CrimsonAlpha_002/c2002000160.lua +++ b/users/CrimsonAlpha_002/c2002000160.lua @@ -1,4 +1,5 @@ --Reprisal of the Monarchs + local s,id=GetID() function s.initial_effect(c) --Activate(effect) diff --git a/users/CrimsonAlpha_002/c2002000161.lua b/users/CrimsonAlpha_002/c2002000161.lua index ca74032..1627db2 100644 --- a/users/CrimsonAlpha_002/c2002000161.lua +++ b/users/CrimsonAlpha_002/c2002000161.lua @@ -1,4 +1,5 @@ --Archfiend Buster Destruction Sword + local s,id=GetID() function s.initial_effect(c) --special summon diff --git a/users/CrimsonAlpha_002/c2002000162.lua b/users/CrimsonAlpha_002/c2002000162.lua index e635fa2..7731edc 100644 --- a/users/CrimsonAlpha_002/c2002000162.lua +++ b/users/CrimsonAlpha_002/c2002000162.lua @@ -1,4 +1,5 @@ --Coral Symphony Magician + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000163.lua b/users/CrimsonAlpha_002/c2002000163.lua index e16cc3b..3045e2c 100644 --- a/users/CrimsonAlpha_002/c2002000163.lua +++ b/users/CrimsonAlpha_002/c2002000163.lua @@ -1,4 +1,5 @@ --Subterror Behemoth Terragon + local s,id=GetID() function s.initial_effect(c) --fusion material diff --git a/users/CrimsonAlpha_002/c2002000164.lua b/users/CrimsonAlpha_002/c2002000164.lua index 492f354..6f8d3d6 100644 --- a/users/CrimsonAlpha_002/c2002000164.lua +++ b/users/CrimsonAlpha_002/c2002000164.lua @@ -1,4 +1,5 @@ --Dark Magician the Toon Knight + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000165.lua b/users/CrimsonAlpha_002/c2002000165.lua index 4713f3a..9ead96b 100644 --- a/users/CrimsonAlpha_002/c2002000165.lua +++ b/users/CrimsonAlpha_002/c2002000165.lua @@ -1,4 +1,5 @@ --Red-Eyes Toon Dragoon + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000166.lua b/users/CrimsonAlpha_002/c2002000166.lua index 85bcf6c..a5bcf08 100644 --- a/users/CrimsonAlpha_002/c2002000166.lua +++ b/users/CrimsonAlpha_002/c2002000166.lua @@ -1,4 +1,5 @@ --Life Stream Power Tool + local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,nil,s.eqfilter) diff --git a/users/CrimsonAlpha_002/c2002000167.lua b/users/CrimsonAlpha_002/c2002000167.lua index 96b25d3..126c94a 100644 --- a/users/CrimsonAlpha_002/c2002000167.lua +++ b/users/CrimsonAlpha_002/c2002000167.lua @@ -1,4 +1,5 @@ --Artifact Forge + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000168.lua b/users/CrimsonAlpha_002/c2002000168.lua index a94497f..41596e3 100644 --- a/users/CrimsonAlpha_002/c2002000168.lua +++ b/users/CrimsonAlpha_002/c2002000168.lua @@ -1,4 +1,5 @@ --Performapal Odd-Eyes Magician + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000169.lua b/users/CrimsonAlpha_002/c2002000169.lua index 2867ee1..3a40064 100644 --- a/users/CrimsonAlpha_002/c2002000169.lua +++ b/users/CrimsonAlpha_002/c2002000169.lua @@ -1,4 +1,5 @@ --Cyber Dragon Future + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000170.lua b/users/CrimsonAlpha_002/c2002000170.lua index 327007b..a7bcdd3 100644 --- a/users/CrimsonAlpha_002/c2002000170.lua +++ b/users/CrimsonAlpha_002/c2002000170.lua @@ -1,4 +1,5 @@ --Cyber Dragon Beyond + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000171.lua b/users/CrimsonAlpha_002/c2002000171.lua index 8ca704a..1eed43c 100644 --- a/users/CrimsonAlpha_002/c2002000171.lua +++ b/users/CrimsonAlpha_002/c2002000171.lua @@ -1,4 +1,5 @@ --The Grim Exodia Necross Incarnate + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000172.lua b/users/CrimsonAlpha_002/c2002000172.lua index bcd4e99..62fdea5 100644 --- a/users/CrimsonAlpha_002/c2002000172.lua +++ b/users/CrimsonAlpha_002/c2002000172.lua @@ -1,4 +1,5 @@ --Substifusion + local s,id=GetID() function s.initial_effect(c) local e1=Fusion.CreateSummonEff(c,nil,nil,s.fextra) diff --git a/users/CrimsonAlpha_002/c2002000173.lua b/users/CrimsonAlpha_002/c2002000173.lua index b4877d4..788ecd7 100644 --- a/users/CrimsonAlpha_002/c2002000173.lua +++ b/users/CrimsonAlpha_002/c2002000173.lua @@ -1,4 +1,5 @@ --Exodia's Disciple + local s,id=GetID() function s.initial_effect(c) --setcode diff --git a/users/CrimsonAlpha_002/c2002000174.lua b/users/CrimsonAlpha_002/c2002000174.lua index 11082c6..e575108 100644 --- a/users/CrimsonAlpha_002/c2002000174.lua +++ b/users/CrimsonAlpha_002/c2002000174.lua @@ -1,4 +1,5 @@ --Guardian of the Trial + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000175.lua b/users/CrimsonAlpha_002/c2002000175.lua index 67b8765..fb2e81e 100644 --- a/users/CrimsonAlpha_002/c2002000175.lua +++ b/users/CrimsonAlpha_002/c2002000175.lua @@ -1,4 +1,5 @@ --Toon Stardust Dragon + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000176.lua b/users/CrimsonAlpha_002/c2002000176.lua index bd0d588..52c94e0 100644 --- a/users/CrimsonAlpha_002/c2002000176.lua +++ b/users/CrimsonAlpha_002/c2002000176.lua @@ -1,4 +1,5 @@ --War Rock Aroy + local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) @@ -87,6 +88,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + Duel.SetChainLimit(aux.FALSE) Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil) end function s.operation(e,tp,eg,ep,ev,re,r,rp) diff --git a/users/CrimsonAlpha_002/c2002000177.lua b/users/CrimsonAlpha_002/c2002000177.lua index 36c73b5..01dd3a2 100644 --- a/users/CrimsonAlpha_002/c2002000177.lua +++ b/users/CrimsonAlpha_002/c2002000177.lua @@ -1,4 +1,5 @@ --Borreload Punishing Dragon + local s,id=GetID() function s.initial_effect(c) Pendulum.AddProcedure(c) diff --git a/users/CrimsonAlpha_002/c2002000178.lua b/users/CrimsonAlpha_002/c2002000178.lua index 027badd..75c4581 100644 --- a/users/CrimsonAlpha_002/c2002000178.lua +++ b/users/CrimsonAlpha_002/c2002000178.lua @@ -1,4 +1,5 @@ --Performapal Odd-Eyes Trump Witch + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000179.lua b/users/CrimsonAlpha_002/c2002000179.lua index 2007b44..5ccea3d 100644 --- a/users/CrimsonAlpha_002/c2002000179.lua +++ b/users/CrimsonAlpha_002/c2002000179.lua @@ -1,4 +1,5 @@ --Cyber Dragon Source + local s,id=GetID() function s.initial_effect(c) --ritual level diff --git a/users/CrimsonAlpha_002/c2002000180.lua b/users/CrimsonAlpha_002/c2002000180.lua index f28a386..4dccece 100644 --- a/users/CrimsonAlpha_002/c2002000180.lua +++ b/users/CrimsonAlpha_002/c2002000180.lua @@ -1,4 +1,5 @@ --Superheavy Samurai War Drummer + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000181.lua b/users/CrimsonAlpha_002/c2002000181.lua index ecb8f69..5d9a966 100644 --- a/users/CrimsonAlpha_002/c2002000181.lua +++ b/users/CrimsonAlpha_002/c2002000181.lua @@ -1,4 +1,5 @@ --Ghost Fox & Wild Performer + local s,id=GetID() function s.initial_effect(c) --Change Effect Target diff --git a/users/CrimsonAlpha_002/c2002000182.lua b/users/CrimsonAlpha_002/c2002000182.lua index 3fb1bfc..d56496b 100644 --- a/users/CrimsonAlpha_002/c2002000182.lua +++ b/users/CrimsonAlpha_002/c2002000182.lua @@ -1,4 +1,5 @@ --Dimension Dice Magician + local s,id=GetID() local sid=300102004 function s.initial_effect(c) diff --git a/users/CrimsonAlpha_002/c2002000183.lua b/users/CrimsonAlpha_002/c2002000183.lua index 59a34af..89f51fc 100644 --- a/users/CrimsonAlpha_002/c2002000183.lua +++ b/users/CrimsonAlpha_002/c2002000183.lua @@ -1,4 +1,5 @@ --Reinhardt, the Mage Knight + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000184.lua b/users/CrimsonAlpha_002/c2002000184.lua index 6ff7232..80cb927 100644 --- a/users/CrimsonAlpha_002/c2002000184.lua +++ b/users/CrimsonAlpha_002/c2002000184.lua @@ -1,4 +1,5 @@ --Symphonic Warrior Tambours + local s,id=GetID() function s.initial_effect(c) -- Add 1 "Symph Amplifier" or a card that mentions it diff --git a/users/CrimsonAlpha_002/c2002000185.lua b/users/CrimsonAlpha_002/c2002000185.lua index 52b5493..1a112f6 100644 --- a/users/CrimsonAlpha_002/c2002000185.lua +++ b/users/CrimsonAlpha_002/c2002000185.lua @@ -1,4 +1,5 @@ --Abbadoctor, the Original Amorphage + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000186.lua b/users/CrimsonAlpha_002/c2002000186.lua index abef26d..a39c5fe 100644 --- a/users/CrimsonAlpha_002/c2002000186.lua +++ b/users/CrimsonAlpha_002/c2002000186.lua @@ -1,4 +1,5 @@ --Sleipnir of the Nordic Beasts + local s,id=GetID() function s.initial_effect(c) c:SetSPSummonOnce(id) diff --git a/users/CrimsonAlpha_002/c2002000187.lua b/users/CrimsonAlpha_002/c2002000187.lua index 6df2489..37ea938 100644 --- a/users/CrimsonAlpha_002/c2002000187.lua +++ b/users/CrimsonAlpha_002/c2002000187.lua @@ -1,4 +1,5 @@ --Corrupted Pendulum + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000188.lua b/users/CrimsonAlpha_002/c2002000188.lua index c4e223f..0413188 100644 --- a/users/CrimsonAlpha_002/c2002000188.lua +++ b/users/CrimsonAlpha_002/c2002000188.lua @@ -93,7 +93,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) r2:SetType(EFFECT_TYPE_IGNITION) r2:SetRange(LOCATION_MZONE) r2:SetCountLimit(1,{id,1}) - r2:SetCost(aux.AND(aux.dxmcostgen(1,1,nil),s.copycost)) + r2:SetCost(aux.AND(Cost.Detach(1,1,nil),s.copycost)) r2:SetTarget(s.copytg) r2:SetOperation(s.copyop) c:RegisterEffect(r2) diff --git a/users/CrimsonAlpha_002/c2002000189.lua b/users/CrimsonAlpha_002/c2002000189.lua index be8c912..9fd8bc0 100644 --- a/users/CrimsonAlpha_002/c2002000189.lua +++ b/users/CrimsonAlpha_002/c2002000189.lua @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(2) - e1:SetCost(aux.dxmcostgen(1,1,nil)) + e1:SetCost(Cost.Detach(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) diff --git a/users/CrimsonAlpha_002/c2002000190.lua b/users/CrimsonAlpha_002/c2002000190.lua index 99cb4ff..0db3135 100644 --- a/users/CrimsonAlpha_002/c2002000190.lua +++ b/users/CrimsonAlpha_002/c2002000190.lua @@ -1,4 +1,5 @@ --Toonlight Junktion + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000191.lua b/users/CrimsonAlpha_002/c2002000191.lua index bd61955..61da8e5 100644 --- a/users/CrimsonAlpha_002/c2002000191.lua +++ b/users/CrimsonAlpha_002/c2002000191.lua @@ -1,4 +1,5 @@ --Pot of Plundering + local s,id=GetID() function s.initial_effect(c) --Activate diff --git a/users/CrimsonAlpha_002/c2002000192.lua b/users/CrimsonAlpha_002/c2002000192.lua index 8941c6b..0b6f702 100644 --- a/users/CrimsonAlpha_002/c2002000192.lua +++ b/users/CrimsonAlpha_002/c2002000192.lua @@ -1,4 +1,5 @@ --PSY-Framegear Iota + local s,id=GetID() function s.initial_effect(c) c:EnableUnsummonable() diff --git a/users/CrimsonAlpha_002/c2002000193.lua b/users/CrimsonAlpha_002/c2002000193.lua index a8c587c..1c88b3a 100644 --- a/users/CrimsonAlpha_002/c2002000193.lua +++ b/users/CrimsonAlpha_002/c2002000193.lua @@ -7,80 +7,85 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) - e1:SetCost(s.cost) - e1:SetOperation(s.operation) + e1:SetCost(s.applycost) + e1:SetTarget(s.applytg) + e1:SetOperation(s.applyop) c:RegisterEffect(e1) end - function s.filter(c,e,tp) - if not (c:IsType(TYPE_MONSTER) and c:IsHasEffect(TYPE_FLIP) and c:IsAbleToGraveAsCost()) then - return false - end - local eff={c:GetCardEffect(TYPE_FLIP)} - for _,teh in ipairs(eff) do - local te=teh:GetLabelObject() - local con=te:GetCondition() - local tg=te:GetTarget() - if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) - and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) then return true end + if not (c:IsType(TYPE_MONSTER) and c:IsType(TYPE_FLIP) and c:IsAbleToGraveAsCost()) then return false end + local effs={c:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:IsHasType(EFFECT_TYPE_FLIP) then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + return true + end + end end return false end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end +function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp) - e:SetLabelObject(g) - Group.KeepAlive(g) - Duel.SendtoGrave(g,REASON_COST) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local tc=e:GetLabelObject():GetFirst() - tc:CreateEffectRelation(e) - if tc and tc:IsRelateToEffect(e) then - local eff={tc:GetCardEffect(TYPE_FLIP)} - local te=nil - local acd={} - local ac={} - for _,teh in ipairs(eff) do - local temp=teh:GetLabelObject() - local con=temp:GetCondition() - local tg=temp:GetTarget() - if (not con or con(temp,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) - and (not tg or tg(temp,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,0)) then - table.insert(ac,teh) - table.insert(acd,temp:GetDescription()) - end - end - if #ac==1 then te=ac[1] elseif #ac>1 then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) - op=Duel.SelectOption(tp,table.unpack(acd)) - op=op+1 - te=ac[op] - end - if not te then return end - Duel.ClearTargetCard() - local teh=te - te=teh:GetLabelObject() - local tg=te:GetTarget() - local op=te:GetOperation() - if tg then tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,1) end - Duel.BreakEffect() - tc:CreateEffectRelation(te) - Duel.BreakEffect() - local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) - if g then - for etc in aux.Next(g) do - etc:CreateEffectRelation(te) + local rc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + Duel.SendtoGrave(rc,REASON_COST) + local available_effs={} + local effs={rc:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:IsHasType(EFFECT_TYPE_FLIP) then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + table.insert(available_effs,eff) end end - if op then op(te,tp,Group.CreateGroup(),PLAYER_NONE,0,teh,REASON_EFFECT,PLAYER_NONE,1) end - tc:ReleaseEffectRelation(te) - if g then - for etc in aux.Next(g) do - etc:ReleaseEffectRelation(te) - end + end + e:SetLabelObject(available_effs) +end +function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then + local eff=e:GetLabelObject() + return eff and eff:GetTarget() and eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0,chkc) + end + if chk==0 then return true end + local eff=nil + local available_effs=e:GetLabelObject() + if #available_effs>1 then + local available_effs_desc={} + for _,eff in ipairs(available_effs) do + table.insert(available_effs_desc,eff:GetDescription()) end + local op=Duel.SelectOption(tp,table.unpack(available_effs_desc)) + eff=available_effs[op+1] + else + eff=available_effs[1] + end + Duel.Hint(HINT_OPSELECTED,1-tp,eff:GetDescription()) + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + e:SetProperty(eff:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local tg=eff:GetTarget() + if tg then + tg(e,tp,eg,ep,ev,re,r,rp,1) + end + eff:SetLabel(e:GetLabel()) + eff:SetLabelObject(e:GetLabelObject()) + e:SetLabelObject(eff) + Duel.ClearOperationInfo(0) +end +function s.applyop(e,tp,eg,ep,ev,re,r,rp) + local eff=e:GetLabelObject() + if not eff then return end + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + local op=eff:GetOperation() + if op then + op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) end - Group.DeleteGroup(e:GetLabelObject()) + e:SetLabel(0) + e:SetLabelObject(nil) end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000194.lua b/users/CrimsonAlpha_002/c2002000194.lua index f1f8405..970ca52 100644 --- a/users/CrimsonAlpha_002/c2002000194.lua +++ b/users/CrimsonAlpha_002/c2002000194.lua @@ -1,4 +1,5 @@ --Penguin Tactician + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000197.lua b/users/CrimsonAlpha_002/c2002000197.lua index 2dad4c6..8b9c3a2 100644 --- a/users/CrimsonAlpha_002/c2002000197.lua +++ b/users/CrimsonAlpha_002/c2002000197.lua @@ -1,4 +1,5 @@ --Mekk-Knighted by the World Chalice + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000198.lua b/users/CrimsonAlpha_002/c2002000198.lua index b8b4b96..6e5d78e 100644 --- a/users/CrimsonAlpha_002/c2002000198.lua +++ b/users/CrimsonAlpha_002/c2002000198.lua @@ -1,4 +1,5 @@ --Orcustrated by the World Chalice + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000199.lua b/users/CrimsonAlpha_002/c2002000199.lua index d0d5bd2..0d1d222 100644 --- a/users/CrimsonAlpha_002/c2002000199.lua +++ b/users/CrimsonAlpha_002/c2002000199.lua @@ -125,4 +125,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #sg==0 then return end local rg=aux.SelectUnselectGroup(sg,e,tp,1,ft,s.rescon(ft1,ft2,ft3,ft),1,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(rg,0,tp,tp,false,false,POS_FACEUP_DEFENSE) -end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000201.lua b/users/CrimsonAlpha_002/c2002000201.lua index be49579..ec714ba 100644 --- a/users/CrimsonAlpha_002/c2002000201.lua +++ b/users/CrimsonAlpha_002/c2002000201.lua @@ -1,4 +1,5 @@ --Mekk-Knight Guardragon Elpy + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000202.lua b/users/CrimsonAlpha_002/c2002000202.lua index a3ee2eb..20356b2 100644 --- a/users/CrimsonAlpha_002/c2002000202.lua +++ b/users/CrimsonAlpha_002/c2002000202.lua @@ -1,4 +1,5 @@ --Mekk-Knight Guardragon Pisty + local s,id=GetID() function s.initial_effect(c) --pendulum summon diff --git a/users/CrimsonAlpha_002/c2002000203.lua b/users/CrimsonAlpha_002/c2002000203.lua index 2dbaccf..c2283d1 100644 --- a/users/CrimsonAlpha_002/c2002000203.lua +++ b/users/CrimsonAlpha_002/c2002000203.lua @@ -118,7 +118,7 @@ end function s.stcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD) + return c:IsPreviousLocation(LOCATION_MZONE) and c:IsLinkSummoned() end function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk) local b1=Duel.GetLocationCount(tp,LOCATION_SZONE)>1 diff --git a/users/CrimsonAlpha_002/c2002000204.lua b/users/CrimsonAlpha_002/c2002000204.lua index 5990ec8..a3e602e 100644 --- a/users/CrimsonAlpha_002/c2002000204.lua +++ b/users/CrimsonAlpha_002/c2002000204.lua @@ -1,4 +1,5 @@ --Scarlet-Eyes Obsidian Dragon + local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving diff --git a/users/CrimsonAlpha_002/c2002000205.lua b/users/CrimsonAlpha_002/c2002000205.lua index 073d7cb..544896c 100644 --- a/users/CrimsonAlpha_002/c2002000205.lua +++ b/users/CrimsonAlpha_002/c2002000205.lua @@ -1,5 +1,6 @@ --Worm Apocalypse --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Cannot be used as material, except for the Special Summon of a Reptile "Worm" monster @@ -13,7 +14,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) end s.listed_series={SET_WORM} s.listed_names={id,88650530} diff --git a/users/CrimsonAlpha_002/c2002000206.lua b/users/CrimsonAlpha_002/c2002000206.lua index 28875ef..24c9da1 100644 --- a/users/CrimsonAlpha_002/c2002000206.lua +++ b/users/CrimsonAlpha_002/c2002000206.lua @@ -1,5 +1,6 @@ --Worm Barses --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Negate Spell/Trap or effect @@ -12,7 +13,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE|LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.discon) - e1:SetCost(aux.SelfToGraveCost) + e1:SetCost(Cost.SelfToGrave) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) c:RegisterEffect(e1) diff --git a/users/CrimsonAlpha_002/c2002000207.lua b/users/CrimsonAlpha_002/c2002000207.lua index 7ed0418..98ac1ec 100644 --- a/users/CrimsonAlpha_002/c2002000207.lua +++ b/users/CrimsonAlpha_002/c2002000207.lua @@ -1,5 +1,6 @@ --Worm Cartaros --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Add 1 Reptile "Worm" monster from your Deck to your hand, except "Worm Cartaros" @@ -11,7 +12,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) end s.listed_series={SET_WORM} function s.thfilter(c) diff --git a/users/CrimsonAlpha_002/c2002000208.lua b/users/CrimsonAlpha_002/c2002000208.lua index ff96b45..ca51ddf 100644 --- a/users/CrimsonAlpha_002/c2002000208.lua +++ b/users/CrimsonAlpha_002/c2002000208.lua @@ -1,5 +1,6 @@ --Worm Dimikles --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Send 1 "Worm" or "W Nebula" card from your Deck to your GY, except "Worm Dimikles" @@ -7,11 +8,12 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O) + -- e1:SetCode(EVENT_FLIP) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetTarget(s.tgtg) e1:SetOperation(s.tgop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) end s.listed_series={SET_WORM} function s.tgfilter(c) diff --git a/users/CrimsonAlpha_002/c2002000209.lua b/users/CrimsonAlpha_002/c2002000209.lua index 422f1fa..deb273c 100644 --- a/users/CrimsonAlpha_002/c2002000209.lua +++ b/users/CrimsonAlpha_002/c2002000209.lua @@ -1,5 +1,6 @@ --Worm Erokin --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -14,7 +15,7 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) - e1:SetCost(aux.SelfTributeCost) + e1:SetCost(Cost.SelfTribute) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) diff --git a/users/CrimsonAlpha_002/c2002000210.lua b/users/CrimsonAlpha_002/c2002000210.lua index c3cc63f..07a983e 100644 --- a/users/CrimsonAlpha_002/c2002000210.lua +++ b/users/CrimsonAlpha_002/c2002000210.lua @@ -1,5 +1,6 @@ --Worm Falco --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Activate 1 of its effects @@ -10,7 +11,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.operation) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) end s.listed_series={SET_WORM} function s.posfilter1(c) diff --git a/users/CrimsonAlpha_002/c2002000211.lua b/users/CrimsonAlpha_002/c2002000211.lua index a1a3c64..8d2822a 100644 --- a/users/CrimsonAlpha_002/c2002000211.lua +++ b/users/CrimsonAlpha_002/c2002000211.lua @@ -1,5 +1,6 @@ --Worm Gulse --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Special Summon 1 Reptile "Worm" monster from your hand in face-up or face-down Defense Position, except "Worm Gulse" @@ -11,7 +12,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) end s.listed_series={SET_WORM} function s.spfilter(c,e,tp) diff --git a/users/CrimsonAlpha_002/c2002000212.lua b/users/CrimsonAlpha_002/c2002000212.lua index ab7eca6..eee8489 100644 --- a/users/CrimsonAlpha_002/c2002000212.lua +++ b/users/CrimsonAlpha_002/c2002000212.lua @@ -1,5 +1,6 @@ --Worm Hope --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Cannot be used as material, except for the Special Summon of a Reptile "Worm" monster @@ -13,7 +14,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) --Draw 1 card, then discard 1 card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/users/CrimsonAlpha_002/c2002000213.lua b/users/CrimsonAlpha_002/c2002000213.lua index 5ce63ab..7217032 100644 --- a/users/CrimsonAlpha_002/c2002000213.lua +++ b/users/CrimsonAlpha_002/c2002000213.lua @@ -1,5 +1,6 @@ --Worm Illidan --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Cannot be used as material for a monster from the Extra Deck, unless all other materials are "Worm" monsters diff --git a/users/CrimsonAlpha_002/c2002000214.lua b/users/CrimsonAlpha_002/c2002000214.lua index 7113f79..f053634 100644 --- a/users/CrimsonAlpha_002/c2002000214.lua +++ b/users/CrimsonAlpha_002/c2002000214.lua @@ -1,5 +1,6 @@ ---Worm Barses +--Worm Jetelikpse --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Negate Spell/Trap or effect @@ -12,7 +13,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE|LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.discon) - e1:SetCost(aux.SelfToGraveCost) + e1:SetCost(Cost.SelfToGrave) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) c:RegisterEffect(e1) diff --git a/users/CrimsonAlpha_002/c2002000215.lua b/users/CrimsonAlpha_002/c2002000215.lua index aaeeb2f..c0b4009 100644 --- a/users/CrimsonAlpha_002/c2002000215.lua +++ b/users/CrimsonAlpha_002/c2002000215.lua @@ -1,5 +1,6 @@ --Worm King --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Contact Fusion diff --git a/users/CrimsonAlpha_002/c2002000216.lua b/users/CrimsonAlpha_002/c2002000216.lua index 7f9666a..8166f8a 100644 --- a/users/CrimsonAlpha_002/c2002000216.lua +++ b/users/CrimsonAlpha_002/c2002000216.lua @@ -1,5 +1,6 @@ --Worm Linx --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() @@ -11,7 +12,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetCost(aux.SelfTributeCost) + e1:SetCost(Cost.SelfTribute) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) diff --git a/users/CrimsonAlpha_002/c2002000217.lua b/users/CrimsonAlpha_002/c2002000217.lua index b230e34..26e2f6e 100644 --- a/users/CrimsonAlpha_002/c2002000217.lua +++ b/users/CrimsonAlpha_002/c2002000217.lua @@ -1,5 +1,6 @@ --Worm Millidith --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Pendulum Summon @@ -34,7 +35,7 @@ function s.initial_effect(c) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) - c:RegisterEffect(e3,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e3) --Place this card in your Pendulum Zone local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) diff --git a/users/CrimsonAlpha_002/c2002000218.lua b/users/CrimsonAlpha_002/c2002000218.lua index fbd3091..5ec6502 100644 --- a/users/CrimsonAlpha_002/c2002000218.lua +++ b/users/CrimsonAlpha_002/c2002000218.lua @@ -1,5 +1,6 @@ --Worm Noble --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000219.lua b/users/CrimsonAlpha_002/c2002000219.lua index d2776ab..314df59 100644 --- a/users/CrimsonAlpha_002/c2002000219.lua +++ b/users/CrimsonAlpha_002/c2002000219.lua @@ -1,5 +1,6 @@ --Worm Opera --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Cannot be used as material for a monster from the Extra Deck, unless all other materials are "Worm" monsters diff --git a/users/CrimsonAlpha_002/c2002000220.lua b/users/CrimsonAlpha_002/c2002000220.lua index 94ca7b1..bbb7350 100644 --- a/users/CrimsonAlpha_002/c2002000220.lua +++ b/users/CrimsonAlpha_002/c2002000220.lua @@ -1,5 +1,6 @@ --Worm Prince --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000221.lua b/users/CrimsonAlpha_002/c2002000221.lua index 791a559..980c4c0 100644 --- a/users/CrimsonAlpha_002/c2002000221.lua +++ b/users/CrimsonAlpha_002/c2002000221.lua @@ -1,5 +1,6 @@ --Worm Queen --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000222.lua b/users/CrimsonAlpha_002/c2002000222.lua index 5d0763e..25cb2e3 100644 --- a/users/CrimsonAlpha_002/c2002000222.lua +++ b/users/CrimsonAlpha_002/c2002000222.lua @@ -1,5 +1,6 @@ --Worm Rakuyeh --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Pendulum Summon diff --git a/users/CrimsonAlpha_002/c2002000223.lua b/users/CrimsonAlpha_002/c2002000223.lua index 4b6da78..810fe26 100644 --- a/users/CrimsonAlpha_002/c2002000223.lua +++ b/users/CrimsonAlpha_002/c2002000223.lua @@ -1,5 +1,6 @@ --Worm Solid --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Gain ATK/DEF + Destruction Immunity @@ -10,7 +11,7 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetOperation(s.valtg) e1:SetOperation(s.valop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) --Gain ATK/DEF + Targeting Immunity local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) diff --git a/users/CrimsonAlpha_002/c2002000224.lua b/users/CrimsonAlpha_002/c2002000224.lua index 86aa056..4cf127b 100644 --- a/users/CrimsonAlpha_002/c2002000224.lua +++ b/users/CrimsonAlpha_002/c2002000224.lua @@ -1,5 +1,6 @@ --Worm Tentacles --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Take control of 1 monster your opponent controls @@ -11,7 +12,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetTarget(s.cntg) e1:SetOperation(s.cnop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) --Add 1 "Worm" or "W Nebula" card from your GY to your hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/users/CrimsonAlpha_002/c2002000225.lua b/users/CrimsonAlpha_002/c2002000225.lua index 4ac8852..76a2dfb 100644 --- a/users/CrimsonAlpha_002/c2002000225.lua +++ b/users/CrimsonAlpha_002/c2002000225.lua @@ -1,5 +1,6 @@ --Worm Ugly --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() diff --git a/users/CrimsonAlpha_002/c2002000226.lua b/users/CrimsonAlpha_002/c2002000226.lua index 33c497c..94dc114 100644 --- a/users/CrimsonAlpha_002/c2002000226.lua +++ b/users/CrimsonAlpha_002/c2002000226.lua @@ -38,7 +38,7 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) - e3:SetCost(aux.dxmcostgen(1,s.mxmc,s.slwc)) + e3:SetCost(Cost.DetachFromSelf(1,s.mxmc,s.slwc)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3,false,REGISTER_FLAG_DETACH_XMAT) diff --git a/users/CrimsonAlpha_002/c2002000227.lua b/users/CrimsonAlpha_002/c2002000227.lua index 28864ff..4a19ef1 100644 --- a/users/CrimsonAlpha_002/c2002000227.lua +++ b/users/CrimsonAlpha_002/c2002000227.lua @@ -1,5 +1,6 @@ --Worm Warlord --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --synchro summon diff --git a/users/CrimsonAlpha_002/c2002000228.lua b/users/CrimsonAlpha_002/c2002000228.lua index d4fc857..3de4186 100644 --- a/users/CrimsonAlpha_002/c2002000228.lua +++ b/users/CrimsonAlpha_002/c2002000228.lua @@ -1,5 +1,6 @@ --Worm Xex --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Cannot be used as material for a monster from the Extra Deck, unless all other materials are "Worm" monsters @@ -13,7 +14,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetTarget(s.postg) e1:SetOperation(s.posop) - c:RegisterEffect(e1,false,CUSTOM_REGISTER_FLIP) + c:RegisterEffect(e1) --Send 1 Reptile "Worm" monster from your Deck to the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) diff --git a/users/CrimsonAlpha_002/c2002000229.lua b/users/CrimsonAlpha_002/c2002000229.lua index 804c70a..0c6b5db 100644 --- a/users/CrimsonAlpha_002/c2002000229.lua +++ b/users/CrimsonAlpha_002/c2002000229.lua @@ -1,5 +1,6 @@ --Worm Yagan --Modified for CrimsonRemodels + local s,id=GetID() function s.initial_effect(c) --Change 1 face-up monster on the field to face-down Defense Position diff --git a/users/CrimsonAlpha_002/c2002000230.lua b/users/CrimsonAlpha_002/c2002000230.lua index 855c7c4..17a0a91 100644 --- a/users/CrimsonAlpha_002/c2002000230.lua +++ b/users/CrimsonAlpha_002/c2002000230.lua @@ -65,75 +65,155 @@ end function s.atkval(e,c) return Duel.GetMatchingGroupCount(s.atkfilter,0,LOCATION_REMOVED+LOCATION_GRAVE,0,nil)*300 end -function s.cfilter(c,e,tp) +-- function s.cfilter(c,e,tp) + -- if not (c:IsFaceup() and c:IsMonster() and c:IsRace(RACE_REPTILE) and c:IsSetCard(SET_WORM) + -- and c:IsHasEffect(TYPE_FLIP) and c:IsAbleToDeckAsCost()) then + -- return false + -- end + -- local eff=c:GetCardEffect(TYPE_FLIP) + -- local te=eff:GetLabelObject() + -- local con=te:GetCondition() + -- local tg=te:GetTarget() + -- if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) + -- and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) then + -- return true + -- end + -- return false +-- end +-- function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) + -- if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end + -- local sc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst() + -- e:SetLabelObject(sc:GetCardEffect(TYPE_FLIP):GetLabelObject()) + -- Duel.SendtoDeck(sc,nil,SEQ_DECKSHUFFLE,REASON_COST) + -- sc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1) +-- end +-- function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + -- local te=e:GetLabelObject() + -- local tg=te and te:GetTarget() or nil + -- if chkc then return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end + -- if chk==0 then return true end + -- e:SetLabel(te:GetLabel()) + -- e:SetLabelObject(te:GetLabelObject()) + -- e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + -- if tg then + -- tg(e,tp,eg,ep,ev,re,r,rp,1) + -- end + -- e:SetLabelObject(te) + -- Duel.ClearOperationInfo(0) +-- end +-- function s.applyop(e,tp,eg,ep,ev,re,r,rp) + -- local te=e:GetLabelObject() + -- if not te then return end + -- local sc=te:GetHandler() + -- if sc:GetFlagEffect(id)==0 then + -- e:SetLabel(0) + -- e:SetLabelObject(nil) + -- return + -- end + -- e:SetLabel(te:GetLabel()) + -- e:SetLabelObject(te:GetLabelObject()) + -- local op=te:GetOperation() + -- if op then + -- op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) + -- end + -- e:SetLabel(0) + -- e:SetLabelObject(nil) +-- end +function s.spfilter(c,e,tp) + return c:IsFaceup() and c:IsMonster() 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_REMOVED) 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_REMOVED,0,1,nil,e,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) then + Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) + end +end +function s.filter(c,e,tp) if not (c:IsFaceup() and c:IsMonster() and c:IsRace(RACE_REPTILE) and c:IsSetCard(SET_WORM) and c:IsHasEffect(TYPE_FLIP) and c:IsAbleToDeckAsCost()) then return false end - local eff=c:GetCardEffect(TYPE_FLIP) - local te=eff:GetLabelObject() - local con=te:GetCondition() - local tg=te:GetTarget() - if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) - and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) then - return true + local effs={c:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:IsHasType(EFFECT_TYPE_FLIP) then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + return true + end + end end return false end function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end - local sc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst() - e:SetLabelObject(sc:GetCardEffect(TYPE_FLIP):GetLabelObject()) - Duel.SendtoDeck(sc,nil,SEQ_DECKSHUFFLE,REASON_COST) - sc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1) + if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + local rc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + Duel.SendtoDeck(rc,nil,SEQ_DECKSHUFFLE,REASON_COST) + local available_effs={} + local effs={rc:GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:IsHasType(EFFECT_TYPE_FLIP) then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (con==nil or con(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) + and (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + table.insert(available_effs,eff) + end + end + end + e:SetLabelObject(available_effs) end function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local te=e:GetLabelObject() - local tg=te and te:GetTarget() or nil - if chkc then return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end + if chkc then + local eff=e:GetLabelObject() + return eff and eff:GetTarget() and eff:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0,chkc) + end if chk==0 then return true end - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) - e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local eff=nil + local available_effs=e:GetLabelObject() + if #available_effs>1 then + local available_effs_desc={} + for _,eff in ipairs(available_effs) do + table.insert(available_effs_desc,eff:GetDescription()) + end + local op=Duel.SelectOption(tp,table.unpack(available_effs_desc)) + eff=available_effs[op+1] + else + eff=available_effs[1] + end + Duel.Hint(HINT_OPSELECTED,1-tp,eff:GetDescription()) + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + e:SetProperty(eff:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) + local tg=eff:GetTarget() if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end - e:SetLabelObject(te) + eff:SetLabel(e:GetLabel()) + eff:SetLabelObject(e:GetLabelObject()) + e:SetLabelObject(eff) Duel.ClearOperationInfo(0) end function s.applyop(e,tp,eg,ep,ev,re,r,rp) - local te=e:GetLabelObject() - if not te then return end - local sc=te:GetHandler() - if sc:GetFlagEffect(id)==0 then - e:SetLabel(0) - e:SetLabelObject(nil) - return - end - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) - local op=te:GetOperation() + local eff=e:GetLabelObject() + if not eff then return end + e:SetLabel(eff:GetLabel()) + e:SetLabelObject(eff:GetLabelObject()) + local op=eff:GetOperation() if op then op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) end e:SetLabel(0) e:SetLabelObject(nil) -end -function s.spfilter(c,e,tp) - return c:IsFaceup() and c:IsMonster() 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_REMOVED) 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_REMOVED,0,1,nil,e,tp) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) -end -function s.spop(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) then - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) - end -end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000231.lua b/users/CrimsonAlpha_002/c2002000231.lua index c49a6fa..b7c413a 100644 --- a/users/CrimsonAlpha_002/c2002000231.lua +++ b/users/CrimsonAlpha_002/c2002000231.lua @@ -1,4 +1,5 @@ --Graydle Scorpion + local s,id=GetID() function s.initial_effect(c) --Set 1 Spell/Trap from your opponent's GY to your field diff --git a/users/CrimsonAlpha_002/c2002000232.lua b/users/CrimsonAlpha_002/c2002000232.lua index d82db52..ceb3a8f 100644 --- a/users/CrimsonAlpha_002/c2002000232.lua +++ b/users/CrimsonAlpha_002/c2002000232.lua @@ -1,4 +1,5 @@ --Graydle Frog + local s,id=GetID() function s.initial_effect(c) --Special Summon 1 monster from your opponent's GY to their field, then equip this card to it diff --git a/users/CrimsonAlpha_002/c2002000233.lua b/users/CrimsonAlpha_002/c2002000233.lua index f0b043f..2b40140 100644 --- a/users/CrimsonAlpha_002/c2002000233.lua +++ b/users/CrimsonAlpha_002/c2002000233.lua @@ -24,7 +24,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e2:SetCountLimit(1,{id,1}) - e2:SetCost(aux.SelfToGraveCost) + e2:SetCost(Cost.SelfToGrave) e2:SetTarget(s.eqtg) e2:SetOperation(s.eqop) c:RegisterEffect(e2) diff --git a/users/CrimsonAlpha_002/c2002000235.lua b/users/CrimsonAlpha_002/c2002000235.lua index e5eb752..31738e5 100644 --- a/users/CrimsonAlpha_002/c2002000235.lua +++ b/users/CrimsonAlpha_002/c2002000235.lua @@ -49,7 +49,7 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e4:SetCountLimit(1,id) - e4:SetCost(aux.dxmcostgen(1,1,nil)) + e4:SetCost(Cost.DetachFromSelf(1,1,nil)) e4:SetTarget(s.thtg) e4:SetOperation(s.thop) c:RegisterEffect(e4) @@ -130,6 +130,9 @@ end function s.mattg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end end +function s.filter(c) + return c:IsFaceup() and c:IsNegatable() and not c:IsSetCard(SET_APOQLIPHORT) +end function s.matop(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() if not tc then return end @@ -147,7 +150,7 @@ function s.matop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoGrave(sg,REASON_EFFECT) end if ct>=3 then - local g=Duel.GetMatchingGroup(Card.IsNegatable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c) + local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if #g==0 then return end for tc in g:Iter() do tc:NegateEffects(c,RESET_EVENT|RESETS_STANDARD_PHASE_END,true) diff --git a/users/CrimsonAlpha_002/c2002000236.lua b/users/CrimsonAlpha_002/c2002000236.lua new file mode 100644 index 0000000..2aa6a2f --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000236.lua @@ -0,0 +1,110 @@ +--War Rock Tatank +local s,id=GetID() +function s.initial_effect(c) + --Disable + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e2:SetCode(EVENT_BATTLED) + e2:SetRange(LOCATION_MZONE) + e2:SetOperation(s.negop) + c:RegisterEffect(e2) + --Special Summon this card + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_HAND) + e1:SetCountLimit(1,{id,0}) + e1:SetCondition(s.spcon) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) + -- + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,0)) + e3:SetCategory(CATEGORY_DAMAGE) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3:SetCode(EVENT_BATTLE_DESTROYING) + e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1,id) + e3:SetCondition(s.setcon) + e3:SetTarget(s.settg) + e3:SetOperation(s.setop) + c:RegisterEffect(e3) +end +s.listed_series={SET_WAR_ROCK} +function s.negop(e,tp,eg,ep,ev,re,r,rp) + local a=Duel.GetAttacker() + local d=Duel.GetAttackTarget() + local p=e:GetHandler():GetControler() + if d==nil then return end + local tc=nil + if a:GetControler()==p and a:IsSetCard(SET_WAR_ROCK) and d:IsStatus(STATUS_BATTLE_DESTROYED) then tc=d + elseif d:GetControler()==p and d:IsSetCard(SET_WAR_ROCK) and a:IsStatus(STATUS_BATTLE_DESTROYED) then tc=a end + if not tc then return end + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_DISABLE) + e1:SetReset(RESET_EVENT+RESETS_STANDARD_EXC_GRAVE) + tc:RegisterEffect(e1) + local e2=Effect.CreateEffect(e:GetHandler()) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_DISABLE_EFFECT) + e2:SetReset(RESET_EVENT+RESETS_STANDARD_EXC_GRAVE) + tc:RegisterEffect(e2) +end +function s.spcon(e,tp,eg,ep,ev,re,r,rp) + return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_WAR_ROCK),tp,LOCATION_MZONE,0,1,nil) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) + end +end + +function s.setcon(e,tp,eg,ep,ev,re,r,rp) + local tc=eg:GetFirst() + local bc=tc:GetBattleTarget() + return tc:IsRelateToBattle() and tc:IsStatus(STATUS_OPPO_BATTLE) and tc:IsControler(tp) and tc:IsSetCard(SET_WAR_ROCK) + and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE) and bc:GetPreviousControler()~=tp and bc:GetBaseAttack()>0 + and bc:GetOwner()==1-tp +end +function s.setfilter(c) + return c:IsSetCard(SET_WAR_ROCK) and c:IsSpellTrap() and c:IsSSetable() +end +function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end + Duel.SetPossibleOperationInfo(0,CATEGORY_DISABLE,nil,1,1-tp,LOCATION_MZONE) +end +function s.atkfilter(c) + return c:IsSetCard(SET_WAR_ROCK) and c:IsFaceup() and not c:IsStatus(STATUS_BATTLE_DESTROYED) +end +function s.setop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) + local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil) + if #g>0 then + Duel.SSet(tp,g) + local atkg=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil) + if #atkg==0 then return end + Duel.BreakEffect() + local c=e:GetHandler() + for tc in aux.Next(atkg) do + --Increase ATK + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN) + e1:SetValue(200) + tc:RegisterEffect(e1) + end + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000237.lua b/users/CrimsonAlpha_002/c2002000237.lua new file mode 100644 index 0000000..66c19e4 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000237.lua @@ -0,0 +1,26 @@ +--War Rock Impasse +local s,id=GetID() +function s.initial_effect(c) + c:SetUniqueOnField(1,0,id) + --Activate + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_ACTIVATE) + e0:SetCode(EVENT_FREE_CHAIN) + e0:SetHintTiming(0,TIMING_END_PHASE) + c:RegisterEffect(e0) + --"War Rock" monsters you control are unaffected by monsters with less ATK + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_IMMUNE_EFFECT) + e1:SetRange(LOCATION_SZONE) + e1:SetTargetRange(LOCATION_MZONE,0) + e1:SetTarget(function(_,c) return c:IsSetCard(SET_WAR_ROCK) end) + e1:SetValue(s.efilter) + c:RegisterEffect(e1) + +end +s.listed_series={SET_WAR_ROCK} +function s.efilter(e,te) + return te:GetOwner()~=e:GetHandler() and te:IsActiveType(TYPE_MONSTER) and e:GetHandlerPlayer() ~= te:GetHandlerPlayer() + and te:GetOwner():GetAttack()0 and Duel.IsPlayerCanDiscardDeck(tp,val) end + Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,0) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,0) +end +function s.filter(c) + return c:IsSetCard(SET_INFERNOID) and c:IsMonster() +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + local val=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE) + local g=Duel.GetDecktopGroup(tp,val) + if val>0 then + Duel.DiscardDeck(tp,val,REASON_EFFECT) + local tg=g:Filter(aux.FilterBoolFunction(Card.IsMonster),nil) + if #tg>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_REMOVED,0,1,nil) then + Duel.BreakEffect() + local sg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_REMOVED,0,1,#tg,nil) + if #sg>0 then + Duel.SendtoGrave(sg,REASON_EFFECT|REASON_RETURN) + end + end + end +end +function s.rmcostfilter(c) + return c:IsMonster() and c:IsRace(RACE_FIEND) and not c:IsPublic() +end +function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end + local c=e:GetHandler() + if chk==0 then + return Duel.IsExistingMatchingCard(s.rmcostfilter,tp,LOCATION_EXTRA,0,1,c) + and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) + end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) + local g=Duel.SelectMatchingCard(tp,s.rmcostfilter,tp,LOCATION_EXTRA,0,1,1,c) + Duel.ConfirmCards(1-tp,g) + e:SetLabel(g:GetFirst():GetCode()) +end +function s.rmfilter(c) + return c:IsAbleToRemove() and aux.SpElimFilter(c) +end +function s.rmop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) or c:IsFacedown() then return end + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_CHANGE_CODE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESETS_STANDARD_PHASE_END) + e1:SetValue(e:GetLabel()) + c:RegisterEffect(e1) + local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,nil) + if #g>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local tc=g:Select(tp,1,1,nil) + Duel.HintSelection(tc) + Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000239.lua b/users/CrimsonAlpha_002/c2002000239.lua new file mode 100644 index 0000000..d6833e5 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000239.lua @@ -0,0 +1,55 @@ +--Void Nightmare +local s,id=GetID() +function s.initial_effect(c) + --Activate + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + c:RegisterEffect(e1) + --tribute substitute + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_FIELD) + e2:SetCode(EFFECT_EXTRA_RELEASE_NONSUM) + e2:SetRange(LOCATION_SZONE) + e2:SetTargetRange(0,LOCATION_MZONE) + e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_INFERNOID)) + e2:SetCountLimit(1,{id,0}) + e2:SetValue(s.relval) + c:RegisterEffect(e2) + --Banish 1 card on the field + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_REMOVE) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_RELEASE) + e3:SetRange(LOCATION_SZONE) + e3:SetCountLimit(1,{id,1}) + e3:SetCondition(s.rmvcond) + e3:SetTarget(s.rmvtg) + e3:SetOperation(s.rmvop) + c:RegisterEffect(e3) +end +s.listed_series={SET_INFERNOID} +function s.relval(e,re,r,rp) + return re and re:IsActivated() and (r&REASON_COST)~=0 +end +function s.cfilter(c,tp) + return c:IsPreviousLocation(LOCATION_MZONE) +end +function s.rmvcond(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.cfilter,1,nil,tp) +end +function s.rmvtg(e,tp,eg,ep,ev,re,r,rp,chk) + local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) + if chk==0 then return #g>0 end + Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,PLAYER_EITHER,LOCATION_ONFIELD) +end +function s.rmvop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) + if #g>0 then + Duel.HintSelection(g,true) + Duel.Remove(g,POS_FACEUP,REASON_EFFECT) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000240.lua b/users/CrimsonAlpha_002/c2002000240.lua new file mode 100644 index 0000000..c5ee509 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000240.lua @@ -0,0 +1,66 @@ +--World Legacy Retribution +local s,id=GetID() +function s.initial_effect(c) + --Send to GY + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_TOGRAVE) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetCountLimit(1,id) + e1:SetTarget(s.tgtg) + e1:SetOperation(s.tgop) + c:RegisterEffect(e1) + --Fusion Summon from GY + local e2=Fusion.CreateSummonEff(c,nil,s.matfilter,s.fextra,s.extraop,nil,nil,nil,nil,nil,nil,nil,nil,nil,s.extratg) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_GRAVE) + e2:SetCost(Cost.SelfBanish) + c:RegisterEffect(e2) +end +s.listed_series={SET_WORLD_LEGACY} +function s.matfilter(c) + return c:IsLinkMonster() + and ((c:IsLocation(LOCATION_HAND|LOCATION_ONFIELD) and c:IsAbleToGrave()) + or (c:IsLocation(LOCATION_REMOVED) and c:IsAbleToDeck())) +end +function s.fextra(e,tp,mg) + return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToDeck),tp,LOCATION_REMOVED,0,nil) +end +function s.extraop(e,tc,tp,sg) + local rg=sg:Filter(Card.IsLocation,nil,LOCATION_REMOVED) + if #rg>0 then + Duel.SendtoDeck(rg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT|REASON_MATERIAL|REASON_FUSION) + sg:Sub(rg) + end +end +function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetPossibleOperationInfo(0,CATEGORY_TODECK,nil,0,1,LOCATION_REMOVED) +end +function s.linkfilter(c,tp) + return c:IsFaceup() and c:IsType(TYPE_LINK) +end +function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end + local g=Duel.GetMatchingGroup(s.linkfilter,tp,LOCATION_MZONE,0,nil) + local ratings={} + local diff=0 + for lc in g:Iter() do + if not ratings[lc:GetLink()] then + ratings[lc:GetLink()]=true + diff=diff+1 + end + end + if chk==0 then return diff>0 and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + local tg=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,diff,nil) + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tg,#tg,0,0) +end +function s.tgop(e,tp,eg,ep,ev,re,r,rp) + local tg=Duel.GetTargetCards(e) + if #tg>0 then + Duel.SendtoGrave(tg,REASON_EFFECT) + end +end diff --git a/users/CrimsonAlpha_002/c2002000241.lua b/users/CrimsonAlpha_002/c2002000241.lua new file mode 100644 index 0000000..14a7a39 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000241.lua @@ -0,0 +1,112 @@ +--Arcana Wild Joker +local s,id=GetID() +function s.initial_effect(c) + --Synchro Summon Procedure + Synchro.AddProcedure(c,s.matfilter,1,1,Synchro.NonTunerEx(s.matfilter),1,99,s.exmatfilter) + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_REMOVE) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetRange(LOCATION_MZONE) + e1:SetHintTiming(TIMING_DAMAGE_STEP) + e1:SetCost(s.rmcost) + e1:SetTarget(s.rmtg) + e1:SetOperation(s.rmop) + c:RegisterEffect(e1) + --add 1 "Joker's Knight + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) + e2:SetCode(EVENT_DESTROYED) + e2:SetCondition(s.condition) + e2:SetCost(s.cost) + e2:SetTarget(s.target) + e2:SetOperation(s.operation) + c:RegisterEffect(e2) +end +s.listed_names={CARD_QUEEN_KNIGHT,CARD_KING_KNIGHT,CARD_JACK_KNIGHT,29284413} +function s.matfilter(c,scard,sumtype,tp) + return c:IsRace(RACE_WARRIOR,scard,sumtype,tp) and c:IsAttribute(ATTRIBUTE_LIGHT,scard,sumtype,tp) +end +function s.exmatfilter(c,scard,sumtype,tp) + return c:IsCode(CARD_QUEEN_KNIGHT) + or c:IsCode(CARD_KING_KNIGHT) + or c:IsCode(CARD_JACK_KNIGHT) +end +function s.costfilter(c,tp) + local tpe=c:GetType() + return tpe~=0 + and Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_ONFIELD,1,nil,tpe) + and not c:IsPublic() +end +function s.rmfilter(c,tpe) + return c:IsFaceup() and c:IsAbleToRemove() and not c:IsType(tpe) +end +function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then + return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil,tp) + and c:GetFlagEffect(id)==0 + end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) + Duel.DiscardHand(tp,s.costfilter,1,1,REASON_COST|REASON_DISCARD,nil,tp) + local g=Duel.GetOperatedGroup() + e:SetLabel(g:GetFirst():GetMainCardType()) + c:RegisterFlagEffect(id,RESET_CHAIN,0,1) +end +function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chk==0 then return true end + local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD,nil,e:GetLabel()) + Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) +end +function s.rmop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD,nil,e:GetLabel()) + if #g>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local sg=g:RandomSelect(tp,1) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + Duel.HintSelection(sg) + Duel.Remove(sg,POS_FACEUP,REASON_EFFECT) + end +end + +function s.condition(e,tp,eg,ep,ev,re,r,rp) + return rp~=tp and e:GetHandler():IsPreviousControler(tp) +end + +function s.cfilter(c) + return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_WARRIOR) and c:IsAbleToDeckAsCost() + and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) +end +function s.check(sg,e,tp,mg) + return sg:GetClassCount(Card.GetCode)==#sg +end +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE,0,nil) + if chk==0 then + return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE,0,3,nil) + and aux.SelectUnselectGroup(g,e,tp,3,3,s.check,0) + end + local sg=aux.SelectUnselectGroup(g,e,tp,3,3,s.check,1,tp,HINTMSG_TARGET) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) + Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_COST) +end +function s.filter(c,e,tp) + return c:IsCode(29284413) 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|LOCATION_GRAVE,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,CATEGORY_TOHAND) + local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp) + if #g>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000243.lua b/users/CrimsonAlpha_002/c2002000243.lua new file mode 100644 index 0000000..f472aee --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000243.lua @@ -0,0 +1,190 @@ +--Nekroz of Arma Gram +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + --Pendulum Summon procedure + Pendulum.AddProcedure(c) + c:AddMustBeRitualSummoned() + --Equip an opponent's monster destroyed by battle to this card + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e1:SetRange(LOCATION_PZONE) + e1:SetCode(EVENT_DESTROYED) + e1:SetCondition(s.eqpcon) + e1:SetTarget(s.eqptg) + e1:SetOperation(s.eqpop) + c:RegisterEffect(e1) + aux.AddEREquipLimit(c,nil,aux.FilterBoolFunction(Card.IsMonster),Card.EquipByEffectAndLimitRegister,e1) + --ritual material + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_FIELD) + e2:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) + e2:SetRange(LOCATION_PZONE) + e2:SetTargetRange(LOCATION_SZONE,0) + e2:SetProperty(EFFECT_FLAG_IGNORE_RANGE) + e2:SetCountLimit(1,{id,0}) + e2:SetCondition(function(e) return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)==0 end) + e2:SetValue(1) + e2:SetTarget(s.mttg) + c:RegisterEffect(e2) + --spsummon + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetRange(LOCATION_HAND) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET) + e3:SetCountLimit(1,{id,1}) + e3:SetCost(Cost.SelfDiscard) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) + local c3=e3:Clone() + c3:SetRange(LOCATION_MZONE) + c3:SetCountLimit(1,{id,2}) + c3:SetCondition(aux.NekrozOuroCheck) + c3:SetCost(Cost.SelfTribute) + c:RegisterEffect(c3) + --Negate targeted monster's effects, also loses ATK + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(id,2)) + e4:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE) + e4:SetType(EFFECT_TYPE_QUICK_O) + e4:SetProperty(EFFECT_FLAG_CARD_TARGET) + e4:SetCode(EVENT_CHAINING) + e4:SetRange(LOCATION_MZONE) + e4:SetCountLimit(1,{id,3}) + e4:SetTarget(s.negtg) + e4:SetOperation(s.negop) + c:RegisterEffect(e4) +end +s.listed_series={SET_NEKROZ} +function s.mat_filter(c) + return c:GetLevel()~=10 +end +function s.mttg(e,c) + local g=Duel.GetMatchingGroup(nil,e:GetHandlerPlayer(),LOCATION_SZONE,0,nil) + return g:IsContains(c) +end +function s.eqpfilter(c,tp) + return c:IsMonster() and c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE|REASON_EFFECT) + and c:IsPreviousControler(1-tp) and s.exfilter(c,tp) +end +function s.exfilter(c,tp) + return not c:IsForbidden() and c:CheckUniqueOnField(tp) +end +function s.eqpcon(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.eqpfilter,1,nil,tp) +end +function s.eqptg(e,tp,eg,ep,ev,re,r,rp,chk) + local eqg=eg:Filter(s.eqpfilter,nil,tp) + if chk==0 then + return #eqg>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>=#eqg + and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_NEKROZ),tp,LOCATION_MZONE,0,1,nil) + end + Duel.SetTargetCard(eqg) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,eqg,#eqg,0,0) +end +function s.eqpop(e,tp,eg,ep,ev,re,r,rp) + local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) + if ft<1 then return end + local c=e:GetHandler() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local ec=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsSetCard,SET_NEKROZ),tp,LOCATION_MZONE,0,1,1,nil):GetFirst() + if not ec then return end + local tg=Duel.GetTargetCards(e):Filter(s.exfilter,nil,tp) + if ec:IsFaceup() and #tg>0 and ft>0 then + local eqg=nil + if #tg>ft then + eqg=tg:Select(tp,ft,ft,nil) + else + eqg=tg + end + for tc in eqg:Iter() do + if Duel.Equip(tp,tc,ec,true,true) then + --Equip limit + local e1=Effect.CreateEffect(tc) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + e1:SetValue(s.eqlimit) + e1:SetLabelObject(ec) + tc:RegisterEffect(e1) + end + end + Duel.EquipComplete() + end +end +function s.eqlimit(e,c) + return c==e:GetLabelObject() +end + +function s.spfilter(c,e,tp) + return c:IsSetCard(SET_NEKROZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + 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) +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) + end +end + +function s.distg(c,eqpc) + return c:IsNegatableMonster() or (eqpc and c:IsFaceup() and c:GetAttack()>0) +end +function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsNegatable() and chkc:IsControler(1-tp) end + if chk==0 then return Duel.IsExistingTarget(Card.IsNegatable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) + local g=Duel.SelectTarget(tp,Card.IsNegatable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) +end +function s.negop(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if tc:IsNegatable() and tc:IsRelateToEffect(e) then + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_DISABLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + tc:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_DISABLE_EFFECT) + e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e2:SetReset(RESET_EVENT|RESETS_STANDARD) + tc:RegisterEffect(e2) + if tc:IsType(TYPE_TRAPMONSTER) then + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_SINGLE) + e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) + e3:SetReset(RESET_EVENT|RESETS_STANDARD) + tc:RegisterEffect(e3) + end + if tc:IsType(TYPE_MONSTER) then + local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsType,TYPE_RITUAL),tp,LOCATION_MZONE,0,nil) + if ct>0 then + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_SINGLE) + e4:SetCode(EFFECT_UPDATE_ATTACK) + e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e4:SetValue(-ct*1000) + e4:SetReset(RESET_EVENT|RESETS_STANDARD) + tc:RegisterEffect(e4) + end + end + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000244.lua b/users/CrimsonAlpha_002/c2002000244.lua new file mode 100644 index 0000000..1b81f22 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000244.lua @@ -0,0 +1,96 @@ +--Emissary of Doom +local s,id=GetID() +function s.initial_effect(c) + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e0:SetTargetRange(1,0) + e0:SetCode(id) + e0:SetRange(LOCATION_MZONE) + c:RegisterEffect(e0) + --Special Summon this card from your hand or GY + local e1=Effect.CreateEffect(c) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) + e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_SPSUMMON) + e1:SetCountLimit(1,id) + e1:SetCondition(s.condition) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) + --count special summons + aux.GlobalCheck(s,function() + local ge1=Effect.CreateEffect(c) + ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + ge1:SetCode(EVENT_SPSUMMON_SUCCESS) + ge1:SetOperation(s.checkop) + Duel.RegisterEffect(ge1,0) + end) + -- --Cannot negate the activation of your "Destiny Boards" + -- local e2=Effect.CreateEffect(c) + -- e2:SetType(EFFECT_TYPE_FIELD) + -- e2:SetCode(EFFECT_CANNOT_INACTIVATE) + -- e2:SetRange(LOCATION_MZONE) + -- e2:SetValue(s.chainfilter) + -- c:RegisterEffect(e2) + -- --Cannot negate the effects of your "Destiny Boards" + -- local e3=Effect.CreateEffect(c) + -- e3:SetType(EFFECT_TYPE_FIELD) + -- e3:SetCode(EFFECT_CANNOT_DISEFFECT) + -- e3:SetRange(LOCATION_MZONE) + -- e3:SetValue(s.chainfilter) + -- c:RegisterEffect(e3) + -- local e4=Effect.CreateEffect(c) + -- e4:SetType(EFFECT_TYPE_FIELD) + -- e4:SetCode(EFFECT_CANNOT_DISABLE) + -- e4:SetRange(LOCATION_MZONE) + -- e4:SetTargetRange(LOCATION_ONFIELD,0) + -- e4:SetTarget(s.distarget) + -- c:RegisterEffect(e4) +end +s.listed_names={CARD_DESTINY_BOARD} +function s.checkop(e,tp,eg,ep,ev,re,r,rp) + local tc=eg:GetFirst() + for tc in aux.Next(eg) do + if tc:IsSummonLocation(LOCATION_EXTRA) then + Duel.RegisterFlagEffect(tc:GetSummonPlayer(),id,RESET_PHASE|PHASE_END,0,1) + end + end +end +function s.condition(e,tp,eg,ep,ev,re,r,rp) + return Duel.GetFlagEffect(1-tp,id)>=3 and Duel.IsMainPhase() +end +function s.plfilter(c,tp) + return c:IsCode(CARD_DESTINY_BOARD) +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 c:IsCanBeSpecialSummoned(e,0,tp,false,false) + and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,tp) + end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then + local tc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,tp):GetFirst() + if tc then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) + Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) + end + end +end + +function s.distarget(e,c) + return c:IsCode(CARD_DESTINY_BOARD) +end +function s.chainfilter(e,ct) + local p=e:GetHandlerPlayer() + local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER) + return p==tp and te:GetHandler():IsCode(CARD_DESTINY_BOARD) +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000245.lua b/users/CrimsonAlpha_002/c2002000245.lua new file mode 100644 index 0000000..2a5ae8a --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000245.lua @@ -0,0 +1,82 @@ +--Gust and Drift +local s,id=GetID() +function s.initial_effect(c) + --Activate + local e1=Effect.CreateEffect(c) + e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetCountLimit(1,id) + e1:SetCost(s.cost) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) +end +function s.cfilter(c,tp) + local att,lv,race,code=c:GetAttribute(),c:GetLevel(),c:GetRace(),c:GetCode() + if lv<=0 then return false end + local tc=Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_DECK,0,1,nil,tp,att,lv,race,code) + if not tc then return false end + return c:IsMonster() and c:IsDiscardable() +end + +function s.filter1(c,tp,att,lv,race,code) + return c:IsAttribute(att) and c:IsLevel(lv) and c:IsAbleToHand() + and not c:IsRace(race) and not c:IsCode(code) + and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK,0,1,nil,att,lv,race,code1,code2) +end + +function s.filter2(c,att,lv,race,code1,code2) + return c:IsAttribute(att) and c:IsLevel(lv) and c:IsAbleToHand() + and not c:IsRace(race) and not c:IsCode(code1) and not c:IsCode(code2) +end +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + e:SetLabel(1) + if chk==0 then return true end +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then + if e:GetLabel()~=1 then return false end + e:SetLabel(0) + return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil,tp) + end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) + local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil,tp) + e:SetLabelObject(g:GetFirst()) + Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + local tc=e:GetLabelObject() + local att,lv,race,code1=tc:GetAttribute(),tc:GetLevel(),tc:GetRace(),tc:GetCode() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local tc1=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_DECK,0,1,1,nil,tp,att,lv,race,code1) + local code2=tc1:GetFirst():GetCode() + local tc2=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_DECK,0,1,1,nil,att,lv,race,code1,code2) + local g=Group.CreateGroup() + g:AddCard(tc1) + g:AddCard(tc2) + if #g>1 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) + e1:SetTargetRange(1,0) + e1:SetTarget(s.splimit(tc:GetAttribute())) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) + local e2=Effect.CreateEffect(e:GetHandler()) + e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetReset(RESET_PHASE|PHASE_END) + e2:SetTargetRange(1,0) + Duel.RegisterEffect(e2,tp) + end +end +function s.splimit(att) + return function(e,c) + return not c:IsAttribute(att) + end +end diff --git a/users/CrimsonAlpha_002/c2002000246.lua b/users/CrimsonAlpha_002/c2002000246.lua new file mode 100644 index 0000000..18d6d59 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000246.lua @@ -0,0 +1,45 @@ +--Unforeseen Disaster +local s,id=GetID() +function s.initial_effect(c) + --Activate + local e1=Effect.CreateEffect(c) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOGRAVE) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) + e1:SetCost(s.cost) + e1:SetTarget(s.target) + e1:SetOperation(s.activate) + c:RegisterEffect(e1) +end +function s.cfilter(c,tp) + return c:IsMonster() and c:IsReleasable() +end +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,true,nil,nil) end + local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,true,nil,nil) + Duel.Release(g,REASON_COST) +end +function s.filter(c) + return c:IsFaceup() + and c:IsSpecialSummoned() +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end + if e:IsHasType(EFFECT_TYPE_ACTIVATE) then + Duel.SetChainLimit(function(te,rp,tp) return not te:IsMonsterEffect() end) + end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) + Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil) +end +-- Destroy target, then purge all copies +function s.activate(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end + local g=Duel.GetMatchingGroup(Card.IsCode,tc:GetControler(),LOCATION_HAND|LOCATION_DECK|LOCATION_EXTRA,LOCATION_HAND|LOCATION_DECK|LOCATION_EXTRA,nil,tc:GetCode()) + if Duel.Destroy(tc,REASON_EFFECT)>0 and #g>0 then + Duel.SendtoGrave(g,REASON_EFFECT) + end +end diff --git a/users/CrimsonAlpha_002/c2002000247.lua b/users/CrimsonAlpha_002/c2002000247.lua new file mode 100644 index 0000000..ebb2bd4 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000247.lua @@ -0,0 +1,97 @@ +--Cyber Endfinity Nova Dragon +local s,id=GetID() +function s.initial_effect(c) + --xyz summon + Xyz.AddProcedure(c,s.mfilter,10,3,s.ovfilter,aux.Stringid(id,0),3,s.xyzop) + c:EnableReviveLimit() + --negate everything then destroy them + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetRange(LOCATION_MZONE) + e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) + e1:SetCountLimit(1,id) + e1:SetCost(Cost.DetachFromSelf(1,1,nil)) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) + --gain ATK + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_DESTROY) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1) + e2:SetCost(s.atcost) + e2:SetOperation(s.atop) + c:RegisterEffect(e2) +end +s.listed_names={10443957} +function s.mfilter(c,xyz,sumtype,tp) + return c:IsRace(RACE_MACHINE,xyz,sumtype,tp) and c:IsAttribute(ATTRIBUTE_LIGHT,xyz,sumtype,tp) +end +function s.ovfilter(c,tp,lc) + return c:IsFaceup() and c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,10443957) and c:GetOverlayCount()>=6 +end +function s.xyzop(e,tp,chk) + if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end + Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) + return true +end +function s.negfilter(c) + return c:IsFaceup() and not c:IsDisabled() +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.negfilter,tp,0,LOCATION_ONFIELD,1,nil) end + local g=Duel.GetMatchingGroup(s.negfilter,tp,0,LOCATION_ONFIELD,nil) + Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,tp,LOCATION_ONFIELD) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,LOCATION_ONFIELD) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local g=Duel.GetMatchingGroup(s.negfilter,tp,0,LOCATION_ONFIELD,nil) + local dg=Group.CreateGroup() + if g and #g>0 then + for tc in aux.Next(g) do + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_DISABLE) + e1:SetReset(RESET_EVENT+RESETS_STANDARD) + tc:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_DISABLE_EFFECT) + e2:SetReset(RESET_EVENT+RESETS_STANDARD) + tc:RegisterEffect(e2) + if not tc:IsImmuneToEffect(e1) and not tc:IsImmuneToEffect(e2) then dg=dg+tc end + end + end + Duel.AdjustInstantly(c) + if #dg>0 then + Duel.Destroy(dg,REASON_EFFECT) + end +end +function s.atfilter(c,e,tp) + return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE) and c:IsAbleToRemoveAsCost() +end +function s.atcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.atfilter,tp,LOCATION_GRAVE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.GetMatchingGroup(s.atfilter,tp,LOCATION_GRAVE,0,nil) + e:SetLabel(#g) + Duel.Remove(g,POS_FACEUP,REASON_COST) +end +function s.atop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsFaceup() and c:IsRelateToEffect(e) then + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) + e1:SetValue(e:GetLabel()*200) + c:RegisterEffect(e1) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000248.lua b/users/CrimsonAlpha_002/c2002000248.lua new file mode 100644 index 0000000..073bfa2 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000248.lua @@ -0,0 +1,221 @@ +--Dragunity Hexallion +local s,id=GetID() +function s.initial_effect(c) + --pendulum summon + Pendulum.AddProcedure(c) + --s/t synchro + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,1)) + e1a:SetType(EFFECT_TYPE_SINGLE) + e1a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) + e1a:SetCode(CUSTOM_ST_SYNCHRO) + e1a:SetLabel(id) + e1a:SetValue(s.synval) + -- c:RegisterEffect(e1a) + --s/t synchro: effect gain + local e1b=Effect.CreateEffect(c) + e1b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) + e1b:SetRange(LOCATION_PZONE) + e1b:SetTargetRange(LOCATION_MZONE,0) + e1b:SetTarget(s.eftg) + e1b:SetLabelObject(e1a) + c:RegisterEffect(e1b) + --Equip 1 "Dragunity" Tuner monster a face-up monster + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,2)) + e2:SetCategory(CATEGORY_EQUIP) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_PZONE) + e2:SetCountLimit(1,{id,0}) + e2:SetTarget(s.eqpztg) + e2:SetOperation(s.eqpzop) + c:RegisterEffect(e2) + --Special Summon itself while it is equipped to a monster + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(id,0)) + e4:SetCategory(CATEGORY_SPECIAL_SUMMON) + e4:SetType(EFFECT_TYPE_IGNITION) + e4:SetRange(LOCATION_SZONE) + e4:SetCountLimit(1,{id,2}) + e4:SetCondition(function(e) return e:GetHandler():GetEquipTarget() end) + e4:SetTarget(s.sptg) + e4:SetOperation(s.spop) + c:RegisterEffect(e4) + --equip itself + local e5=Effect.CreateEffect(c) + e5:SetDescription(aux.Stringid(id,2)) + e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e5:SetCode(EVENT_TO_DECK) + e5:SetCountLimit(1,{id,1}) + e5:SetCondition(s.eqcon) + e5:SetTarget(s.eqtg) + e5:SetOperation(s.eqop) + c:RegisterEffect(e5) + local e6=e5:Clone() + e6:SetCode(EVENT_TO_GRAVE) + e6:SetCondition(aux.TRUE) + c:RegisterEffect(e6) + --pzone itself + local e7=e5:Clone() + e7:SetDescription(aux.Stringid(id,3)) + e7:SetCode(EVENT_TO_DECK) + e7:SetTarget(s.pentg) + e7:SetOperation(s.penop) + c:RegisterEffect(e7) + local e8=e7:Clone() + e8:SetCode(EVENT_TO_GRAVE) + e8:SetCondition(aux.TRUE) + c:RegisterEffect(e8) + +end +s.listed_series={SET_DRAGUNITY} +s.listed_names={62265044} +-- {Pendulum Effect: Synchro Summon using Dragunity monsters in the S/T Zone] +function s.eftg(e,c) + return c:IsType(TYPE_MONSTER) + and c:IsSetCard(SET_DRAGUNITY) +end +function s.synval(e,c,sc) + if c:IsLocation(LOCATION_SZONE) then + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(CUSTOM_ST_SYNCHRO+EFFECT_SYNCHRO_CHECK) + e1:SetLabel(id) + e1:SetTarget(s.synchktg) + c:RegisterEffect(e1) + return true + else return false end +end +function s.chk(c) + if not c:IsHasEffect(CUSTOM_ST_SYNCHRO+EFFECT_SYNCHRO_CHECK) then return false end + local te={c:GetCardEffect(CUSTOM_ST_SYNCHRO+EFFECT_SYNCHRO_CHECK)} + for i=1,#te do + local e=te[i] + if e:GetLabel()~=id then return false end + end + return true +end +function s.chk2(c) + if not c:IsHasEffect(CUSTOM_ST_SYNCHRO) or c:IsHasEffect(CUSTOM_ST_SYNCHRO+EFFECT_SYNCHRO_CHECK) then return false end + local te={c:GetCardEffect(CUSTOM_ST_SYNCHRO)} + for i=1,#te do + local e=te[i] + if e:GetLabel()==id then return true end + end + return false +end +function s.synchktg(e,c,sg,tg,ntg,tsg,ntsg) + if c then + local res=true + if sg:IsExists(s.chk,1,c) or (not tg:IsExists(s.chk2,1,c) and not ntg:IsExists(s.chk2,1,c) + and not sg:IsExists(s.chk2,1,c)) then return false end + local trg=tg:Filter(s.chk,nil) + local ntrg=ntg:Filter(s.chk,nil) + return res,trg,ntrg + else + return true + end +end +-- {Pendulum Effect: Equip from Hand/GY] +function s.eqlimit(e,c) + return c==e:GetLabelObject() +end +function s.eqfilter(c) + return c:IsSetCard(SET_DRAGUNITY) and c:IsType(TYPE_TUNER) and not c:IsForbidden() +end +function s.eqpztg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil) + and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) + local tc=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetTargetCard(tc) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) +end +function s.eqpzop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil) + if #g>0 then + Duel.Equip(tp,g:GetFirst(),tc,true) + local e1=Effect.CreateEffect(tc) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+RESETS_STANDARD) + e1:SetValue(s.eqlimit) + e1:SetLabelObject(tc) + g:GetFirst():RegisterEffect(e1) + end +end +-- {Monster Effect: Special Summon} +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) +end +function s.thfilter(c) + return (c:IsSetCard(SET_DRAGUNITY) and c:IsSpellTrap()) or c:IsCode(62265044) and c:IsAbleToHand() +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end + if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) + and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) + if #g>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) + end + end +end +-- {Monster Effect: Equip self} +function s.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsLocation(LOCATION_EXTRA) +end +function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) + Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK) +end +function s.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + if Duel.Equip(tp,c,tc,true) then + --Add Equip limit + local e1=Effect.CreateEffect(tc) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+RESETS_STANDARD) + e1:SetValue(s.eqlimit) + e1:SetLabelObject(tc) + c:RegisterEffect(e1) + local e2=Effect.CreateEffect(tc) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE) + e2:SetCode(EFFECT_UPDATE_ATTACK) + e2:SetReset(RESET_EVENT|RESETS_STANDARD) + e2:SetValue(500) + c:RegisterEffect(e2) + end +end +-- {Monster Effect: PZone self} +function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckPendulumZones(tp) end +end +function s.penop(e,tp,eg,ep,ev,re,r,rp) + if not Duel.CheckPendulumZones(tp) then return end + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000249.lua b/users/CrimsonAlpha_002/c2002000249.lua new file mode 100644 index 0000000..c95dc9e --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000249.lua @@ -0,0 +1,85 @@ +--Dragunity Imperator +local s,id=GetID() +function s.initial_effect(c) + --summon with no tribute + local e0=Effect.CreateEffect(c) + e0:SetDescription(aux.Stringid(id,0)) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) + e0:SetType(EFFECT_TYPE_SINGLE) + e0:SetCode(EFFECT_SUMMON_PROC) + e0:SetCondition(s.ntcon) + e0:SetValue(1) + c:RegisterEffect(e0) + --search + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_SUMMON_SUCCESS) + e1:SetCountLimit(1,{id,0}) + e1:SetTarget(s.thtg) + e1:SetOperation(s.thop) + c:RegisterEffect(e1) + local e2=e1:Clone() + e2:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e2) + --Special summon procedure (from hand or GY) + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetRange(LOCATION_GRAVE) + e3:SetCountLimit(1,{id,1}) + e3:SetCost(s.spcost) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) +end +s.listed_series={SET_DRAGUNITY} +s.listed_names={62265044} +function s.cfilter(c) + return c:IsFaceup() and (c:IsSetCard(SET_DRAGUNITY) or c:IsCode(62265044)) +end +function s.ntcon(e,c,minc) + if c==nil then return true end + return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.cfilter,c:GetControler(),LOCATION_ONFIELD|LOCATION_GRAVE,0,1,nil) +end +function s.filter(c) + return c:IsAbleToHand() + and c:IsSetCard(SET_DRAGUNITY) + and c:IsType(TYPE_MONSTER) +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,e:GetHandler():GetCode()) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,e:GetHandler():GetCode()) + if #g>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) + end +end +function s.spfilter(c) + return c:IsSetCard(SET_DRAGUNITY) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) +end +function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) + local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,e:GetHandler()) + if chk==0 then return #rg>0 + and aux.SelectUnselectGroup(rg,e,tp,1,1,aux.ChkfMMZ(1),0) end + local g=aux.SelectUnselectGroup(rg,e,tp,1,1,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE) + Duel.Remove(g,POS_FACEUP,REASON_COST) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000250.lua b/users/CrimsonAlpha_002/c2002000250.lua new file mode 100644 index 0000000..3b8ecf8 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000250.lua @@ -0,0 +1,112 @@ +--Dragunity Arma Exallion +local s,id=GetID() +function s.initial_effect(c) + --Synchro summon + Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_DRAGUNITY),1,99,Synchro.NonTuner(nil),1,99) + c:EnableReviveLimit() + --Banish 1 Tuner and non-Tuner to Special Summon a "Dragunity" Synchro + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1,{id,0}) + e1:SetCost(s.spcost) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) + --Equip 1 "Dragunity" Tuner monster to itself + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_EQUIP) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetRange(LOCATION_MZONE) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetCountLimit(1,{id,1}) + e2:SetCost(s.eqcost) + e2:SetTarget(s.eqtg) + e2:SetOperation(s.eqop) + c:RegisterEffect(e2) +end +s.listed_series={SET_DRAGUNITY} +function s.tdfilter(c) + return c:IsSetCard(SET_DRAGUNITY) and c:HasLevel() and c:IsFaceup() and c:IsAbleToDeckOrExtraAsCost() +end +function s.spfilter(c,e,tp,lv) + return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsType(TYPE_SYNCHRO) + and c:IsSetCard(SET_DRAGUNITY) + and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) +end +function s.rescon(sg,e,tp,mg) + return #sg==2 and sg:FilterCount(Card.IsType,nil,TYPE_TUNER)==1 + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,sg:GetSum(Card.GetLevel)) +end +function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) + e:SetLabel(1) + return true +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_SYNCHRO) + local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_REMOVED|LOCATION_GRAVE,0,nil) + if chk==0 then return #pg<=0 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end + local dg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_TODECK) + e:SetLabel(dg:GetSum(Card.GetLevel)) + Duel.ConfirmCards(1-tp,dg) + Duel.SendtoDeck(dg,nil,SEQ_DECKSHUFFLE,REASON_COST) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,e:GetLabel()) + if #g>0 and Duel.SpecialSummon(g,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then + g:GetFirst():CompleteProcedure() + end +end +function s.cfilter(c) + return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) +end +function s.eqcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) + Duel.Remove(g,POS_FACEUP,REASON_COST) +end +function s.eqfilter(c,ec) + return c:IsSetCard(SET_DRAGUNITY) and c:IsType(TYPE_TUNER) and not c:IsForbidden() +end +function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) + and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_PZONE) +end +function s.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,c) + if #g>0 then + Duel.Equip(tp,g:GetFirst(),c) + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + e1:SetValue(s.eqlimit) + e1:SetLabelObject(c) + g:GetFirst():RegisterEffect(e1) + if not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) + or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local x=c:GetEquipCount() + local dg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,x,nil) + if #dg>0 then + Duel.HintSelection(dg,true) + Duel.BreakEffect() + Duel.Destroy(dg,REASON_EFFECT) + end + end +end +function s.eqlimit(e,c) + return c==e:GetLabelObject() +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000251.lua b/users/CrimsonAlpha_002/c2002000251.lua new file mode 100644 index 0000000..f08f3a4 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000251.lua @@ -0,0 +1,135 @@ +--Shaddollswarm Ouroboros +local s,id=GetID() +function s.initial_effect(c) + --flip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e1:SetCountLimit(1,id) + e1:SetTarget(s.rmtg) + e1:SetOperation(s.rmop) + c:RegisterEffect(e1) + --Special Summon this card from your hand by sending 1 "Shaddoll" card from Deck, and 2 monsters from hand or field to GY + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER) + e2:SetRange(LOCATION_HAND|LOCATION_GRAVE) + e2:SetCountLimit(1,id) + e2:SetCondition(aux.exccon) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) + --tohand + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_TOHAND) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetCode(EVENT_TO_GRAVE) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e3:SetCountLimit(1,id) + e3:SetTarget(s.thtg) + e3:SetOperation(s.thop) + c:RegisterEffect(e3) +end +s.listed_series={SET_SHADDOLL} + +function s.rmfilter(c,ty) + return c:IsType(ty) and c:IsAbleToRemove() + and ( c:IsMonster() or (c:IsSpellTrap() and c:IsPublic()) ) +end +function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then + return ( not Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),69832741) + and ( Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_ONFIELD|LOCATION_GRAVE,1,nil,TYPE_MONSTER) + or Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_ONFIELD|LOCATION_GRAVE,1,nil,TYPE_SPELL) + or Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_ONFIELD|LOCATION_GRAVE,1,nil,TYPE_TRAP) ) ) + or e:GetHandler():IsFaceup() and e:GetHandler():IsMonster() + end + Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_ONFIELD|LOCATION_GRAVE) +end +function s.rmop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local g1=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD|LOCATION_GRAVE,nil,TYPE_MONSTER) + local g2=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD|LOCATION_GRAVE,nil,TYPE_SPELL) + local g3=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD|LOCATION_GRAVE,nil,TYPE_TRAP) + if #g1>0 or #g2>0 or #g3>0 + then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local sg1=g1:Select(tp,1,1,nil) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local sg2=g2:Select(tp,1,1,nil) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local sg3=g3:Select(tp,1,1,nil) + sg1:Merge(sg2) + sg1:Merge(sg3) + Duel.HintSelection(sg1) + Duel.Remove(sg1,POS_FACEUP,REASON_EFFECT) + end + --switch ATK and DEF + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_SWAP_BASE_AD) + e1:SetReset(RESET_EVENT+RESETS_STANDARD) + c:RegisterEffect(e1) +end +function s.rescon(sg,e,tp,mg) + return #sg==2 and sg:FilterCount(Card.IsType,nil,TYPE_TUNER)==1 + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,sg:GetSum(Card.GetLevel)) +end +function s.spfilter1(c) + return c:IsSetCard(SET_SHADDOLL) and c:IsAbleToGrave() +end +function s.spfilter2(c,tp) + return c:IsMonster() and c:IsAbleToGrave() and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 +end +function s.rescon(sg,e,tp,mg) + if #sg>1 then + return aux.ChkfMMZ(1)(sg,e,tp,mg) + end +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + local g=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_HAND|LOCATION_MZONE,0,c,tp) + if chk==0 then return #g>1 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end + if chk==0 then + return Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_DECK,0,1,c) + and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_HAND|LOCATION_MZONE,0,2,c,tp) + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,3,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_DECK) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) +end + +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + local mg=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_HAND|LOCATION_MZONE,0,c,tp) + local g1=Duel.SelectMatchingCard(tp,s.spfilter1,tp,LOCATION_DECK,0,1,1,c) + local g2=aux.SelectUnselectGroup(mg,e,tp,2,2,s.rescon,1,tp,HINTMSG_TOGRAVE) + if #g2>1 then end + g1:Merge(g2) + if #g1>2 and Duel.SendtoGrave(g1,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_DEFENSE) + end +end + +function s.thfilter(c) + return c:IsSetCard(SET_SHADDOLL) and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if tc and tc:IsRelateToEffect(e) then + Duel.SendtoHand(tc,nil,REASON_EFFECT) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000252.lua b/users/CrimsonAlpha_002/c2002000252.lua new file mode 100644 index 0000000..3f77932 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000252.lua @@ -0,0 +1,121 @@ +--Dark Rebellion Pendulum Dragon +local s,id=GetID() +function s.initial_effect(c) + Pendulum.AddProcedure(c) + --Special Summon from Pendulum Zone + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e1:SetCode(EVENT_DETACH_MATERIAL) + e1:SetRange(LOCATION_PZONE) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCountLimit(1,{id,0}) + e1:SetCondition(s.spcon1) + e1:SetTarget(s.sptg1) + e1:SetOperation(s.spop1) + c:RegisterEffect(e1) + --Special Summon from hand, GY, or face-up Extra Deck + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE+CATEGORY_TOHAND+CATEGORY_SEARCH) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_EXTRA) + e2:SetCountLimit(1,{id,1}) + e2:SetCost(s.spcost2) + e2:SetTarget(s.sptg2) + e2:SetOperation(s.spop2) + c:RegisterEffect(e2) + --to hand + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,0)) + e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetCode(EVENT_SPSUMMON_SUCCESS) + e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCountLimit(1,{id,2}) + e3:SetTarget(s.thtg) + e3:SetOperation(s.thop) + c:RegisterEffect(e3) + --Xyz level + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_SINGLE) + e4:SetCode(EFFECT_XYZ_MATERIAL_CUSTOM) + e4:SetValue(s.val) + c:RegisterEffect(e4) +end +s.listed_series={SET_ODD_EYES,SET_REBELLION,SET_THE_PHANTOM_KNIGHTS,SET_RANK_UP_MAGIC} +function s.cfilter(c,tp) + return c:IsControler(tp) + and (c:IsSetCard(SET_ODD_EYES) or c:IsSetCard(SET_REBELLION) or c:IsSetCard(SET_THE_PHANTOM_KNIGHTS)) +end +function s.spcon1(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.cfilter,1,nil,tp) +end +function s.sptg1(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) +end +function s.spop1(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) +end +function s.spcost2(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end + Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST) +end +function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then + return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) +end +function s.spop2(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end + if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end + -- halve ATK + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) + local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) + local tc=g:GetFirst() + if tc then + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_SET_ATTACK_FINAL) + e1:SetValue(math.floor(tc:GetAttack()/2)) + e1:SetReset(RESET_EVENT+RESETS_STANDARD) + tc:RegisterEffect(e1) + end +end +function s.chkval(sg) + for sc in sg:Iter() do + if not (sc:IsSetCard(SET_ODD_EYES) or sc:IsSetCard(SET_REBELLION) or sc:IsSetCard(SET_THE_PHANTOM_KNIGHTS)) then + return false + end + end + return true +end +function s.val(te,xyz,sg) + --if you want to do something with `sg` later then you must return the expected level if `sg` is nil + if not sg then return 4 end + return s.chkval(sg) and sg and sg:IsContains(te:GetHandler()) and 4 or 0 +end +function s.rumfilter(c) + return c:IsSetCard(SET_RANK_UP_MAGIC) and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,s.rumfilter,tp,LOCATION_DECK,0,1,1,nil) + if #g>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000253.lua b/users/CrimsonAlpha_002/c2002000253.lua new file mode 100644 index 0000000..2e14869 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000253.lua @@ -0,0 +1,224 @@ +--El Shaddoll Zefracoreaver +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + c:SetUniqueOnField(1,0,id) + --Pendulum Summon procedure + Pendulum.AddProcedure(c) + --Fusion + Fusion.AddProcMixN(c,true,true,s.ffilter1,1,s.ffilter2,1,s.ffilter3,1) + c:AddMustFirstBeFusionSummoned() + --Negate 1 face-up card, then change the scales of your "Zefra" cards in the Pendulum Zone to 0 & 12 + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DISABLE) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetRange(LOCATION_PZONE) + e1:SetCountLimit(1,{id,0}) + e1:SetCondition(s.discon) + e1:SetTarget(s.distg) + e1:SetOperation(s.disop) + c:RegisterEffect(e1) + --Lingering Floodgate + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_SPSUMMON_SUCCESS) + e2:SetRange(LOCATION_MZONE) + e2:SetCondition(s.Condition) + e2:SetTarget(s.Target) + e2:SetOperation(s.Operation) + c:RegisterEffect(e2) + --Set 1 "Shaddoll" or "Zefra" Spell/Trap, then place this card in the Pendulum Zone + local e3a=Effect.CreateEffect(c) + e3a:SetDescription(aux.Stringid(id,2)) + e3a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3a:SetProperty(EFFECT_FLAG_DELAY) + e3a:SetCode(EVENT_TO_DECK) + e3a:SetRange(LOCATION_EXTRA) + -- e3a:SetCountLimit(1,{id,2}) + e3a:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_MZONE) and e:GetHandler():IsFaceup() end) + e3a:SetTarget(s.plctg) + e3a:SetOperation(s.plcop) + c:RegisterEffect(e3a) + -- local e3b=e3a:Clone() + -- e3b:SetCode(EVENT_SPSUMMON_SUCCESS) + -- e3b:SetRange(LOCATION_MZONE) + -- e3b:SetCondition(function(e) return e:GetHandler():IsFusionSummoned() end) + -- c:RegisterEffect(e3b) +end +s.listed_series={SET_SHADDOLL,SET_ZEFRA} +--Material Check +function s.ffilter1(c,fc,sumtype,sp,sub,mg,sg,set) + return c:IsSetCard(SET_SHADDOLL,fc,sumtype,sp) + and (not sg or sg:FilterCount(aux.TRUE,c)==0 or not sg:IsExists(Card.IsAttribute,1,c,c:GetAttribute(),fc,sumtype,sp)) +end +function s.ffilter2(c,fc,sumtype,sp,sub,mg,sg) + return c:IsSetCard(SET_ZEFRA,fc,sumtype,sp) + and (not sg or sg:FilterCount(aux.TRUE,c)==0 or not sg:IsExists(Card.IsAttribute,1,c,c:GetAttribute(),fc,sumtype,sp)) +end +function s.ffilter3(c,fc,sumtype,sp,sub,mg,sg) + return (not sg or sg:FilterCount(aux.TRUE,c)==0 or not sg:IsExists(Card.IsAttribute,1,c,c:GetAttribute(),fc,sumtype,sp)) +end +--E1: Negate 1 face-up card, then change the scales of your "Zefra" cards in the Pendulum Zone to 0 & 12 +function s.disfilter(c) + return c:IsSetCard({SET_SHADDOLL,SET_ZEFRA}) and c:IsMonster() and c:IsReason(REASON_EFFECT) +end +function s.discon(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.disfilter,1,nil) +end +function s.distgfilter(c) + return c:IsFaceup() and not c:IsDisabled() +end +function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) + if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_ONFIELD) and s.distgfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.distgfilter,tp,0,LOCATION_ONFIELD,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) + local g=Duel.SelectTarget(tp,s.distgfilter,tp,0,LOCATION_ONFIELD,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) +end +function s.disop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsDisabled() and tc:IsControler(1-tp) then + Duel.NegateRelatedChain(tc,RESET_TURN_SET) + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_DISABLE) + e1:SetReset(RESETS_STANDARD_PHASE_END) + tc:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_DISABLE_EFFECT) + e2:SetValue(RESET_TURN_SET) + e2:SetReset(RESETS_STANDARD_PHASE_END) + tc:RegisterEffect(e2) + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_FIELD) + e3:SetCode(EFFECT_CHANGE_LSCALE) + e3:SetRange(LOCATION_MZONE) + e3:SetTargetRange(LOCATION_PZONE,0) + e3:SetValue(s.scval(0)) + e3:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e3,tp) + local e4=e3:Clone() + e4:SetCode(EFFECT_CHANGE_RSCALE) + e4:SetValue(s.scval(12)) + Duel.RegisterEffect(e4,tp) + end +end +function s.scval(val) + return function(e,c) + local tp=e:GetHandler():GetControler() + local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_ZEFRA),tp,LOCATION_PZONE,0,nil) + if ct==2 and not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then + return val + else + if val==1 and not Duel.CheckLocation(tp,LOCATION_PZONE,0) then + return Duel.GetFieldCard(tp,LOCATION_PZONE,0):GetLeftScale() + end + if val==9 and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then + return Duel.GetFieldCard(tp,LOCATION_PZONE,1):GetRightScale() + end + end + end +end +--E2: Lingering Floodgate +function s.mtfilter(c) + return c:IsSetCard(SET_ZEFRA) + and c:IsType(TYPE_MONSTER) +end +function s.getmats(c,tp) + return c:GetMaterial():IsExists(s.mtfilter,1,nil) and c:GetControler()==tp +end +function s.Condition(e,tp,eg,ep,ev,re,r,rp) + if not eg:IsExists(s.getmats,1,nil,tp) or eg:IsContains(e:GetHandler()) then return end + local ritual_chk=eg:IsExists(s.getmats,1,nil,tp) and eg:GetFirst():IsSummonType(SUMMON_TYPE_RITUAL) + local extra_chk=eg:IsExists(s.getmats,1,nil,tp) and eg:GetFirst():IsPreviousLocation(LOCATION_EXTRA) + local synchro_chk,xyz_chk,link_chk,fusion_chk,special_chk=false,false,false,false,false + if not (ritual_chk or extra_chk) then return end + if extra_chk or extra_chk~=false then + -- Extra Deck Mechanics + synchro_chk= eg:GetFirst():IsSummonType(SUMMON_TYPE_SYNCHRO) + xyz_chk=eg:GetFirst():IsSummonType(SUMMON_TYPE_XYZ) + link_chk=eg:GetFirst():IsSummonType(SUMMON_TYPE_LINK) + fusion_chk=eg:GetFirst():IsSummonType(SUMMON_TYPE_FUSION) + -- Contact Fusion + if not fusion_chk and eg:GetFirst():IsType(TYPE_FUSION) then + fusion_chk=extra_chk + end + -- Zefraath / Zefratorah Metaltron / Odd-Eyes Raging Dragon Tyrant / etc... + -- Main Deck Pendulum Monsters that are Special Summoned from the Extra Deck + if not fusion_chk and not synchro_chk and not xyz_chk and not link_chk then + special_chk=extra_chk + end + end + return ritual_chk or special_chk + or fusion_chk or synchro_chk or xyz_chk or link_chk +end +function s.tgfilter(c,tp) + return (c:IsLocation(LOCATION_HAND) or (c:IsLocation(LOCATION_EXTRA) and c:IsPublic() and c:IsMonster())) + and (c:IsSetCard(SET_ZEFRA) or c:IsSetCard(SET_SHADDOLL)) and c:IsAbleToGrave() +end +function s.Target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) +end +function s.Operation(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + local tc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND,0,1,1,c):GetFirst() + if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 then + local ctype=nil + local sid=0 + if eg:GetFirst():IsType(TYPE_RITUAL) then sid=4 ctype=TYPE_RITUAL end + if eg:GetFirst():IsType(TYPE_FUSION) then sid=5 ctype=TYPE_FUSION end + if eg:GetFirst():IsType(TYPE_SYNCHRO) then sid=6 ctype=TYPE_SYNCHRO end + if eg:GetFirst():IsType(TYPE_XYZ) then sid=7 ctype=TYPE_XYZ end + if eg:GetFirst():IsType(TYPE_LINK) then sid=8 ctype=TYPE_LINK end + if ctype~=nil then + --Cannot Special Summon monsters of the declared type + local r1=Effect.CreateEffect(c) + r1:SetDescription(aux.Stringid(id,sid)) + r1:SetType(EFFECT_TYPE_FIELD) + r1:SetRange(LOCATION_MZONE) + r1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + r1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + r1:SetTargetRange(0,1) + r1:SetTarget(s.sumlimit(ctype)) + r1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE|RESET_PHASE|PHASE_STANDBY,2) + c:RegisterEffect(r1) + end + end +end +function s.sumlimit(ctype) + return function(e,c,sump,sumtype,sumpos,targetp) + if c:IsMonster() then + return c:IsType(ctype) + else + return c:IsOriginalType(ctype) + end + end +end +--E3: Set 1 "Shaddoll" or "Zefra" Spell/Trap, then place this card in the Pendulum Zone +function s.plcfilter(c,tp) + return c:IsSetCard({SET_SHADDOLL,SET_ZEFRA}) and c:IsSpellTrap() and c:IsSSetable() +end +function s.plctg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.plcfilter,tp,LOCATION_DECK,0,1,nil) end +end +function s.plcop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) + local g=Duel.SelectMatchingCard(tp,s.plcfilter,tp,LOCATION_DECK,0,1,1,nil) + if #g>0 and Duel.SSet(tp,g)>0 then + if aux.GetPendulumZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) + Duel.BreakEffect() + Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) + end + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000254.lua b/users/CrimsonAlpha_002/c2002000254.lua new file mode 100644 index 0000000..b93cc25 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000254.lua @@ -0,0 +1,128 @@ +--Nekroz of Zefralancea +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + c:SetUniqueOnField(1,0,id) + --Pendulum Summon procedure + Pendulum.AddProcedure(c) + --Ritual Summon + c:AddMustFirstBeRitualSummoned() + --Banish 1 Spell/Trap on the field + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_REMOVE) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_RELEASE) + e1:SetRange(LOCATION_PZONE) + e1:SetCountLimit(1,{id,0}) + e1:SetCondition(s.rmcon) + e1:SetTarget(s.rmtg) + e1:SetOperation(s.rmop) + c:RegisterEffect(e1) + --Ritual Summon + local e2=Ritual.CreateProc({handler=c,lvtype=RITPROC_EQUAL,desc=aux.Stringid(id,1)}) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_PZONE) + e2:SetCountLimit(1,{id,1}) + c:RegisterEffect(e2) + --spsummon + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetRange(LOCATION_HAND) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET) + e3:SetCountLimit(1,{id,1}) + e3:SetCost(Cost.SelfDiscard) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) + local c3=e3:Clone() + c3:SetRange(LOCATION_MZONE) + c3:SetCountLimit(1,{id,2}) + c3:SetCondition(aux.NekrozOuroCheck) + c3:SetCost(Cost.SelfTribute) + c:RegisterEffect(c3) + --Special Summon 1 "Ice Barrier" Synchro Monster from your Extra Deck + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(id,1)) + e4:SetCategory(CATEGORY_SPECIAL_SUMMON) + e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e4:SetProperty(EFFECT_FLAG_DELAY) + e4:SetCountLimit(1,{id,3}) + e4:SetCode(EVENT_DESTROYED) + e4:SetCondition(s.exspcon) + e4:SetTarget(s.exsptg) + e4:SetOperation(s.exspop) + c:RegisterEffect(e4) +end + +s.listed_series={SET_NEKROZ,SET_ZEFRA} +function s.mat_filter(c) + return c:GetLevel()~=10 +end +function s.rmconfilter(c,tp) + return c:IsSetCard(SET_NEKROZ) and c:IsPreviousControler(tp) and c:IsFaceup() +end +function s.rmcon(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.rmconfilter,1,nil,tp) +end +function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsOnField() and chkc:IsMonster() and chkc:IsAbleToRemove() end + if chk==0 then return Duel.IsExistingTarget(aux.AND(Card.IsMonster,Card.IsAbleToRemove),tp,0,LOCATION_ONFIELD,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.SelectTarget(tp,aux.AND(Card.IsMonster,Card.IsAbleToRemove),tp,0,LOCATION_ONFIELD,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0) +end +function s.rmop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) then + Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) + end +end + +function s.spfilter(c,e,tp) + return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,false,false) + and (c:IsSetCard(SET_NEKROZ) or c:IsSetCard(SET_ZEFRA)) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|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_HAND|LOCATION_DECK,0,1,1,nil,e,tp) + if #g>0 and Duel.SpecialSummon(g,SUMMON_TYPE_PENDULUM,tp,tp,false,false,POS_FACEUP) + and Duel.IsExistingMatchingCard(aux.AND(Card.IsAttackPos,Card.IsCanChangePosition),tp,0,LOCATION_MZONE,1,nil) + and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) + local posg=Duel.SelectMatchingCard(tp,aux.AND(Card.IsAttackPos,Card.IsCanChangePosition),tp,0,LOCATION_MZONE,1,1,nil) + if #posg==0 then return end + Duel.HintSelection(posg,true) + Duel.ChangePosition(posg,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE) + end +end + +function s.exspcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return rp==1-tp and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) + and c:IsRitualSummoned() +end +function s.exspfilter(c,e,tp) + return c:IsSetCard(SET_NEKROZ) and c:IsRitualMonster() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) +end +function s.exsptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.exspfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK) +end +function s.exspop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local tc=Duel.SelectMatchingCard(tp,s.exspfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() + if tc and Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)>0 then + tc:CompleteProcedure() + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000255.lua b/users/CrimsonAlpha_002/c2002000255.lua new file mode 100644 index 0000000..77e5cb4 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000255.lua @@ -0,0 +1,124 @@ +--Zefratellarknight Sefer Draxciton +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + c:SetUniqueOnField(1,0,id) + --Pendulum Summon procedure + Pendulum.AddProcedure(c) + --Xyz Summon procedure + Xyz.AddProcedure(c,nil,8,2,nil,nil,Xyz.InfiniteMats,nil,nil,s.xyzcheck) + c:AddMustFirstBeXyzSummoned() + --Treat "tellarknight" & "Zefra" monsters as Level 8 for this card's Xyz Summon + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_FIELD) + e0:SetCode(EFFECT_XYZ_LEVEL) + e0:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE) + e0:SetRange(LOCATION_EXTRA) + e0:SetTargetRange(LOCATION_MZONE,0) + e0:SetTarget(function(e,c) return c:IsLevelBelow(6) and c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) end) + e0:SetValue(s.lvval) + c:RegisterEffect(e0) + --When detaching a card: return cards on field and GY to hand + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_TOHAND) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetRange(LOCATION_PZONE) + e1:SetCondition(s.thcon) + e1:SetTarget(s.thtg) + e1:SetOperation(s.thop) + c:RegisterEffect(e1) + --Destroy all other cards your opponent controls + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_DESTROY) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetRange(LOCATION_MZONE) + e2:SetHintTiming(TIMING_SPSUMMON,TIMING_BATTLE_START|TIMING_BATTLE_END) + e2:SetCountLimit(1,{id,0}) + e2:SetCost(aux.CostWithReplace(Cost.DetachFromSelf(2),CARD_CONSTELLARKNIGHT_TROIVERNUM)) + e2:SetCondition(s.descon) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) + c:RegisterEffect(e2) + --place in Pendulum Zone + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) + e3:SetCode(EVENT_LEAVE_FIELD) + e3:SetCountLimit(1,{id,1}) + e3:SetCondition(s.pencon) + e3:SetTarget(s.pentg) + e3:SetOperation(s.penop) + c:RegisterEffect(e3) +end +s.listh_series={SET_TELLARKNIGHT,SET_ZEFRA} +function s.xyzfilter(c,xyz,tp) + return c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) +end +function s.xyzcheck(g,tp,xyz) + local mg=g:Filter(function(c) return not c:IsHasEffect(EFFECT_EQUIP_SPELL_XYZ_MAT) end,nil) + return mg:IsExists(s.xyzfilter,1,nil,xyz,tp) +end +function s.lvval(e,c,rc) + local lv=c:GetLevel() + if rc:IsCode(id) then + return 8 + else + return lv + end +end +function s.thfilter(c,re,tp) + return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ) + and c:IsPreviousLocation(LOCATION_OVERLAY) and c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) +end +function s.thcon(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.thfilter,1,nil,re,tp) +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chk==0 then return true end + local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,nil) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) + local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.SendtoHand(g,nil,REASON_EFFECT) + end +end +function s.descon(e,tp,eg,ep,ev,re,r,rp) + return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase() +end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) + local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil) + if chk==0 then return #g>0 end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0) +end +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil) + if #g>0 and c:IsRelateToEffect(e) then + Duel.Destroy(g,REASON_EFFECT) + end +end +function s.pencon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsXyzSummoned() +end +function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckPendulumZones(tp) end +end +function s.penop(e,tp,eg,ep,ev,re,r,rp) + if not Duel.CheckPendulumZones(tp) then return end + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000256.lua b/users/CrimsonAlpha_002/c2002000256.lua new file mode 100644 index 0000000..28f344d --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000256.lua @@ -0,0 +1,191 @@ +--Shenlong, Divine Yang Zing of Zefra +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + c:SetUniqueOnField(1,0,id) + --Pendulum Summon procedure + Pendulum.AddProcedure(c) + --Synchro Summon procedure + Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsSetCard,{SET_YANG_ZING,SET_ZEFRA}),1,99) + c:AddMustFirstBeSynchroSummoned() + --register effect + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e0:SetCode(EVENT_SPSUMMON_SUCCESS) + e0:SetCondition(s.regcon) + e0:SetOperation(s.regop) + c:RegisterEffect(e0) + --material count check + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_MATERIAL_CHECK) + e1:SetValue(s.valcheck) + e1:SetLabelObject(e0) + c:RegisterEffect(e1) + --Special summon itself from GY + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_DESTROYED) + e2:SetRange(LOCATION_PZONE) + e2:SetCountLimit(1,{id,0}) + e2:SetCondition(s.tdcon) + e2:SetTarget(s.tdtg) + e2:SetOperation(s.tdop) + c:RegisterEffect(e2) + --summon limit + local e3=Effect.CreateEffect(c) + e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) + e3:SetType(EFFECT_TYPE_SINGLE) + e3:SetCode(EFFECT_SPSUMMON_CONDITION) + e3:SetValue(aux.synlimit) + c:RegisterEffect(e3) + --Special summon 1 "Yang Zing" or "Zefra" monster from deck + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(id,0)) + e4:SetCategory(CATEGORY_SPECIAL_SUMMON) + e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e4:SetProperty(EFFECT_FLAG_DELAY) + e4:SetCode(EVENT_DESTROYED) + e4:SetCondition(s.spcon) + e4:SetTarget(s.sptg) + e4:SetOperation(s.spop) + c:RegisterEffect(e4) +end +s.listed_series={SET_YANG_ZING,SET_ZEFRA} +function s.exmatfilter(c,scard,sumtype,tp) + return c:IsSetCard(SET_YANG_ZING,scard,sumtype,tp) or c:IsSetCard(SET_ZEFRA,scard,sumtype,tp) +end +function s.setcheck(c) + return c:IsSetCard(SET_YANG_ZING) or c:IsSetCard(SET_ZEFRA) +end +function s.valcheck(e,c) + local ct=c:GetMaterial():Filter(Card.IsSetCard,nil,{SET_YANG_ZING,SET_ZEFRA}):GetClassCount(Card.GetAttribute) + e:GetLabelObject():SetLabel(ct) +end +function s.regcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and e:GetLabel()>0 +end +function s.chkfilter(c,label) + return c:GetFlagEffect(label)>0 +end +function s.regop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local ct=e:GetLabel() + local r1=Effect.CreateEffect(c) + r1:SetDescription(aux.Stringid(id,1)) + r1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) + r1:SetType(EFFECT_TYPE_QUICK_O) + r1:SetRange(LOCATION_MZONE) + r1:SetProperty(EFFECT_FLAG_CARD_TARGET) + r1:SetCode(EVENT_FREE_CHAIN) + r1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) + r1:SetReset(RESET_EVENT+(RESETS_STANDARD&~RESET_TURN_SET)) + r1:SetCountLimit(ct) + r1:SetTarget(s.destg) + r1:SetOperation(s.desop) + c:RegisterEffect(r1) +end +function s.desfilter(c) + return c:IsFaceup() and c:IsSetCard(SET_YANG_ZING) +end +function s.spfilter1(c,e,tp) + if c:IsLocation(LOCATION_DECK) and Duel.GetLocationCount(tp,tp,nil,c)==0 then return false end + return (c:IsSetCard(SET_YANG_ZING) or c:IsSetCard(SET_ZEFRA)) and c:IsMonster() + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local c=e:GetHandler() + if chkc then return false end + if chk==0 then return not c:HasFlagEffect(id) and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,0,1,nil) + and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end + c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g1=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,0,1,1,nil) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil) + g1:Merge(g2) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0) +end +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) + local tg=g:Filter(Card.IsRelateToEffect,nil,e) + if #tg>0 and Duel.Destroy(tg,REASON_EFFECT)~=0 then + if Duel.IsExistingTarget(s.spfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) + and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) + end + end + end +end +function s.desfilter(c,tp) + return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) + and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT)) + and (c:IsSetCard(SET_YANG_ZING) or c:IsSetCard(SET_ZEFRA)) +end +function s.tdcon(e,tp,eg,ep,ev,re,r,rp) + return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.desfilter,1,nil,tp) +end +function s.rescon(sg) + return #sg==1 or (sg:IsExists(Card.IsSetCard,1,nil,SET_YANG_ZING) and sg:IsExists(Card.IsSetCard,1,nil,SET_ZEFRA)) +end +function s.tdfilter(c,e) + return c:IsAbleToDeck() and c:IsSetCard({SET_YANG_ZING,SET_ZEFRA}) and c:IsCanBeEffectTarget(e) +end +function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) + local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE,0,nil,e) + if chk==0 then return #g>0 end + local tg=aux.SelectUnselectGroup(g,e,tp,1,2,s.rescon,1,tp,HINTMSG_TODECK) + Duel.SetTargetCard(tg) + Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,#tg,tp,0) +end +function s.tdop(e,tp,eg,ep,ev,re,r,rp) + local tg=Duel.GetTargetCards(e) + if #tg>0 and Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) then + if Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then + local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local sg=g:Select(tp,1,1,nil) + Duel.HintSelection(sg) + Duel.Destroy(sg,REASON_EFFECT) + end + end +end +function s.spcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE|REASON_EFFECT) + and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) + and c:IsSummonType(SUMMON_TYPE_SYNCHRO) +end +function s.spfilter2(c,e,tp) + if c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)==0 then return false end + return (c:IsSetCard(SET_YANG_ZING) or c:IsSetCard(SET_ZEFRA)) and c:IsMonster() + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local loc=LOCATION_EXTRA + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc|LOCATION_DECK end + if chk==0 then return loc~=0 and Duel.IsExistingMatchingCard(s.spfilter2,tp,loc,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local loc=LOCATION_EXTRA + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc|LOCATION_DECK end + if loc==0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter2,tp,loc,0,1,1,nil,e,tp) + if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0 then + if aux.GetPendulumZoneCount(tp)>0 then + Duel.BreakEffect() + Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) + end + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000257.lua b/users/CrimsonAlpha_002/c2002000257.lua new file mode 100644 index 0000000..24f592b --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000257.lua @@ -0,0 +1,96 @@ +--アルカナ エクストラジョーカー +--Arcana Extra Joker - Custom +local s,id=GetID() +function s.initial_effect(c) + --Link summon procedure + Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_WARRIOR),3,3,s.lcheck) + c:EnableReviveLimit() + --Negate + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_NEGATE) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) + e1:SetCode(EVENT_CHAINING) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1) + e1:SetCondition(s.negcon) + e1:SetCost(s.negcost) + e1:SetTarget(s.negtg) + e1:SetOperation(s.negop) + c:RegisterEffect(e1) + --Special summon + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetCode(EVENT_BATTLE_DESTROYED) + e2:SetCondition(s.spcon) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) + aux.DoubleSnareValidity(c,LOCATION_MZONE) +end +s.listed_names={CARD_QUEEN_KNIGHT,CARD_KING_KNIGHT,CARD_JACK_KNIGHT} +function s.lcheck(g,lc,sumtype,tp) + return g:CheckDifferentProperty(Card.GetCode,lc,sumtype,tp) +end +function s.negfilter(c,g) + return g:IsContains(c) +end +function s.negcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end + if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end + local lg=e:GetHandler():GetLinkedGroup() + lg:AddCard(c) + local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) + return tg and lg:IsExists(s.negfilter,1,nil,tg) and Duel.IsChainNegatable(ev) +end +function s.costfilter(c,tpe) + return c:IsDiscardable() + and (c:IsType(tpe) or c:IsCode(CARD_JACK_KNIGHT,CARD_QUEEN_KNIGHT,CARD_KING_KNIGHT)) +end +function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) + local rtype=(re:GetActiveType()&(TYPE_MONSTER|TYPE_SPELL|TYPE_TRAP)) + if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil,rtype) end + Duel.DiscardHand(tp,s.costfilter,1,1,REASON_COST|REASON_DISCARD,nil,rtype) +end +function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) +end +function s.negop(e,tp,eg,ep,ev,re,r,rp,chk) + if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then + Duel.SendtoGrave(eg,REASON_EFFECT) + end +end +function s.spcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:IsLinkSummoned() +end +function s.spfilter(c,e,tp) + return c:IsType(TYPE_NORMAL) and c:IsLevel(4) and c:IsRace(RACE_WARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,c) +end +function s.thfilter(c) + return c:IsLevel(4) and c:IsRace(RACE_WARRIOR) and c:IsAbleToHand() +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_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 g1=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) + if #g1>0 and Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)~=0 then + Duel.ConfirmCards(1-tp,g1) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g2=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) + if #g2>0 then + Duel.SendtoHand(g2,tp,REASON_EFFECT) + end + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000258.lua b/users/CrimsonAlpha_002/c2002000258.lua new file mode 100644 index 0000000..6fc8553 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000258.lua @@ -0,0 +1,86 @@ +--Heavymetal Ignition Lord +local s,id=GetID() +function s.initial_effect(c) + --fusion material + c:EnableReviveLimit() + Fusion.AddProcMix(c,true,true,s.fusfilter1,s.fusfilter2,s.fusfilter3) + Fusion.AddContactProc(c,s.contactfil,s.contactop,s.splimit,nil,nil,nil,false) + --Activate: destroy own cards then banish opponent's, then search + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_SEARCH) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1,{id,0}) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCost(s.cost) + e1:SetTarget(s.target) + e1:SetOperation(s.activate) + c:RegisterEffect(e1) +end +function s.fusfilter1(c,fc,sumtype,tp) + return c:IsAttribute(ATTRIBUTE_FIRE,fc,sumtype,tp) +end +function s.fusfilter2(c,fc,sumtype,tp) + return c:IsType(TYPE_NORMAL,fc,sumtype,tp) +end +function s.fusfilter3(c,fc,sumtype,tp) + return c:IsType(TYPE_PENDULUM,fc,sumtype,tp) +end +function s.splimit(e,se,sp,st) + return (st&SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION +end +function s.contactfil(tp) + local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,0,nil) + return g +end +function s.contactop(g) + return Duel.Destroy(g,REASON_COST+REASON_MATERIAL) +end + +-- any own card in Monster Zone or Pendulum Zone +function s.ownfilter(c) + return c:IsFaceup() or c:IsLocation(LOCATION_MZONE) -- allow face-down monsters too by not restricting faceup if desired +end +-- search filter: FIRE Normal Pendulum Monster +function s.thfilter(c) + return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_NORMAL) and c:IsAbleToHand() +end +function s.tgfilter(c,e,tp) + return c:IsDestructable() + and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) +end +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local tg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil) + local ct_max=#tg + if #tg>3 then ct_max=3 end + local dg=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE|LOCATION_PZONE,0,1,ct_max,nil,e,tp) + if not(#dg>0 and Duel.Destroy(dg,REASON_COST)>0) then return false end + local ct=#dg + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + e:SetLabel(ct) +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local ct=0 + ct=e:GetLabel() + if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local rmg=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,ct,ct,nil) + Duel.SetOperationInfo(0,CATEGORY_REMOVE,rmg,#rmg,0,0) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) +end +function s.activate(e,tp,eg,ep,ev,re,r,rp) + local tg=Duel.GetTargetCards(e) + if #tg>0 and Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)>0 then + if Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local sg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) + if #sg>0 then + Duel.SendtoHand(sg,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,sg) + end + end + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000259.lua b/users/CrimsonAlpha_002/c2002000259.lua new file mode 100644 index 0000000..da2a90b --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000259.lua @@ -0,0 +1,101 @@ +--Dinotron Giggantos +local s,id=GetID() +function s.initial_effect(c) + --Synchro Summon Procedure + Synchro.AddProcedure(c,s.matfilter1,1,1,Synchro.NonTunerEx(s.matfilter2),1,99,s.exmatfilter) + --destroy replace + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_DESTROY_REPLACE) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1,{id,0}) + e1:SetTarget(s.reptg) + e1:SetValue(s.repval) + e1:SetOperation(s.repop) + c:RegisterEffect(e1) +end +function s.matfilter1(c,scard,sumtype,tp) + return c:IsRace(RACE_MACHINE,scard,sumtype,tp) +end +function s.matfilter2(c,scard,sumtype,tp) + return c:IsRace(RACE_MACHINE,scard,sumtype,tp) and c:IsAttribute(ATTRIBUTE_WATER,scard,sumtype,tp) +end +function s.exmatfilter(c,scard,sumtype,tp) + return c:IsRace(RACE_MACHINE) + or c:IsAttribute(ATTRIBUTE_WATER) + or c:IsType(TYPE_PENDULUM) +end +function s.repfilter(c,tp) + return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) + and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT)) and not c:IsReason(REASON_REPLACE) +end +function s.tgfilter(c,e,tp) + return c:IsControler(tp) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_MACHINE) + and c:IsAbleToGrave() and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED) +end +function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) + and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end + if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) + local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) + e:SetLabelObject(g:GetFirst()) + Duel.SendtoGrave(g,REASON_REPLACE+REASON_EFFECT) + --destroy + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetCategory(CATEGORY_DESTROY) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetRange(LOCATION_MZONE) + e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) + e1:SetReset(RESET_EVENT|(RESETS_STANDARD_PHASE_END&~RESET_TOFIELD)) + e1:SetCountLimit(1) + e1:SetCost(s.descost) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) + c:RegisterEffect(e1) + return true + end + return false +end +function s.repval(e,c) + return s.repfilter(c,e:GetHandlerPlayer()) +end +function s.filter(c) + return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_WATER) +end +function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + local a=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,e:GetHandler()) + if a and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then + local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,e:GetHandler()) + Duel.Remove(g,POS_FACEUP,REASON_COST) + e:SetLabel(1) + else + e:SetLabel(0) + end +end + --Activation legality +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + local cg=c:GetColumnGroup():Filter(Card.IsControler,nil,1-tp) + if chk==0 then return #cg>0 end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,cg,#cg,0,0) +end + +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + if e:GetLabel()==1 then + local cg=c:GetColumnGroup(1,1):Filter(Card.IsControler,nil,1-tp) + if #cg<=0 then return end + Duel.Destroy(cg,REASON_EFFECT) + else + local cg=c:GetColumnGroup():Filter(Card.IsControler,nil,1-tp) + if #cg<=0 then return end + Duel.Destroy(cg,REASON_EFFECT) + end + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000260.lua b/users/CrimsonAlpha_002/c2002000260.lua new file mode 100644 index 0000000..3c355e7 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000260.lua @@ -0,0 +1,106 @@ +--Zodiac Moujespecter +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + Pendulum.AddProcedure(c,false) + --2 Level 4 monsters + Xyz.AddProcedure(c,nil,4,2,s.ovfilter,aux.Stringid(id,0),3,s.xyzop) + --Type Spellcaster + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_SINGLE) + e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e0:SetCode(EFFECT_ADD_RACE) + e0:SetRange(LOCATION_ONFIELD) + e0:SetValue(RACE_SPELLCASTER) + c:RegisterEffect(e0) + --tribute substitute + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_EXTRA_RELEASE_NONSUM) + e1:SetRange(LOCATION_PZONE) + e1:SetTargetRange(LOCATION_EXTRA,0) + e1:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_WIND)) + e1:SetCountLimit(2,{id,0}) + e1:SetValue(s.relval) + c:RegisterEffect(e1) + --Place in Pendulum Zone if Tributed or Destroyed + local e2a=Effect.CreateEffect(c) + e2a:SetDescription(aux.Stringid(id,1)) + e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) + e2a:SetCode(EVENT_DESTROYED) + e2a:SetCountLimit(1,{id,1}) + e2a:SetTarget(s.pentg) + e2a:SetOperation(s.penop) + c:RegisterEffect(e2a) + local e2b=e2a:Clone() + e2b:SetCode(EVENT_RELEASE) + c:RegisterEffect(e2b) + --to hand + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_TOHAND) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET) + e3:SetRange(LOCATION_MZONE) + e3:SetCountLimit(1,id) + e3:SetCost(Cost.DetachFromSelf(1,1,nil)) + e3:SetTarget(s.thtg) + e3:SetOperation(s.thop) + c:RegisterEffect(e3) +end + +function s.ovfilter(c,tp,lc) + return c:IsFaceup() + and ((c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_BEASTWARRIOR)) + or c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_PENDULUM)) +end +function s.xyzop(e,tp,chk) + if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end + Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) + return true +end +function s.relval(e,re,r,rp) + return re and re:IsActivated() and (r&REASON_COST)~=0 +end +function s.tribute_cost(c) + return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToGraveAsCost() +end +function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckPendulumZones(tp) end +end +function s.penop(e,tp,eg,ep,ev,re,r,rp) + if not Duel.CheckPendulumZones(tp) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) + Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end + if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) + local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,1,nil) + e:GetHandler():RegisterFlagEffect(0,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,5)) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) +end +function s.spfilter(c,e,tp) + return c:IsCanBeSpecialSummoned(e,0,tp,false,false) + and c:IsLevel(4) + and (c:IsRace(RACE_BEASTWARRIOR) or (c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_SPELLCASTER))) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetTargetCards(e) + if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then + if Duel.CheckReleaseGroup(tp,nil,1,false,nil,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + local rg=Duel.SelectReleaseGroup(tp,nil,1,1,false,nil,nil) + if Duel.Release(rg,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>=0 then + if not Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) then return end + Duel.BreakEffect() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local spg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + if #spg>0 then + Duel.SpecialSummon(spg,0,tp,tp,false,false,POS_FACEUP) + end + end + end + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000261.lua b/users/CrimsonAlpha_002/c2002000261.lua new file mode 100644 index 0000000..18ee071 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000261.lua @@ -0,0 +1,144 @@ +--True King Phostaros, the Extinguisher +local s,id=GetID() +function s.initial_effect(c) + --Destroy 2 monsters and Special Summon itself from the hand + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_HAND) + e1:SetCountLimit(1,{id,0}) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) + --banish 2 random cards in the controlling player's hand + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_REMOVE) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e2:SetCode(EVENT_SPSUMMON_SUCCESS) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(function(e) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 end) + e2:SetTarget(s.efftg) + e2:SetOperation(s.effop) + c:RegisterEffect(e2) + --Special summon a monster from hand + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,4)) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_DESTROYED) + e3:SetCountLimit(1,{id,2}) + e3:SetCondition(function(e) return e:GetHandler():IsReason(REASON_EFFECT) end) + e3:SetTarget(s.tftg) + e3:SetOperation(s.tfop) + c:RegisterEffect(e3) + local e4=e3:Clone() + e4:SetDescription(aux.Stringid(id,5)) + e4:SetCategory(CATEGORY_SPECIAL_SUMMON) + e4:SetTarget(s.sptg2) + e4:SetOperation(s.spop2) + c:RegisterEffect(e4) +end +s.listed_series={SET_TRUE_DRACO_KING} +function s.desfilter(c,e,tp,hc,resolution_chk) + return c:IsMonster() and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) + and (resolution_chk or s.spcheck(c,e,tp,hc)) +end +function s.spcheck(c,e,tp,hc) + local ctrl=c:GetControler() + return (Duel.GetMZoneCount(ctrl,c,tp)>0 and hc:IsCanBeSpecialSummoned(e,1,tp,false,false,POS_FACEUP,ctrl)) + or (Duel.GetMZoneCount(1-ctrl,nil,tp)>0 and hc:IsCanBeSpecialSummoned(e,1,tp,false,false,POS_FACEUP,1-ctrl)) +end +function s.rescon(sg,e,tp,mg) + return sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_LIGHT) + and (Duel.GetMZoneCount(tp)>0 or sg:IsExists(Card.IsInMainMZone,1,nil,tp)) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + local oppo_location=Duel.IsPlayerAffectedByEffect(tp,88581108) and LOCATION_MZONE or 0 + local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,oppo_location,c,e,tp,c,false) + if chk==0 then return #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end + if not g:IsExists(Card.IsOnField,2,nil) or ((Duel.GetMZoneCount(tp)>1 or Duel.GetMZoneCount(1-tp)>1) + and (Duel.IsExistingMatchingCard(aux.NOT(Card.IsPublic),tp,LOCATION_HAND,0,2,c) + or g:IsExists(aux.FaceupFilter(Card.IsLocation,LOCATION_HAND),2,nil))) then + Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,LOCATION_HAND|LOCATION_ONFIELD) + else + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,tp,0) + end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local relation_chk=c:IsRelateToEffect(e) + local exc=relation_chk and c or nil + local oppo_location=Duel.IsPlayerAffectedByEffect(tp,88581108) and LOCATION_MZONE or 0 + local resolution_chk=not (relation_chk and Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,oppo_location,2,c,e,tp,c,false)) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE|LOCATION_HAND,oppo_location,exc,e,tp,c,resolution_chk) + if #g<2 or not g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_LIGHT) then return end + local dg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_DESTROY) + local light_chk=dg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)==2 + if not dg then return end + -- if sc:IsOnField() then Duel.HintSelection(sc) end + if Duel.Destroy(dg,REASON_EFFECT)>0 and relation_chk then + local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,1,tp,false,false) + local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,1,tp,false,false,POS_FACEUP,1-tp) + if not (b1 or b2) then return end + local op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,2)}, + {b2,aux.Stringid(id,3)}) + local target_player=op==1 and tp or 1-tp + if light_chk then + Duel.SpecialSummon(c,1,tp,target_player,false,false,POS_FACEUP) + else + Duel.SpecialSummon(c,0,tp,target_player,false,false,POS_FACEUP) + end + end + +end +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil) + Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,tp,0) +end +function s.effop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil) + if #g>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local sg=g:RandomSelect(tp,2) + Duel.Remove(sg,POS_FACEUP,REASON_EFFECT) + end +end +function s.thfilter(c,e,tp) + return c:IsAttributeExcept(ATTRIBUTE_LIGHT) and c:IsRace(RACE_WYRM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) +end +function s.spop2(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.thfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) + end +end +function s.tffilter(c,tp) + return c:IsSpellTrap() and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(SET_TRUE_DRACO_KING) + and not c:IsForbidden() and c:CheckUniqueOnField(tp) +end +function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingMatchingCard(s.tffilter,tp,LOCATION_GRAVE,0,1,nil,tp) end +end +function s.tfop(e,tp,eg,ep,ev,re,r,rp) + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) + local tc=Duel.SelectMatchingCard(tp,s.tffilter,tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst() + if tc then + Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000262.lua b/users/CrimsonAlpha_002/c2002000262.lua new file mode 100644 index 0000000..62c646a --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000262.lua @@ -0,0 +1,77 @@ +--Dreiath III, the True Dracolancer +local s,id=GetID() +function s.initial_effect(c) + --Tribute using Continuous Spell/Traps + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) + e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE) + e1:SetTargetRange(LOCATION_SZONE,0) + e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_CONTINUOUS)) + e1:SetValue(POS_FACEUP) + c:RegisterEffect(e1) + --spsummon + local e2=Effect.CreateEffect(c) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e2:SetRange(LOCATION_HAND|LOCATION_GRAVE) + e2:SetCode(EVENT_DESTROYED) + e2:SetCountLimit(1,{id,0}) + e2:SetCondition(s.condition) + e2:SetTarget(s.target) + e2:SetOperation(s.operation) + c:RegisterEffect(e2) + local e3=e2:Clone() + e3:SetCode(EVENT_RELEASE) + c:RegisterEffect(e3) + --Triple Summon + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(id,2)) + e4:SetCategory(CATEGORY_SUMMON) + e4:SetType(EFFECT_TYPE_QUICK_O) + e4:SetCode(EVENT_FREE_CHAIN) + e4:SetRange(LOCATION_MZONE) + e4:SetCountLimit(1,{id,1}) + e4:SetTarget(s.sumtg) + e4:SetOperation(s.sumop) + c:RegisterEffect(e4) +end +s.listed_series={SET_TRUE_DRACO_KING} +function s.filter(c,tp) + return c:IsSetCard(SET_TRUE_DRACO_KING) and not c:IsCode(id) + and c:IsPreviousControler(tp) +end +function s.condition(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.filter,1,nil,tp) +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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) +end + +function s.sumfilter(c) + return c:IsSetCard(SET_TRUE_DRACO_KING) and c:IsSummonable(true,nil,1) +end +function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then + return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil) + end + Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) +end +function s.sumop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not e:GetHandler():IsRelateToEffect(e) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) + local g=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil) + local tc=g:GetFirst() + if tc then + Duel.Summon(tp,tc,true,nil,1) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000263.lua b/users/CrimsonAlpha_002/c2002000263.lua new file mode 100644 index 0000000..3346dc6 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000263.lua @@ -0,0 +1,158 @@ +--Destructor Pain, the True Dracoreaping Tyrant +local s,id=GetID() +function s.initial_effect(c) + --Tribute using Continuous Spell/Traps + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) + e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE) + e1:SetTargetRange(LOCATION_SZONE,0) + e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_CONTINUOUS)) + e1:SetValue(POS_FACEUP) + c:RegisterEffect(e1) + --tribute check + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_MATERIAL_CHECK) + e2:SetValue(s.valcheck) + c:RegisterEffect(e2) + --immune reg + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) + e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e3:SetCode(EVENT_SUMMON_SUCCESS) + e3:SetCondition(s.regcon) + e3:SetOperation(s.regop) + e3:SetLabelObject(e2) + c:RegisterEffect(e3) + --Negate + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(id,0)) + e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) + e4:SetType(EFFECT_TYPE_QUICK_O) + e4:SetCode(EVENT_CHAINING) + e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) + e4:SetRange(LOCATION_MZONE) + e4:SetCountLimit(1) + e4:SetCost(s.discost) + e4:SetCondition(s.discon) + e4:SetTarget(s.distg) + e4:SetOperation(s.disop) + c:RegisterEffect(e4) + --Register Attributes used + aux.GlobalCheck(s,function() + s.attr_list={} + s.attr_list[0]=0 + s.attr_list[1]=0 + aux.AddValuesReset(function() + s.attr_list[0]=0 + s.attr_list[1]=0 + end) + end) +end +s.listed_series={SET_TRUE_DRACO_KING} +function s.valcheck(e,c) + local g=c:GetMaterial() + local typ=0 + for tc in g:Iter() do + typ=typ|(tc:GetOriginalType()&(TYPE_MONSTER|TYPE_SPELL|TYPE_TRAP)) + end + e:SetLabel(typ) +end +function s.regcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsTributeSummoned() +end +function s.regop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local typ=e:GetLabelObject():GetLabel() + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetCode(EFFECT_IMMUNE_EFFECT) + e1:SetRange(LOCATION_MZONE) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + e1:SetValue(s.efilter) + e1:SetLabel(typ) + c:RegisterEffect(e1) + if typ&TYPE_MONSTER~=0 then + c:RegisterFlagEffect(0,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3)) + end + if typ&TYPE_SPELL~=0 then + c:RegisterFlagEffect(0,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,4)) + end + if typ&TYPE_TRAP~=0 then + c:RegisterFlagEffect(0,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,5)) + end +end +function s.efilter(e,te) + return te:IsActiveType(e:GetLabel()) and te:GetOwner()~=e:GetOwner() +end +function s.cfilter(c,tp) + local attr=c:GetAttribute() + return s.attr_list[tp]&attr==0 and c:IsMonster() + and c:IsSetCard(SET_TRUE_DRACO_KING) and c:IsAbleToRemoveAsCost() and not c:IsCode(id) +end +function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_DECK,0,1,nil,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_DECK,0,1,1,nil,tp) + s.attr_list[tp]=s.attr_list[tp]|g:GetFirst():GetAttribute() + Duel.Remove(g,POS_FACEUP,REASON_COST) + e:SetLabelObject(g) +end +function s.discon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end + return re:IsMonsterEffect() and Duel.IsChainNegatable(ev) and c:IsTributeSummoned() and rp~=tp +end +function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return not c:HasFlagEffect(id) end + c:RegisterFlagEffect(id,RESET_CHAIN,0,1) + Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) + if re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsDestructable() then + Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) + end +end +function s.disop(e,tp,eg,ep,ev,re,r,rp) + if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then + Duel.Destroy(eg,REASON_EFFECT) + + local g=e:GetLabelObject() + local available_effs={} + local effs={g:GetFirst():GetOwnEffects()} + for _,eff in ipairs(effs) do + if eff:GetCode()==EVENT_CHAINING then + local con=eff:GetCondition() + local tg=eff:GetTarget() + if (tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0)) then + table.insert(available_effs,eff) + end + end + end + + if #available_effs>0 then + if #available_effs>1 then + local available_effs_desc={} + for _,eff in ipairs(available_effs) do + table.insert(available_effs_desc,eff:GetDescription()) + end + local op=Duel.SelectOption(tp,table.unpack(available_effs_desc)) + eff=available_effs[op+1] + else + eff=available_effs[1] + end + + Duel.Hint(HINT_OPSELECTED,1-tp,eff:GetDescription()) + local tg=eff:GetTarget() + if tg then + tg(e,tp,eg,ep,ev,re,r,rp,1) + end + local op=eff:GetOperation() + if op then + op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE) + end + end + e:SetLabelObject(nil) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000264.lua b/users/CrimsonAlpha_002/c2002000264.lua new file mode 100644 index 0000000..20f6608 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000264.lua @@ -0,0 +1,99 @@ +--True Draco's Return +local s,id=GetID() +function s.initial_effect(c) + --place 1 Continuous Spell/Trap from your Deck face-up in the Spell/Trap Zone + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetCountLimit(1,{id,0}) + e1:SetTarget(s.pltg) + e1:SetOperation(s.plop) + c:RegisterEffect(e1) + --add 1 "True Draco"/"True King" monster (mini Dragonic Diagram) + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_SZONE) + e2:SetCountLimit(1,{id,1}) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) + c:RegisterEffect(e2) + --Special Summon + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_TO_GRAVE) + e3:SetCountLimit(1,{id,2}) + e3:SetCondition(s.spcon) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) +end +s.listed_series={SET_TRUE_DRACO_KING} +function s.plfilter(c,tp) + return c:IsSpellTrap() and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(SET_TRUE_DRACO_KING) + and not c:IsForbidden() and c:CheckUniqueOnField(tp) + and not Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,c:GetCode()),tp,LOCATION_ONFIELD,0,1,nil) +end +function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk) + local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) + if e:GetHandler():IsLocation(LOCATION_HAND) then ft=ft-1 end + if chk==0 then return ft>0 and Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,nil,tp) end +end +function s.plop(e,tp,eg,ep,ev,re,r,rp) + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) + local tc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,tp):GetFirst() + if tc then + Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) + end +end +function s.thfilter(c) + return c:IsSetCard(SET_TRUE_DRACO_KING) and c:IsMonster() and c:IsAbleToHand() +end +function s.desfilter(c) + return c:IsSetCard(SET_TRUE_DRACO_KING) and c:IsDestructable() +end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) + local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,e:GetHandler()) + if chk==0 then return #g>0 and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) +end +function s.desop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local exc=c:IsRelateToEffect(e) and c or nil + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,exc) + if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local sg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) + if #sg>0 then + Duel.SendtoHand(sg,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,sg) + end + end +end +function s.spcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) +end +function s.spfilter(c,e,tp) + return c:IsSetCard(SET_TRUE_DRACO_KING) and c:IsMonster() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000265.lua b/users/CrimsonAlpha_002/c2002000265.lua new file mode 100644 index 0000000..6181f61 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000265.lua @@ -0,0 +1,155 @@ +--Crusadia Dragoon +local s,id=GetID() +function s.initial_effect(c) + --Synchro Summon procedure + Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(aux.NOT(Card.IsLinkMonster)),1,99,aux.FilterBoolFunction(Card.IsLinkMonster)) + c:EnableReviveLimit() + --For this card's Synchro Summon, you can treat 1 "Crusadia" Link monster you control + local e0a=Effect.CreateEffect(c) + e0a:SetType(EFFECT_TYPE_FIELD) + e0a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE) + e0a:SetCode(EFFECT_SYNCHRO_LEVEL) + e0a:SetRange(LOCATION_EXTRA) + e0a:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e0a:SetTarget(s.syntg(1)) + e0a:SetValue(s.synval(1)) + c:RegisterEffect(e0a) + local e0b=e0a:Clone() + e0b:SetTarget(s.syntg(2)) + e0b:SetValue(s.synval(2)) + c:RegisterEffect(e0b) + local e0c=e0a:Clone() + e0c:SetTarget(s.syntg(3)) + e0c:SetValue(s.synval(3)) + c:RegisterEffect(e0c) + local e0d=e0a:Clone() + e0d:SetTarget(s.syntg(4)) + e0d:SetValue(s.synval(4)) + c:RegisterEffect(e0d) + local e0e=e0a:Clone() + e0e:SetTarget(s.syntg(5)) + e0e:SetValue(s.synval(5)) + c:RegisterEffect(e0e) + local e0f=e0a:Clone() + e0f:SetTarget(s.syntg(6)) + e0f:SetValue(s.synval(6)) + c:RegisterEffect(e0f) + local e0g=e0a:Clone() + e0g:SetTarget(s.syntg(7)) + e0g:SetValue(s.synval(7)) + c:RegisterEffect(e0g) + local e0h=e0a:Clone() + e0h:SetTarget(s.syntg(8)) + e0h:SetValue(s.synval(8)) + c:RegisterEffect(e0h) + local e0z=e0a:Clone() + e0z:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) + e0z:SetValue(function(e,sc) return sc and not sc:IsSetCard(SET_CRUSADIA) end) + c:RegisterEffect(e0z) + --Change original ATK + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e1:SetCode(EVENT_SPSUMMON_SUCCESS) + e1:SetOperation(s.atkop) + c:RegisterEffect(e1) + --pos + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetRange(LOCATION_MZONE) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetCountLimit(1,id) + e2:SetCondition(s.negcon) + e2:SetTarget(s.negtg) + e2:SetOperation(s.negop) + c:RegisterEffect(e2) +end +s.listed_series={SET_CRUSADIA} +function s.syntg(val) + return function(e,c) + return c:IsLinkMonster() and c:IsSetCard(SET_CRUSADIA) and c:IsLink(val) + end +end +function s.synval(val) + return function(e,sc) + return sc:IsSetCard(SET_CRUSADIA) and val or -1 + end +end +function s.atkop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local g=c:GetMaterial() + local atk=0 + local def=0 + local tc=g:GetFirst() + for tc in aux.Next(g) do + if tc:IsSetCard(SET_CRUSADIA) then + local a=tc:GetAttack() + local b=tc:GetDefense() + if a<0 then a=0 end + if b<0 then b=0 end + atk=atk+a + def=def+b + end + end + if atk>3000 then atk=3000 end + if def>3000 then def=3000 end + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_SET_BASE_ATTACK) + e1:SetValue(atk) + e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) + c:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_SET_BASE_DEFENSE) + e2:SetValue(def) + e2:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) + c:RegisterEffect(e2) +end +function s.negcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return Duel.IsMainPhase() + and c:IsLinked() +end +function s.filter(c) + return c:IsNegatableMonster() or aux.nzatk(c) +end +function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,1-tp,LOCATION_MZONE) +end +function s.negop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_SET_ATTACK_FINAL) + e1:SetValue(0) + e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) + tc:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_SET_DEFENSE_FINAL) + e2:SetValue(0) + e2:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) + tc:RegisterEffect(e2) + Duel.NegateRelatedChain(tc,RESET_TURN_SET) + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_SINGLE) + e3:SetCode(EFFECT_DISABLE) + e3:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) + tc:RegisterEffect(e3) + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_SINGLE) + e4:SetCode(EFFECT_DISABLE_EFFECT) + e4:SetValue(RESET_TURN_SET) + e4:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) + tc:RegisterEffect(e4) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000266.lua b/users/CrimsonAlpha_002/c2002000266.lua new file mode 100644 index 0000000..bdb1b0d --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000266.lua @@ -0,0 +1,104 @@ +--Mekk-Knight Krawler Cyanapse +local s,id=GetID() +function s.initial_effect(c) + --FLIP + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e1:SetCountLimit(1) + e1:SetTarget(s.lktg) + e1:SetOperation(s.lkop) + c:RegisterEffect(e1) + --Normal Set w/o Tributing + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_SET_PROC) + e2:SetCondition(s.ntcon) + c:RegisterEffect(e2) + --Basically Krawler Soma effect but activates as a Quick Effect while facedown + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_QUICK_O) + e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE) + e3:SetCode(EVENT_FREE_CHAIN) + e3:SetRange(LOCATION_MZONE) + e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END) + e3:SetCountLimit(1,{id,0}) + e3:SetCondition(s.spcon) + e3:SetCost(Cost.SelfChangePosition(POS_FACEUP_ATTACK)) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) + c:RegisterEffect(e3) +end +s.listed_series={SET_MEKK_KNIGHT,SET_KRAWLER} + +function s.lktg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) +end +function s.lkop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end + local g=Duel.GetMatchingGroup(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,nil,c) + if #g>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sg=g:Select(tp,1,1,nil) + Duel.LinkSummon(tp,sg:GetFirst(),c) + end +end +function s.ntcon(e,c,minc) + if c==nil then return true end + return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 +end +function s.lvfilter(c,e,tp) + return (c:IsSetCard(SET_KRAWLER) or c:IsSetCard(SET_MEKK_KNIGHT)) + and c:HasLevel() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_DEFENSE) +end +function s.lvrescon(mustlv) + return function(sg) + local res,stop=aux.dncheck(sg) + local sum=sg:GetSum(Card.GetLevel) + return (res and sum==mustlv),(stop or sum>mustlv) + end +end +function s.spcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end + return Duel.IsTurnPlayer(1-tp) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local c=e:GetHandler() + local g=Duel.GetMatchingGroup(s.lvfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,nil,e,tp) + if chk==0 then + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + if ft==0 or not c:HasLevel() or c:IsLevelBelow(2) then return false end + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end + if c:IsLevelAbove(3) and aux.SelectUnselectGroup(g,e,tp,1,ft,s.lvrescon(2),0) then return true end + if c:IsLevelAbove(5) and aux.SelectUnselectGroup(g,e,tp,1,ft,s.lvrescon(4),0) then return true end + return false + end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + if ft==0 or c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or c:IsLevelBelow(2) then return end + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end + local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.lvfilter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,nil,e,tp) + local lvs={} + if c:IsLevelAbove(3) and aux.SelectUnselectGroup(g,e,tp,1,ft,s.lvrescon(2),0) then table.insert(lvs,2) end + if c:IsLevelAbove(5) and aux.SelectUnselectGroup(g,e,tp,1,ft,s.lvrescon(4),0) then table.insert(lvs,4) end + if #lvs<1 then return end + local lv=Duel.AnnounceNumber(tp,table.unpack(lvs)) + if c:UpdateLevel(-lv)~=-lv then return end + local tg=aux.SelectUnselectGroup(g,e,tp,1,ft,s.lvrescon(lv),1,tp,HINTMSG_SPSUMMON,s.lvrescon(lv)) + if #tg>0 and Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_DEFENSE)>0 then + local fdg=Duel.GetOperatedGroup():Match(Card.IsFacedown,nil) + if #fdg==0 then return end + Duel.ConfirmCards(1-tp,fdg) + end +end \ No newline at end of file diff --git a/users/CrimsonAlpha_002/c2002000267.lua b/users/CrimsonAlpha_002/c2002000267.lua new file mode 100644 index 0000000..446cff0 --- /dev/null +++ b/users/CrimsonAlpha_002/c2002000267.lua @@ -0,0 +1,107 @@ +--Yazi, Spiritual Beast of the Yang Zing +local s,id=GetID() +function s.initial_effect(c) + c:SetSPSummonOnce(id) + --Special Summon 1 "Ritual Beast"/"Yang Zing" from the Deck + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_REMOVE) + e1a:SetCountLimit(1,{id,0}) + e1a:SetTarget(s.target) + e1a:SetOperation(s.operation) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_TO_GRAVE) + e1b:SetCondition(s.condition) + c:RegisterEffect(e1b) + --Special Summon this card + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_HAND|LOCATION_GRAVE) + e2:SetCountLimit(1,{id,1}) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) +end +s.listed_series={SET_YANG_ZING,SET_RITUAL_BEAST} +function s.condition(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsReason(REASON_DESTROY) and c:IsPreviousControler(tp) +end +function s.filter(c,e,tp) + return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and not c:IsCode(id) + and (c:IsSetCard(SET_RITUAL_BEAST) or c:IsSetCard(SET_YANG_ZING)) +end +function s.rescon(sg) + return #sg==1 or (sg:IsExists(Card.IsSetCard,1,nil,SET_RITUAL_BEAST) + and sg:IsExists(Card.IsSetCard,1,nil,SET_YANG_ZING)) +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,e,tp) + if ft<=0 then return end + if ft>2 then ft=2 end + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end + if chk==0 then return ft>0 and #g>0 end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + if ft<=0 then return end + if ft>2 then ft=2 end + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,e,tp) + local tg=aux.SelectUnselectGroup(g,e,tp,1,ft,s.rescon,1,tp,HINTMSG_SPSUMMON) + if #tg>0 then + Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP) + end +end + +function s.tgfilter(c,e,tp) + return c:IsMonster() and c:IsAbleToRemove() + or (c:IsDestructable() and c:IsLocation(LOCATION_MZONE)) +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local c=e:GetHandler() + local loc=LOCATION_MZONE + if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then + loc=LOCATION_MZONE+LOCATION_GRAVE + end + if chk==0 then + return Duel.IsExistingTarget(s.tgfilter,tp,loc,0,1,c,e,tp,e) + and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) + end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) + Duel.SelectTarget(tp,s.tgfilter,tp,loc,0,1,1,c,e,tp,e) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + local ops={} + local op=1 + local ev=nil + ops[1]=aux.Stringid(id,2) + if tc:IsLocation(LOCATION_MZONE) then + ops[2]=aux.Stringid(id,3) + op=Duel.SelectOption(tp,table.unpack(ops))+1 + end + if op==1 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + ev=Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) + elseif op==2 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + ev=Duel.Destroy(tc,REASON_EFFECT) + end + if ev and ev>0 then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) + end +end \ No newline at end of file diff --git a/utility_ext.lua b/utility_ext.lua index 9afb2fa..a69816e 100644 --- a/utility_ext.lua +++ b/utility_ext.lua @@ -246,3 +246,64 @@ function Auxiliary.GetOtherColumnGroup(c_or_group,left,right) return nil end end + +local _IsCanBeRitualMaterial, _GetRitualMaterial = Card.IsCanBeRitualMaterial, Duel.GetRitualMaterial + +function Card.IsCanBeRitualMaterial(c,...) + if c:IsLocation(LOCATION_SZONE) and c:IsMonsterCard() and c:IsHasEffect(EFFECT_EXTRA_RITUAL_MATERIAL) then + c:AssumeProperty(ASSUME_TYPE,c:GetType()|TYPE_MONSTER) + end + local res = _IsCanBeRitualMaterial(c,...) + Duel.AssumeReset() + return res +end + +local function GraveRitualMaterialFilter(c,check_level) + return c:IsMonsterCard() and (not check_level or c:GetLevel()>0) and c:IsHasEffect(EFFECT_EXTRA_RITUAL_MATERIAL) +end + +function Duel.GetRitualMaterial(p,...) + local params={...} + local check_level = true + if #params>0 then check_level=params[1] end + local original_ritual_mats = _GetRitualMaterial(p,...) + + local sz_mats = Duel.GetMatchingGroup(GraveRitualMaterialFilter,p,LOCATION_SZONE,0,nil,check_level) + original_ritual_mats:Merge(sz_mats) + + return original_ritual_mats +end + +Condition={} + +local self_summon_type={} +function Condition.IsPendulumSummoned(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM) +end +self_summon_type[Condition.IsPendulumSummoned]=true + +local function condition_table_check(t) + return function(eff) return t[eff:GetCondition()] end +end + +Effect.HasPendulumSummonCondition=condition_table_check(self_summon_type) + +function Condition.AND(...) + local fns={...} + + local function full_condition(e,tp,eg,ep,ev,re,r,rp) + --when checking, stop at the first falsy value + if chk==0 then + for _,fn in ipairs(fns) do + if not fn(e,tp,eg,ep,ev,re,r,rp,0) then return false end + end + return true + end + --when executing, run all functions regardless of what they return + for _,fn in ipairs(fns) do + fn(e,tp,eg,ep,ev,re,r,rp,1) + end + end + + return full_condition +end \ No newline at end of file