posibility to configure blood or cry when attack or being under attack

master
mckaygerhard 2023-01-12 14:41:20 -04:00
parent 5ba7c54408
commit c55a8f8dcd
7 changed files with 29 additions and 4 deletions

View File

@ -33,6 +33,11 @@ of the inventory. also once in the game type `/m` and press
enter and you will get a crafting guide, equipping armor form enter and you will get a crafting guide, equipping armor form
and changing skin form. and changing skin form.
### Configuration
By default each interaction of attack causes blood, but you
can configure to make the enemy just cry with `enable_blood` to `false`
### Know issues ### Know issues
If yu got crash, somethigns you game get slow for movement, in singleplayer, If yu got crash, somethigns you game get slow for movement, in singleplayer,
@ -41,7 +46,6 @@ a block just stop it.
To solve, go into your world directory and delete the affects.txt To solve, go into your world directory and delete the affects.txt
and physics file. This happens sometimes when there is a crash. and physics file. This happens sometimes when there is a crash.
Adventuretest License Adventuretest License
------------------------------------------ ------------------------------------------
Copyright (C) 2013-2014 Brandon Bohannon <brandon@bremaweb.com> Copyright (C) 2013-2014 Brandon Bohannon <brandon@bremaweb.com>

View File

@ -33,6 +33,11 @@ of the inventory. also once in the game type `/m` and press
enter and you will get a crafting guide, equipping armor form enter and you will get a crafting guide, equipping armor form
and changing skin form. and changing skin form.
### Configuration
By default each interaction of attack causes blood, but you
can configure to make the enemy just cry with `enable_blood` to `false`
### Know issues ### Know issues
If yu got crash, somethigns you game get slow for movement, in singleplayer, If yu got crash, somethigns you game get slow for movement, in singleplayer,
@ -41,7 +46,6 @@ a block just stop it.
To solve, go into your world directory and delete the affects.txt To solve, go into your world directory and delete the affects.txt
and physics file. This happens sometimes when there is a crash. and physics file. This happens sometimes when there is a crash.
Adventuretest License Adventuretest License
------------------------------------------ ------------------------------------------
Copyright (C) 2013-2014 Brandon Bohannon <brandon@bremaweb.com> Copyright (C) 2013-2014 Brandon Bohannon <brandon@bremaweb.com>

View File

@ -5,6 +5,8 @@ enable_node_highlighting = true
debug_log_level = action debug_log_level = action
enable_blood = true
torches_enable_ceiling = false torches_enable_ceiling = false
torches_style = minetest torches_style = minetest

View File

@ -3,6 +3,11 @@ adventuretest = {}
adventuretest.seed = os.time() adventuretest.seed = os.time()
local enable_blood
if minetest.setting_get("enable_blood") ~= nil then
enable_blood = minetest.setting_getbool("enable_blood") or true
end
game_origin = nil game_origin = nil
if minetest.setting_get("game_origin") ~= nil then if minetest.setting_get("game_origin") ~= nil then
game_origin = minetest.string_to_pos(minetest.setting_get("game_origin")) game_origin = minetest.string_to_pos(minetest.setting_get("game_origin"))
@ -10,6 +15,9 @@ else
game_origin = {x=0,y=3,z=0} game_origin = {x=0,y=3,z=0}
end end
adventuretest.blood = enable_blood
dofile(minetest.get_modpath("adventuretest").."/functions.lua"); dofile(minetest.get_modpath("adventuretest").."/functions.lua");
dofile(minetest.get_modpath("adventuretest").."/register_functions.lua"); dofile(minetest.get_modpath("adventuretest").."/register_functions.lua");
dofile(minetest.get_modpath("adventuretest").."/privs.lua") dofile(minetest.get_modpath("adventuretest").."/privs.lua")

View File

@ -216,10 +216,13 @@ end
adventuretest.register_pl_hook(default.player_globalstep,0) adventuretest.register_pl_hook(default.player_globalstep,0)
if minetest.register_on_punchplayer ~= nil then if minetest.register_on_punchplayer ~= nil then
local enable_blood = adventuretest.blood
local texture_blood_cry = "mobs_blood_blue.png"
if enable_blood then texture_blood_cry = "mobs_blood.png" end
minetest.register_on_punchplayer( function(player, hitter, time_from_last_punch, tool_capabilities, dir) minetest.register_on_punchplayer( function(player, hitter, time_from_last_punch, tool_capabilities, dir)
local name = player:get_player_name() local name = player:get_player_name()
process_weapon(hitter,time_from_last_punch,tool_capabilities) process_weapon(hitter,time_from_last_punch,tool_capabilities)
blood_particles(player:getpos(),0.5,27,"mobs_blood.png") blood_particles(player:getpos(),0.5,27,texture_blood_cry)
if player_anim[name] == "lay" or player_anim[name] == "sit" then if player_anim[name] == "lay" or player_anim[name] == "sit" then
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0}) player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
local sleep_hud = pd.get(name,"sleep_hud") local sleep_hud = pd.get(name,"sleep_hud")

View File

@ -1,5 +1,9 @@
mobs = {} mobs = {}
local enable_blood = adventuretest.blood
local texture_blood_cry = "mobs_blood_blue.png"
if enable_blood then texture_blood_dry = "mobs_blood.png" end
dofile(minetest.get_modpath("mobs").."/step.lua") dofile(minetest.get_modpath("mobs").."/step.lua")
mobs.mob_list = { npc={}, barbarian={}, monster={}, animal={}, npc_special={}} mobs.mob_list = { npc={}, barbarian={}, monster={}, animal={}, npc_special={}}
@ -58,7 +62,7 @@ function mobs:register_mob(name, def)
knock_back = def.knock_back or 3, knock_back = def.knock_back or 3,
blood_offset = def.blood_offset or 0, blood_offset = def.blood_offset or 0,
blood_amount = def.blood_amount or 15, blood_amount = def.blood_amount or 15,
blood_texture = def.blood_texture or "mobs_blood.png", blood_texture = texture_blood_cry,
rewards = def.rewards or nil, rewards = def.rewards or nil,
stationary = def.stationary or false, stationary = def.stationary or false,
activity_level = def.activity_level or 10, activity_level = def.activity_level or 10,

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB