Exchange of the Sheep
- Card ID:
120293030 - Format: Rush Duel
- Script:
Rush/Scripts/c120293030.lua
Stats
| Field | Value |
|---|---|
| Type | 0x4 |
| ATK | 0 |
| DEF | 0 |
| Level/Rank/Link | 0x0 |
| Race | 0x0 |
| Attribute | 0x0 |
| Category | 0x40120 |
Card Text
text
[REQUIREMENT]
When your opponent draws a card(s) while you have 15 or more Beast Type monsters in your Graveyard, send your entire hand to the Graveyard.
[EFFECT]
Shuffle all cards from the Graveyards into the owners' Decks. Then, you can draw 1 card and show it. If that card is a Level 7 or higher Beast Type monster, you can Special Summon it face-up to your field.Detected API Calls
Auxiliary.NecroValleyFilterAuxiliary.StringidCard.IsAbleToDeckCard.IsAbleToGraveAsCostCard.IsLevelAboveCard.IsRaceCard.RegisterEffectDuel.BreakEffectDuel.ConfirmCardsDuel.DrawDuel.GetDecktopGroupDuel.GetFieldGroupDuel.GetLocationCountDuel.GetMatchingGroupDuel.IsExistingMatchingCardDuel.IsPlayerCanDrawDuel.SelectEffectYesNoDuel.SelectYesNoDuel.SendtoGraveDuel.SetOperationInfoDuel.SpecialSummonEffect.CreateEffectEffect.SetCategoryEffect.SetCodeEffect.SetConditionEffect.SetCostEffect.SetOperationEffect.SetPropertyEffect.SetTargetEffect.SetTypeGroup.GetCountRushDuel.IsCanBeSpecialSummonedRushDuel.SendToDeckAndExists
Script
lua
local cm,m=GetID()
cm.name="羊界与咩~界的逆转"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION+CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DRAW)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.confilter(c)
return c:IsRace(RACE_BEAST)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,15,nil)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if RD.SendToDeckAndExists(mg,e,tp,REASON_EFFECT) then
if Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
if tc:IsLevelAbove(7) and tc:IsRace(RACE_BEAST)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and RD.IsCanBeSpecialSummoned(tc,e,tp,POS_FACEUP)
and Duel.SelectEffectYesNo(tp,tc,aux.Stringid(m,1)) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end