Commit 982c0ec1 authored by Grajade's avatar Grajade

Update c1199001.lua

parent 2490b3bf
......@@ -21,8 +21,8 @@ function c1199001.initial_effect(c)
end
--
function c1199001.damtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local c=e:GetHandler()
if c:IsLocation(LOCATION_SZONE) then
local seq=c:GetSequence()
local dis=(2^(seq))*256
......@@ -42,7 +42,6 @@ function c1199001.damop1(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1_1,tp)
Duel.RegisterFlagEffect(tp,1199000,0,0,0)
end
Duel.RegisterFlagEffect(tp,1199001,0,0,0)
local e1_2=Effect.CreateEffect(c)
e1_2:SetType(EFFECT_TYPE_FIELD)
e1_2:SetCode(EFFECT_DISABLE_FIELD)
......@@ -53,13 +52,13 @@ end
--
function c1199001.damval1_1(e,re,val,r,rp,rc)
if bit.band(r,REASON_EFFECT)==0 then return val end
if Duel.GetFlagEffect(rp,1199001)<1 then return val end
if re then
local rc=re:GetHandler()
local b1=rc:IsSetCard(0x2022)
local b2=(rc:GetPreviousLocation()==LOCATION_HAND)
local b2=rc:IsPreviousLocation(LOCATION_HAND)
if not (b1 and b2) then return val end
Duel.ResetFlagEffect(rp,1199001)
e:Reset()
Duel.ResetFlagEffect(rp,1199000)
return val*2
end
return val
......@@ -73,64 +72,72 @@ function c1199001.thcon2(e,tp,eg,ep,ev,re,r,rp)
and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER)
and re:GetHandler():IsRace(RACE_SPELLCASTER)
end
--
function c1199001.thfilter2(c,tp)
return c:IsSetCard(0x2022) and c:GetActivateEffect():IsActivatable(tp,false,false)
end
function c1199001.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1199001.thfilter2,tp,LOCATION_DECK,0,1,nil,tp) end
end
--
function c1199001.thop2(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RESOLVECARD)
local g=Duel.SelectMatchingCard(tp,c1199001.thfilter2,tp,LOCATION_DECK,0,1,1,nil,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
if not te then
Duel.SendtoGrave(tc,REASON_RULE)
else
local tetable={tc:GetActivateEffect()}
if #tetable>0 then
for i=1,#tetable do
local te=tetable[i]
local condition=te:GetCondition()
local cost=te:GetCost()
local target=te:GetTarget()
local operation=te:GetOperation()
if not (te:GetCode()==EVENT_FREE_CHAIN
and te:IsActivatable(tp)
and (not condition or condition(te,tp,eg,ep,ev,re,r,rp))
and (not cost or cost(te,tp,eg,ep,ev,re,r,rp,0))
and (not target or target(te,tp,eg,ep,ev,re,r,rp,0))) then
table.remove(tetable,i)
end
end
if #tetable>0 then
local effectlist={}
for i=1,#tetable do
local te=tetable[i]
effectlist[i]=te:GetDescription()
end
local op=0
if #tetable>1 then
op=Duel.SelectOption(tp,table.unpack(effectlist))
end
local te=tetable[op+1]
local condition=te:GetCondition()
local cost=te:GetCost()
local target=te:GetTarget()
local operation=te:GetOperation()
if te:GetCode()==EVENT_FREE_CHAIN and te:IsActivatable(tep)
and (not condition or condition(te,tep,eg,ep,ev,re,r,rp))
and (not cost or cost(te,tep,eg,ep,ev,re,r,rp,0))
and (not target or target(te,tep,eg,ep,ev,re,r,rp,0)) then
Duel.ClearTargetCard()
e:SetProperty(te:GetProperty())
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
if tc:GetType()==TYPE_SPELL then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
if not (tc:IsType(TYPE_FIELD+TYPE_CONTINUOUS+TYPE_EQUIP)
or tc:IsHasEffect(EFFECT_REMAIN_FIELD)) then
tc:CancelToGrave(false)
end
tc:CreateEffectRelation(te)
te:UseCountLimit(tp,1,true)
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
if target then target(te,tep,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and g:GetCount()>0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
end
if operation then operation(te,tep,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(te)
if g and g:GetCount()>0 then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
if cost then cost(te,tp,eg,ep,ev,re,r,rp,1) end
if target then target(te,tp,eg,ep,ev,re,r,rp,1) end
local lg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if lg and lg:GetCount()>0 then
for lc in aux.Next(lg) do
lc:CreateEffectRelation(te)
end
end
if operation then operation(te,tp,eg,ep,ev,re,r,rp) end
Duel.BreakEffect()
Duel.Damage(tp,2000,REASON_EFFECT)
else
Duel.SendtoGrave(tc,REASON_RULE)
end
end
Duel.Damage(tp,2000,REASON_EFFECT)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment