Commit 9314cb59 authored by songtongtong's avatar songtongtong

bug fix and func replace

parent a79d8f1b
Pipeline #22019 passed with stages
in 35 minutes and 37 seconds
...@@ -91,5 +91,5 @@ function cm.activate1(e,tp,eg,ep,ev,re,r,rp) ...@@ -91,5 +91,5 @@ function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
c:CompleteProcedure() c:CompleteProcedure()
end end
function readRandomValueInTable(Table) function readRandomValueInTable(Table)
return Table[math.random(1,#Table)] return Table[Duel.GetRandomNumber(1,#Table)]
end end
\ No newline at end of file
...@@ -84,5 +84,5 @@ function cm.seed() ...@@ -84,5 +84,5 @@ function cm.seed()
end end
function readRandomValueInTable(Table) function readRandomValueInTable(Table)
--math.randomseed(cm.seed()) --math.randomseed(cm.seed())
return Table[math.random(1,#Table)] return Table[Duel.GetRandomNumber(1,#Table)]
end end
\ No newline at end of file
...@@ -30,6 +30,15 @@ function cm.initial_effect(c) ...@@ -30,6 +30,15 @@ function cm.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_PZONE)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -116,10 +125,10 @@ function cm.splimit(e,c,sump,sumtype,sumpos,targetp) ...@@ -116,10 +125,10 @@ function cm.splimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM and not c:IsSetCard(0xa73) return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM and not c:IsSetCard(0xa73)
end end
function cm.tfilter2(c,tp) function cm.tfilter2(c,tp)
return c:GetSummonPlayer()~=tp and c:IsAbleToDeck() and c:IsLocation(LOCATION_MZONE) return c:GetSummonPlayer()~=tp
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 return eg:IsExists(cm.tfilter2,1,nil,tp)
end end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -263,10 +263,10 @@ function this.ccGen(from,count) ...@@ -263,10 +263,10 @@ function this.ccGen(from,count)
end end
local g={} local g={}
for i=1,count do for i=1,count do
local temp=this.CardList[from][math.random(1,#this.CardList[from])] local temp=this.CardList[from][Duel.GetRandomNumber(1,#this.CardList[from])]
local at=this.CardList[from.."AliasTable"] local at=this.CardList[from.."AliasTable"]
if #at[temp]>1 then if #at[temp]>1 then
g[i]=at[temp][math.random(1,#at[temp])] g[i]=at[temp][Duel.GetRandomNumber(1,#at[temp])]
else else
g[i]=temp g[i]=temp
end end
...@@ -754,10 +754,10 @@ function this.picrandom(g) ...@@ -754,10 +754,10 @@ function this.picrandom(g)
for _,v in pairs(g) do for _,v in pairs(g) do
if this.CardList.MainAliasTable[v] then if this.CardList.MainAliasTable[v] then
local at=this.CardList.MainAliasTable local at=this.CardList.MainAliasTable
rg[#rg+1]=at[v][math.random(1,#at[v])] rg[#rg+1]=at[v][Duel.GetRandomNumber(1,#at[v])]
elseif this.CardList.ExtraAliasTable[v] then elseif this.CardList.ExtraAliasTable[v] then
local at=this.CardList.ExtraAliasTable local at=this.CardList.ExtraAliasTable
rg[#rg+1]=at[v][math.random(1,#at[v])] rg[#rg+1]=at[v][Duel.GetRandomNumber(1,#at[v])]
else else
rg[#rg+1]=v rg[#rg+1]=v
end end
...@@ -773,7 +773,7 @@ function this.sample(g,ct) ...@@ -773,7 +773,7 @@ function this.sample(g,ct)
if i>cct then if i>cct then
break break
end end
local idx=math.random(1,cct-i+1) local idx=Duel.GetRandomNumber(1,cct-i+1)
rg[#rg+1]=g[idx] rg[#rg+1]=g[idx]
if idx<cct-i+1 then if idx<cct-i+1 then
......
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