-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc80604091.lua
62 lines (62 loc) · 2.2 KB
/
c80604091.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--Ultimate Offerings (pre-errata)
function c80604091.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
--Removed the effect on activation so you can't activate the cards effect when the card is flipped up.
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--instant
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(80604091,0))
e3:SetCategory(CATEGORY_SUMMON)
--Changed the activation type to IGNITION so it can't be chained
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
--Added this in order to let both players use the card
e3:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e3:SetCondition(c80604091.condition2)
e3:SetCost(c80604091.cost2)
e3:SetTarget(c80604091.target2)
e3:SetOperation(c80604091.activate2)
c:RegisterEffect(e3)
end
function c80604091.filter(c)
return c:IsSummonable(true,nil) or c:IsMSetable(true,nil)
end
function c80604091.condition2(e,tp,eg,ep,ev,re,r,rp)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
return (tn==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)) or (tn~=tp and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function c80604091.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500)
else Duel.PayLPCost(tp,500) end
end
function c80604091.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not e:GetHandler():IsStatus(STATUS_CHAINING) then
local ct=Duel.GetMatchingGroupCount(c80604091.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
e:SetLabel(ct)
return ct>0
else return e:GetLabel()>0 end
end
e:SetLabel(e:GetLabel()-1)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c80604091.activate2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c80604091.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local s1=tc:IsSummonable(true,nil)
local s2=tc:IsMSetable(true,nil)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil)
else
Duel.MSet(tp,tc,true,nil)
end
end
end