Skip to content

Instantly share code, notes, and snippets.

@Andrey2470T
Created July 7, 2018 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andrey2470T/c14d6acfc2a4e07b888b560ccd9fbdac to your computer and use it in GitHub Desktop.
Save Andrey2470T/c14d6acfc2a4e07b888b560ccd9fbdac to your computer and use it in GitHub Desktop.
diseases = {}
diseases_misc = {}
active_diseases = {["poisoning_disease"] = false}
--#####DISEASES#####
function diseases.register_poisoning_disease(playername, effect_time)
active_diseases["poisoning_disease"] = true
local player = minetest.get_player_by_name(playername)
minetest.hud_replace_builtin("health", {
hud_elem_type = "statbar",
position = {x = 0.5, y = 1},
text = "poisonous_heart.png",
number = 20,
direction = 0,
size = {x = 24, y = 24},
offset = {x = (-10*24)-25, y = -(48 + 24 + 16)}
})
player:set_physics_override({
speed = 0.4,
jump = 0.4,
gravity = 1.0,
sneak = true,
sneak_glitch = false
})
local player_properties = player:get_properties()
local player_textures = player_properties.textures
if table.maxn(player_textures) == 1 then
local player_current_texture = player_textures[1]
local player_add_texture = player_current_texture .. "^character_with_green_face.png"
default.player_set_textures(player, {player_add_texture})
--saved_players_properties[textures][playername] = player_add_texture
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment