Convert math.random percentage computations into percent()

This commit is contained in:
copperwater
2020-02-29 17:04:26 -05:00
committed by Pasi Kallinen
parent c4bb3c904f
commit 35a2f6e3ed
21 changed files with 76 additions and 76 deletions

View File

@@ -11,7 +11,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
des.feature("fountain", 12, 07)
des.feature("fountain", 11, 13)
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", x=2,y=2, w=4,h=2,
contents = function()
des.door({ state = "closed", wall="south" })
@@ -19,7 +19,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
})
end
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", x=7,y=2, w=2,h=2,
contents = function()
des.door({ state = "closed", wall="north" })
@@ -27,7 +27,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
})
end
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", x=7,y=5, w=2,h=2,
contents = function()
des.door({ state = "closed", wall="south" })
@@ -35,7 +35,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
})
end
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", lit=1, x=10,y=2, w=3,h=4,
contents = function()
des.monster("gnome")
@@ -47,7 +47,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
})
end
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", x=14,y=2, w=4,h=2,
contents = function()
des.door({ state = "closed", wall="south", pos=0 })
@@ -56,7 +56,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
})
end
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", x=16,y=5, w=2,h=2,
contents = function()
des.door({ state = "closed", wall="south" })
@@ -64,7 +64,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
})
end
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", lit=0, x=19,y=2, w=2,h=2,
contents = function()
des.door({ state = "locked", wall="east" })
@@ -79,7 +79,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
end
})
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", x=2,y=7, w=2,h=2,
contents = function()
des.door({ state = "closed", wall="east" })
@@ -99,7 +99,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
end
})
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", x=11,y=10, w=2,h=2,
contents = function()
des.door({ state = "locked", wall="west" })
@@ -114,7 +114,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
end
})
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", x=17,y=11, w=4,h=2,
contents = function()
des.door({ state = "closed", wall="north" })
@@ -122,7 +122,7 @@ des.room({ type="ordinary", lit=1, x=3,y=3,
})
end
if math.random(0,99) < 75 then
if percent(75) then
des.room({ type="ordinary", x=22,y=11, w=2,h=2,
contents = function()
des.door({ state = "closed", wall="south" })