Commit 9977b62c authored by Vury Leo's avatar Vury Leo

fix link

parent c0b340e1
--TG サイバー・マジシャン --TG サイバー・マジシャン
function c64910482.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--synchro custom --synchro custom
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM) e1:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetTarget(c64910482.syntg) e1:SetTarget(s.syntg)
e1:SetValue(1) e1:SetValue(1)
e1:SetOperation(c64910482.synop) e1:SetOperation(s.synop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to grave --to grave
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c64910482.regop) e2:SetOperation(s.regop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--hand synchro --hand synchro
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_HAND_SYNCHRO) e3:SetCode(EFFECT_HAND_SYNCHRO)
e3:SetTarget(c64910482.hsyntg) e3:SetTarget(s.hsyntg)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--hand synchro
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(id)
e4:SetTarget(s.hsyntg)
c:RegisterEffect(e4)
end end
function c64910482.synfilter1(c,syncard,tuner,f) function s.synfilter1(c,syncard,tuner,f)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard)) return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end end
function c64910482.synfilter2(c,syncard,tuner,f) function s.synfilter2(c,syncard,tuner,f)
return c:IsSetCard(0x27) and c:IsNotTuner(syncard) and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard)) return c:IsSetCard(0x27) and c:IsNotTuner(syncard) and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end end
function c64910482.syncheck(c,g,mg,tp,lv,syncard,minc,maxc) function s.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
g:AddCard(c) g:AddCard(c)
local ct=g:GetCount() local ct=g:GetCount()
local res=c64910482.syngoal(g,tp,lv,syncard,minc,ct) local res=s.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(c64910482.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc)) or (ct<maxc and mg:IsExists(s.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c) g:RemoveCard(c)
return res return res
end end
function c64910482.syngoal(g,tp,lv,syncard,minc,ct) function s.syngoal(g,tp,lv,syncard,minc,ct)
return ct>=minc return ct>=minc
and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard) and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard)
and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0 and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0
and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL)
end end
function c64910482.syntg(e,syncard,f,min,max) function s.syntg(e,syncard,f,min,max)
local minc=min+1 local minc=min+1
local maxc=max+1 local maxc=max+1
local c=e:GetHandler() local c=e:GetHandler()
...@@ -52,29 +60,29 @@ function c64910482.syntg(e,syncard,f,min,max) ...@@ -52,29 +60,29 @@ function c64910482.syntg(e,syncard,f,min,max)
local lv=syncard:GetLevel() local lv=syncard:GetLevel()
if lv<=c:GetLevel() then return false end if lv<=c:GetLevel() then return false end
local g=Group.FromCards(c) local g=Group.FromCards(c)
local mg=Duel.GetSynchroMaterial(tp):Filter(c64910482.synfilter1,c,syncard,c,f) local mg=Duel.GetSynchroMaterial(tp):Filter(s.synfilter1,c,syncard,c,f)
if syncard:IsSetCard(0x27) then if syncard:IsSetCard(0x27) then
local exg=Duel.GetMatchingGroup(c64910482.synfilter2,tp,LOCATION_HAND,0,c,syncard,c,f) local exg=Duel.GetMatchingGroup(s.synfilter2,tp,LOCATION_HAND,0,c,syncard,c,f)
mg:Merge(exg) mg:Merge(exg)
end end
return mg:IsExists(c64910482.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc) return mg:IsExists(s.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc)
end end
function c64910482.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max) function s.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max)
local minc=min+1 local minc=min+1
local maxc=max+1 local maxc=max+1
local c=e:GetHandler() local c=e:GetHandler()
local lv=syncard:GetLevel() local lv=syncard:GetLevel()
local g=Group.FromCards(c) local g=Group.FromCards(c)
local mg=Duel.GetSynchroMaterial(tp):Filter(c64910482.synfilter1,c,syncard,c,f) local mg=Duel.GetSynchroMaterial(tp):Filter(s.synfilter1,c,syncard,c,f)
if syncard:IsSetCard(0x27) then if syncard:IsSetCard(0x27) then
local exg=Duel.GetMatchingGroup(c64910482.synfilter2,tp,LOCATION_HAND,0,c,syncard,c,f) local exg=Duel.GetMatchingGroup(s.synfilter2,tp,LOCATION_HAND,0,c,syncard,c,f)
mg:Merge(exg) mg:Merge(exg)
end end
for i=1,maxc do for i=1,maxc do
local cg=mg:Filter(c64910482.syncheck,g,g,mg,tp,lv,syncard,minc,maxc) local cg=mg:Filter(s.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end if cg:GetCount()==0 then break end
local minct=1 local minct=1
if c64910482.syngoal(g,tp,lv,syncard,minc,i) then if s.syngoal(g,tp,lv,syncard,minc,i) then
minct=0 minct=0
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
...@@ -84,37 +92,37 @@ function c64910482.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max) ...@@ -84,37 +92,37 @@ function c64910482.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max)
end end
Duel.SetSynchroMaterial(g) Duel.SetSynchroMaterial(g)
end end
function c64910482.regop(e,tp,eg,ep,ev,re,r,rp) function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) then if c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(64910482,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetRange(LOCATION_GRAVE) e1:SetRange(LOCATION_GRAVE)
e1:SetTarget(c64910482.thtg) e1:SetTarget(s.thtg)
e1:SetOperation(c64910482.thop) e1:SetOperation(s.thop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
function c64910482.filter(c) function s.filter(c)
return c:IsSetCard(0x27) and not c:IsCode(64910482) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x27) and not c:IsCode(id) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function c64910482.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c64910482.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c64910482.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c64910482.filter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c64910482.hsyntg(e,c,syncard) function s.hsyntg(e,c,syncard)
return c:IsSetCard(0x27) and c:IsNotTuner(syncard) return c:IsSetCard(0x27) and c:IsNotTuner(syncard)
end end
...@@ -3384,7 +3384,7 @@ Synchro.Role={ ...@@ -3384,7 +3384,7 @@ Synchro.Role={
} }
--- Shadowing Duel.GetSynchroMaterial as we have different definition on hand materials --- Shadowing Duel.GetSynchroMaterial as we have different definition on hand materials
function Synchro.GetSynchroMaterial(tp,tc) function Synchro.GetSynchroMaterial(tp,tc,base_mapper)
local mg=Duel.GetMatchingGroup(function(mc) return mc:IsFaceup() and mc:IsOnField() end,tp,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(function(mc) return mc:IsFaceup() and mc:IsOnField() end,tp,LOCATION_MZONE,0,nil)
local mg_hand=Duel.GetMatchingGroup(function(mc) return mc:IsFaceupEx() end,tp,LOCATION_HAND,0,nil) local mg_hand=Duel.GetMatchingGroup(function(mc) return mc:IsFaceupEx() end,tp,LOCATION_HAND,0,nil)
local mg_oppoent=Duel.GetMatchingGroup(function(mc) local mg_oppoent=Duel.GetMatchingGroup(function(mc)
...@@ -3418,6 +3418,14 @@ function Synchro.GetSynchroMaterial(tp,tc) ...@@ -3418,6 +3418,14 @@ function Synchro.GetSynchroMaterial(tp,tc)
end end
return true return true
end,nil) end,nil)
--- it must have a level
mg=mg:Filter(function(mc)
local lvls=base_mapper(mc,tc)
if #lvls==0 then
return false
end
return true
end,nil)
return mg return mg
end end
...@@ -3700,7 +3708,7 @@ function Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_f ...@@ -3700,7 +3708,7 @@ function Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_f
end end
local target_level=c:GetLevel() local target_level=c:GetLevel()
mg=mg or Synchro.GetSynchroMaterial(c:GetControler(),c) mg=mg or Synchro.GetSynchroMaterial(c:GetControler(),c,base_mapper)
local smat_states=nil local smat_states=nil
local smat_arr=nil local smat_arr=nil
...@@ -3739,7 +3747,7 @@ function Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filt ...@@ -3739,7 +3747,7 @@ function Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filt
e:SetLabelObject(mg) e:SetLabelObject(mg)
return true return true
end end
mg=mg or Synchro.GetSynchroMaterial(tp,tc) mg=mg or Synchro.GetSynchroMaterial(tp,tc,base_mapper)
-- add リペア・ジェネクス・コントローラー to scheck -- add リペア・ジェネクス・コントローラー to scheck
if Duel.IsPlayerAffectedByEffect(tp,8173184) then if Duel.IsPlayerAffectedByEffect(tp,8173184) then
...@@ -3979,6 +3987,7 @@ function Synchro.DefaultLevelMapper(card,tc) ...@@ -3979,6 +3987,7 @@ function Synchro.DefaultLevelMapper(card,tc)
level_dict[val]=true level_dict[val]=true
end end
end end
effs={card:IsHasEffect(61052897)} --- レアル・ジェネクス・チューリング effs={card:IsHasEffect(61052897)} --- レアル・ジェネクス・チューリング
if #effs>0 then if #effs>0 then
local val=effs[1]:GetValue()(effs[1],tc) local val=effs[1]:GetValue()(effs[1],tc)
...@@ -3989,8 +3998,10 @@ function Synchro.DefaultLevelMapper(card,tc) ...@@ -3989,8 +3998,10 @@ function Synchro.DefaultLevelMapper(card,tc)
if not mandatory then if not mandatory then
-- include original level -- include original level
if card:IsLevelAbove(1) then
level_dict[card:GetLevel()]=true level_dict[card:GetLevel()]=true
end end
end
-- Convert dictionary keys back to array -- Convert dictionary keys back to array
local levels={} local levels={}
......
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