Dolphin Counterattack
- Card ID:
120199058 - Format: Rush Duel
- Script:
Rush/Scripts/c120199058.lua
Stats
| Field | Value |
|---|---|
| Type | 0x4 |
| ATK | 0 |
| DEF | 0 |
| Level/Rank/Link | 0x0 |
| Race | 0x0 |
| Attribute | 0x0 |
| Category | 0x400502 |
Card Text
text
[REQUIREMENT]
When an opponent's monster declares an attack targeting your face-up Fish or Sea Serpent Type monster, shuffle 1 "Umi" or "Big Umi" from your Graveyard into the Deck.
[EFFECT]
Destroy 1 face-up monster with the highest ATK on your opponent's field. Draw 1 card and show it. If that card is "Umi" or "Big Umi", inflict 500 damage to your opponent.Detected API Calls
Card.GetAttackCard.IsAbleToDeckOrExtraAsCostCard.IsCodeCard.IsControlerCard.IsFaceupCard.IsRaceCard.RegisterEffectDuel.ConfirmCardsDuel.DamageDuel.DestroyDuel.DrawDuel.GetAttackTargetDuel.GetAttackerDuel.GetDecktopGroupDuel.GetMatchingGroupDuel.HintDuel.HintSelectionDuel.IsExistingMatchingCardDuel.IsPlayerCanDrawDuel.SetOperationInfoDuel.ShuffleHandEffect.CreateEffectEffect.SetCategoryEffect.SetCodeEffect.SetConditionEffect.SetCostEffect.SetOperationEffect.SetTargetEffect.SetTypeGroup.GetCountGroup.GetMaxGroupGroup.SelectRushDuel.AddCodeListRushDuel.CostSendGraveToDeck
Script
lua
local cm,m=GetID()
local list={120145052,120145050}
cm.name="海豚反击"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.costfilter(c)
return c:IsCode(list[1],list[2]) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget()
return Duel.GetAttacker():IsControler(1-tp)
and c and c:IsControler(tp) and c:IsFaceup() and c:IsRace(RACE_FISH+RACE_SEASERPENT)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()==0 then return end
local mg=g:GetMaxGroup(Card.GetAttack)
local sg=nil
if mg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
sg=mg:Select(tp,1,1,nil)
else
sg=mg
end
Duel.HintSelection(sg)
if Duel.Destroy(sg,REASON_EFFECT)~=0 and Duel.IsPlayerCanDraw(tp,1) then
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.Draw(tp,1,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
if tc:IsCode(list[1],list[2]) then
Duel.Damage(1-tp,500,REASON_EFFECT)
end
Duel.ShuffleHand(tp)
end
end