oerkki.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. -- That flying thing. NOT supposed to be an oerkki, but not changing name now
  2. -- due to long usage.
  3. mobs.register_mob("oerkki:oerkki", {
  4. type = "monster",
  5. description = "Flying Menace",
  6. passive = false,
  7. attack_type = "dogfight",
  8. reach = 2,
  9. punch_reach = 3,
  10. damage = 3*500,
  11. damage_group = "snappy",
  12. hp_min = 8*500,
  13. hp_max = 34*500,
  14. armor = 100,
  15. armor_level = 2,
  16. --collisionbox = {-0.3, -1, -0.3, 0.3, 0.7, 0.3},
  17. collisionbox = {-0.4, -0.4, -0.4, 0.4, 0.4, 0.4},
  18. visual = "mesh",
  19. mesh = "mobs_oerkki2.b3d",
  20. textures = {
  21. {"mobs_oerkki3.png"},
  22. },
  23. rotate = 270,
  24. makes_footstep_sound = false,
  25. sounds = {
  26. random = "mobs_oerkki",
  27. },
  28. walk_velocity = 2,
  29. run_velocity = 5,
  30. view_range = 15,
  31. jump = false,
  32. fly = true,
  33. fly_in = "air",
  34. drops = {
  35. {name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
  36. {name = "mobs:leather", chance = 2, min = 1, max = 1},
  37. },
  38. water_damage = 1*500,
  39. lava_damage = 100*500,
  40. light_damage = 1*500,
  41. fear_height = 0,
  42. animation = {
  43. stand_start = 1,
  44. stand_end = 29,
  45. walk_start = 1,
  46. walk_end = 29,
  47. run_start = 1,
  48. run_end = 29,
  49. punch_start = 30,
  50. punch_end = 60,
  51. speed_normal = 15,
  52. speed_run = 15,
  53. },
  54. replace_rate = 10,
  55. replace_what = {
  56. "torches:torch_floor",
  57. "torches:torch_wall",
  58. "torches:torch_ceiling",
  59. "torches:kalite_torch_floor",
  60. "torches:kalite_torch_wall",
  61. "torches:kalite_torch_ceiling",
  62. },
  63. replace_with = "air",
  64. replace_offset = 0,
  65. replace_range = 2,
  66. immune_to = {
  67. {"default:gold_lump", -10}, -- heals by 10 points
  68. },
  69. glow = 3,
  70. -- Throw player off things.
  71. punch_target = function(self, object, attack)
  72. if attack and attack:is_player() then
  73. local p1 = object:get_pos()
  74. local p2 = attack:get_pos()
  75. p1.y = p2.y
  76. local vel = vector.subtract(p2, p1)
  77. -- Quick hack to fix problems with null vectors.
  78. if vector.length(vel) < 0.01 then
  79. vel.x = 1
  80. end
  81. vel = vector.normalize(vel)
  82. vel = vector.add(vel, {x=0, y=0.5, z=0})
  83. vel = vector.multiply(vel, 7)
  84. -- The player needs to be kicked up 1 node manually, because otherwise
  85. -- the collision box of the menace prevents them from being thrown, very
  86. -- often.
  87. p2.y = p2.y + 1
  88. p1.y = p1.y - 1
  89. object:set_pos(p1)
  90. attack:set_pos(p2)
  91. minetest.after(0.3, function()
  92. attack:add_player_velocity(vel)
  93. end)
  94. end
  95. end,
  96. })
  97. mobs.register_egg("oerkki:oerkki", "Oerkki", "default_obsidian.png", 1)
  98. mobs.alias_mob("mobs_monster:oerkki2", "oerkki:oerkki")