diff --git a/README.md b/README.md index 641b79a..2042813 100644 --- a/README.md +++ b/README.md @@ -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 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 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 and physics file. This happens sometimes when there is a crash. - Adventuretest License ------------------------------------------ Copyright (C) 2013-2014 Brandon Bohannon diff --git a/README.txt b/README.txt index 641b79a..2042813 100644 --- a/README.txt +++ b/README.txt @@ -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 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 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 and physics file. This happens sometimes when there is a crash. - Adventuretest License ------------------------------------------ Copyright (C) 2013-2014 Brandon Bohannon diff --git a/minetest.conf b/minetest.conf index 3562104..f6d3c03 100644 --- a/minetest.conf +++ b/minetest.conf @@ -5,6 +5,8 @@ enable_node_highlighting = true debug_log_level = action +enable_blood = true + torches_enable_ceiling = false torches_style = minetest diff --git a/mods/adventuretest/init.lua b/mods/adventuretest/init.lua index 75146c9..85abc32 100644 --- a/mods/adventuretest/init.lua +++ b/mods/adventuretest/init.lua @@ -3,6 +3,11 @@ adventuretest = {} 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 if minetest.setting_get("game_origin") ~= nil then game_origin = minetest.string_to_pos(minetest.setting_get("game_origin")) @@ -10,6 +15,9 @@ else game_origin = {x=0,y=3,z=0} end +adventuretest.blood = enable_blood + + dofile(minetest.get_modpath("adventuretest").."/functions.lua"); dofile(minetest.get_modpath("adventuretest").."/register_functions.lua"); dofile(minetest.get_modpath("adventuretest").."/privs.lua") diff --git a/mods/default/player.lua b/mods/default/player.lua index 5826900..128553b 100644 --- a/mods/default/player.lua +++ b/mods/default/player.lua @@ -216,10 +216,13 @@ end adventuretest.register_pl_hook(default.player_globalstep,0) 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) local name = player:get_player_name() 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 player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0}) local sleep_hud = pd.get(name,"sleep_hud") diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index d6f6b46..81d87a7 100644 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -1,5 +1,9 @@ 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") 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, blood_offset = def.blood_offset or 0, 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, stationary = def.stationary or false, activity_level = def.activity_level or 10, diff --git a/mods/mobs/textures/mobs_blood_blue.png b/mods/mobs/textures/mobs_blood_blue.png new file mode 100644 index 0000000..b285eb2 Binary files /dev/null and b/mods/mobs/textures/mobs_blood_blue.png differ