Skip to content

Commit c362d65

Browse files
committed
"Guardragon Andrake" update
- Rescripted to match modern standards - Fixed a bug where it would not be able to trigger its effects sometimes when summoned at the same time as other monsters - Fixed a bug that it would not destroy the target if it changed control
1 parent 13779a2 commit c362d65

File tree

1 file changed

+28
-36
lines changed

1 file changed

+28
-36
lines changed

official/c6990577.lua

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,37 @@
44
local s,id=GetID()
55
function s.initial_effect(c)
66
c:EnableUnsummonable()
7-
--spsummon
7+
c:AddMustBeSpecialSummonedByCardEffect()
8+
--Double this card's original ATK/DEF, until the end of the next turn
89
local e1=Effect.CreateEffect(c)
9-
e1:SetType(EFFECT_TYPE_SINGLE)
10-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
11-
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
12-
e1:SetValue(s.splimit)
10+
e1:SetDescription(aux.Stringid(id,0))
11+
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
12+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
13+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
14+
e1:SetProperty(EFFECT_FLAG_DELAY)
15+
e1:SetCountLimit(1,id)
16+
e1:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_HAND|LOCATION_DECK) end)
17+
e1:SetTarget(s.atktg)
18+
e1:SetOperation(s.atkop)
1319
c:RegisterEffect(e1)
14-
--ATK/DEF up
20+
--Destroy 1 monster your opponent controls
1521
local e2=Effect.CreateEffect(c)
16-
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
22+
e2:SetDescription(aux.Stringid(id,1))
23+
e2:SetCategory(CATEGORY_DESTROY)
24+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
25+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
1726
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
18-
e2:SetRange(LOCATION_MZONE)
19-
e2:SetProperty(EFFECT_FLAG_DELAY)
20-
e2:SetCountLimit(1,id)
21-
e2:SetCondition(s.atkcon)
22-
e2:SetOperation(s.atkop)
27+
e2:SetCountLimit(1,{id,1})
28+
e2:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE|LOCATION_REMOVED) end)
29+
e2:SetTarget(s.destg)
30+
e2:SetOperation(s.desop)
2331
c:RegisterEffect(e2)
24-
--destroy
25-
local e3=Effect.CreateEffect(c)
26-
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
27-
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
28-
e3:SetRange(LOCATION_MZONE)
29-
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
30-
e3:SetCountLimit(1,{id,1})
31-
e3:SetCondition(s.descon)
32-
e3:SetTarget(s.destg)
33-
e3:SetOperation(s.desop)
34-
c:RegisterEffect(e3)
3532
end
36-
function s.splimit(e,se,sp,st)
37-
return se:IsHasType(EFFECT_TYPE_ACTIONS)
38-
end
39-
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
33+
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
34+
if chk==0 then return true end
4035
local c=e:GetHandler()
41-
return eg:GetFirst()==c and c:IsPreviousLocation(LOCATION_HAND|LOCATION_DECK)
36+
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,c,1,tp,c:GetBaseAttack())
37+
Duel.SetOperationInfo(0,CATEGORY_DEFCHANGE,c,1,tp,c:GetBaseDefense())
4238
end
4339
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
4440
local c=e:GetHandler()
@@ -55,20 +51,16 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
5551
c:RegisterEffect(e2)
5652
end
5753
end
58-
function s.descon(e,tp,eg,ep,ev,re,r,rp)
59-
local c=e:GetHandler()
60-
return eg:GetFirst()==c and c:IsPreviousLocation(LOCATION_GRAVE|LOCATION_REMOVED)
61-
end
6254
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
6355
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
64-
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
56+
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
6557
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
66-
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
67-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
58+
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
59+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
6860
end
6961
function s.desop(e,tp,eg,ep,ev,re,r,rp)
7062
local tc=Duel.GetFirstTarget()
71-
if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then
63+
if tc:IsRelateToEffect(e) then
7264
Duel.Destroy(tc,REASON_EFFECT)
7365
end
7466
end

0 commit comments

Comments
 (0)