Commit 3a2eeef0 authored by wind2009's avatar wind2009

Fix 糾罪巧

parent cb41a81d
...@@ -66,17 +66,19 @@ function s.initial_effect(c) ...@@ -66,17 +66,19 @@ function s.initial_effect(c)
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_TO_HAND) e6:SetCode(EVENT_TO_HAND)
e6:SetLabelObject(c) e6:SetProperty(EFFECT_FLAG_IMMEDIATELY_APPLY)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(s.regcon) e6:SetCondition(s.regcon)
e6:SetOperation(s.regop) e6:SetOperation(s.regop)
Duel.RegisterEffect(e6,0) c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_CHAIN_SOLVED) e7:SetCode(EVENT_CHAIN_SOLVED)
e7:SetLabelObject(c) e7:SetProperty(EFFECT_FLAG_IMMEDIATELY_APPLY)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(s.damcon2) e7:SetCondition(s.damcon2)
e7:SetOperation(s.damop2) e7:SetOperation(s.damop2)
Duel.RegisterEffect(e7,0) c:RegisterEffect(e7)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end end
function s.counterfilter(c) function s.counterfilter(c)
...@@ -164,7 +166,9 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -164,7 +166,9 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.flipop(e,tp,eg,ep,ev,re,r,rp) function s.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3)) local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
c:SetStatus(STATUS_EFFECT_ENABLED,true)
end end
function s.damcon1(e,tp,eg,ep,ev,re,r,rp) function s.damcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)>0 return e:GetHandler():GetFlagEffect(id)>0
...@@ -176,34 +180,23 @@ function s.damop1(e,tp,eg,ep,ev,re,r,rp) ...@@ -176,34 +180,23 @@ function s.damop1(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(Card.IsControler,nil,1-tp) local ct=eg:FilterCount(Card.IsControler,nil,1-tp)
Duel.Damage(1-tp,ct*900,REASON_EFFECT) Duel.Damage(1-tp,ct*900,REASON_EFFECT)
end end
function s.regfilter(c,ec,code)
return c==ec and c:IsFaceup() and c:GetFlagEffect(code)>0 and not c:IsStatus(STATUS_BATTLE_DESTROYED) and not c:IsDisabled()
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp) function s.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject() return e:GetHandler():GetFlagEffect(id)>0
local p=c:GetControler() and eg:IsExists(Card.IsControler,1,nil,1-tp) and Duel.IsChainSolving()
return eg:IsExists(Card.IsControler,1,nil,1-p) and Duel.IsChainSolving() and re and re:GetOwnerPlayer()==1-tp
and re and re:GetOwnerPlayer()==1-p
and Duel.IsExistingMatchingCard(s.regfilter,p,LOCATION_MZONE,0,1,nil,c,id)
end end
function s.regop(e,tp,eg,ep,ev,re,r,rp) function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject() local ct=eg:FilterCount(Card.IsControler,nil,1-tp)
local p=c:GetControler() e:GetHandler():RegisterFlagEffect(id+o,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1,ct)
local ct=eg:FilterCount(Card.IsControler,nil,1-p)
c:RegisterFlagEffect(id+o,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1,ct)
end end
function s.damcon2(e,tp,eg,ep,ev,re,r,rp) function s.damcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject() return e:GetHandler():GetFlagEffect(id+o)>0
local p=c:GetControler()
return Duel.IsExistingMatchingCard(s.regfilter,p,LOCATION_MZONE,0,1,nil,c,id+o)
end end
function s.damop2(e,tp,eg,ep,ev,re,r,rp) function s.damop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local p=c:GetControler()
Duel.Hint(HINT_CARD,0,id) Duel.Hint(HINT_CARD,0,id)
local labels={c:GetFlagEffectLabel(id+o)} local labels={e:GetHandler():GetFlagEffectLabel(id+o)}
local ct=0 local ct=0
for i=1,#labels do ct=ct+labels[i] end for i=1,#labels do ct=ct+labels[i] end
c:ResetFlagEffect(id+o) e:GetHandler():ResetFlagEffect(id+o)
Duel.Damage(1-p,ct*900,REASON_EFFECT) Duel.Damage(1-tp,ct*900,REASON_EFFECT)
end end
...@@ -58,13 +58,12 @@ function s.initial_effect(c) ...@@ -58,13 +58,12 @@ function s.initial_effect(c)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD) e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e5:SetProperty(EFFECT_FLAG_SET_AVAILABLE|EFFECT_FLAG_IMMEDIATELY_APPLY)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE) e5:SetTargetRange(LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE)
e5:SetLabelObject(c)
e5:SetCondition(s.effcon) e5:SetCondition(s.effcon)
e5:SetValue(s.effval) e5:SetValue(aux.tgoval)
Duel.RegisterEffect(e5,0) c:RegisterEffect(e5)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end end
function s.counterfilter(c) function s.counterfilter(c)
...@@ -167,12 +166,6 @@ function s.efffilter(c,ec) ...@@ -167,12 +166,6 @@ function s.efffilter(c,ec)
return c==ec and c:IsFaceup() and c:GetFlagEffect(id)>0 and not c:IsStatus(STATUS_BATTLE_DESTROYED) and not c:IsDisabled() return c==ec and c:IsFaceup() and c:GetFlagEffect(id)>0 and not c:IsStatus(STATUS_BATTLE_DESTROYED) and not c:IsDisabled()
end end
function s.effcon(e) function s.effcon(e)
local c=e:GetLabelObject() local c=e:GetHandler()
local p=c:GetControler() return c:GetFlagEffect(id)>0
return Duel.IsExistingMatchingCard(s.efffilter,p,LOCATION_MZONE,0,1,nil,c)
end
function s.effval(e,re,rp)
local c=e:GetLabelObject()
local p=c:GetControler()
return rp==1-p
end end
...@@ -47,7 +47,7 @@ function s.initial_effect(c) ...@@ -47,7 +47,7 @@ function s.initial_effect(c)
e3:SetTarget(s.negtg) e3:SetTarget(s.negtg)
e3:SetOperation(s.negop) e3:SetOperation(s.negop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--flip --set
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3)) e4:SetDescription(aux.Stringid(id,3))
e4:SetCategory(CATEGORY_POSITION) e4:SetCategory(CATEGORY_POSITION)
......
...@@ -34,7 +34,7 @@ function s.initial_effect(c) ...@@ -34,7 +34,7 @@ function s.initial_effect(c)
e2:SetTarget(s.sptg) e2:SetTarget(s.sptg)
e2:SetOperation(s.spop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--to hand --indestructable
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
...@@ -57,10 +57,27 @@ function s.initial_effect(c) ...@@ -57,10 +57,27 @@ function s.initial_effect(c)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_TO_GRAVE) e5:SetCode(EVENT_TO_GRAVE)
e5:SetLabelObject(c) e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCondition(s.damcon) e5:SetRange(LOCATION_MZONE)
e5:SetOperation(s.damop) e5:SetCondition(s.damcon1)
Duel.RegisterEffect(e5,0) e5:SetOperation(s.damop1)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_TO_HAND)
e6:SetProperty(EFFECT_FLAG_IMMEDIATELY_APPLY)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(s.regcon)
e6:SetOperation(s.regop)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_CHAIN_SOLVED)
e7:SetProperty(EFFECT_FLAG_IMMEDIATELY_APPLY)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(s.damcon2)
e7:SetOperation(s.damop2)
c:RegisterEffect(e7)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end end
function s.counterfilter(c) function s.counterfilter(c)
...@@ -157,25 +174,34 @@ function s.indtg2(e,c) ...@@ -157,25 +174,34 @@ function s.indtg2(e,c)
return c:IsType(TYPE_MONSTER) or c:IsSetCard(0x2d5) and c:IsType(TYPE_SPELL) and c:IsFaceup() return c:IsType(TYPE_MONSTER) or c:IsSetCard(0x2d5) and c:IsType(TYPE_SPELL) and c:IsFaceup()
end end
function s.flipop(e,tp,eg,ep,ev,re,r,rp) function s.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3)) local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
c:SetStatus(STATUS_EFFECT_ENABLED,true)
end end
function s.efffilter(c,ec) function s.damfilter(c,tp)
return c==ec and c:IsFaceup() and c:GetFlagEffect(id)>0 and not c:IsStatus(STATUS_BATTLE_DESTROYED) and not c:IsDisabled() return c:IsControler(tp) and c:IsType(TYPE_MONSTER)
end end
function s.damcon(e,tp,eg,ep,ev,re,r,rp) function s.damcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject() return e:GetHandler():GetFlagEffect(id)>0
local p=c:GetControler() and eg:IsExists(s.damfilter,1,nil,1-tp) and not Duel.IsChainSolving()
return Duel.IsExistingMatchingCard(s.efffilter,p,LOCATION_MZONE,0,1,nil,c)
end end
function s.damfilter(c,tp) function s.damop1(e,tp,eg,ep,ev,re,r,rp)
return c:GetOwner()==1-tp and c:IsType(TYPE_MONSTER) Duel.Hint(HINT_CARD,0,id)
end local ct=eg:FilterCount(s.damfilter,nil,1-tp)
function s.damop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,ct*900,REASON_EFFECT)
local c=e:GetLabelObject() end
local p=c:GetControler() function s.regcon(e,tp,eg,ep,ev,re,r,rp)
local dam=eg:IsExists(s.damfilter,1,nil,p) return e:GetHandler():GetFlagEffect(id)>0
if dam then and eg:IsExists(s.damfilter,1,nil,1-tp) and Duel.IsChainSolving()
Duel.Hint(HINT_CARD,0,id) end
Duel.Damage(1-p,900,REASON_EFFECT) function s.regop(e,tp,eg,ep,ev,re,r,rp)
end local ct=eg:FilterCount(s.damfilter,nil,1-tp)
e:GetHandler():RegisterFlagEffect(id+o,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
end
function s.damcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id+o)>0
end
function s.damop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
Duel.Damage(1-tp,900,REASON_EFFECT)
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