Commit 6a4cc7a2 authored by VanillaSalt's avatar VanillaSalt

fix

parent f96f3df4
...@@ -5,16 +5,15 @@ function c17988746.initial_effect(c) ...@@ -5,16 +5,15 @@ function c17988746.initial_effect(c)
e1:SetDescription(aux.Stringid(17988746,0)) e1:SetDescription(aux.Stringid(17988746,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_DAMAGE) e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c17988746.condition) e1:SetCondition(c17988746.condition)
e1:SetTarget(c17988746.target) e1:SetTarget(c17988746.target)
e1:SetOperation(c17988746.operation) e1:SetOperation(c17988746.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c17988746.condition(e,tp,eg,ep,ev,re,r,rp) function c17988746.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and tp~=rp and bit.band(r,REASON_BATTLE)~=0 and Duel.GetAttacker():IsControler(1-tp) return ep==tp and tp~=rp and Duel.GetAttacker():IsControler(1-tp)
end end
function c17988746.target(e,tp,eg,ep,ev,re,r,rp,chk) function c17988746.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -42,7 +42,7 @@ end ...@@ -42,7 +42,7 @@ end
function c38522377.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c38522377.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c38522377.spfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c38522377.spfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c38522377.spfilter,tp,LOCATION_MZONE,0,1,5,e:GetHandler()) local g=Duel.SelectTarget(tp,c38522377.spfilter,tp,LOCATION_MZONE,0,1,7,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end end
function c38522377.atkfilter(c,e) function c38522377.atkfilter(c,e)
......
...@@ -23,7 +23,7 @@ function c54497620.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -23,7 +23,7 @@ function c54497620.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c54497620.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c54497620.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c54497620.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c54497620.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c54497620.filter,tp,LOCATION_MZONE,0,1,5,nil) local g=Duel.SelectTarget(tp,c54497620.filter,tp,LOCATION_MZONE,0,1,7,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end end
function c54497620.tfilter(c,e) function c54497620.tfilter(c,e)
......
...@@ -24,7 +24,7 @@ function c54591086.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -24,7 +24,7 @@ function c54591086.target(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(0) e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c54591086.rfilter,1,nil) return Duel.CheckReleaseGroup(tp,c54591086.rfilter,1,nil)
end end
local rg=Duel.SelectReleaseGroup(tp,c54591086.rfilter,1,5,nil) local rg=Duel.SelectReleaseGroup(tp,c54591086.rfilter,1,7,nil)
e:SetLabel(rg:GetCount()) e:SetLabel(rg:GetCount())
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
......
...@@ -44,26 +44,19 @@ function c58383100.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -44,26 +44,19 @@ function c58383100.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end end
function c58383100.filter(c,ft) function c58383100.filter(c,tp)
return c:IsAbleToGrave() and (ft>0 or c:GetSequence()<5) return c:IsAbleToGrave() and Duel.GetMZoneCount(tp,c)>0
end end
function c58383100.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c58383100.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return Duel.IsExistingMatchingCard(c58383100.filter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler(),tp) end
local loc=LOCATION_HAND+LOCATION_ONFIELD
if ft==0 then loc=LOCATION_MZONE end
if chk==0 then return ft>-1 and Duel.IsExistingMatchingCard(c58383100.filter,tp,loc,0,1,e:GetHandler(),ft) end
local ec=eg:GetFirst() local ec=eg:GetFirst()
Duel.SetTargetCard(ec) Duel.SetTargetCard(ec)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,loc) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,ec,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,ec,1,0,0)
end end
function c58383100.spop(e,tp,eg,ep,ev,re,r,rp) function c58383100.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return end
local loc=LOCATION_HAND+LOCATION_ONFIELD
if ft==0 then loc=LOCATION_MZONE end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,c58383100.filter,tp,loc,0,1,1,nil,ft) local tg=Duel.SelectMatchingCard(tp,c58383100.filter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,tp)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local ec=Duel.GetFirstTarget() local ec=Duel.GetFirstTarget()
......
...@@ -36,7 +36,7 @@ function c64631466.initial_effect(c) ...@@ -36,7 +36,7 @@ function c64631466.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_AVAILABLE_BD) e4:SetProperty(EFFECT_FLAG_AVAILABLE_BD)
e4:SetCode(EVENT_DAMAGE) e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c64631466.damcon) e4:SetCondition(c64631466.damcon)
e4:SetOperation(c64631466.damop) e4:SetOperation(c64631466.damop)
...@@ -44,7 +44,6 @@ function c64631466.initial_effect(c) ...@@ -44,7 +44,6 @@ function c64631466.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c64631466.eqcon(e,tp,eg,ep,ev,re,r,rp) function c64631466.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=e:GetLabelObject() local ec=e:GetLabelObject()
return ec==nil or ec:GetFlagEffect(64631466)==0 return ec==nil or ec:GetFlagEffect(64631466)==0
end end
...@@ -91,13 +90,13 @@ function c64631466.repval(e,re,r,rp) ...@@ -91,13 +90,13 @@ function c64631466.repval(e,re,r,rp)
end end
function c64631466.damcon(e,tp,eg,ep,ev,re,r,rp) function c64631466.damcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject() local ec=e:GetLabelObject():GetLabelObject()
return ec and ec:GetFlagEffect(64631466)~=0 and ep==tp and bit.band(r,REASON_BATTLE)~=0 return ec and ec:GetFlagEffect(64631466)~=0 and ep==tp
and (Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()) and (Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler())
end end
function c64631466.damop(e,tp,eg,ep,ev,re,r,rp) function c64631466.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,ev,REASON_EFFECT) Duel.Damage(1-tp,ev,REASON_EFFECT)
end end
function c64631466.adcon(e,tp,eg,ep,ev,re,r,rp) function c64631466.adcon(e)
local ec=e:GetLabelObject():GetLabelObject() local ec=e:GetLabelObject():GetLabelObject()
return ec and ec:GetFlagEffect(64631466)~=0 return ec and ec:GetFlagEffect(64631466)~=0
end end
......
...@@ -87,7 +87,7 @@ function c70298454.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,7 +87,7 @@ function c70298454.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c70298454.repval(e,re,r,rp) function c70298454.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0 or bit.band(r,REASON_EFFECT)~=0 return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end end
function c70298454.eqlimit(e,c) function c70298454.eqlimit(e,c)
return e:GetHandler():GetEquipTarget()==c return e:GetHandler():GetEquipTarget()==c
......
...@@ -54,15 +54,19 @@ function c71133680.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,15 +54,19 @@ function c71133680.atkop(e,tp,eg,ep,ev,re,r,rp)
local dc=Duel.SelectMatchingCard(tp,c71133680.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,tc):GetFirst() local dc=Duel.SelectMatchingCard(tp,c71133680.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,tc):GetFirst()
if dc and Duel.Destroy(dc,REASON_EFFECT)~=0 then if dc and Duel.Destroy(dc,REASON_EFFECT)~=0 then
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local atk=dc:GetBaseAttack()
local def=dc:GetBaseDefense()
if atk<0 then atk=0 end
if def<0 then def=0 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(dc:GetBaseAttack()) e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(dc:GetBaseDefense()) e2:SetValue(def)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
end end
end end
......
...@@ -88,7 +88,7 @@ function c77411244.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,7 +88,7 @@ function c77411244.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
end end
function c77411244.repval(e,re,r,rp) function c77411244.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0 or bit.band(r,REASON_EFFECT)~=0 return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end end
function c77411244.efilter(e,te) function c77411244.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:GetOwner()~=e:GetOwner() return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:GetOwner()~=e:GetOwner()
......
...@@ -28,7 +28,7 @@ function c77505534.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,7 +28,7 @@ function c77505534.activate(e,tp,eg,ep,ev,re,r,rp)
if tg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(77505534,0)) then if tg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(77505534,0)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local sg=tg:Select(tp,1,5,nil) local sg=tg:Select(tp,1,7,nil)
Duel.ChangePosition(sg,POS_FACEUP_DEFENSE) Duel.ChangePosition(sg,POS_FACEUP_DEFENSE)
end end
end end
......
...@@ -15,7 +15,7 @@ function c86516889.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -15,7 +15,7 @@ function c86516889.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFacedown() end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFacedown() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,5,nil) local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,7,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end end
function c86516889.filter(c,e) function c86516889.filter(c,e)
......
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