tweak lucky blocks and update readme
This commit is contained in:
parent
9a175b5dfb
commit
0fb4e82b58
10
README.txt
10
README.txt
@ -55,18 +55,20 @@ TenPlus1 Additions:
|
||||
- Added Pipeworks checks for fake players
|
||||
- Added 60 second drunk effect when foods have {alcohol=1} group (eat 4 or more)
|
||||
- Moved exhaustion and hud_id to player table instead of player attributes
|
||||
- Added 4 lucky block effects
|
||||
|
||||
|
||||
License:
|
||||
--------
|
||||
Code:
|
||||
- all code LGPL-2.1+
|
||||
|
||||
Textures:
|
||||
- stamina_hud_poison.png - BlockMen (CC-BY 3.0)
|
||||
- stamina_hud_fg.png - PilzAdam (WTFPL), modified by BlockMen
|
||||
- stamina_hud_bg.png - PilzAdam (WTFPL), modified by BlockMen
|
||||
Sounds:
|
||||
- stamina_eat.*.ogg - http://www.freesound.org/people/sonictechtonic/sounds/242215/ CC-BY-3.0
|
||||
|
||||
stamina_burp.ogg - https://www.freesfx.co.uk/sfx/burp (small burp)
|
||||
stamina_sip.ogg - https://elements.envato.com/sip-16081-C7V5YLG
|
||||
Sounds (CC-BY-3.0):
|
||||
- stamina_eat.*.ogg - http://www.freesound.org/people/sonictechtonic/sounds/242215/
|
||||
- stamina_burp.ogg - https://www.freesfx.co.uk/sfx/burp (small burp)
|
||||
- stamina_sip.ogg - https://elements.envato.com/sip-16081-C7V5YLG
|
||||
|
@ -2,3 +2,4 @@ default
|
||||
3d_armor?
|
||||
player_monoids?
|
||||
pova?
|
||||
lucky_block?
|
||||
|
35
init.lua
35
init.lua
@ -706,41 +706,12 @@ minetest.register_on_leaveplayer(function(player)
|
||||
end)
|
||||
|
||||
|
||||
--lucky blocks (if damage and stamina active)
|
||||
-- add lucky blocks (if damage and stamina active)
|
||||
if minetest.get_modpath("lucky_block")
|
||||
and minetest.settings:get_bool("enable_damage")
|
||||
and minetest.settings:get_bool("enable_stamina") ~= false then
|
||||
|
||||
local effect_me = function(pos, player, def)
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
local green = minetest.get_color_escape_sequence("#bada55")
|
||||
local name = player:get_player_name() ; if not name then return end
|
||||
|
||||
if def.poison or def.drunk then
|
||||
|
||||
player:hud_change(stamina.players[name].hud_id,
|
||||
"text", "stamina_hud_poison.png")
|
||||
end
|
||||
|
||||
if def.poison and def.poison > 0 then
|
||||
|
||||
stamina.players[name].poisoned = def.poison
|
||||
|
||||
minetest.chat_send_player(name,
|
||||
green .. "Seems you have been poisoned!")
|
||||
|
||||
elseif def.drunk and def.drunk > 0 then
|
||||
|
||||
stamina.players[name].drunk = def.drunk
|
||||
|
||||
minetest.chat_send_player(name,
|
||||
green .. "You seem a little tipsy!")
|
||||
end
|
||||
end
|
||||
|
||||
lucky_block:add_blocks({
|
||||
{"cus", effect_me, {poison = 5} },
|
||||
{"cus", effect_me, {poison = 10} },
|
||||
{"cus", effect_me, {drunk = 30} }
|
||||
})
|
||||
dofile(MP .. "/lucky_block.lua")
|
||||
end
|
||||
|
46
lucky_block.lua
Normal file
46
lucky_block.lua
Normal file
@ -0,0 +1,46 @@
|
||||
local green = minetest.get_color_escape_sequence("#bada55")
|
||||
local green2 = minetest.get_color_escape_sequence("#33ff55")
|
||||
|
||||
-- poison and drunk effects function
|
||||
local effect_me = function(pos, player, def)
|
||||
|
||||
local name = player:get_player_name() ; if not name then return end
|
||||
|
||||
if def.poison or def.drunk then
|
||||
|
||||
player:hud_change(stamina.players[name].hud_id, "text", "stamina_hud_poison.png")
|
||||
end
|
||||
|
||||
if def.poison and def.poison > 0 then
|
||||
|
||||
stamina.players[name].poisoned = def.poison
|
||||
|
||||
minetest.chat_send_player(name, green .. "Seems you have been poisoned!")
|
||||
|
||||
elseif def.drunk and def.drunk > 0 then
|
||||
|
||||
stamina.players[name].drunk = def.drunk
|
||||
|
||||
minetest.chat_send_player(name, green .. "You seem a little tipsy!")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- restore stamina function
|
||||
local full_stamina = function(pos, player, def)
|
||||
|
||||
local name = player:get_player_name() ; if not name then return end
|
||||
|
||||
stamina.change(player, 100) -- set to 100 incase of default stamina increase
|
||||
|
||||
minetest.chat_send_player(name, green2 .. "You suddenly feel full!")
|
||||
end
|
||||
|
||||
|
||||
-- add lucky blocks
|
||||
lucky_block:add_blocks({
|
||||
{"cus", effect_me, {poison = 5}},
|
||||
{"cus", effect_me, {poison = 10}},
|
||||
{"cus", effect_me, {drunk = 30}},
|
||||
{"cus", full_stamina}
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user