From c55a8f8dcdfba4d35628668517a1f3ce14ec5fd3 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Thu, 12 Jan 2023 14:41:20 -0400 Subject: [PATCH] posibility to configure blood or cry when attack or being under attack --- README.md | 6 +++++- README.txt | 6 +++++- minetest.conf | 2 ++ mods/adventuretest/init.lua | 8 ++++++++ mods/default/player.lua | 5 ++++- mods/mobs/api.lua | 6 +++++- mods/mobs/textures/mobs_blood_blue.png | Bin 0 -> 5852 bytes 7 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 mods/mobs/textures/mobs_blood_blue.png 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 0000000000000000000000000000000000000000..b285eb2bf0451fac9a29e3db730c77e550407190 GIT binary patch literal 5852 zcmeHLc~}$I7EjcICWwes5N#QQBB&vgg={7$CM;1R6sTaeJ|{C17$FPE#3Z;?D=La2 zxC>IMqIIp}Rt2|D6!oE?wzN;AXl>C}{jiFN3i|E@#Mt`m^LwxV317m@xxe!}=br5{ zlNCEIvM0lrL8H-ns-l!};I9Yu>Fxr){T@6=Xtb_JG7^%=IK&DWO$IHIhC`&?h(oxI z(9&qOE9Vn+c{c*x+Ny$@yGM2DR&jmrRKxCyde?w)6?O6v>#=P$D|(+v%BWcmaofH) zw%{?-ySDtaeaXPgDd~rP_Dpu$Am3GzQKEl1U1Rv%^@zj|PUsR;A^5$wRG0^(ALMcyPFPrq{#kmp`d1tQ&vo z>0PCyWz=ugBMxjEhz$6bG+b8OZRp{v{t>m8)#>^5t9Wp_x98%*%w8*ahFmw*E!7YA z24qBE&A2vb=kbZLJ-WjM?kD|g`D^@8bIwK4_l+}Z#w}mz(opC#ojjXkCRM%8Pvk6k zrVlK*Kc^G#qTvYN|-GTyGQ=k9F#gQ6OTwe z(zn{{U`0~m*p!Rfi6=<@fejlN0a-o+dYQfryj*k?D`qTQI%3!$Gd|&P_h8TO!;j^k zub#4UkebEY$V%)sHFQt){rpv>V|v@`yANACC0jeWZrx+Cy?7>1aC%2SR{yFbx_4E! zOZM5TclI#mRsX$;#CWLONT7H z=cx=+=ed;>Jc#nMT!a>scsG_kI*0Z0!rT6@$;!9_Sq~?DYS+lFMZC%Kf9lx{2 zxJl&`KL6yQc5cJ8pN1q)$^Kw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