Turn enderman to monster, but reduce view range

This commit is contained in:
Wuzzy 2018-12-22 14:29:45 +01:00
parent e1870c2808
commit fa3fd68c8c

@ -3,6 +3,13 @@
--made for MC like Survival game --made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes --License for code WTFPL and otherwise stated in readmes
-- ENDERMAN BEHAVIOUR:
-- In this game, endermen attack the player on sight, like other monsters do.
-- However, they have a reduced viewing range to make them less dangerous.
-- This differs from MC, in which endermen only become hostile when provoked,
-- and they are provoked by looking directly at them.
-- TODO: Implement MC behaviour.
-- intllib -- intllib
local MP = minetest.get_modpath(minetest.get_current_modname()) local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua") local S, NS = dofile(MP.."/intllib.lua")
@ -164,8 +171,8 @@ end
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
mobs:register_mob("mobs_mc:enderman", { mobs:register_mob("mobs_mc:enderman", {
-- TODO: Make endermen attack when looked at -- TODO: Endermen should be classified as passive
type = "animal", type = "monster",
passive = false, passive = false,
pathfinding = 1, pathfinding = 1,
stepheight = 1.2, stepheight = 1.2,
@ -320,7 +327,9 @@ mobs:register_mob("mobs_mc:enderman", {
water_damage = 8, water_damage = 8,
lava_damage = 4, lava_damage = 4,
light_damage = 0, light_damage = 0,
view_range = 16, -- TODO: Increase view range when it detects being seen
-- Low view range to emulate that behaviour somehow
view_range = 4,
fear_height = 4, fear_height = 4,
attack_type = "dogfight", attack_type = "dogfight",
blood_amount = 0, blood_amount = 0,