forked from github/server
math.mod is deprecated
This commit is contained in:
parent
64658bd260
commit
ba328d913e
|
@ -13,14 +13,14 @@ end
|
||||||
local function freeze(r, chance)
|
local function freeze(r, chance)
|
||||||
for i, rn in ipairs(r.adj) do
|
for i, rn in ipairs(r.adj) do
|
||||||
-- each region has a chance to freeze
|
-- each region has a chance to freeze
|
||||||
if rn.terrain=="ocean" and (chance>=100 or math.mod(rng_int(), 100)<chance) then
|
if rn.terrain=="ocean" and (chance>=100 or math.fmod(rng_int(), 100)<chance) then
|
||||||
rn.terrain = "packice"
|
rn.terrain = "packice"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function thaw(r, chance)
|
local function thaw(r, chance)
|
||||||
if chance>=100 or math.mod(rng_int(), 100)<chance then
|
if chance>=100 or math.fmod(rng_int(), 100)<chance then
|
||||||
r.terrain = "ocean"
|
r.terrain = "ocean"
|
||||||
for s in r.ships do
|
for s in r.ships do
|
||||||
s.coast = nil
|
s.coast = nil
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
-- use only once to hand out some items to existing factions
|
-- use only once to hand out some items to existing factions
|
||||||
function adamant_gifts()
|
function adamant_gifts()
|
||||||
for f in factions() do
|
for f in factions() do
|
||||||
local i = math.mod(test.rng_int(), 2)
|
local i = math.fmod(test.rng_int(), 2)
|
||||||
if i==0 then
|
if i==0 then
|
||||||
f:add_item("adamantium", 1)
|
f:add_item("adamantium", 1)
|
||||||
f:add_item("adamantiumplate", 1)
|
f:add_item("adamantiumplate", 1)
|
||||||
|
|
|
@ -39,7 +39,7 @@ function wyrm()
|
||||||
local r
|
local r
|
||||||
for index, r in pairs(map) do
|
for index, r in pairs(map) do
|
||||||
if r~=grave then
|
if r~=grave then
|
||||||
if (math.mod(r.x,2)==math.mod(get_turn(),2)) then
|
if (math.fmod(r.x,2)==math.fmod(get_turn(),2)) then
|
||||||
r:add_notice("Eine Botschaft von Igjarjuk, Herr der Wyrme: 'Die Zeit des Wartens ist beinahe vorrüber. Euer Fürst kehrt aus dem Grabe zurück.'")
|
r:add_notice("Eine Botschaft von Igjarjuk, Herr der Wyrme: 'Die Zeit des Wartens ist beinahe vorrüber. Euer Fürst kehrt aus dem Grabe zurück.'")
|
||||||
else
|
else
|
||||||
r:add_notice("Eine Botschaft von Gwaewar, Herr der Greife: 'Das Ende naht. Igjarjuk ist aus seinem Grab auferstanden. Eilt, noch ist die Welt zu retten!'")
|
r:add_notice("Eine Botschaft von Gwaewar, Herr der Greife: 'Das Ende naht. Igjarjuk ist aus seinem Grab auferstanden. Eilt, noch ist die Welt zu retten!'")
|
||||||
|
|
|
@ -34,7 +34,7 @@ local function get_target(param)
|
||||||
if ntargets==0 then
|
if ntargets==0 then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
local rn = math.mod(rng_int(), ntargets)
|
local rn = math.fmod(rng_int(), ntargets)
|
||||||
return targets[rn]
|
return targets[rn]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue