Bug fixes

pull/14/head
Brandon 2015-07-25 00:14:32 -05:00
parent f5a8627bc4
commit fab18119f7
12 changed files with 62 additions and 57 deletions

View File

@ -19,23 +19,18 @@ local function adventuretest_globalstep(dtime)
end
minetest.register_globalstep(adventuretest_globalstep)
local function adventuretest_respawnplayer(player)
energy.respawnplayer(player)
hunger.update_hunger(player, 20)
affects.player_died(player)
if sethome_respawnplayer(player) == false then
mg_villages.spawnplayer(player)
end
return true
end
minetest.register_on_respawnplayer(adventuretest_respawnplayer)
local function adventuretest_die_player(player)
bones_on_dieplayer(player)
skills_on_dieplayer(player)
return true
energy.respawnplayer(player)
hunger.update_hunger(player, 20)
affects.player_died(player)
player:set_hp(20)
if sethome_respawnplayer(player) == false then
mg_villages.spawnplayer(player)
end
print("on respawn")
return true
end
minetest.register_on_dieplayer(adventuretest_die_player)

View File

@ -142,12 +142,12 @@ minetest.register_chatcommand("arena",{
})
minetest.register_on_dieplayer(function (player)
if ( #events > 0 ) then
arena.die(player)
end
return true
end)
--minetest.register_on_dieplayer(function (player)
--if ( #events > 0 ) then
-- arena.die(player)
--end
--return true
--end)
function string:split(sep)
local sep, fields = sep or ":", {}

View File

@ -26,6 +26,7 @@ minetest.register_alias("mapgen_mese", "default:mese")
minetest.register_alias("mapgen_desert_sand", "default:desert_sand")
minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
minetest.register_alias("mapgen_river_water_source","default:water_source")
--
-- Ore generation

View File

@ -158,6 +158,7 @@ function energy.respawnplayer(player)
local name = player:get_player_name()
player_energy[name] = 20
player_lastpos[name] = player:getpos()
energy.update_energy(player,name)
--affects.removeAffect(name,"tired")
end

View File

@ -1,12 +1,16 @@
-- TODO: this function also occours in replacements.lua
handle_schematics.get_content_id_replaced = function( node_name, replacements )
if( not( node_name ) or not( replacements ) or not(replacements.table )) then
return minetest.get_content_id( 'ignore' );
if( not( replacements ) or not(replacements.table )) then
if not( node_name ) then
return minetest.get_content_id( 'ignore' );
else
return minetest.get_content_id( node_name );
end
end
if( replacements.table[ node_name ]) then
return minetest.get_content_id( replacements.table[ node_name ] );
else
return minetest.get_content_id( node_name );
return minetest.get_content_id( node_name )
end
end
@ -164,7 +168,7 @@ local function generate_building_translate_nodenames( nodenames, replacements, c
-- place a normal chest here
new_nodes[ i ].new_content = cid.c_chest;
new_nodes[ i ].special_chest = node_name;
new_node_name = 'default:chest';
new_node_name = 'default:chest';
elseif(new_node_name == 'cottages:chest_private'
or new_node_name == 'cottages:chest_work'
@ -570,7 +574,7 @@ handle_schematics.place_buildings = function(village, minp, maxp, data, param2_d
cid.c_chest_spruce = handle_schematics.get_content_id_replaced( 'trees:chest_spruce', replacements );
cid.c_sign = handle_schematics.get_content_id_replaced( 'default:sign_wall', replacements );
--print('REPLACEMENTS: '..minetest.serialize( replacements.table )..' CHEST: '..tostring( minetest.get_name_from_content_id( cid.c_chest ))); -- TODO
--print("Chest CID" ..tostring(cid.c_chest))
local extranodes = {}
local extra_calls = { on_constr = {}, trees = {}, chests = {}, signs = {}, traders = {} };

View File

@ -5,16 +5,16 @@ ADD_RCC2 = function( data )
end
minetest.after(5,function()
ADD_RCC2({"farming:bread", 85, 3, 2, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"mobs:meat_raw", 70, 2, 2, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"bushes:berry_pie_cooked", 80, 4, 3, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"throwing:arrow", 30, 1, 3, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"farming:pumpkin_bread", 60, 3, 2, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"farming_plus:potato_item", 66, 2, 2, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"farming:bread", 85, 3, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"mobs:meat_raw", 70, 2, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"bushes:berry_pie_cooked", 80, 4, 3, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"throwing:arrow", 30, 1, 3, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"farming:pumpkin_bread", 60, 3, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"farming_plus:potato_item", 66, 2, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1})
ADD_RCC2({"experience:1_exp", 90, 6, 1, chest_storage=7, chest_private=6, shelf=5})
ADD_RCC2({"experience:3_exp", 85, 3, 1, chest_storage=7, chest_private=6, shelf=5})
ADD_RCC2({"experience:6_exp", 60, 2, 1, chest_storage=7, chest_private=6, shelf=5})
ADD_RCC2({"experience:9_exp", 40, 1, 1, chest_storage=7, chest_private=6, shelf=5})
ADD_RCC2({"experience:12_exp", 30, 1, 1, chest_storage=7, chest_private=6, shelf=5})
ADD_RCC2({"experience:1_exp", 90, 6, 1, chest_storage=1, chest_private=1, shelf=1})
ADD_RCC2({"experience:3_exp", 85, 3, 1, chest_storage=1, chest_private=1, shelf=1})
ADD_RCC2({"experience:6_exp", 60, 2, 1, chest_storage=1, chest_private=1, shelf=1})
ADD_RCC2({"experience:9_exp", 40, 1, 1, chest_storage=1, chest_private=1, shelf=1})
ADD_RCC2({"experience:12_exp", 30, 1, 1, chest_storage=1, chest_private=1, shelf=1})
end)

View File

@ -148,7 +148,7 @@ mg_villages.prices = {
-- know exactly what you are doing.
-----------------------------------------------------------------------------
-- if set to false, villages will not be integrated into the terrain - which looks very bad
mg_villages.ENABLE_TERRAIN_BLEND = false;
mg_villages.ENABLE_TERRAIN_BLEND = true;
-- if set to false, holes digged by cavegen and mudflow inside the village will not be repaired; houses will be destroyed
mg_villages.UNDO_CAVEGEN_AND_MUDFLOW = true;
@ -161,8 +161,8 @@ mg_villages.VILLAGE_CHECK_COUNT = 1
--mg_villages.VILLAGE_MAX_SIZE = 40
mg_villages.VILLAGE_CHANCE = 28
-- min and max size are only used in case of them beeing not provided by the village type (see buildings.lua)
mg_villages.VILLAGE_MIN_SIZE = 25
mg_villages.VILLAGE_MAX_SIZE = 90 --55
mg_villages.VILLAGE_MIN_SIZE = 10
mg_villages.VILLAGE_MAX_SIZE = 30 --55
mg_villages.FIRST_ROADSIZE = 3
mg_villages.BIG_ROAD_CHANCE = 0

View File

@ -35,7 +35,7 @@ ADD_RCC({"default:ladder", 20, 1, 2, church=1, library=1, shed=
ADD_RCC({"default:coal_lump", 80, 30, 1, forge=1, shed=1, lumberjack=1, hut=1});
ADD_RCC({"default:steel_ingot", 30, 4, 2, forge=1 });
ADD_RCC({"default:mese_crystal_fragment", 10, 3, 1, forge=1, chest_storage=1 });
--ADD_RCC({"default:mese_crystal_fragment", 10, 3, 1, forge=1, chest_storage=1 });
ADD_RCC({"bucket:bucket_empty", 10, 3, 2, chest_work=1, forge=1, shed=1, hut=1 });
ADD_RCC({"bucket:bucket_water", 5, 3, 2, chest_work=1, forge=1 });
@ -158,30 +158,32 @@ mg_villages.fill_chest_random = function( pos, pr, building_nr, building_typ )
if( pos.typ_name ) then
typ = pos.typ_name;
end
if( not( typ ) or (typ ~= "default:chest" and typ ~= 'cottages:shelf' and typ ~= 'cottages:chest_work' and typ ~= 'cottages:chest_storage' and typ ~= 'cottages:chest_private' )) then
typ = building_data.typ;
else
typ = string.sub( typ, 10 );
if ( typ == "default:chest" ) then
typ = "chest_storage"
else
if( not( typ ) or ( typ ~= 'cottages:shelf' and typ ~= 'cottages:chest_work' and typ ~= 'cottages:chest_storage' and typ ~= 'cottages:chest_private' )) then
typ = building_data.typ;
else
typ = string.sub( typ, 10 );
end
end
local typ2 = nil;
if( typ == 'cottages:chest_work' and building_data.typ ) then
typ2 = building_data.typ;
end
--print('FILLING chest of type '..tostring( typ )..' and '..tostring( typ2));
if( not( typ ) or typ=='' ) then
--print('FILLING chest of type '..tostring( typ )..' and '..tostring( typ2).." at "..minetest.pos_to_string(pos));
return;
end
local inv_size = inv:get_size('main');
for i,v in ipairs( mg_villages.random_chest_content ) do
--print(v[1])
for i,v in ipairs( mg_villages.random_chest_content ) do
-- repeat this many times
for count=1, v[ 4 ] do
-- to avoid too many things inside a chest, lower probability
if( count<30 -- make sure it does not get too much and there is still room for a new stack
and (v[ typ ] or (typ2 and v[ typ2 ]))
and inv_size and inv_size > 0 and v[ 2 ] > pr:next( 1, 200 )) then
--inv:add_item('main', v[ 1 ].." "..tostring( math.random( 1, tonumber(v[ 3 ]) )));
-- add itemstack at a random position in the chests inventory
inv:set_stack( 'main', pr:next( 1, inv:get_size( 'main' )), v[ 1 ].." "..tostring( pr:next( 1, tonumber(v[ 3 ]) )) );

View File

@ -833,6 +833,8 @@ mg_villages.place_villages_via_voxelmanip = function( villages, minp, maxp, vm,
if( not( village.is_single_house )) then
-- only add artificial snow if the village has at least a size of 15 (else it might look too artificial)
village.artificial_snow=0
--[[
if( not( village.artificial_snow ) and village.vs > 15) then
if( mg_villages.artificial_snow_probability and math.random( 1, mg_villages.artificial_snow_probability )==1
and minetest.registered_nodes['default:snow']) then
@ -841,7 +843,7 @@ mg_villages.place_villages_via_voxelmanip = function( villages, minp, maxp, vm,
village.artificial_snow = 0;
end
end
]]
-- will set village_area to N where .. is:
-- 2: a building
-- 3: border around a building

View File

@ -19,12 +19,12 @@
-- plant_frequency = 1 The higher this value is, the less plants are placed.
local village_type_data_list = {
nore = { min = 20, max = 40, space_between_buildings=1, mods={}, texture = 'default_stone_brick.png',
nore = { min = 15, max = 30, space_between_buildings=1, mods={}, texture = 'default_stone_brick.png',
replacement_function = mg_villages.replacements_nore },
taoki = { min = 30, max = 70, space_between_buildings=1, mods={}, texture = 'default_brick.png' ,
taoki = { min = 15, max = 30, space_between_buildings=1, mods={}, texture = 'default_brick.png' ,
sapling_divisor = 5, plant_type = 'farming:cotton_8', plant_frequency = 1,
replacement_function = mg_villages.replacements_taoki },
medieval = { min = 25, max = 60, space_between_buildings=2, mods={'cottages'}, texture = 'cottages_darkage_straw.png', -- they often have straw roofs
medieval = { min = 15, max = 30, space_between_buildings=2, mods={'cottages'}, texture = 'cottages_darkage_straw.png', -- they often have straw roofs
sapling_divisor = 10, plant_type = 'farming:wheat_8', plant_frequency = 1,
replacement_function = mg_villages.replacements_medieval,
roadsize_list = {2,3,4,5,6},
@ -39,9 +39,9 @@ local village_type_data_list = {
replacement_function = mg_villages.replacements_claytrader },
logcabin = { min = 15, max = 30, space_between_buildings=1, mods={'cottages'}, texture = 'default_wood.png',
replacement_function = mg_villages.replacements_logcabin },
canadian = { min = 40, max = 110, space_between_buildings=1, mods={'hdb','nbu'}, texture = 'wool_white.png',
canadian = { min = 10, max = 45, space_between_buildings=1, mods={'hdb','nbu'}, texture = 'wool_white.png',
replacement_function = mg_villages.replacements_canadian },
grasshut = { min = 10, max = 40, space_between_buildings=1, mods={'dryplants'}, texture = 'dryplants_reed.png',
grasshut = { min = 10, max = 20, space_between_buildings=1, mods={'dryplants'}, texture = 'dryplants_reed.png',
replacement_function = mg_villages.replacements_grasshut },
tent = { min = 5, max = 20, space_between_buildings=2, mods={'cottages'}, texture = 'wool_white.png', name_preifx = 'Tent at',
replacement_function = mg_villages.replacements_tent },

View File

@ -787,7 +787,7 @@ function mobs:register_mob(name, def)
for _, oir in pairs(inradius) do
local obj = oir:get_luaentity()
if obj then
if obj.group_attack == true and obj.state ~= "attack" then
if obj.group_attack == true and obj.state ~= "attack" and self.type == obj.type then
obj.do_attack(obj,hitter,1)
end
end

View File

@ -49,7 +49,7 @@ mobs:register_mob("mobs:jungle_spider",{
self.attack.player:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups = {fleshy=self.damage}
}, vec)
})
if randomChance(40) then
-- poison the player
affects.affectPlayer(target:get_player_name(),"spider_poison")