Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 28/01/2017
- --Last update: 28/01/2017
- takeMul = function(x)
- return x-(x%5)
- end
- tfm.exec.disableAutoShaman()
- tfm.exec.disableAutoNewGame()
- math.randomseed = 9
- xml = {}
- xml.standard = "<C><P F=\""..(math.random(0,8)%6).."\" /><Z><S>%s</S><D>%s</D><O /></Z></C>"
- xml.grounds,xml.decorations = {},{}
- xml.S,xml.SET,xml.D = '<S L="%d" H="%d" X="%d" Y="%d" T="%d" P="0,0,%f,%f,%d,0,0,0" o="'..math.random(0xD2436B,0x43D28B)..'" />','<%s X="%d" Y="%d" />','<P P="0,0" X="%d" Y="%d" T="%d" />'
- grounds = {{0,1,4},{10,1},{12,13},{1,2},{4,1},{1,10},{10,9,2}}
- groundProperties = {{.3,.2},{0,.2},{0,1.2},{0,20},{20,.2},{.3,.2},{.3,.2},{.1,.2},{.3,.2},{0,0},{.3,0},{.05,.1},{.3,.2},{.3,.2},{.3,.2},{0,0}}
- decorations = {{0,4,5},{},{},{},{1,42,51},{1,2,4,12,18,20,32,42,46},{0,1,2,3,4,5,11,42},{7,8,9,10},{},{},{42,103,118},{51,106},{},{},{},{}}
- currentX,currentY = 0,0
- mapGrounds = grounds[math.random(#grounds)]
- for i = 1,math.random(8,25) do
- local ground = mapGrounds[i==1 and i or math.random(#mapGrounds)]
- local L = takeMul(ground~=13 and math.random(40,120) or math.random(20,40))
- local H = takeMul(math.random(20,35))
- if ground == 9 and math.random(10) < 6 then
- L,H = H,L
- end
- local X,Y
- repeat
- X = takeMul(math.random(90,860) - L - (currentX/8))
- Y = takeMul(math.random(100,300) + (currentY/4))
- until X > 0 and X < 800 and Y > 0 and Y < 400
- currentX,currentY = X - X^.5,Y + Y^.5
- table.insert(xml.grounds,xml.S:format(L,H,X,Y,ground,groundProperties[ground+1][1],groundProperties[ground+1][2],i==1 and math.random(-10,10) or math.random(0,360)))
- if math.random(22) < 3 then
- local dec = decorations[ground+1]
- table.insert(xml.decorations,xml.D:format(X - math.random(-((L/4)+1),((L/4)+1)),Y - (H/2),#dec>0 and dec[math.random(#dec)] or -1))
- end
- if i == 1 then
- for k,v in next,{"DS","T"} do
- table.insert(xml.decorations,xml.SET:format(v,X,Y - (H/2)))
- end
- end
- end
- local cheeses = 1
- if math.random(30) == 2 then cheeses = 2 end
- for c = 1,cheeses do
- local X,Y
- repeat
- X,Y = takeMul(math.random(90,860) + (currentX/4)),takeMul(math.random(100,300) - (currentY/10))
- until X > 0 and X < 800 and Y > 0 and Y < 400
- table.insert(xml.decorations,xml.SET:format("F",X,Y))
- end
- tfm.exec.newGame(xml.standard:format(table.concat(xml.grounds),table.concat(xml.decorations)))
- eventPlayerDied = function(n)
- tfm.exec.respawnPlayer(n)
- end
- eventPlayerWon = function(n)
- tfm.exec.respawnPlayer(n)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement