Commit bc43f927 authored by wind2009's avatar wind2009

Fix

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