Commit b6cd0b77 authored by VanillaSalt's avatar VanillaSalt

fix

parent c1194f8b
...@@ -16,6 +16,7 @@ function c1003840.initial_effect(c) ...@@ -16,6 +16,7 @@ function c1003840.initial_effect(c)
e2:SetTarget(c1003840.sptg) e2:SetTarget(c1003840.sptg)
e2:SetOperation(c1003840.spop) e2:SetOperation(c1003840.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--todeck
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK) e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
......
...@@ -30,7 +30,8 @@ function c61156777.initial_effect(c) ...@@ -30,7 +30,8 @@ function c61156777.initial_effect(c)
end end
function c61156777.ctcon(e,tp,eg,ep,ev,re,r,rp) function c61156777.ctcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsRelateToBattle() and c:GetBattleTarget():IsType(TYPE_MONSTER) local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER) and bc:IsLocation(LOCATION_GRAVE)
end end
function c61156777.ctop(e,tp,eg,ep,ev,re,r,rp) function c61156777.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -72,7 +72,7 @@ function c74892653.sccon(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,7 +72,7 @@ function c74892653.sccon(e,tp,eg,ep,ev,re,r,rp)
and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousPosition(POS_FACEUP)
end end
function c74892653.filter(c,e,tp) function c74892653.filter(c,e,tp)
return c:IsSetCard(0xc1) and c:IsLevelBelow(8) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,true,false) return c:IsSetCard(0xc1) and c:IsLevelBelow(8) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end end
function c74892653.sctg(e,tp,eg,ep,ev,re,r,rp,chk) function c74892653.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -85,7 +85,7 @@ function c74892653.scop(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,7 +85,7 @@ function c74892653.scop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c74892653.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c74892653.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
...@@ -5,93 +5,92 @@ function c8529136.initial_effect(c) ...@@ -5,93 +5,92 @@ function c8529136.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c8529136.condition)
e1:SetTarget(c8529136.target) e1:SetTarget(c8529136.target)
e1:SetOperation(c8529136.activate) e1:SetOperation(c8529136.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c8529136.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()<PHASE_MAIN2
end
function c8529136.filter(c) function c8529136.filter(c)
return c:IsFaceup() and c:IsCode(60800381) and c:GetFlagEffect(8529136)==0 return c:IsFaceup() and c:IsCode(60800381) and c:GetFlagEffect(8529136)==0
end end
function c8529136.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c8529136.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c8529136.filter(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c8529136.filter(chkc) end
if chk==0 then return bit.band(Duel.GetCurrentPhase(),0xc0)==0 if chk==0 then return Duel.IsExistingTarget(c8529136.filter,tp,LOCATION_MZONE,0,1,nil) end
and Duel.IsExistingTarget(c8529136.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c8529136.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,c8529136.filter,tp,LOCATION_MZONE,0,1,1,nil)
end end
function c8529136.activate(e,tp,eg,ep,ev,re,r,rp) function c8529136.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:GetFlagEffect(8529136)==0 then if tc:IsRelateToEffect(e) then
tc:RegisterFlagEffect(8529136,RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END,0,1) if tc:GetFlagEffect(8529136)==0 then
local e1=Effect.CreateEffect(c) tc:RegisterFlagEffect(8529136,RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END,0,1)
e1:SetType(EFFECT_TYPE_FIELD) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1) e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c8529136.actcon) e1:SetTargetRange(0,1)
e1:SetValue(c8529136.aclimit) e1:SetCondition(c8529136.actcon)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetValue(c8529136.aclimit)
tc:RegisterEffect(e1) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
local e2=Effect.CreateEffect(c) tc:RegisterEffect(e1)
e2:SetType(EFFECT_TYPE_SINGLE) local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_PIERCE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCondition(c8529136.con) e2:SetCode(EFFECT_PIERCE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e2:SetCondition(c8529136.effcon)
tc:RegisterEffect(e2) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
local e3=Effect.CreateEffect(c) tc:RegisterEffect(e2)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) local e3=Effect.CreateEffect(c)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCondition(c8529136.damcon) e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetOperation(c8529136.damop) e3:SetCondition(c8529136.damcon)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e3:SetOperation(c8529136.damop)
tc:RegisterEffect(e3) e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
local e4=Effect.CreateEffect(c) tc:RegisterEffect(e3)
e4:SetType(EFFECT_TYPE_SINGLE) local e4=Effect.CreateEffect(c)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCondition(c8529136.con) e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetValue(1) e4:SetCondition(c8529136.effcon)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e4:SetValue(1)
tc:RegisterEffect(e4) e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
end
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_DAMAGE_STEP_END) e5:SetCode(EVENT_DAMAGE_STEP_END)
e5:SetCondition(c8529136.descon) e5:SetCondition(c8529136.descon)
e5:SetTarget(c8529136.destg)
e5:SetOperation(c8529136.desop) e5:SetOperation(c8529136.desop)
e5:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e5:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e5) tc:RegisterEffect(e5)
end end
end end
function c8529136.actcon(e) function c8529136.actcon(e)
return e:GetHandler():GetBattleTarget()~=nil and e:GetHandler():GetControler()==e:GetOwnerPlayer() local c=e:GetHandler()
return (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c) and c:GetBattleTarget()~=nil
and e:GetOwnerPlayer()==e:GetHandlerPlayer()
end end
function c8529136.aclimit(e,re,tp) function c8529136.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e) return not re:GetHandler():IsImmuneToEffect(e)
end end
function c8529136.con(e) function c8529136.effcon(e)
return e:GetHandler():GetControler()==e:GetOwnerPlayer() return e:GetOwnerPlayer()==e:GetHandlerPlayer()
end end
function c8529136.damcon(e,tp,eg,ep,ev,re,r,rp) function c8529136.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetBattleTarget()~=nil and e:GetHandler():GetControler()==e:GetOwnerPlayer() return ep~=tp and e:GetHandler():GetBattleTarget()~=nil and e:GetOwnerPlayer()==tp
end end
function c8529136.damop(e,tp,eg,ep,ev,re,r,rp) function c8529136.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2) Duel.ChangeBattleDamage(ep,ev*2)
end end
function c8529136.descon(e,tp,eg,ep,ev,re,r,rp) function c8529136.descon(e,tp,eg,ep,ev,re,r,rp)
local d=e:GetHandler():GetBattleTarget()
return d and d:IsRelateToBattle() and e:GetHandler():GetControler()==e:GetOwnerPlayer()
end
function c8529136.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget() local tc=e:GetHandler():GetBattleTarget()
if chk==0 then return tc:IsDestructable() end return tc and tc:IsRelateToBattle() and e:GetOwnerPlayer()==tp
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end end
function c8529136.desop(e,tp,eg,ep,ev,re,r,rp) function c8529136.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget() local tc=e:GetHandler():GetBattleTarget()
if tc:IsRelateToBattle() then Duel.Hint(HINT_CARD,0,8529136)
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end
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