Stalker may be overloaded, but never charged

This commit is contained in:
the-real-herowl 2024-05-19 02:49:40 +02:00
parent 18af03b99c
commit af13bd0635
2 changed files with 11 additions and 11 deletions

View File

@ -44,8 +44,8 @@ local function get_texture(self)
return texture return texture
end end
local AURA = "vl_stalker_charge.png" local AURA = "vl_stalker_overloaded_aura.png"
local function get_charged_aura(timer) local function get_overloaded_aura(timer)
local frame = math.floor(timer*16) local frame = math.floor(timer*16)
local f = tostring(frame) local f = tostring(frame)
local nf = tostring(16-f) local nf = tostring(16-f)
@ -177,8 +177,8 @@ mcl_mobs.register_mob("mobs_mc:stalker", {
view_range = 16, view_range = 16,
}) })
mcl_mobs.register_mob("mobs_mc:stalker_charged", { mcl_mobs.register_mob("mobs_mc:stalker_overloaded", {
description = S("Charged Stalker"), description = S("Overloaded Stalker"),
type = "monster", type = "monster",
spawn_class = "hostile", spawn_class = "hostile",
hp_min = 20, hp_min = 20,
@ -194,7 +194,7 @@ mcl_mobs.register_mob("mobs_mc:stalker_charged", {
textures = { textures = {
{get_texture({}), {get_texture({}),
"vl_stalker_charge.png"}, AURA},
}, },
use_texture_alpha = true, use_texture_alpha = true,
visual_size = {x=2, y=2}, visual_size = {x=2, y=2},
@ -253,7 +253,7 @@ mcl_mobs.register_mob("mobs_mc:stalker_charged", {
end end
if not self._aura_timer or self._aura_timer > 1 then self._aura_timer = 0 end if not self._aura_timer or self._aura_timer > 1 then self._aura_timer = 0 end
self._aura_timer = self._aura_timer + dtime self._aura_timer = self._aura_timer + dtime
self.object:set_properties({textures={get_texture(self), get_charged_aura(self._aura_timer)}}) self.object:set_properties({textures={get_texture(self), get_overloaded_aura(self._aura_timer)}})
end, end,
on_die = function(self, pos, cmi_cause) on_die = function(self, pos, cmi_cause)
-- Drop a random music disc when killed by skeleton or stray -- Drop a random music disc when killed by skeleton or stray
@ -268,7 +268,7 @@ mcl_mobs.register_mob("mobs_mc:stalker_charged", {
end end
end, end,
on_lightning_strike = function(self, pos, pos2, objects) on_lightning_strike = function(self, pos, pos2, objects)
mcl_util.replace_mob(self.object, "mobs_mc:stalker_charged") mcl_util.replace_mob(self.object, "mobs_mc:stalker_overloaded")
return true return true
end, end,
maxdrops = 2, maxdrops = 2,
@ -280,7 +280,7 @@ mcl_mobs.register_mob("mobs_mc:stalker_charged", {
looting = "common",}, looting = "common",},
-- Head -- Head
-- TODO: Only drop if killed by charged stalker -- TODO: Only drop if killed by overloaded stalker
{name = "mcl_heads:stalker", {name = "mcl_heads:stalker",
chance = 200, -- 0.5% chance = 200, -- 0.5%
min = 1, min = 1,
@ -323,13 +323,13 @@ minetest.register_entity("mobs_mc:creeper", {
}) })
minetest.register_entity("mobs_mc:creeper_charged", { minetest.register_entity("mobs_mc:creeper_charged", {
on_activate = function(self, staticdata, dtime) on_activate = function(self, staticdata, dtime)
local obj = minetest.add_entity(self.object:get_pos(), "mobs_mc:stalker_charged", staticdata) local obj = minetest.add_entity(self.object:get_pos(), "mobs_mc:stalker_overloaded", staticdata)
obj:set_properties({ obj:set_properties({
visual_size = {x=2, y=2}, visual_size = {x=2, y=2},
mesh = "vl_stalker.b3d", mesh = "vl_stalker.b3d",
textures = { textures = {
{get_texture({}), {get_texture({}),
"vl_stalker_charge.png"}, AURA},
}, },
}) })
self.object:remove() self.object:remove()
@ -487,4 +487,4 @@ mcl_vars.mg_overworld_max)
-- spawn eggs -- spawn eggs
mcl_mobs.register_egg("mobs_mc:stalker", S("Stalker"), "#0da70a", "#000000", 0) mcl_mobs.register_egg("mobs_mc:stalker", S("Stalker"), "#0da70a", "#000000", 0)
minetest.register_alias("mobs_mc:creeper", "mobs_mc:stalker") minetest.register_alias("mobs_mc:creeper", "mobs_mc:stalker")
mcl_mobs.register_egg("mobs_mc:stalker_charged", S("Charged Stalker"), "#00a77a", "#000000", 0) mcl_mobs.register_egg("mobs_mc:stalker_overloaded", S("Overloaded Stalker"), "#00a77a", "#000000", 0)

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB