SHOW:
|
|
- or go back to the newest paste.
1 | - | def budujStatekPiracki(): |
1 | + | def buildPirateShip(): |
2 | - | statekSzerokosc = 7 |
2 | + | shipWidth = 7 |
3 | - | statekDlugosc = 15 |
3 | + | shipLength = 15 |
4 | - | statekWysokosc = 5 |
4 | + | shipHeight = 5 |
5 | ||
6 | - | statekPozycja = world(0, -48, (wyspaDlugosc // 2) + 5) |
6 | + | shipPosition = world(0, -48, (islandLength // 2) + 5) |
7 | ||
8 | - | for x in range(-statekSzerokosc // 2, statekSzerokosc // 2 + 1): |
8 | + | for x in range(-shipWidth // 2, shipWidth // 2 + 1): |
9 | - | for z in range(-statekDlugosc // 2, statekDlugosc // 2 + 1): |
9 | + | for z in range(-shipLength // 2, shipLength // 2 + 1): |
10 | - | for y in range(statekWysokosc): |
10 | + | for y in range(shipHeight): |
11 | if y == 0: | |
12 | - | blocks.place(PLANKS_OAK, positions.add(statekPozycja, pos(x, y, z))) |
12 | + | blocks.place(PLANKS_OAK, positions.add(shipPosition, pos(x, y, z))) |
13 | - | elif y == statekWysokosc - 1 and -statekSzerokosc // 4 <= x <= statekSzerokosc // 4 and -statekDlugosc // 4 <= z <= statekDlugosc // 4: |
13 | + | elif y == shipHeight - 1 and -shipWidth // 4 <= x <= shipWidth // 4 and -shipLength // 4 <= z <= shipLength // 4: |
14 | - | blocks.place(PLANKS_OAK, positions.add(statekPozycja, pos(x, y, z))) |
14 | + | blocks.place(PLANKS_OAK, positions.add(shipPosition, pos(x, y, z))) |
15 | - | elif y > 0 and y < statekWysokosc - 1 and ((x == -statekSzerokosc // 2 or x == statekSzerokosc // 2) or (z == -statekDlugosc // 2 or z == statekDlugosc // 2)): |
15 | + | elif y > 0 and y < shipHeight - 1 and ((x == -shipWidth // 2 or x == shipWidth // 2) or (z == -shipLength // 2 or z == shipLength // 2)): |
16 | - | blocks.place(PLANKS_OAK, positions.add(statekPozycja, pos(x, y, z))) |
16 | + | blocks.place(PLANKS_OAK, positions.add(shipPosition, pos(x, y, z))) |
17 | ||
18 | - | # Dodanie masztu |
18 | + | # Adding a mast |
19 | - | for y in range(statekWysokosc, statekWysokosc * 3): |
19 | + | for y in range(shipHeight, shipHeight * 3): |
20 | - | blocks.place(PLANKS_OAK, positions.add(statekPozycja, pos(0, y, 0))) |
20 | + | blocks.place(PLANKS_OAK, positions.add(shipPosition, pos(0, y, 0))) |
21 | ||
22 | - | # Dodanie żagli |
22 | + | # Adding sails |
23 | - | for y in range(statekWysokosc + 1, statekWysokosc * 3 - 1): |
23 | + | for y in range(shipHeight + 1, shipHeight * 3 - 1): |
24 | - | for z in range(-statekDlugosc // 4, statekDlugosc // 4 + 1): |
24 | + | for z in range(-shipLength // 4, shipLength // 4 + 1): |
25 | - | if -y + statekWysokosc <= z <= y - statekWysokosc: |
25 | + | if -y + shipHeight <= z <= y - shipHeight: |
26 | - | blocks.place(WOOL, positions.add(statekPozycja, pos(0, y, z))) |
26 | + | blocks.place(WOOL, positions.add(shipPosition, pos(0, y, z))) |
27 | ||
28 | ||
29 | - | def statek(): |
29 | + | def ship(): |
30 | - | budujStatekPiracki() |
30 | + | buildPirateShip() |
31 | ||
32 | - | player.on_chat("statek", statek) |
32 | + | player.on_chat("ship", ship) |
33 | ||
34 |