Advertisement
MateuszGrabarczyk

Untitled

Dec 9th, 2022
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1.  
  2.  
  3.  
  4. def zamekKonstruktor(mur,wysokosc):
  5. dlMuru = mur
  6. dlMuruKopia = dlMuru / 2
  7. wysokoscMuru = wysokosc
  8. builder.teleport_to(pos(-5, 0, 5))
  9. builder.set_origin()
  10. builder.mark()
  11. i = 0
  12. # pętla tworząca 3 warstwowe mury dookoła gracza
  13. while i < 3:
  14. j = 0
  15. while j < 4:
  16. builder.move(FORWARD, dlMuru)
  17. builder.raise_wall(MOSSY_STONE_BRICKS, wysokoscMuru)
  18. builder.turn(RIGHT_TURN)
  19. j += 1
  20. dlMuru += -2
  21. builder.move(RIGHT, 1)
  22. builder.move(FORWARD, 1)
  23. builder.mark()
  24. i += 1
  25. builder.move(UP, wysokoscMuru - 1)
  26. builder.face(WEST)
  27. builder.move(BACK, 15)
  28. builder.mark()
  29. i = 0
  30. #pętla tworząca schody
  31. while i < wysokoscMuru - 1:
  32. builder.shift(1, -1, 0)
  33. builder.line(STONE_BRICK_STAIRS)
  34. i += 1
  35. builder.teleport_to_origin()
  36. builder.move(UP, wysokoscMuru)
  37. builder.face(NORTH)
  38. builder.mark()
  39. i = 0
  40. #pętla tworząca wierzchołki
  41. while i < 4:
  42. j = 0
  43. while j < dlMuruKopia:
  44. builder.place(SEA_LANTERN)
  45. builder.move(FORWARD, 2)
  46. j += 1
  47. builder.turn(RIGHT_TURN)
  48. i += 1
  49.  
  50. player.on_chat("zamek", zamekKonstruktor)
  51.  
  52. def ekwipunek():
  53. # lista przedmiotów, które ma dostać gracz
  54. przedmioty = [NETHERITE_SWORD, 1, NETHERITE_AXE, 1, BOW, 1, ARROW, 64, FIREBALL, 10
  55. , LAVA_BUCKET, 5, NETHERITE_HELMET, 1, NETHERITE_CHESTPLATE, 1, NETHERITE_LEGGINGS, 1, NETHERITE_BOOTS, 1
  56. , SPRUCE_DOOR, 20, TORCH, 20, LADDER, 64, ENCHANTED_APPLE, 2, COOKED_PORKCHOP, 4]
  57. # Pętla przypisująca przedmioty graczowi
  58. for i in range(0, len(przedmioty), 2):
  59. mobs.give(mobs.target(NEAREST_PLAYER), przedmioty[i], przedmioty[i+1])
  60.  
  61.  
  62. player.on_chat("ekwipunek", ekwipunek)
  63.  
  64. def konSpawn():
  65. mobs.spawn(HORSE, pos(1, 0, 0))
  66. mobs.give(mobs.target(NEAREST_PLAYER), SADDLE, 1)
  67. mobs.give(mobs.target(NEAREST_PLAYER), IRON_HORSE_ARMOR, 1)
  68.  
  69. player.on_chat("kon", konSpawn)
  70.  
  71. # DESZCZ TNT LUB STRZAŁ -> FUNKCJA!
  72. def atak(rodzajPocisku, x, z):
  73. if rodzajPocisku == 1:
  74. rodzajPocisku = ARROW_PROJECTILE_MOB
  75. else:
  76. rodzajPocisku = PRIMED_TNT
  77. for i in range(20):
  78. mobs.spawn(rodzajPocisku, randpos(pos(x, 20, z), pos(x+20, 20, z+20)))
  79.  
  80. player.on_chat("a", atak)
  81.  
  82.  
  83. #atak mobów
  84. def moby(iloscMobow):
  85. #ustawienie przetrwania
  86. gameplay.set_game_mode(SURVIVAL, mobs.target(NEAREST_PLAYER))
  87. #ustawienie nocy
  88. gameplay.time_set(DayTime.NIGHT)
  89.  
  90. #tworzymy listę mobów
  91. lista = [CREEPER, ENDERMAN, ZOMBIE]
  92.  
  93. for i in range(len(lista)):
  94. for j in range(iloscMobow):
  95. mobs.spawn(lista[i], randpos(pos(25, 1, 25), pos(30, 1, 30)))
  96. loops.pause(2000)
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement