Commit bc43f927 authored by wind2009's avatar wind2009

Fix

parent 10a0905e
...@@ -18,25 +18,18 @@ function s.initial_effect(c) ...@@ -18,25 +18,18 @@ function s.initial_effect(c)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetValue(RACE_PLANT) e2:SetValue(RACE_PLANT)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--destroyed --damage
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetDescription(aux.Stringid(id,1))
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_DESTROYED) e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(s.regcon) e3:SetCountLimit(1,id)
e3:SetOperation(s.regop) e3:SetCondition(s.damcon)
e3:SetTarget(s.damtg)
e3:SetOperation(s.damop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,id)
e4:SetTarget(s.damtg)
e4:SetOperation(s.damop)
c:RegisterEffect(e4)
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsSetCard(0x1123) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x1123) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
...@@ -53,16 +46,16 @@ end ...@@ -53,16 +46,16 @@ end
function s.cfilter(c) function s.cfilter(c)
return c:IsFaceupEx() and c:IsRace(RACE_PLANT) return c:IsFaceupEx() and c:IsRace(RACE_PLANT)
end end
function s.regcon(e,tp,eg,ep,ev,re,r,rp) function s.damcon(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end if not re then return true end
local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
return e:GetHandler():IsReason(REASON_EFFECT) and re:IsActivated() if c:IsReason(REASON_EFFECT) and re:IsActivated()
and (rc:IsRelateToChain(ev) and rc:IsCode(73580471) and (rc:IsRelateToChain(ev) and rc:IsCode(73580471)
or not rc:IsRelateToChain(ev) and rc:GetPreviousCodeOnField()==73580471) or not rc:IsRelateToChain(ev) and rc:GetPreviousCodeOnField()==73580471) then
end c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
function s.regop(e,tp,eg,ep,ev,re,r,rp) end
local c=e:GetHandler() return true
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -12,24 +12,16 @@ function s.initial_effect(c) ...@@ -12,24 +12,16 @@ function s.initial_effect(c)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--destroyed --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetDescription(aux.Stringid(id,1))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED) e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.regcon) e2:SetCondition(s.setcon)
e2:SetOperation(s.regop) e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(s.setcon)
e3:SetTarget(s.settg)
e3:SetOperation(s.setop)
c:RegisterEffect(e3)
end end
function s.thfilter2(c) function s.thfilter2(c)
return c:IsSetCard(0x2d1) and c:IsLevelBelow(4) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x2d1) and c:IsLevelBelow(4) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
...@@ -81,23 +73,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,23 +73,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end
local rc=re:GetHandler()
return e:GetHandler():IsReason(REASON_EFFECT) and re:IsActivated()
and (rc:IsRelateToChain(ev) and rc:IsCode(5318639)
or not rc:IsRelateToChain(ev) and rc:GetPreviousCodeOnField()==5318639)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) return c:IsReason(REASON_EFFECT) and re:GetHandler():IsCode(5318639)
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() and e:GetHandler():GetFlagEffect(id)>0 end if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -12,24 +12,16 @@ function s.initial_effect(c) ...@@ -12,24 +12,16 @@ function s.initial_effect(c)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--destroyed --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetDescription(aux.Stringid(id,1))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED) e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.regcon) e2:SetCondition(s.setcon)
e2:SetOperation(s.regop) e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(s.setcon)
e3:SetTarget(s.settg)
e3:SetOperation(s.setop)
c:RegisterEffect(e3)
end end
function s.tgfilter(c) function s.tgfilter(c)
return c:IsSetCard(0x2d1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() return c:IsSetCard(0x2d1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
...@@ -80,23 +72,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,23 +72,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end
local rc=re:GetHandler()
return e:GetHandler():IsReason(REASON_EFFECT) and re:IsActivated()
and (rc:IsRelateToChain(ev) and rc:IsCode(5318639)
or not rc:IsRelateToChain(ev) and rc:GetPreviousCodeOnField()==5318639)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) return c:IsReason(REASON_EFFECT) and re:GetHandler():IsCode(5318639)
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() and e:GetHandler():GetFlagEffect(id)>0 end if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -13,24 +13,16 @@ function s.initial_effect(c) ...@@ -13,24 +13,16 @@ function s.initial_effect(c)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--destroyed --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetDescription(aux.Stringid(id,1))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED) e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.regcon) e2:SetCondition(s.setcon)
e2:SetOperation(s.regop) e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(s.setcon)
e3:SetTarget(s.settg)
e3:SetOperation(s.setop)
c:RegisterEffect(e3)
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsCode(5318639) and c:IsAbleToHand() return c:IsCode(5318639) and c:IsAbleToHand()
...@@ -93,23 +85,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,23 +85,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end
local rc=re:GetHandler()
return e:GetHandler():IsReason(REASON_EFFECT) and re:IsActivated()
and (rc:IsRelateToChain(ev) and rc:IsCode(5318639)
or not rc:IsRelateToChain(ev) and rc:GetPreviousCodeOnField()==5318639)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) return c:IsReason(REASON_EFFECT) and re:GetHandler():IsCode(5318639)
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() and e:GetHandler():GetFlagEffect(id)>0 end if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -33,24 +33,16 @@ function s.initial_effect(c) ...@@ -33,24 +33,16 @@ function s.initial_effect(c)
e3:SetTarget(s.distg) e3:SetTarget(s.distg)
e3:SetOperation(s.disop) e3:SetOperation(s.disop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--destroyed --set
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetDescription(aux.Stringid(id,2))
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED) e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(s.regcon) e4:SetCondition(s.setcon)
e4:SetOperation(s.regop) e4:SetTarget(s.settg)
e4:SetOperation(s.setop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--set
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,2))
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_DESTROYED)
e5:SetCondition(s.setcon)
e5:SetTarget(s.settg)
e5:SetOperation(s.setop)
c:RegisterEffect(e5)
end end
function s.tdfilter(c) function s.tdfilter(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToDeck() and c:IsCanBeEffectTarget() return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToDeck() and c:IsCanBeEffectTarget()
...@@ -130,23 +122,12 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -130,23 +122,12 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end
local rc=re:GetHandler()
return e:GetHandler():IsReason(REASON_EFFECT) and re:IsActivated()
and (rc:IsRelateToChain(ev) and rc:IsCode(5318639)
or not rc:IsRelateToChain(ev) and rc:GetPreviousCodeOnField()==5318639)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) return c:IsReason(REASON_EFFECT) and re:GetHandler():IsCode(5318639)
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() and e:GetHandler():GetFlagEffect(id)>0 end if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(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