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)
c:CompleteProcedure()
end
function readRandomValueInTable(Table)
return Table[math.random(1,#Table)]
return Table[Duel.GetRandomNumber(1,#Table)]
end
\ No newline at end of file
......@@ -84,5 +84,5 @@ function cm.seed()
end
function readRandomValueInTable(Table)
--math.randomseed(cm.seed())
return Table[math.random(1,#Table)]
return Table[Duel.GetRandomNumber(1,#Table)]
end
\ No newline at end of file
......@@ -30,6 +30,15 @@ function cm.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
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:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
......@@ -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)
end
function cm.tfilter2(c,tp)
return c:GetSummonPlayer()~=tp and c:IsAbleToDeck() and c:IsLocation(LOCATION_MZONE)
return c:GetSummonPlayer()~=tp
end
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
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)
......
......@@ -263,10 +263,10 @@ function this.ccGen(from,count)
end
local g={}
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"]
if #at[temp]>1 then
g[i]=at[temp][math.random(1,#at[temp])]
g[i]=at[temp][Duel.GetRandomNumber(1,#at[temp])]
else
g[i]=temp
end
......@@ -754,10 +754,10 @@ function this.picrandom(g)
for _,v in pairs(g) do
if this.CardList.MainAliasTable[v] then
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
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
rg[#rg+1]=v
end
......@@ -773,7 +773,7 @@ function this.sample(g,ct)
if i>cct then
break
end
local idx=math.random(1,cct-i+1)
local idx=Duel.GetRandomNumber(1,cct-i+1)
rg[#rg+1]=g[idx]
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