Compare commits
2 Commits
0af5f94e21
...
c55a8f8dcd
Author | SHA1 | Date | |
---|---|---|---|
c55a8f8dcd | |||
5ba7c54408 |
@ -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 <brandon@bremaweb.com>
|
||||
|
@ -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 <brandon@bremaweb.com>
|
||||
|
@ -5,6 +5,8 @@ enable_node_highlighting = true
|
||||
|
||||
debug_log_level = action
|
||||
|
||||
enable_blood = true
|
||||
|
||||
torches_enable_ceiling = false
|
||||
torches_style = minetest
|
||||
|
||||
|
@ -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")
|
||||
|
@ -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")
|
||||
|
@ -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,
|
||||
|
BIN
mods/mobs/textures/mobs_blood_blue.png
Normal file
BIN
mods/mobs/textures/mobs_blood_blue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
@ -89,22 +89,52 @@ local function inventory_set(player, size)
|
||||
end
|
||||
|
||||
local function on_craft(itemstack,player,old_craftgrid,craft_inv)
|
||||
if itemstack:get_definition().skill ~= nil then
|
||||
|
||||
local name = player:get_player_name()
|
||||
local probability = skills.get_probability(name,SKILL_CRAFTING,itemstack:get_definition().skill)
|
||||
local rangeLow = ( probability - 10 ) / 100
|
||||
if not name then return nil end
|
||||
|
||||
local craftItemDef = itemstack:get_definition()
|
||||
if not craftItemDef then return nil end
|
||||
|
||||
local craftItemSkill = craftItemDef.skill
|
||||
if not craftItemSkill then return nil end
|
||||
|
||||
if craftItemDef.type == "tool" then
|
||||
local isSameItem = true
|
||||
local itemCount = 0
|
||||
local craftedItemName = craftItemDef.name
|
||||
for _,recipeStack in ipairs(old_craftgrid) do
|
||||
local recipeItemName = recipeStack:get_name()
|
||||
if recipeItemName ~= "" then
|
||||
itemCount = itemCount + 1
|
||||
if itemCount > 2 then break end
|
||||
if recipeItemName ~= craftedItemName then
|
||||
isSameItem = false
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if isSameItem and itemCount == 2 then
|
||||
-- Yes we can ... repair
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local probability = skills.get_probability(name, SKILL_CRAFTING, craftItemSkill)
|
||||
local rangeLow = math.max(( probability - 10 ) / 100, 0.0)
|
||||
probability = probability / 100
|
||||
local wear = math.floor(50000 - ( 50000 * math.random(rangeLow,probability) ))
|
||||
itemstack:add_wear(wear)
|
||||
local i = skills.add_skill_exp(name,SKILL_CRAFTING,1)
|
||||
local ii = skills.add_skill_exp(name,itemstack:get_definition().skill,1)
|
||||
if i or ii then
|
||||
local craftItemDefw = itemstack:get_definition()
|
||||
local craftItemSkillw = craftItemDefw.skill
|
||||
-- local i = skills.add_skill_exp(name,SKILL_CRAFTING,1)
|
||||
local ii = skills.add_skill_exp(name,craftItemSkillw,1)
|
||||
if ii then
|
||||
minetest.chat_send_player(name,"Your skills are increasing!")
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
minetest.register_on_craft(on_craft)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user