Heavenly Bliss
- Card ID:
120203033 - Format: Rush Duel
- Script:
Rush/Scripts/c120203033.lua
Stats
| Field | Value |
|---|---|
| Type | 0x4 |
| ATK | 0 |
| DEF | 0 |
| Level/Rank/Link | 0x0 |
| Race | 0x0 |
| Attribute | 0x0 |
| Category | 0x803 |
Card Text
text
[REQUIREMENT]
When a monster(s) on your field is destroyed by an opponent's attack or their card effect while you have no other monsters on your field.
[EFFECT]
Change 1 face-up monster on your opponent's field to face-down Defense Position. If the original Level of the destroyed monster was 10, you can destroy 1 face-down card on your opponent's field.Detected API Calls
Auxiliary.StringidCard.IsCanTurnSetCard.IsControlerCard.IsFacedownCard.IsFaceupCard.IsLevelCard.IsPreviousLocationCard.IsReasonCard.RegisterEffectDuel.DestroyDuel.GetAttackTargetDuel.GetFieldGroupCountDuel.GetMatchingGroupDuel.IsExistingMatchingCardDuel.SetOperationInfoEffect.CreateEffectEffect.GetLabelEffect.SetCategoryEffect.SetCodeEffect.SetConditionEffect.SetLabelEffect.SetOperationEffect.SetPropertyEffect.SetTargetEffect.SetTypeGroup.IsExistsRushDuel.CanSelectAndDoActionRushDuel.ChangePositionRushDuel.FilterRushDuel.IsCanChangePositionRushDuel.IsPreviousControlerRushDuel.SelectAndDoAction
Script
lua
local cm,m=GetID()
cm.name="天之冥福"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.confilter(c,tp,rp)
return RD.IsPreviousControler(c,tp) and c:IsPreviousLocation(LOCATION_MZONE)
and ((rp==1-tp and c:IsReason(REASON_EFFECT)) or c==Duel.GetAttackTarget())
end
function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.exfilter(c,tp)
return c:IsControler(tp) and RD.IsPreviousControler(c,tp) and c:IsLevel(10)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,tp,rp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
if eg:IsExists(cm.exfilter,1,nil,tp) then
e:SetLabel(1)
else
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)~=0 and e:GetLabel()==1 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil,function(sg)
Duel.Destroy(sg,REASON_EFFECT)
end)
end
end)
end