Commit 4377882a authored by POLYMER's avatar POLYMER

fix

parent e33cd23c
No preview for this file type
--人生如逆旅
local s,id,o=GetID()
function c13000747.initial_effect(c)
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--spsummon condition
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetValue(SUMMON_TYPE_SYNCHRO)
e2:SetCondition(s.sprcon)
e2:SetOperation(s.sprop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCountLimit(1)
e3:SetCondition(s.lvcon)
e3:SetOperation(s.lvop)
c:RegisterEffect(e3)
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_MZONE)
e6:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e6:SetHintTiming(0,TIMING_END_PHASE)
e6:SetCountLimit(1)
e6:SetTarget(s.target)
e6:SetOperation(s.operation)
c:RegisterEffect(e6)
--effect gain
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_BE_MATERIAL)
e7:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e7:SetCondition(s.effcon)
e7:SetOperation(s.effop)
c:RegisterEffect(e7)
end
function s.effcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_FUSION+REASON_SYNCHRO+REASON_XYZ+REASON_LINK+REASON_RITUAL)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end
function s.thfilter(c)
return (c:IsRace(RACE_BEAST) or c:IsRace(RACE_BEASTWARRIOR)) and c:IsAbleToHand() and c:IsLevelAbove(7)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local aa=g:GetFirst():GetAttribute()
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
if tg:IsExists(s.filter9,1,nil,tp,aa) then
if Duel.SelectYesNo(tp,aux.Stringid(13000747,0)) then
local ta=tg:SelectSubGroup(tp,s.filter9,true,1,1,tp,aa)
Duel.Destroy(ta,REASON_EFFECT)
end
end
end
end
function s.filter9(c,tp,aa)
return Card.IsPublic(c) and Card.IsAttribute(c,aa)
end
function s.lvcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffectLabel(tp,s)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local level=Duel.GetFlagEffectLabel(tp,s)
Duel.ResetFlagEffect(tp,s)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(level)
c:RegisterEffect(e1)
end
function s.tgrfilter(c)
return c:IsFaceup() and c:IsLevelAbove(1) and (c:IsAbleToHandAsCost() or c:IsAbleToExtraAsCost())
end
function s.fselect(g,tp,sc)
return g:GetCount()==2 and g:GetClassCount(Card.GetLevel)>=2
and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(s.tgrfilter,tp,LOCATION_MZONE,0,nil)
return g:CheckSubGroup(s.fselect,2,2)
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(s.tgrfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:SelectSubGroup(tp,s.fselect,false,2,2,tp,c)
local ta=tg:GetFirst()
local tb=tg:GetNext()
local aa=ta:GetLevel()
local bb=tb:GetLevel()
Duel.SendtoHand(tg,1-tp,REASON_COST+REASON_MATERIAL)
local cc=math.abs(aa-bb)
e:GetHandler():SetMaterial(tg)
Duel.RegisterFlagEffect(tp,s,0,0,1,cc)
if ta:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(66)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+0x1fe0000)
ta:RegisterEffect(e1)
end
if tb:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(66)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+0x1fe0000)
tb:RegisterEffect(e1)
end
end
local s,id=GetID()
function c13000766.initial_effect(c)
--synchro summon
c:SetSPSummonOnce(13000766)
local e0=s.AddLinkProcedure(c,nil,3,5)
c:EnableReviveLimit()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13000766,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetCondition(s.descon)
--e3:SetCost(s.cost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
if s.global==nil then --添加全局效果并注册给1个玩家
s.global=true
local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e13:SetCode(EVENT_CHANGE_POS)
e13:SetOperation(s.globals)
Duel.RegisterEffect(e13,0)
end
end
s.num=0
function s.globals(e,tp,eg,ep,ev,re,r,rp)--添加标识
local g=eg:Filter(s.cfilter2,nil,tp)--筛选自己盖放的卡
for tc in aux.Next(g) do
tc:RegisterFlagEffect(id+rp,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET,0,1)
end
end
function s.cfilter2(c,tp)
return c:IsLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
and c:IsPosition(POS_FACEDOWN)
end
function s.AddLinkProcedure(c,f,min,max,gf)
if max==nil then max=c:GetLink() end
local e1=Effect.CreateEffect(c)
e1:SetDescription(1166)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(s.LinkCondition(f,min,max,gf))
e1:SetTarget(s.LinkTarget(f,min,max,gf))
e1:SetOperation(s.LinkOperation(f,min,max,gf))
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
return e1
end
function s.LinkCondition(f,minct,maxct,gf)
return function(e,c,og,lmat,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local tp=c:GetControler()
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
local mg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local mg3=Duel.GetMatchingGroup(s.filter,tp,LOCATION_SZONE,0,nil)
mg:Merge(mg2)
mg:Merge(mg3)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
if fg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(fg)
return mg:CheckSubGroup(s.LCheckGoal,minc,maxc,tp,c,gf,lmat)
end
end
function s.LinkTarget(f,minct,maxct,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
local mg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local mg3=Duel.GetMatchingGroup(s.filter,tp,LOCATION_SZONE,0,nil)
mg:Merge(mg2)
mg:Merge(mg3)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
Duel.SetSelectedCard(fg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local cancel=Duel.IsSummonCancelable()
local sg=mg:SelectSubGroup(tp,s.LCheckGoal,cancel,minc,maxc,tp,c,gf,lmat)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
end
function s.LCheckGoal(sg,tp,lc,gf,lmat)
return sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),#sg,#sg)
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg,lc,tp))
and not sg:IsExists(Auxiliary.LUncompatibilityFilter,1,nil,sg,lc,tp)
and (not lmat or sg:IsContains(lmat)) and sg:FilterCount(s.link,nil)<=2
end
function s.link(c)
return c:IsFacedown() and c:IsLocation(LOCATION_MZONE)
end
function s.LinkOperation(f,minct,maxct,gf)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Auxiliary.LExtraMaterialCount(g,c,tp)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
g:DeleteGroup()
end
end
function s.chainlm(e,ep,tp)
return tp==ep
end
function s.filter(c)
return bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and not c:IsFacedown()
end
function s.filter2(c,tp)
return c:IsFacedown() and c:GetFlagEffect(id+tp)~=0
end
function s.mattg(e,c,tp)
return bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0
end
function s.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,true
end
function s.matval2(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,not mg or not mg:IsExists(s.filter2,1,nil,tp)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local aa=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil,tp)
if e:GetHandler():GetFlagEffect(13000766)>0 then Duel.SetChainLimit(s.chainlm) end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
s.num=s.num+1
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(s.atkval)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
if Duel.SelectYesNo(tp,aux.Stringid(13000766,0)) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
if not tc:IsLocation(LOCATION_REMOVED) then
local aa=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,3,nil)
Duel.SendtoDeck(aa,nil,0,REASON_EFFECT)
end
end
end
function s.atkval(e,c)
return s.num*1000
end
function s.cfilter(c,tp)
return c:IsPreviousControler(tp)
and c:GetReasonPlayer()==1-tp and c:IsSummonLocation(LOCATION_EXTRA)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local c=e:GetHandler()
local a=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if Duel.Destroy(a,REASON_COST)~0 and a:IsSummonLocation(LOCATION_EXTRA) then
c:RegisterFlagEffect(13000766,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local c=e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
if e:GetHandler():GetFlagEffect(13000766)>0 then Duel.SetChainLimit(s.chainlm) end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
......@@ -29,10 +29,10 @@ function c75081033.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c75081033.cfilter1,1,nil,tp) or eg:IsExists(c75081033.cfilter2,1,nil,tp)
end
function c75081033.cfilter1(c,tp)
return c:IsSetCard(0xa754) and c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and c:IsPreviousControler(tp)
return c:IsSetCard(0xa754) and c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c75081033.cfilter2(c,tp)
return c:IsSetCard(0xa754) and c:IsLocation(LOCATION_DECK+LOCATION_REMOVED) and c:IsPreviousControler(tp)
return c:IsSetCard(0xa754) and c:IsLocation(LOCATION_DECK+LOCATION_REMOVED) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c75081033.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -30,10 +30,10 @@ function c75081034.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c75081034.cfilter1,1,nil,tp) or eg:IsExists(c75081034.cfilter2,1,nil,tp)
end
function c75081034.cfilter1(c,tp)
return c:IsSetCard(0xa754) and c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and c:IsPreviousControler(tp)
return c:IsSetCard(0xa754) and c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c75081034.cfilter2(c,tp)
return c:IsSetCard(0xa754) and c:IsLocation(LOCATION_DECK+LOCATION_REMOVED) and c:IsPreviousControler(tp)
return c:IsSetCard(0xa754) and c:IsLocation(LOCATION_DECK+LOCATION_REMOVED) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c75081034.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -35,14 +35,14 @@ function c75081047.initial_effect(c)
c:RegisterEffect(e3)
end
function c75081047.sumtg(e,c)
return c:IsType(TYPE_MONSTER) and c~=e:GetHandler() and c:IsSetCard(0xa754)
return c:IsType(TYPE_MONSTER) and c~=e:GetHandler() and c:IsSetCard(0xa754) and c:IsPreviousLocation(LOCATION_MZONE)
end
--
function c75081047.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c75081047.cfilter1,1,nil,tp)
end
function c75081047.cfilter1(c,tp)
return c:IsSetCard(0xa754) and c:IsPreviousControler(tp)
return c:IsSetCard(0xa754) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c75081047.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
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