From e3b4a7ccc8250bc0dc8f75981edd43ef5bf03db3 Mon Sep 17 00:00:00 2001 From: Dark Zane <138526168+VaHReX@users.noreply.github.com> Date: Fri, 9 Aug 2024 23:41:22 -0400 Subject: [PATCH 1/2] Update c61650133.lua --- c61650133.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c61650133.lua b/c61650133.lua index 23e97a2bcb..e919fdcf8d 100644 --- a/c61650133.lua +++ b/c61650133.lua @@ -7,6 +7,7 @@ function c61650133.initial_effect(c) c:RegisterEffect(e1) --maintain local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(61650133,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetCode(EVENT_PHASE+PHASE_END) @@ -17,7 +18,7 @@ function c61650133.initial_effect(c) c:RegisterEffect(e2) --remove local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(61650133,0)) + e3:SetDescription(aux.Stringid(61650133,1)) e3:SetCategory(CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_SPSUMMON_SUCCESS) From 98e455e49acb8a57c90826fab94fcd147328a137 Mon Sep 17 00:00:00 2001 From: Dark Zane <138526168+VaHReX@users.noreply.github.com> Date: Sun, 15 Sep 2024 12:23:46 -0400 Subject: [PATCH 2/2] Add Mimighoul cards --- c13204145.lua | 97 +++++++++++++++++++++++++++++++++++++++++++++++ c23920796.lua | 75 +++++++++++++++++++++++++++++++++++++ c50415441.lua | 90 ++++++++++++++++++++++++++++++++++++++++++++ c55537983.lua | 92 +++++++++++++++++++++++++++++++++++++++++++++ c59293853.lua | 79 ++++++++++++++++++++++++++++++++++++++ c81522098.lua | 84 +++++++++++++++++++++++++++++++++++++++++ c86809440.lua | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 619 insertions(+) create mode 100644 c13204145.lua create mode 100644 c23920796.lua create mode 100644 c50415441.lua create mode 100644 c55537983.lua create mode 100644 c59293853.lua create mode 100644 c81522098.lua create mode 100644 c86809440.lua diff --git a/c13204145.lua b/c13204145.lua new file mode 100644 index 0000000000..a7c356bf5d --- /dev/null +++ b/c13204145.lua @@ -0,0 +1,97 @@ +--Mimighoul Maker +local s,id,o=GetID() +function s.initial_effect(c) + --Activate + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetCountLimit(1,id) + e1:SetTarget(s.target) + e1:SetOperation(s.activate) + c:RegisterEffect(e1) + --ChangePosition + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TOGRAVE) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetCode(EVENT_SPSUMMON_SUCCESS) + e2:SetRange(LOCATION_GRAVE) + e2:SetCountLimit(1,id) + e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) + e2:SetCondition(s.tgcon2) + e2:SetCost(aux.bfgcost) + e2:SetTarget(s.postg) + e2:SetOperation(s.posop) + c:RegisterEffect(e2) +end +function s.spfilter1(c,e,tp) + return c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) and c:IsAbleToHand() +end +function s.spfilter2(c,e,tp) + return c:IsSetCard(0x1b7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then + local g=Duel.GetMatchingGroup(s.spfilter1,tp,LOCATION_DECK,0,nil,e,tp) + return g:GetClassCount(Card.GetCode)>=2 + end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) +end +function s.activate(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetMatchingGroup(s.spfilter1,tp,LOCATION_DECK,0,nil,e,tp) + if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and g:GetClassCount(Card.GetCode)>=2 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) + local cg=g:SelectSubGroup(tp,aux.dncheck,false,2,2) + Duel.ConfirmCards(1-tp,cg) + local tc=cg:RandomSelect(1-tp,1):GetFirst() + Duel.ConfirmCards(tp,tc) + if tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) then + Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE) + cg:RemoveCard(tc) + if cg:GetFirst():IsAbleToHand() then + Duel.SendtoHand(cg,nil,REASON_EFFECT) + if Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() + if sc then + Duel.BreakEffect() + Duel.ShuffleHand(tp) + Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) + end + end + else + Duel.SendtoGrave(cg,REASON_RULE) + end + end + end +end +function s.tgcon2(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) +end +function s.posfilter(c) + return c:IsFacedown() and c:IsDefensePos() +end +function s.postg(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:IsFacedown() end + if chk==0 then return Duel.IsExistingTarget(s.posfilter,tp,0,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) + Duel.SelectTarget(tp,s.posfilter,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0) +end +function s.posop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then + if tc:IsPosition(POS_FACEUP_ATTACK) and tc:IsCanChangePosition() then + Duel.ChangePosition(tc,POS_FACEUP_DEFENCE) + elseif tc:IsPosition(POS_FACEUP_DEFENCE) and tc:IsCanChangePosition() then + Duel.ChangePosition(tc,POS_FACEUP_ATTACK) + else + local pos=Duel.SelectPosition(tp,tc,POS_FACEUP) + Duel.ChangePosition(tc,pos) + end + end +end \ No newline at end of file diff --git a/c23920796.lua b/c23920796.lua new file mode 100644 index 0000000000..d953004a7a --- /dev/null +++ b/c23920796.lua @@ -0,0 +1,75 @@ +--Mimighoul Cerberus +local s,id,o=GetID() +function s.initial_effect(c) + --flip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_REMOVE+CATEGORY_CONTROL+CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCountLimit(1,id) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) + --spsummon + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id+o) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) + --cannot be target + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_FIELD) + e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) + e3:SetRange(LOCATION_MZONE) + e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e3:SetTargetRange(LOCATION_ONFIELD,0) + e3:SetTarget(aux.TargetBoolFunction(aux.AND(Card.IsType,Card.IsFaceup),TYPE_SPELL)) + e3:SetValue(aux.tgoval) + c:RegisterEffect(e3) +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED) + Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0) +end +function s.spfilter(c,e,tp) + return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then + local tg=Duel.GetDecktopGroup(tp,3) + if #tg==0 then return end + Duel.DisableShuffleCheck() + if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) + if #g>0 then + Duel.BreakEffect() + Duel.SpecialSummon(g:GetFirst(),0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) + end + end + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.BreakEffect() + Duel.GetControl(c,1-tp) + end + end +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 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 + if Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)>0 then Duel.ConfirmCards(tp,c) end + end +end \ No newline at end of file diff --git a/c50415441.lua b/c50415441.lua new file mode 100644 index 0000000000..9a8fb048cd --- /dev/null +++ b/c50415441.lua @@ -0,0 +1,90 @@ +--Mimighoul Archfiend +local s,id,o=GetID() +function s.initial_effect(c) + --flip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES+CATEGORY_CONTROL) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCountLimit(1,id) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) + --spsummon + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id+o) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) + --ChangePosition + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_POSITION) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_SUMMON_SUCCESS) + e3:SetCountLimit(1,id+o*2) + e3:SetTarget(s.postg) + e3:SetOperation(s.posop) + c:RegisterEffect(e3) + local e4=e3:Clone() + e4:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e4) +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) + Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,1) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then + Duel.Draw(1-tp,1,REASON_EFFECT) + local tg1=Duel.GetFieldGroup(tp,LOCATION_HAND,0) + if tg1:GetCount()>0 then + Duel.ShuffleHand(tp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + local tc1=tg1:Select(tp,1,1,nil):GetFirst() + Duel.BreakEffect() + Duel.SendtoGrave(tc1,REASON_EFFECT) + end + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.BreakEffect() + Duel.GetControl(c,1-tp) + end + end +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 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 + if Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)>0 then Duel.ConfirmCards(tp,c) end + end +end +function s.posfilter(c) + return c:IsType(TYPE_MONSTER) and c:IsFacedown() and c:IsDefensePos() +end +function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0) +end +function s.posop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) + local g=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) + local tc=g:GetFirst() + if tc then + Duel.HintSelection(g) + local pos=Duel.SelectPosition(tp,tc,POS_FACEUP) + Duel.ChangePosition(tc,pos) + end +end \ No newline at end of file diff --git a/c55537983.lua b/c55537983.lua new file mode 100644 index 0000000000..5b3f78255a --- /dev/null +++ b/c55537983.lua @@ -0,0 +1,92 @@ +--Mimighoul Master +local s,id,o=GetID() +function s.initial_effect(c) + --indestructable + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetRange(LOCATION_MZONE) + e1:SetValue(1) + e1:SetCondition(s.indescon) + c:RegisterEffect(e1) + local e2=e1:Clone() + e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) + c:RegisterEffect(e2) + --search + 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_SUMMON_SUCCESS) + e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCountLimit(1,id) + e3:SetTarget(s.thtg) + e3:SetOperation(s.thop) + c:RegisterEffect(e3) + local e4=e3:Clone() + e4:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e4) + --change pos + local e5=Effect.CreateEffect(c) + e5:SetDescription(aux.Stringid(id,1)) + e5:SetCategory(CATEGORY_POSITION) + e5:SetType(EFFECT_TYPE_QUICK_O) + e5:SetCode(EVENT_FREE_CHAIN) + e5:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) + e5:SetRange(LOCATION_MZONE) + e5:SetCountLimit(1,id+o) + e5:SetCondition(s.poscon) + e5:SetTarget(s.postg) + e5:SetOperation(s.posop) + c:RegisterEffect(e5) +end +function s.cfilter1(c) + return c:IsFaceup() and c:IsSetCard(0x1b7) and not c:IsCode(id) +end +function s.cfilter2(c) + return c:IsFacedown() +end +function s.indescon(e) + local tp=e:GetHandlerPlayer() + return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_MZONE,0,1,nil) + or Duel.IsExistingMatchingCard(s.cfilter2,tp,0,LOCATION_MZONE,1,nil) +end +function s.thfilter(c) + return c:IsSetCard(0x1b7) and c:IsType(TYPE_MONSTER) and not c:IsCode(id) and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,0)) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) + if g:GetCount()>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) + end +end +function s.poscon(e,tp,eg,ep,ev,re,r,rp) + local ph=Duel.GetCurrentPhase() + return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) +end +function s.filter(c) + return c:IsType(TYPE_MONSTER) and c:IsFacedown() and c:IsDefensePos() +end +function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1)) + Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0) +end +function s.posop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) + local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) + local tc=g:GetFirst() + if tc then + Duel.HintSelection(g) + local pos=Duel.SelectPosition(tp,tc,POS_FACEUP) + Duel.ChangePosition(tc,pos) + end +end diff --git a/c59293853.lua b/c59293853.lua new file mode 100644 index 0000000000..561d520e5c --- /dev/null +++ b/c59293853.lua @@ -0,0 +1,79 @@ +--Mimighoul Room +local s,id,o=GetID() +function s.initial_effect(c) + --Activate + local e1=Effect.CreateEffect(c) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetCountLimit(1,id) + e1:SetTarget(s.target) + e1:SetOperation(s.activate) + c:RegisterEffect(e1) + --changepos + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_QUICK_O) + e2:SetCategory(CATEGORY_TOHAND) + e2:SetCode(EVENT_FREE_CHAIN) + e2:SetRange(LOCATION_GRAVE) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetCountLimit(1,id) + e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER) + e2:SetCost(aux.bfgcost) + e2:SetTarget(s.thtg) + e2:SetOperation(s.thop) + c:RegisterEffect(e2) +end +function s.filter(c,e,tp) + return c:IsSetCard(0x1b7) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0) +end +function s.target(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.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) +end +function s.posfilter(c) + return c:IsFaceup() and c:IsCanTurnSet() +end +function s.activate(e,tp,eg,ep,ev,re,r,rp) + if Duel.GetLocationCount(tp,LOCATION_MZONE)+Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp) + if g:GetCount()>0 then + local tc=g:GetFirst() + local s1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) + local s2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) + local op=aux.SelectFromOptions(tp, + {s1,aux.Stringid(id,2),tp}, + {s2,aux.Stringid(id,3),1-tp}) + if Duel.SpecialSummon(tc,0,tp,op,false,false,op==tp and POS_FACEUP or POS_FACEDOWN_DEFENCE)~=0 + and Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) + and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then + Duel.BreakEffect() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) + local sg=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) + Duel.HintSelection(sg) + Duel.ChangePosition(sg:GetFirst(),POS_FACEDOWN_DEFENSE) + end + end +end +function s.thfilter(c) + return c:IsFaceup() and c:IsSetCard(0x1b7) and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and s.thfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_ONFIELD,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) + local ct=Duel.GetMatchingGroupCount(s.thfilter,tp,LOCATION_ONFIELD,0,nil) + local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_ONFIELD,0,1,ct,nil) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) +end +function s.hfilter(c,e) + return c:IsRelateToEffect(e) and c:IsType(TYPE_MONSTER) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(s.hfilter,nil,e) + if #g>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + end +end \ No newline at end of file diff --git a/c81522098.lua b/c81522098.lua new file mode 100644 index 0000000000..fc1b8a5c0a --- /dev/null +++ b/c81522098.lua @@ -0,0 +1,84 @@ +--Mimighoul Dragon +local s,id,o=GetID() +function s.initial_effect(c) + --flip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_CONTROL) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F) + e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCountLimit(1,id) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) + --spsummon + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetRange(LOCATION_HAND) + e2:SetCountLimit(1,id+o) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) + c:RegisterEffect(e2) + --search + local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_SUMMON_SUCCESS) + e3:SetCountLimit(1,id+o*2) + e3:SetTarget(s.thtg) + e3:SetOperation(s.thop) + c:RegisterEffect(e3) + local e4=e3:Clone() + e4:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e4) +end +function s.filter(c) + return c:IsFaceup() and not c:IsSetCard(0x1b7) +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) + Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then + local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil) + Duel.Destroy(g,REASON_EFFECT) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.BreakEffect() + Duel.GetControl(c,1-tp) + end + end +end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 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 + if Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)>0 then Duel.ConfirmCards(tp,c) end + end +end +function s.thfilter(c) + return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x1b7) and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) + if g:GetCount()>0 then + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) + end +end \ No newline at end of file diff --git a/c86809440.lua b/c86809440.lua new file mode 100644 index 0000000000..26abdb65d0 --- /dev/null +++ b/c86809440.lua @@ -0,0 +1,102 @@ +--Mimighoul Dungeon +local s,id,o=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) + --can not spsummon + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_FIELD) + e2:SetRange(LOCATION_FZONE) + e2:SetCode(EFFECT_CANNOT_SUMMON) + e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e2:SetTargetRange(1,0) + e2:SetCondition(s.effcon1) + c:RegisterEffect(e2) + local e3=e2:Clone() + e3:SetTargetRange(0,1) + e3:SetCondition(s.effcon2) + c:RegisterEffect(e3) + --search + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(id,0)) + e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e4:SetType(EFFECT_TYPE_IGNITION) + e4:SetRange(LOCATION_FZONE) + e4:SetCountLimit(1,id) + e4:SetTarget(s.thtg) + e4:SetOperation(s.thop) + c:RegisterEffect(e4) + --atkup + local e5=Effect.CreateEffect(c) + e5:SetType(EFFECT_TYPE_FIELD) + e5:SetCode(EFFECT_UPDATE_ATTACK) + e5:SetRange(LOCATION_FZONE) + e5:SetTargetRange(LOCATION_MZONE,0) + e5:SetValue(s.atkval) + e5:SetTarget(s.atktg) + c:RegisterEffect(e5) + --cannot attack + local e6=Effect.CreateEffect(c) + e6:SetType(EFFECT_TYPE_FIELD) + e6:SetCode(EFFECT_CANNOT_ATTACK) + e6:SetRange(LOCATION_FZONE) + e6:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) + e6:SetTarget(s.atktarget) + c:RegisterEffect(e6) + if not s.global_check then + s.global_check=true + local ge1=Effect.CreateEffect(c) + ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + ge1:SetCode(EVENT_SUMMON_SUCCESS) + ge1:SetOperation(s.checkop) + Duel.RegisterEffect(ge1,0) + local ge2=ge1:Clone() + ge2:SetCode(EVENT_SPSUMMON_SUCCESS) + Duel.RegisterEffect(ge2,0) + end +end +function s.checkop(e,tp,eg,ep,ev,re,r,rp) + local tc=eg:GetFirst() + while tc do + tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE+RESET_PHASE+PHASE_END,0,1) + if tc:IsSummonType(SUMMON_TYPE_SPECIAL) then + tc:RegisterFlagEffect(id+1,RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE+RESET_PHASE+PHASE_END,0,1) + end + tc=eg:GetNext() + end +end +function s.atktg(e,c) + return c:IsSetCard(0x1b7) and c:GetFlagEffect(id)==0 +end +function s.atkval(e,c) + return c:GetBaseDefense() +end +function s.atktarget(e,c) + return c:GetFlagEffect(id+1)>0 and Duel.IsExistingMatchingCard(Card.IsFacedown,c:GetControler(),LOCATION_MZONE,0,1,nil) +end +function s.effcon1(e) + local tp=e:GetHandlerPlayer() + return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) +end +function s.effcon2(e) + local tp=e:GetHandlerPlayer() + return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_MZONE,1,nil) +end +function s.thfilter(c) + return c:IsSetCard(0x1b7) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() +end +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) + if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then + Duel.ConfirmCards(1-tp,g) + end +end \ No newline at end of file