entity.lua 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. -- Copyright (C) 2020 2021 PsycoJaker
  2. -- This file is part of UwU Mod Minetest Mod.
  3. -- UwU Mod is free software: you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation, either version 3 of the License, or
  6. -- any later version.
  7. -- UwU Mod is distributed in the hope that it will be useful,
  8. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. -- GNU General Public License for more details.
  11. -- You should have received a copy of the GNU General Public License
  12. -- along with UwU Mod. If not, see <https://www.gnu.org/licenses/>.
  13. -----------------UWU-----------------
  14. local S = core.get_translator(core.get_current_modname())
  15. local uwu_spawn = core.settings:get_bool("uwu.entity_spawn") ~= false
  16. local uwu_big = {
  17. description = S("UwU"),
  18. type = "animal",
  19. spawn_class = "passive",
  20. can_despawn = true,
  21. hp_min = 16,
  22. hp_max = 16,
  23. xp_min = 4,
  24. xp_max = 4,
  25. collisionbox = {-1.02, -0.01, -1.02, 1.02, 2.03, 1.02},
  26. visual_size = {x=12.5, y=12.5},
  27. textures = {{ "uwu_entity.png", "uwu_entity.png" }},
  28. visual = "mesh",
  29. mesh = "mobs_mc_magmacube.b3d",
  30. makes_footstep_sound = true,
  31. sounds = {
  32. jump = "",
  33. death = "mobs_mc_magma_cube_big",
  34. attack = "uwu",
  35. distance = 16,
  36. base_pitch = 0.65,
  37. },
  38. walk_velocity = 2.5,
  39. run_velocity = 2.5,
  40. damage = 6,
  41. reach = 3,
  42. armor = 53,
  43. drops = {},
  44. -- TODO: Fix animations
  45. animation = {
  46. jump_speed = 20,
  47. stand_speed = 20,
  48. walk_speed = 20,
  49. jump_start = 1,
  50. jump_end = 40,
  51. stand_start = 1,
  52. stand_end = 1,
  53. walk_start = 1,
  54. walk_end = 40,
  55. },
  56. follow = {
  57. "uwu:crystal",
  58. },
  59. pick_up = {"uwu:crystal"},
  60. on_pick_up = uwu.entity_on_pickup,
  61. water_damage = 0,
  62. lava_damage = 1,
  63. fire_damage = 1,
  64. light_damage = 0,
  65. fall_damage = 0,
  66. view_range = 16,
  67. attack_type = "dogfight",
  68. passive = false,
  69. jump = true,
  70. jump_height = 8,
  71. walk_chance = 0,
  72. fear_height = 5,
  73. spawn_small_alternative = "uwu:uwu_small",
  74. on_die = uwu.spawn_children_on_die("uwu:uwu_small", 0.8, 1.5),
  75. fire_resistant = false,
  76. attacks_monsters = true,
  77. attack_animals = false,
  78. }
  79. mcl_mobs.register_mob("uwu:uwu_big", uwu_big)
  80. local uwu_small = table.copy(uwu_big)
  81. uwu_small.sounds.jump = ""
  82. uwu_small.sounds.death = "mobs_mc_magma_cube_small"
  83. uwu_small.sounds.base_pitch = 1
  84. uwu_small.hp_min = 4
  85. uwu_small.hp_max = 4
  86. uwu_small.xp_min = 2
  87. uwu_small.xp_max = 2
  88. uwu_small.collisionbox = {-0.51, -0.01, -0.51, 0.51, 1.00, 0.51}
  89. uwu_small.visual_size = {x=6.25, y=6.25}
  90. uwu_small.reach = 2.75
  91. uwu_small.walk_velocity = .8
  92. uwu_small.run_velocity = 2.0
  93. uwu_small.jump_height = 6
  94. uwu_small.damage = 1
  95. uwu_small.reach = 2.75
  96. uwu_small.armor = 66
  97. uwu_small.spawn_small_alternative = "uwu:uwu_tiny"
  98. uwu_small.on_die = uwu.spawn_children_on_die("uwu:uwu_tiny", 0.6, 1.0)
  99. mcl_mobs.register_mob("uwu:uwu_small", uwu_small)
  100. local uwu_tiny = table.copy(uwu_big)
  101. uwu_tiny.sounds.jump = ""
  102. uwu_tiny.sounds.death = "mobs_mc_magma_cube_small"
  103. uwu_tiny.sounds.base_pitch = 1.25
  104. uwu_tiny.hp_min = 1
  105. uwu_tiny.hp_max = 1
  106. uwu_tiny.xp_min = 1
  107. uwu_tiny.xp_max = 1
  108. uwu_tiny.collisionbox = {-0.2505, -0.01, -0.2505, 0.2505, 0.50, 0.2505}
  109. uwu_tiny.visual_size = {x=3.125, y=3.125}
  110. uwu_tiny.walk_velocity = 1.02
  111. uwu_tiny.run_velocity = 1.02
  112. uwu_tiny.jump_height = 4
  113. uwu_tiny.damage = 0
  114. uwu_tiny.reach = 2.5
  115. uwu_tiny.armor = 50
  116. uwu_tiny.drops = {
  117. {name = "uwu:crystal",
  118. chance = 4,
  119. min = 1,
  120. max = 1,},
  121. }
  122. uwu_tiny.pick_up = nil
  123. uwu_tiny.on_pick_up = nil
  124. uwu_tiny.spawn_small_alternative = nil
  125. uwu_tiny.on_die = nil
  126. uwu_tiny.attacks_monsters = false
  127. mcl_mobs.register_mob("uwu:uwu_tiny", uwu_tiny)
  128. local cave_biomes = {
  129. "FlowerForest_underground",
  130. "JungleEdge_underground",
  131. "StoneBeach_underground",
  132. "MesaBryce_underground",
  133. "Mesa_underground",
  134. "RoofedForest_underground",
  135. "Jungle_underground",
  136. "Swampland_underground",
  137. "BirchForest_underground",
  138. "Plains_underground",
  139. "MesaPlateauF_underground",
  140. "ExtremeHills_underground",
  141. "MegaSpruceTaiga_underground",
  142. "BirchForestM_underground",
  143. "SavannaM_underground",
  144. "MesaPlateauFM_underground",
  145. "Desert_underground",
  146. "Savanna_underground",
  147. "Forest_underground",
  148. "SunflowerPlains_underground",
  149. "ColdTaiga_underground",
  150. "IcePlains_underground",
  151. "IcePlainsSpikes_underground",
  152. "MegaTaiga_underground",
  153. "Taiga_underground",
  154. "ExtremeHills+_underground",
  155. "JungleM_underground",
  156. "ExtremeHillsM_underground",
  157. "JungleEdgeM_underground",
  158. "MangroveSwamp_underground"
  159. }
  160. local water_level = mobs_mc.water_level
  161. local cave_min = mcl_vars.mg_overworld_min
  162. local cave_max = water_level - 23
  163. local light_level = 7 --minetest.LIGHT_MAX+1
  164. if uwu_spawn then
  165. mcl_mobs:spawn_specific(
  166. "uwu:uwu_tiny",
  167. "overworld",
  168. "ground",
  169. cave_biomes,
  170. 0,
  171. light_level,
  172. 30, -- interval
  173. 35000, -- chance
  174. 1, -- count
  175. cave_min,
  176. cave_max)
  177. mcl_mobs:spawn_specific(
  178. "uwu:uwu_small",
  179. "overworld",
  180. "ground",
  181. cave_biomes,
  182. 0,
  183. light_level,
  184. 30, -- interval
  185. 85000, -- chance
  186. 1, -- count
  187. cave_min,
  188. cave_max)
  189. mcl_mobs:spawn_specific(
  190. "uwu:uwu_big",
  191. "overworld",
  192. "ground",
  193. cave_biomes,
  194. 0,
  195. light_level,
  196. 30, -- interval
  197. 55000, -- chance
  198. 1, -- count
  199. cave_min,
  200. cave_max)
  201. end
  202. mcl_mobs.register_egg("uwu:uwu_tiny", S("UwU tiny"), "#FEE41A", "#ED5FF9")
  203. mcl_mobs.register_egg("uwu:uwu_small", S("UwU small"), "#FEE41A", "#ED5FF9")
  204. mcl_mobs.register_egg("uwu:uwu_big", S("UwU Big"), "#FEE41A", "#ED5FF9")