Commit 51e481b3 authored by VanillaSalt's avatar VanillaSalt

fix

parent 0b61e78b
......@@ -35,7 +35,6 @@ function c12014404.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCountLimit(1)
e1:SetOperation(c12014404.atkop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
......@@ -45,6 +44,7 @@ function c12014404.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc then
if c:GetFlagEffect(12014404)~=0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -59,5 +59,6 @@ function c12014404.atkop(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(-500)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
bc:RegisterEffect(e2)
c:RegisterFlagEffect(12014404,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE,0,1)
end
end
......@@ -14,7 +14,7 @@ function c12079734.filter1(c,ec)
return c:IsType(TYPE_UNION) and c:CheckEquipTarget(ec)
end
function c12079734.filter2(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
end
function c12079734.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......
......@@ -4,7 +4,7 @@ function c19163116.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19163116,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c19163116.spcon)
......
......@@ -14,31 +14,50 @@ function c19327348.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsControlerCanBeChanged()
end
function c19327348.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and c19327348.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c19327348.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c19327348.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
if not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c19327348.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
end
end
function c19327348.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsControlerCanBeChanged() then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c19327348.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetValue(tp)
e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c19327348.con)
e1:SetCondition(c19327348.ctcon)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c19327348.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end
end
function c19327348.con(e)
function c19327348.ctcon(e)
if e:GetLabel()==1 then return true end
local c=e:GetOwner()
local h=e:GetHandler()
if not h:IsAttribute(ATTRIBUTE_DARK) then return false end
return not h:IsRelateToCard(c) or (not c:IsDisabled() and c:IsRelateToCard(h))
return h:IsAttribute(ATTRIBUTE_DARK) and not c:IsDisabled() and c:IsRelateToCard(h)
end
function c19327348.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_DARK) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -45,9 +45,8 @@ function c23454876.damcon(e,tp,eg,ep,ev,re,r,rp)
and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,51960178)
end
function c23454876.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23454876)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,23454876,RESET_PHASE+PHASE_END,0,1)
end
function c23454876.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -14,6 +14,7 @@ function c25290459.costfilter(c,e,tp)
if not c:IsSetCard(0x41) or not c:IsAbleToGraveAsCost() then return false end
local code=c:GetCode()
local class=_G["c"..code]
if class==nil or class.lvupcount==nil then return false end
return Duel.IsExistingMatchingCard(c25290459.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,class,e,tp)
end
function c25290459.spfilter(c,class,e,tp)
......
......@@ -66,5 +66,4 @@ function c25341652.repop(e,tp,eg,ep,ev,re,r,rp)
tc:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
tc=g:GetNext()
end
g:DeleteGroup()
end
......@@ -5,7 +5,8 @@ function c27769400.initial_effect(c)
e1:SetDescription(aux.Stringid(27769400,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCode(27769400)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c27769400.spcon)
e1:SetTarget(c27769400.sptg)
......@@ -26,25 +27,33 @@ function c27769400.initial_effect(c)
c27769400[0]=Group.CreateGroup()
c27769400[0]:KeepAlive()
c27769400[1]=0
c27769400[2]=false
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_BATTLE)
ge1:SetOperation(c27769400.checkop1)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.GlobalEffect()
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_BATTLE_DESTROYED)
ge2:SetOperation(c27769400.checkop2)
Duel.RegisterEffect(ge2,0)
end
end
function c27769400.checkop1(e,tp,eg,ep,ev,re,r,rp)
c27769400[0]:Clear()
c27769400[0]:Merge(Duel.GetFieldGroup(Duel.GetTurnPlayer(),0,LOCATION_MZONE))
c27769400[1]=c27769400[0]:GetCount()
c27769400[2]=false
end
function c27769400.spcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp or c27769400[1]<2 or c27769400[0]:GetCount()==0 then return false end
function c27769400.checkop2(e,tp,eg,ep,ev,re,r,rp)
if c27769400[1]<2 or c27769400[0]:GetCount()==0 then return end
local g=eg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
c27769400[0]:Sub(g)
return c27769400[0]:GetCount()==0
if c27769400[0]:GetCount()==0 then
Duel.RaiseEvent(e:GetHandler(),27769400,e,0,0,0,0)
end
end
function c27769400.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c27769400.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -58,7 +58,8 @@ function c303660.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c303660.etarget(e,c)
return c:IsType(TYPE_TRAP) and c:GetControler()==e:GetHandler():GetEquipTarget():GetControler()
local ec=e:GetHandler():GetEquipTarget()
return c:IsType(TYPE_TRAP) and ec and c:GetControler()==ec:GetControler()
end
function c303660.efilter(e,re)
return re:GetHandler()==e:GetHandler():GetEquipTarget()
......
......@@ -26,7 +26,7 @@ function c30608985.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c30608985.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc then
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -71,6 +71,8 @@ function c32542011.activate(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
Duel.BreakEffect()
Duel.DiscardHand(tp,nil,1,1,REASON_DISCARD+REASON_EFFECT)
end
end
end
......@@ -14,31 +14,50 @@ function c37744402.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WIND) and c:IsControlerCanBeChanged()
end
function c37744402.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and c37744402.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c37744402.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c37744402.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
if not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c37744402.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
end
end
function c37744402.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsControlerCanBeChanged() then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c37744402.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetValue(tp)
e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c37744402.con)
e1:SetCondition(c37744402.ctcon)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c37744402.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end
end
function c37744402.con(e)
function c37744402.ctcon(e)
if e:GetLabel()==1 then return true end
local c=e:GetOwner()
local h=e:GetHandler()
if not h:IsAttribute(ATTRIBUTE_WIND) then return false end
return not h:IsRelateToCard(c) or (not c:IsDisabled() and c:IsRelateToCard(h))
return h:IsAttribute(ATTRIBUTE_WIND) and not c:IsDisabled() and c:IsRelateToCard(h)
end
function c37744402.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_WIND) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -14,31 +14,50 @@ function c37970940.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsControlerCanBeChanged()
end
function c37970940.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and c37970940.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c37970940.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c37970940.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
if not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c37970940.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
end
end
function c37970940.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsControlerCanBeChanged() then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c37970940.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetValue(tp)
e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c37970940.con)
e1:SetCondition(c37970940.ctcon)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c37970940.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end
end
function c37970940.con(e)
function c37970940.ctcon(e)
if e:GetLabel()==1 then return true end
local c=e:GetOwner()
local h=e:GetHandler()
if not h:IsAttribute(ATTRIBUTE_EARTH) then return false end
return not h:IsRelateToCard(c) or (not c:IsDisabled() and c:IsRelateToCard(h))
return h:IsAttribute(ATTRIBUTE_EARTH) and not c:IsDisabled() and c:IsRelateToCard(h)
end
function c37970940.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_EARTH) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -3,7 +3,7 @@ function c45425051.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetCondition(c45425051.con)
e1:SetTarget(c45425051.tg)
......
......@@ -21,27 +21,24 @@ function c46668237.initial_effect(c)
e2:SetOperation(c46668237.operation)
c:RegisterEffect(e2)
end
function c46668237.filter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsControler(tp) and c:IsRace(RACE_BEAST)
function c46668237.filter(c)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_BEAST)
end
function c46668237.adjop(e,tp,eg,ep,ev,re,r,rp)
local pg=e:GetLabelObject()
if pg then pg:DeleteGroup() end
local dg=eg:Filter(c46668237.filter,nil,tp)
e:SetLabelObject(dg)
dg:KeepAlive()
local g=eg:Filter(c46668237.filter,nil)
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(46668237)==0 then
tc:RegisterFlagEffect(46668237,RESET_EVENT+0x17a0000+RESET_PHASE+PHASE_END,0,1)
end
tc=g:GetNext()
end
end
function c46668237.cfilter(c,dg)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEAST) and dg:IsContains(c)
function c46668237.cfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEAST) and c:GetPreviousControler()==tp and c:GetFlagEffect(46668237)~=0
end
function c46668237.condition(e,tp,eg,ep,ev,re,r,rp)
local de=e:GetLabelObject()
local dg=de:GetLabelObject()
if not dg then return false end
local res=eg:IsExists(c46668237.cfilter,1,nil,dg)
dg:DeleteGroup()
de:SetLabelObject(nil)
return res
return eg:IsExists(c46668237.cfilter,1,nil,tp)
end
function c46668237.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
......
......@@ -91,6 +91,7 @@ function c47297616.opspsum(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(dg,REASON_EFFECT)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -52,7 +52,7 @@ function c59593925.desop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c59593925.sdesop(e,tp,eg,ep,ev,re,r,rp)
if tp==Duel.GetTurnPlayer() then return end
if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
......
......@@ -24,6 +24,7 @@ function c65303664.filter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsControler(tp) and c:IsRace(RACE_BEAST)
end
function c65303664.adjop(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_BATTLE)==0 then return end
local pg=e:GetLabelObject()
if pg then pg:DeleteGroup() end
local dg=eg:Filter(c65303664.filter,nil,tp)
......@@ -31,7 +32,7 @@ function c65303664.adjop(e,tp,eg,ep,ev,re,r,rp)
dg:KeepAlive()
end
function c65303664.cfilter(c,dg)
return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEAST) and dg:IsContains(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEAST) and c:IsReason(REASON_BATTLE) and dg:IsContains(c)
end
function c65303664.condition(e,tp,eg,ep,ev,re,r,rp)
local de=e:GetLabelObject()
......
......@@ -3,10 +3,10 @@ function c66970002.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,5),3)
c:EnableReviveLimit()
--damage
--todeck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66970002,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_DESTROYED)
......
......@@ -27,7 +27,7 @@ function c72278479.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c72278479.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
......
......@@ -16,29 +16,48 @@ end
function c73318863.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c73318863.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c73318863.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
if not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c73318863.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
end
end
function c73318863.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsControlerCanBeChanged() then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c73318863.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetValue(tp)
e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c73318863.con)
e1:SetCondition(c73318863.ctcon)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c73318863.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end
end
function c73318863.con(e)
function c73318863.ctcon(e)
if e:GetLabel()==1 then return true end
local c=e:GetOwner()
local h=e:GetHandler()
if not h:IsAttribute(ATTRIBUTE_LIGHT) then return false end
return not h:IsRelateToCard(c) or (not c:IsDisabled() and c:IsRelateToCard(h))
return h:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsDisabled() and c:IsRelateToCard(h)
end
function c73318863.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -16,29 +16,48 @@ end
function c74364659.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c74364659.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c74364659.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
if not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c74364659.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
end
end
function c74364659.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsControlerCanBeChanged() then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c74364659.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetValue(tp)
e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c74364659.con)
e1:SetCondition(c74364659.ctcon)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c74364659.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end
end
function c74364659.con(e)
function c74364659.ctcon(e)
if e:GetLabel()==1 then return true end
local c=e:GetOwner()
local h=e:GetHandler()
if not h:IsAttribute(ATTRIBUTE_WATER) then return false end
return not h:IsRelateToCard(c) or (not c:IsDisabled() and c:IsRelateToCard(h))
return h:IsAttribute(ATTRIBUTE_WATER) and not c:IsDisabled() and c:IsRelateToCard(h)
end
function c74364659.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_WATER) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -18,7 +18,7 @@ end
function c75198893.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(1-tp) and c75198893.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c75198893.filter,tp,0,LOCATION_REMOVED,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c75198893.filter,tp,0,LOCATION_REMOVED,1,1,nil)
end
function c75198893.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -14,31 +14,50 @@ function c759393.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsControlerCanBeChanged()
end
function c759393.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and c759393.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c759393.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c759393.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
if not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c759393.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
end
end
function c759393.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsControlerCanBeChanged() then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c759393.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetValue(tp)
e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c759393.con)
e1:SetCondition(c759393.ctcon)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c759393.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end
end
function c759393.con(e)
function c759393.ctcon(e)
if e:GetLabel()==1 then return true end
local c=e:GetOwner()
local h=e:GetHandler()
if not h:IsAttribute(ATTRIBUTE_FIRE) then return false end
return not h:IsRelateToCard(c) or (not c:IsDisabled() and c:IsRelateToCard(h))
return h:IsAttribute(ATTRIBUTE_FIRE) and not c:IsDisabled() and c:IsRelateToCard(h)
end
function c759393.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_FIRE) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -37,6 +37,7 @@ function c770365.filter(c)
end
function c770365.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5)
local ct=g:FilterCount(c770365.filter,nil)
......@@ -46,6 +47,7 @@ function c770365.operation(e,tp,eg,ep,ev,re,r,rp)
local dg=sg:Select(tp,1,ct,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
Duel.BreakEffect()
end
Duel.SortDecktop(tp,tp,5)
end
......@@ -66,6 +66,14 @@ function c84117021.activate(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c84117021.sumcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c84117021.filter,1,nil)
......
......@@ -16,6 +16,7 @@ function c86827882.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c86827882.filter(c)
if c==Duel.GetAttacker() and Duel.GetAttackTarget()==nil then return false end
return c:IsFaceup() and (c:IsSetCard(0x42) or c:IsSetCard(0x4b))
end
function c86827882.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -17,11 +17,11 @@ function c92035412.initial_effect(c)
e2:SetOperation(c92035412.spop)
c:RegisterEffect(e2)
end
function c92035412.cfilter(c)
return c:IsSetCard(0x30) and c:IsType(TYPE_EQUIP) and c:IsFaceup()
function c92035412.cfilter(c,tp)
return c:IsSetCard(0x30) and c:IsType(TYPE_EQUIP) and c:IsFaceup() and c:IsControler(tp)
end
function c92035412.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(c92035412.cfilter,nil)
local ct=eg:FilterCount(c92035412.cfilter,nil,tp)
e:SetLabel(ct)
return ct>0
end
......
......@@ -37,7 +37,7 @@ end
function c92736188.adtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c92736188.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c92736188.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c92736188.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c92736188.adop(e,tp,eg,ep,ev,re,r,rp)
......
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