Skip to content
This repository was archived by the owner on Jun 22, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 34 additions & 18 deletions script/c511000922.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,52 @@ function c511000922.initial_effect(c)
c:RegisterEffect(e1)
end
function c511000922.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
return Duel.GetAttacker():IsControler(1-tp)
end
function c511000922.filter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c511000922.filter(c,e,tp,tid)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsReason(REASON_DESTROY) and c:GetTurnID()==tid-1
end
function c511000922.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c511000922.filter(chkc,e,tp) end
local tid=Duel.GetTurnCount()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c511000922.filter(chkc,e,tp,tid) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c511000922.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
and Duel.IsExistingTarget(c511000922.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,tid) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c511000922.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local g=Duel.SelectTarget(tp,c511000922.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,tid)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c511000922.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetOperation(c511000922.desop)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e3:SetCountLimit(1)
tc:RegisterEffect(e3)
Duel.SpecialSummonComplete()
local fid=c:GetFieldID()
if tc and tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local a=Duel.GetAttacker()
if a:IsRelateToBattle() then
Duel.CalculateDamage(a,tc)
end
tc:RegisterFlagEffect(51100922,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,fid)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCountLimit(1)
e2:SetLabel(fid)
e2:SetLabelObject(tc)
e2:SetCondition(c511000922.descon)
e2:SetOperation(c511000922.desop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function c511000922.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return tc:GetFlagEffectLabel(51100922)==e:GetLabel()
end
function c511000922.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
Duel.Hint(HINT_CARD,0,511000922)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end

2 changes: 1 addition & 1 deletion script/c511002016.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function c511002016.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c511002016.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c511002016.damval(e,re,val,r,rp,rc)
if re and bit.band(r,REASON_EFFECT)~=0 then return 0
if bit.band(r,REASON_EFFECT)~=0 and rp~=e:GetOwnerPlayer() then return 0
else return val end
end
function c511002016.sdcon(e)
Expand Down
2 changes: 1 addition & 1 deletion script/c511009383.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ end
function c511009383.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c511009383.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and e:GetHandler():IsReleasableByEffect()
and Duel.IsExistingMatchingCard(c511009383.tfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c511009383.tfilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingTarget(c511009383.filter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c511009383.filter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Expand Down
230 changes: 100 additions & 130 deletions script/c511010107.lua
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
--No.107 銀河眼の時空竜 (Anime)
--fixed and cleaned up by MLD
function c511010107.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,8,2)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetLabel(0)
e1:SetCondition(c511010107.regcon)
e1:SetOperation(c511010107.regop)
c:RegisterEffect(e1)
--
--negate opponent's turn
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetDescription(aux.Stringid(511010107,0))
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetCondition(c511010107.regcon)
e2:SetOperation(c511010107.regop)
e2:SetLabelObject(e1)
e2:SetCountLimit(1)
e2:SetCondition(c511010107.negcono)
e2:SetCost(c511010107.negcost)
e2:SetTarget(c511010107.negtg)
e2:SetOperation(c511010107.negop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE)
e3:SetDescription(aux.Stringid(511010107,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0x1c0+TIMING_BATTLE_PHASE+TIMING_BATTLE_END,0x1c0+TIMING_BATTLE_PHASE+TIMING_BATTLE_END)
e3:SetCountLimit(1)
e3:SetCondition(c511010107.negcon)
e3:SetCondition(c511010107.negconp)
e3:SetCost(c511010107.negcost)
e3:SetTarget(c511010107.negtg)
e3:SetOperation(c511010107.negop)
e3:SetLabelObject(e1)
c:RegisterEffect(e3)
--reset
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_ADJUST)
e5:SetCountLimit(1)
e5:SetRange(LOCATION_MZONE)
e5:SetOperation(c511010107.reset)
e5:SetLabelObject(e1)
c:RegisterEffect(e5)
--battle indestructable
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
Expand All @@ -56,140 +54,112 @@ function c511010107.initial_effect(c)
ge2:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
ge2:SetOperation(c511010107.numchk)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_ATTACK_DISABLED)
ge3:SetOperation(c511010107.check)
Duel.RegisterEffect(ge3,0)
end
end
c511010107.xyz_number=107
function c511010107.check(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local cn=tc:GetFlagEffectLabel(511010107)
if cn then
tc:SetFlagEffectLabel(511010107,cn+1)
else
tc:RegisterFlagEffect(511010107,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,1)
end
function c511010107.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
end
function c511010107.filter1(c)
local cfn=c:GetFlagEffectLabel(511010107)
local cxm=c:GetEffectCount(EFFECT_EXTRA_ATTACK_MONSTER)
local cxa=c:GetEffectCount(EFFECT_EXTRA_ATTACK)
if (cfn and cfn~=0) and (cxa and cxa>0) and (cxm and cxm>0) then
return c:IsFaceup() and (c:GetAttackAnnouncedCount()==0 or c:GetAttackAnnouncedCount()~=c:GetBattledGroupCount()+cfn) and Duel.GetTurnPlayer()==c:GetControler() and (c:GetEffectCount(EFFECT_CANNOT_ATTACK)==0 and c:GetEffectCount(EFFECT_CANNOT_ATTACK_ANNOUNCE)==0) and (c:IsAttackPos() or c:GetEffectCount(EFFECT_DEFENCE_ATTACK)==1) and c:GetAttackAnnouncedCount()<=math.ceil(cxa+cxm)
elseif (cfn and cfn~=0) and (cxa and cxa>0) and not cxm then
return c:IsFaceup() and (c:GetAttackAnnouncedCount()==0 or c:GetAttackAnnouncedCount()~=c:GetBattledGroupCount()+cfn) and Duel.GetTurnPlayer()==c:GetControler() and (c:GetEffectCount(EFFECT_CANNOT_ATTACK)==0 and c:GetEffectCount(EFFECT_CANNOT_ATTACK_ANNOUNCE)==0) and (c:IsAttackPos() or c:GetEffectCount(EFFECT_DEFENCE_ATTACK)==1) and (c:GetEffectCount(EFFECT_EXTRA_ATTACK_MONSTER)==0 and c:GetAttackAnnouncedCount()<=cxa)
elseif (cfn and cfn~=0) and (cxm and cxm>0) and not cxa then
return c:IsFaceup() and (c:GetAttackAnnouncedCount()==0 or c:GetAttackAnnouncedCount()~=c:GetBattledGroupCount()+cfn) and Duel.GetTurnPlayer()==c:GetControler() and (c:GetEffectCount(EFFECT_CANNOT_ATTACK)==0 and c:GetEffectCount(EFFECT_CANNOT_ATTACK_ANNOUNCE)==0) and (c:IsAttackPos() or c:GetEffectCount(EFFECT_DEFENCE_ATTACK)==1) and (c:GetEffectCount(EFFECT_EXTRA_ATTACK)==0 and c:GetAttackAnnouncedCount()<=cxm)
elseif (cfn and cfn~=0) and (not cxa and not cxm) then
return c:IsFaceup() and (c:GetAttackAnnouncedCount()==0 or c:GetAttackAnnouncedCount()~=c:GetBattledGroupCount()+cfn) and Duel.GetTurnPlayer()==c:GetControler() and (c:GetEffectCount(EFFECT_CANNOT_ATTACK)==0 and c:GetEffectCount(EFFECT_CANNOT_ATTACK_ANNOUNCE)==0) and (c:IsAttackPos() or c:GetEffectCount(EFFECT_DEFENCE_ATTACK)==1) and (c:GetEffectCount(EFFECT_EXTRA_ATTACK)==0 and c:GetEffectCount(EFFECT_EXTRA_ATTACK_MONSTER)==0)
elseif (cxa and cxa>0) and (cxm and cxm>0) and not cfn then
return c:IsFaceup() and (c:GetAttackAnnouncedCount()==0 or c:GetAttackAnnouncedCount()~=c:GetBattledGroupCount()) and Duel.GetTurnPlayer()==c:GetControler() and (c:GetEffectCount(EFFECT_CANNOT_ATTACK)==0 and c:GetEffectCount(EFFECT_CANNOT_ATTACK_ANNOUNCE)==0) and (c:IsAttackPos() or c:GetEffectCount(EFFECT_DEFENCE_ATTACK)==1) and c:GetAttackAnnouncedCount()<=math.ceil(cxa+cxm)
elseif (cxa and cxa>0) and (not cfn and not cxm) then
return c:IsFaceup() and (c:GetAttackAnnouncedCount()==0 or c:GetAttackAnnouncedCount()~=c:GetBattledGroupCount()) and Duel.GetTurnPlayer()==c:GetControler() and (c:GetEffectCount(EFFECT_CANNOT_ATTACK)==0 and c:GetEffectCount(EFFECT_CANNOT_ATTACK_ANNOUNCE)==0) and (c:IsAttackPos() or c:GetEffectCount(EFFECT_DEFENCE_ATTACK)==1) and (c:GetEffectCount(EFFECT_EXTRA_ATTACK_MONSTER)==0 and c:GetAttackAnnouncedCount()<=cxa)
elseif (cxm and cxm>0) and (not cfn and not cxa) then
return c:IsFaceup() and (c:GetAttackAnnouncedCount()==0 or c:GetAttackAnnouncedCount()~=c:GetBattledGroupCount()) and Duel.GetTurnPlayer()==c:GetControler() and (c:GetEffectCount(EFFECT_CANNOT_ATTACK)==0 and c:GetEffectCount(EFFECT_CANNOT_ATTACK_ANNOUNCE)==0) and (c:IsAttackPos() or c:GetEffectCount(EFFECT_DEFENCE_ATTACK)==1) and (c:GetEffectCount(EFFECT_EXTRA_ATTACK)==0 and c:GetAttackAnnouncedCount()<=cxm)
else
return c:IsFaceup() and (c:GetAttackAnnouncedCount()==0 or c:GetAttackAnnouncedCount()~=c:GetBattledGroupCount()) and Duel.GetTurnPlayer()==c:GetControler() and (c:GetEffectCount(EFFECT_CANNOT_ATTACK)==0 and c:GetEffectCount(EFFECT_CANNOT_ATTACK_ANNOUNCE)==0) and (c:IsAttackPos() or c:GetEffectCount(EFFECT_DEFENCE_ATTACK)==1) and (c:GetEffectCount(EFFECT_EXTRA_ATTACK)==0 and c:GetEffectCount(EFFECT_EXTRA_ATTACK_MONSTER)==0)
end
function c511010107.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(511010107,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE,0,0)
end
function c511010107.negcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c511010107.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()~=0 then
return Duel.GetCurrentPhase()==PHASE_BATTLE
else
return (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
end
function c511010107.negcono(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c511010107.cfilter(c)
return c:GetFlagEffect(511010108)>0
end
function c511010107.negconp(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE and Duel.GetTurnPlayer()==tp
and not Duel.GetAttacker() and Duel.GetCurrentChain()==0
and not Duel.IsExistingMatchingCard(c511010107.cfilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function c511010107.ftarget(e,c)
return c:GetFlagEffect(511010108)==0
end
function c511010107.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
if Duel.GetTurnPlayer()==tp then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c511010107.ftarget)
e1:SetLabel(e:GetHandler():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e1,tp)
end
end
function c511010107.filter2(c)
return c:IsFaceup() and (c:GetAttack()~=c:GetBaseAttack() or c:GetDefense()~=c:GetBaseDefense())
function c511010107.disfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled()
end
function c511010107.filter3(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
function c511010107.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c511010107.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler())
or e:GetHandler():GetFlagEffect(511010107)>0 end
end
function c511010107.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c511010107.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,c)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
g=Duel.GetMatchingGroup(c511010107.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,c)
tc=g:GetFirst()
while tc do
if tc:GetAttack()~=tc:GetBaseAttack() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetBaseAttack())
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
if tc:GetDefense()~=tc:GetBaseDefense() then
local res=false
local g=Duel.GetMatchingGroup(c511010107.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
e1:SetValue(tc:GetBaseDefense())
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(tc:GetBaseAttack())
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
e4:SetValue(tc:GetBaseDefense())
e4:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e4)
tc=g:GetNext()
end
tc=g:GetNext()
res=true
end
if c:IsFaceup() and c:IsRelateToEffect(e) then
local ct=e:GetLabelObject():GetLabel()
local atk=math.ceil(ct*1000)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
if Duel.GetTurnPlayer()==tp then
local val=math.max(c:GetEffectCount(EFFECT_EXTRA_ATTACK)+1,c:GetAttackAnnouncedCount())
if c:GetEffectCount(EFFECT_EXTRA_ATTACK_MONSTER)>0 then
local val=math.max(c:GetEffectCount(EFFECT_EXTRA_ATTACK)+c:GetEffectCount(EFFECT_EXTRA_ATTACK_MONSTER)+1,c:GetAttackAnnouncedCount())
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(val)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local ct=c:GetFlagEffect(511010107)
if ct>0 then
Duel.BreakEffect()
local atk=ct*1000
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
res=true
end
if Duel.GetTurnPlayer()==tp and res then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(c:GetAttackAnnouncedCount())
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
c:RegisterFlagEffect(511010108,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE+PHASE_BATTLE,0,0)
end
end
function c511010107.regcon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
end

function c511010107.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(ct+1)
end
function c511010107.numchk(e,tp,eg,ep,ev,re,r,rp)
Duel.CreateToken(tp,88177324)
Duel.CreateToken(1-tp,88177324)
end
function c511010107.indes(e,c)
return not c:IsSetCard(0x48)
end
function c511010107.reset(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetLabelObject():SetLabel(0)
return not c:IsSetCard(0x48)
end