Skip to content

Commit 9013c61

Browse files
authored
Update "Impact Flip"
- Resolved nil error in retrieving operation info - Script modernization updates
1 parent 46d5ec0 commit 9013c61

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

unofficial/c511000495.lua

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,31 @@
33
local s,id=GetID()
44
function s.initial_effect(c)
55
aux.AddEquipProcedure(c)
6-
--Position Change
6+
--Flip 1 face-down monster your opponent controls face-up
77
local e1=Effect.CreateEffect(c)
88
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_POSITION)
910
e1:SetType(EFFECT_TYPE_IGNITION)
1011
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
1112
e1:SetCode(EVENT_FREE_CHAIN)
12-
e1:SetCountLimit(1)
1313
e1:SetRange(LOCATION_SZONE)
14+
e1:SetCountLimit(1)
1415
e1:SetCost(s.poscost)
1516
e1:SetTarget(s.postg)
1617
e1:SetOperation(s.posop)
1718
c:RegisterEffect(e1)
18-
--Deck Destruction
19+
--Send the top of card of your opponent's deck to the GY
1920
local e2=Effect.CreateEffect(c)
2021
e2:SetDescription(aux.Stringid(id,2))
2122
e2:SetCategory(CATEGORY_DECKDES)
2223
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
2324
e2:SetCode(EVENT_BATTLE_DESTROYING)
2425
e2:SetRange(LOCATION_SZONE)
25-
e2:SetCondition(s.descon)
26-
e2:SetTarget(s.destg)
27-
e2:SetOperation(s.desop)
26+
e2:SetCondition(s.deckdescon)
27+
e2:SetTarget(s.deckdestg)
28+
e2:SetOperation(function(e) Duel.DiscardDeck(1-e:GetHandlerPlayer(),1,REASON_EFFECT) end)
2829
c:RegisterEffect(e2)
29-
--Draw
30+
--Both players draw 1 card when this card is sent to the GY
3031
local e3=Effect.CreateEffect(c)
3132
e3:SetDescription(aux.Stringid(id,1))
3233
e3:SetCategory(CATEGORY_DRAW)
@@ -42,41 +43,37 @@ function s.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
4243
e1:SetType(EFFECT_TYPE_EQUIP)
4344
e1:SetCode(EFFECT_CANNOT_ATTACK)
4445
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
45-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
46+
e1:SetReset(RESETS_STANDARD_PHASE_END)
4647
e:GetHandler():RegisterEffect(e1)
4748
end
4849
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
49-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFacedown() end
50-
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,0,LOCATION_MZONE,1,nil) end
50+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFacedown() and chkc:IsCanChangePosition() end
51+
if chk==0 then return Duel.IsExistingTarget(aux.AND(Card.IsFacedown,Card.IsCanChangePosition),tp,0,LOCATION_MZONE,1,nil) end
5152
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
52-
Duel.SelectTarget(tp,Card.IsFacedown,tp,0,LOCATION_MZONE,1,1,nil)
53-
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
53+
Duel.SelectTarget(tp,aux.AND(Card.IsFacedown,Card.IsCanChangePosition),tp,0,LOCATION_MZONE,1,1,nil)
54+
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
5455
end
5556
function s.posop(e,tp,eg,ep,ev,re,r,rp)
5657
local tc=Duel.GetFirstTarget()
57-
local sc=e:GetHandler():GetEquipTarget()
58-
if tc:IsRelateToEffect(e) then
59-
Duel.ChangePosition(tc,0x1,0x1,0x4,0x4,true)
58+
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
59+
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,true)
6060
end
6161
end
62-
function s.descon(e,tp,eg,ep,ev,re,r,rp)
62+
function s.deckdescon(e,tp,eg,ep,ev,re,r,rp)
6363
local ec=eg:GetFirst()
6464
local bc=ec:GetBattleTarget()
65-
return e:GetHandler():GetEquipTarget()==eg:GetFirst() and ec:IsControler(tp)
65+
return ec==e:GetHandler():GetEquipTarget() and ec:IsControler(tp)
6666
and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE)
6767
end
68-
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
68+
function s.deckdestg(e,tp,eg,ep,ev,re,r,rp,chk)
6969
if chk==0 then return true end
7070
Duel.SetOperationInfo(0,CATEGORY_DECKDES,0,0,1-tp,1)
7171
end
72-
function s.desop(e,tp,eg,ep,ev,re,r,rp)
73-
Duel.DiscardDeck(1-tp,1,REASON_EFFECT)
74-
end
7572
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
7673
if chk==0 then return true end
7774
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
7875
end
7976
function s.drop(e,tp,eg,ep,ev,re,r,rp)
8077
Duel.Draw(tp,1,REASON_EFFECT)
8178
Duel.Draw(1-tp,1,REASON_EFFECT)
82-
end
79+
end

0 commit comments

Comments
 (0)