From f381272663b755c697a88c5e1791ca6f4cfd5576 Mon Sep 17 00:00:00 2001 From: yoshiduels Date: Fri, 17 Jan 2025 13:56:05 +0100 Subject: [PATCH] added new rush cards --- rush/c160020014.lua | 1 + rush/c160020038.lua | 41 ++++++++++++++++++++++++++++++++++++++ rush/c160020039.lua | 48 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 rush/c160020038.lua create mode 100644 rush/c160020039.lua diff --git a/rush/c160020014.lua b/rush/c160020014.lua index e0b7c2345..9cb564448 100644 --- a/rush/c160020014.lua +++ b/rush/c160020014.lua @@ -7,6 +7,7 @@ function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) + e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) e1:SetValue(s.indes) c:RegisterEffect(e1) diff --git a/rush/c160020038.lua b/rush/c160020038.lua new file mode 100644 index 000000000..8720474e9 --- /dev/null +++ b/rush/c160020038.lua @@ -0,0 +1,41 @@ +--ミュリネス・パワー・ビートル +--Mulliness Power Beetle +--Scripted by YoshiDuels +local s,id=GetID() +function s.initial_effect(c) + --Special summon + local e1=Effect.CreateEffect(c) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1) + e1:SetCondition(s.condition) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) +end +function s.cfilter(c) + return c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_DARK) +end +function s.condition(e,tp,eg,ep,ev,re,r,rp) + return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,4,nil) +end +function s.spfilter(c,e,tp) + return c:IsRace(RACE_INSECT) and c:IsDefense(400) and c:HasContinuousRushEffect() 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.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + --Effect + local ft=Duel.GetMZoneCount(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 + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,ft,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) + end +end \ No newline at end of file diff --git a/rush/c160020039.lua b/rush/c160020039.lua new file mode 100644 index 000000000..488df4346 --- /dev/null +++ b/rush/c160020039.lua @@ -0,0 +1,48 @@ +--コクーン・キング・ビートル +--Cocoon King Beetle +--Scripted by YoshiDuels +local s,id=GetID() +function s.initial_effect(c) + --Draw + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DRAW|CATEGORY_TOHAND) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1) + e1:SetCondition(s.condition) + e1:SetCost(s.cost) + e1:SetTarget(s.target) + e1:SetOperation(s.operation) + c:RegisterEffect(e1) +end +function s.condition(e,tp,eg,ep,ev,re,r,rp) + return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=10 +end +function s.cfilter(c) + return c:IsMonster() and c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGraveAsCost() +end +function s.cost(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 +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end + Duel.SetTargetPlayer(tp) + Duel.SetTargetParam(1) + Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) +end +function s.operation(e,tp,eg,ep,ev,re,r,rp) + --Requirement + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil) + if Duel.SendtoGrave(g,REASON_COST)<1 then return end + --Effect + local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) + if Duel.Draw(p,d,REASON_EFFECT)>0 and Duel.IsPlayerCanDiscardDeck(tp,3) + and Duel.IsExistingMatchingCard(Card.IsAttribute,tp,LOCATION_GRAVE,0,2,nil,ATTRIBUTE_DARK) + and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then + Duel.BreakEffect() + Duel.DiscardDeck(tp,3,REASON_EFFECT) + end +end \ No newline at end of file