diff --git a/.gitignore b/.gitignore index acf7968..f8b5424 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .stignore .stfolder/ +.blend1 diff --git a/mods/gamer/change_skin.lua b/mods/gamer/change_skin.lua new file mode 100644 index 0000000..54f99b1 --- /dev/null +++ b/mods/gamer/change_skin.lua @@ -0,0 +1,72 @@ +local skin_selection = + 'formspec_version[3]'.. + 'size[9,7]'.. + 'textarea[.5,.5;8,2.5;;;Enter the number of the skin tone in the box below. This change is free, future changes will cost 500XP.]'.. + 'image[1,3;7,1;gamer_skin_swatch.png]'.. + 'field[1,5.5;2,1;tone;What skin tone would you like?;]'.. + 'button_exit[3.5,5.5;2,1;exit;Close]'.. + 'button_exit[6,5.5;2,1;save;Save]'.. + 'tooltip[save;!!!You can only do this once!!!]' + +local skin_selection_1 = + 'formspec_version[3]'.. + 'size[9,7]'.. + 'textarea[.5,.5;8,2.5;;;Enter the number of the skin tone in the box below. If you do not have 500XP you will not be able to change skin color.]'.. + 'image[1,3;7,1;gamer_skin_swatch.png]'.. + 'field[1,5.5;2,1;tone;What skin tone would you like?;]'.. + 'button_exit[3.5,5.5;2,1;exit;Close]'.. + 'button_exit[6,5.5;2,1;save;Save]'.. + 'tooltip[save;!!!This will cost 500XP!!!]' + +minetest.register_chatcommand('skin', { + description = 'Change your skin.', + privs = {server=true}, + func = function(name) + local player = minetest.get_player_by_name(name) + local player_attributes = player:get_meta() + local tone = player_attributes:get_int('tone') + print (tone) + if tone == 0 or nil then + minetest.show_formspec(name, 'gamer:skin_selection', skin_selection) + else + minetest.show_formspec(name, 'gamer:skin_selection_1', skin_selection_1) + end + end +}) + +minetest.register_on_player_receive_fields(function(player, formname, fields) + local name = player:get_player_name() + if formname == 'gamer:skin_selection' then + if fields.save then + local tone = tonumber(fields.tone) + if tone >= 1 and tone <= 7 then + local player_attributes = player:get_meta() + local skin_col = 'gamer_skin_'..tone..'.png' + player_attributes:set_int('tone', tone) + gamer.player_set_textures(player, {skin_col}) + minetest.chat_send_player(name, 'Skin tone updated!') + gamer.save_skins() + else + minetest.chat_send_player(name, 'Select a valid skin tone.') + end + end + elseif formname == 'gamer:skin_selection_1' then + if fields.save then + local tone = tonumber(fields.tone) + if tone >= 1 and tone <= 7 then + if lobby.take_xp(player, 500) then + local player_attributes = player:get_meta() + local skin_col = 'gamer_skin_'..tone..'.png' + player_attributes:set_int('tone', tone) + gamer.player_set_textures(player, {skin_col}) + minetest.chat_send_player(name, 'Skin tone updated!') + gamer.save_skins() + else + minetest.chat_send_player(name, 'Sorry, you need more XP.') + end + else + minetest.chat_send_player(name, 'Select a valid skin tone.') + end + end + end +end) diff --git a/mods/gamer/init.lua b/mods/gamer/init.lua index adb925e..3e85bda 100644 --- a/mods/gamer/init.lua +++ b/mods/gamer/init.lua @@ -1,4 +1,20 @@ gamer = {} +gamer.player_attached = {} +gamer.registered_player_models = {} + +local file = io.open(minetest.get_worldpath() .. '/skins', 'r') +if file then + gamer.player_textures = minetest.deserialize(file:read('*a')) + file:close() +else + gamer.player_textures = {} +end + +function gamer.save_skins() + local file = io.open(minetest.get_worldpath() .. '/skins', 'w') + file:write(minetest.serialize(gamer.player_textures)) + file:close() +end minetest.register_item(':', { type = 'none', @@ -7,8 +23,6 @@ minetest.register_item(':', { range = 10, }) -gamer.registered_player_models = { } - -- Local for speed. local models = gamer.registered_player_models @@ -19,7 +33,7 @@ end -- Default player appearance gamer.player_register_model('gamer_model.b3d', { animation_speed = 30, - textures = {'gamer_skin.png', }, + textures = {'gamer_skin_default.png'}, animations = { -- Standard animations. stand = { x= 0, y= 79, }, @@ -36,21 +50,18 @@ gamer.player_register_model('gamer_model.b3d', { -- Player stats and animations local player_model = {} -local player_textures = {} local player_anim = {} local player_sneak = {} -gamer.player_attached = {} function gamer.player_get_animation(player) local name = player:get_player_name() return { model = player_model[name], - textures = player_textures[name], + textures = gamer.player_textures[name], animation = player_anim[name], } end --- Called when a player's appearance needs to be updated function gamer.player_set_model(player, model_name) local name = player:get_player_name() local model = models[model_name] @@ -60,24 +71,24 @@ function gamer.player_set_model(player, model_name) end player:set_properties({ mesh = model_name, - textures = player_textures[name] or model.textures, + textures = gamer.player_textures[name] or {'gamer_skin_default.png'}, visual = 'mesh', - visual_size = model.visual_size or {x=1, y=1}, + visual_size = {x=10, y=10}, }) gamer.player_set_animation(player, 'stand') else player:set_properties({ - textures = { 'player.png', 'player_back.png', }, + textures = {'gamer_skin_default.png'}, visual = 'upright_sprite', }) end player_model[name] = model_name end -function gamer.player_set_textures(player, textures) +function gamer.player_set_textures(player, texture) local name = player:get_player_name() - player_textures[name] = textures - player:set_properties({textures = textures,}) + gamer.player_textures[name] = texture + player:set_properties({textures = texture}) end function gamer.player_set_animation(player, anim_name, speed) @@ -110,7 +121,7 @@ minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() player_model[name] = nil player_anim[name] = nil - player_textures[name] = nil + gamer.save_skins() end) -- Localize for better performance. @@ -170,3 +181,6 @@ local function player_heal() minetest.after(3.0, player_heal) end minetest.after(5.0, player_heal) + + +dofile(minetest.get_modpath('gamer')..'/change_skin.lua') diff --git a/mods/gamer/models/character.blend b/mods/gamer/models/character.blend new file mode 100644 index 0000000..1b612d6 Binary files /dev/null and b/mods/gamer/models/character.blend differ diff --git a/mods/gamer/models/character.blend1 b/mods/gamer/models/character.blend1 new file mode 100644 index 0000000..662a9ab Binary files /dev/null and b/mods/gamer/models/character.blend1 differ diff --git a/mods/gamer/models/gamer_model.b3d b/mods/gamer/models/gamer_model.b3d index 8edbaf6..c3d3b78 100644 Binary files a/mods/gamer/models/gamer_model.b3d and b/mods/gamer/models/gamer_model.b3d differ diff --git a/mods/gamer/textures/gamer_skin.png b/mods/gamer/textures/gamer_skin.png index b074f15..2821917 100644 Binary files a/mods/gamer/textures/gamer_skin.png and b/mods/gamer/textures/gamer_skin.png differ diff --git a/mods/gamer/textures/gamer_skin.svg b/mods/gamer/textures/gamer_skin.svg new file mode 100644 index 0000000..2e936ae --- /dev/null +++ b/mods/gamer/textures/gamer_skin.svg @@ -0,0 +1,44 @@ + + + +character.blend, (Blender 2.93.5) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mods/gamer/textures/gamer_skin.xcf b/mods/gamer/textures/gamer_skin.xcf new file mode 100644 index 0000000..41547b0 Binary files /dev/null and b/mods/gamer/textures/gamer_skin.xcf differ diff --git a/mods/gamer/textures/gamer_skin_1.png b/mods/gamer/textures/gamer_skin_1.png new file mode 100644 index 0000000..8bd6edf Binary files /dev/null and b/mods/gamer/textures/gamer_skin_1.png differ diff --git a/mods/gamer/textures/gamer_skin_2.png b/mods/gamer/textures/gamer_skin_2.png new file mode 100644 index 0000000..ce38ad4 Binary files /dev/null and b/mods/gamer/textures/gamer_skin_2.png differ diff --git a/mods/gamer/textures/gamer_skin_3.png b/mods/gamer/textures/gamer_skin_3.png new file mode 100644 index 0000000..0161b2e Binary files /dev/null and b/mods/gamer/textures/gamer_skin_3.png differ diff --git a/mods/gamer/textures/gamer_skin_4.png b/mods/gamer/textures/gamer_skin_4.png new file mode 100644 index 0000000..b9d4b33 Binary files /dev/null and b/mods/gamer/textures/gamer_skin_4.png differ diff --git a/mods/gamer/textures/gamer_skin_5.png b/mods/gamer/textures/gamer_skin_5.png new file mode 100644 index 0000000..c9355df Binary files /dev/null and b/mods/gamer/textures/gamer_skin_5.png differ diff --git a/mods/gamer/textures/gamer_skin_6.png b/mods/gamer/textures/gamer_skin_6.png new file mode 100644 index 0000000..3b8aded Binary files /dev/null and b/mods/gamer/textures/gamer_skin_6.png differ diff --git a/mods/gamer/textures/gamer_skin_7.png b/mods/gamer/textures/gamer_skin_7.png new file mode 100644 index 0000000..89efe5c Binary files /dev/null and b/mods/gamer/textures/gamer_skin_7.png differ diff --git a/mods/gamer/textures/gamer_skin_default.png b/mods/gamer/textures/gamer_skin_default.png new file mode 100644 index 0000000..75d1c4f Binary files /dev/null and b/mods/gamer/textures/gamer_skin_default.png differ diff --git a/mods/gamer/textures/gamer_skin_swatch.png b/mods/gamer/textures/gamer_skin_swatch.png new file mode 100644 index 0000000..d3ba0f9 Binary files /dev/null and b/mods/gamer/textures/gamer_skin_swatch.png differ diff --git a/mods/lobby/buttons.lua b/mods/lobby/buttons.lua index e76297b..cbf3d89 100644 --- a/mods/lobby/buttons.lua +++ b/mods/lobby/buttons.lua @@ -327,11 +327,10 @@ minetest.register_node('lobby:button_1', { if solo == 'true' then lobby.update_stats(map_id, 'solo') local name = puncher:get_player_name() - gamer.player_set_textures(puncher,{'lobby_ghost.png'}) puncher:set_nametag_attributes({ color = {a = 0, r = 255, g = 255, b = 255} }) - puncher:set_properties({visual_size = {x = 1, y = 1}, collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}}) + puncher:set_properties({visual_size = {x = 0, y = 0}, collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}}) player_attributes:set_string('mode', 'solo') local privs = minetest.get_player_privs(name) local player_inv = puncher:get_inventory() diff --git a/mods/lobby/chat_commands.lua b/mods/lobby/chat_commands.lua index ea99239..66ad58c 100644 --- a/mods/lobby/chat_commands.lua +++ b/mods/lobby/chat_commands.lua @@ -46,11 +46,10 @@ minetest.register_chatcommand('lobby', { local player_attributes = player:get_meta() local mode = player_attributes:get_string('mode') if mode == 'ghost' or mode == 'solo' then - gamer.player_set_textures(player,{'gamer_skin.png'}) player:set_nametag_attributes({ color = {a = 255, r = 255, g = 255, b = 255} }) - player:set_properties({visual_size = {x = 1, y = 1}, collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}}) + player:set_properties({visual_size = {x = 10, y = 10}, collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}}) player:set_pos(lobby.spawn_pos) lobby.game[name] = 'lobby' minetest.chat_send_player(name, 'Here you are.') diff --git a/mods/lobby/corpse.lua b/mods/lobby/corpse.lua index 076d439..4e9bb40 100644 --- a/mods/lobby/corpse.lua +++ b/mods/lobby/corpse.lua @@ -1,46 +1,49 @@ -minetest.register_node('lobby:corpse', { - description = 'Corpse', - drawtype = 'mesh', - mesh = 'corpse.obj', - tiles = {'lobby_corpse.png', 'lobby_blood.png'}, - use_texture_alpha = true, - walkable = false, - groups = {breakable=1, not_in_creative_inventory=1}, - paramtype = 'light', - paramtype2 = 'facedir', - selection_box = { - type = 'fixed', - fixed = {-.6, -.5, -.6, .6, -.2, .6}, -- Right, Bottom, Back, Left, Top, Front - }, - collision_box = { - type = 'fixed', - fixed = {-.6, -.5, -.6, .6, -.2, .6}, -- Right, Bottom, Back, Left, Top, Front - }, - on_rightclick = function(pos, node, clicker, itemstack) - local name = clicker:get_player_name() - local player_attributes = clicker:get_meta() - local mode = player_attributes:get_string('mode') - local voting = player_attributes:get_string('voting') - local map_id = lobby.game[name] - if voting == 'false' then - if map_id ~= 'lobby' and mode == 'player' then - minetest.remove_node(pos) - local game_data = lobby.savedata.data[map_id] - local game_pos = game_data['level_pos'] - local survivors = lobby.players_on_level(map_id) - lobby.votes[map_id] = 0 - for _, player in pairs(minetest.get_connected_players()) do - local rname = player:get_player_name() - if lobby.game[rname] == map_id then - lobby.voted[rname] = false - player:set_physics_override({speed=0}) - player_attributes:set_string('voting', 'true') - minetest.chat_send_player(rname, minetest.colorize('#FF0000', 'Somebody discovered a corpse!')) - minetest.show_formspec(rname, 'lobby:voting', lobby.voting_formspec(survivors)) - player:set_pos({x=game_pos.x+(math.random(-3,3)),y=game_pos.y,z=game_pos.z+(math.random(-3,3))}) +for i = 1,7 do + + minetest.register_node('lobby:corpse_'..i, { + description = 'Corpse', + drawtype = 'mesh', + mesh = 'corpse.obj', + tiles = {'gamer_skin_'..i..'.png^lobby_corpse.png', 'lobby_blood.png'}, + use_texture_alpha = true, + walkable = false, + groups = {breakable=1, not_in_creative_inventory=1}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-.6, -.5, -.6, .6, -.2, .6}, -- Right, Bottom, Back, Left, Top, Front + }, + collision_box = { + type = 'fixed', + fixed = {-.6, -.5, -.6, .6, -.2, .6}, -- Right, Bottom, Back, Left, Top, Front + }, + on_rightclick = function(pos, node, clicker, itemstack) + local name = clicker:get_player_name() + local player_attributes = clicker:get_meta() + local mode = player_attributes:get_string('mode') + local voting = player_attributes:get_string('voting') + local map_id = lobby.game[name] + if voting == 'false' then + if map_id ~= 'lobby' and mode == 'player' then + minetest.remove_node(pos) + local game_data = lobby.savedata.data[map_id] + local game_pos = game_data['level_pos'] + local survivors = lobby.players_on_level(map_id) + lobby.votes[map_id] = 0 + for _, player in pairs(minetest.get_connected_players()) do + local rname = player:get_player_name() + if lobby.game[rname] == map_id then + lobby.voted[rname] = false + player:set_physics_override({speed=0}) + player_attributes:set_string('voting', 'true') + minetest.chat_send_player(rname, minetest.colorize('#FF0000', 'Somebody discovered a corpse!')) + minetest.show_formspec(rname, 'lobby:voting', lobby.voting_formspec(survivors)) + player:set_pos({x=game_pos.x+(math.random(-3,3)),y=game_pos.y,z=game_pos.z+(math.random(-3,3))}) + end end end end - end - end, -}) + end, + }) +end diff --git a/mods/lobby/functions.lua b/mods/lobby/functions.lua index 97af0a7..679ed66 100644 --- a/mods/lobby/functions.lua +++ b/mods/lobby/functions.lua @@ -137,7 +137,6 @@ function lobby.vote(map_id, force) lobby.message_to_level(map_id, 'The votes are in, '..kick..' will be kicked.') local player = minetest.get_player_by_name(kick) local player_attributes = player:get_meta() - gamer.player_set_textures(player,{'lobby_ghost.png'}) player:set_nametag_attributes({ color = {a = 0, r = 255, g = 255, b = 255} }) diff --git a/mods/lobby/models/corpse.obj b/mods/lobby/models/corpse.obj index eefa458..7f2ff99 100644 --- a/mods/lobby/models/corpse.obj +++ b/mods/lobby/models/corpse.obj @@ -1,423 +1,210 @@ -# Blender v2.83.5 OBJ File: 'character.blend' +# Blender v2.93.5 OBJ File: 'character.blend' # www.blender.org -o Player_Cube -v -0.208247 -0.491621 -0.198331 -v -0.208247 -0.283374 -0.198331 -v -0.208247 -0.491621 0.426410 -v -0.208247 -0.283374 0.426410 -v -0.362489 -0.285412 0.461850 -v -0.363025 -0.493644 0.459434 -v -0.174274 -0.493109 0.371458 -v -0.173739 -0.284876 0.373874 -v -0.626417 -0.278164 -0.104358 -v -0.626952 -0.486397 -0.106773 -v -0.438201 -0.485861 -0.194749 -v -0.437666 -0.277629 -0.192333 -v -0.366393 -0.492176 -0.774836 -v -0.366393 -0.283929 -0.774836 -v -0.204698 -0.492176 -0.171382 -v -0.204698 -0.283929 -0.171382 -v -0.274314 -0.059409 0.455924 -v 0.018710 -0.059409 0.751903 -v -0.570294 -0.059409 0.748949 -v -0.277269 -0.059409 1.044928 -v 0.208247 -0.283374 -0.198331 -v 0.208247 -0.491621 -0.198331 -v 0.208247 -0.283374 0.426410 -v 0.208247 -0.491621 0.426410 -v 0.754580 -0.277629 0.613806 -v 0.756674 -0.485861 0.615125 -v 0.610193 -0.486397 0.763145 -v 0.608100 -0.278164 0.761826 -v 0.310562 -0.284876 0.174379 -v 0.312656 -0.493109 0.175698 -v 0.166175 -0.493644 0.323718 -v 0.164081 -0.285412 0.322399 -v -0.165242 -0.283929 -0.828734 -v -0.165242 -0.492176 -0.828734 -v -0.003547 -0.492176 -0.225280 -v -0.003547 -0.283929 -0.225280 -v 0.018710 -0.475903 0.751903 -v -0.274314 -0.475903 0.455924 -v -0.277269 -0.475903 1.044928 -v -0.570294 -0.475903 0.748949 -v 0.085372 -0.283929 -0.095910 -v 0.085372 -0.492176 -0.095910 -v 0.699898 -0.283929 0.016604 -v 0.699898 -0.492176 0.016604 -v 0.737403 -0.283929 -0.188238 -v 0.737403 -0.492176 -0.188238 -v 0.122877 -0.492176 -0.300752 -v 0.122877 -0.283929 -0.300752 -v -0.274174 -0.039576 0.427876 -v 0.046758 -0.039576 0.752044 -v -0.598342 -0.039576 0.748808 -v -0.277410 -0.039576 1.072976 -v 0.046758 -0.495736 0.752044 -v -0.274174 -0.495736 0.427876 -v -0.277410 -0.495736 1.072976 -v -0.598342 -0.495736 0.748808 -v 0.208247 -0.283374 0.426410 -v 0.208247 -0.283374 0.426410 -v 0.208247 -0.491621 0.426410 -v 0.208247 -0.491621 0.426410 -v 0.208247 -0.491621 -0.198331 -v 0.208247 -0.491621 -0.198331 -v 0.208247 -0.283374 -0.198331 -v 0.208247 -0.283374 -0.198331 -v -0.208247 -0.491621 0.426410 -v -0.208247 -0.491621 0.426410 -v -0.208247 -0.491621 -0.198331 -v -0.208247 -0.491621 -0.198331 -v -0.208247 -0.283374 0.426410 -v -0.208247 -0.283374 0.426410 -v -0.208247 -0.283374 -0.198331 -v -0.208247 -0.283374 -0.198331 -v -0.362489 -0.285412 0.461850 -v -0.362489 -0.285412 0.461850 -v -0.626417 -0.278164 -0.104358 -v -0.626417 -0.278164 -0.104358 -v -0.174274 -0.493109 0.371458 -v -0.174274 -0.493109 0.371458 -v -0.438201 -0.485861 -0.194749 -v -0.438201 -0.485861 -0.194749 -v -0.363025 -0.493644 0.459434 -v -0.363025 -0.493644 0.459434 -v -0.626952 -0.486397 -0.106773 -v -0.626952 -0.486397 -0.106773 -v -0.173739 -0.284876 0.373874 -v -0.173739 -0.284876 0.373874 -v -0.437666 -0.277629 -0.192333 -v -0.437666 -0.277629 -0.192333 -v -0.165242 -0.492176 -0.828734 -v -0.165242 -0.492176 -0.828734 -v -0.165242 -0.283929 -0.828734 -v -0.165242 -0.283929 -0.828734 -v -0.366393 -0.492176 -0.774836 -v -0.366393 -0.492176 -0.774836 -v -0.204698 -0.492176 -0.171382 -v -0.204698 -0.492176 -0.171382 -v -0.204698 -0.283929 -0.171382 -v -0.204698 -0.283929 -0.171382 -v -0.366393 -0.283929 -0.774836 -v -0.366393 -0.283929 -0.774836 -v -0.277269 -0.475903 1.044928 -v -0.277269 -0.475903 1.044928 -v -0.570294 -0.475903 0.748949 -v -0.570294 -0.475903 0.748949 -v -0.274314 -0.475903 0.455924 -v -0.274314 -0.475903 0.455924 -v 0.018710 -0.475903 0.751903 -v 0.018710 -0.475903 0.751903 -v -0.570294 -0.059409 0.748949 -v -0.570294 -0.059409 0.748949 -v -0.274314 -0.059409 0.455924 -v -0.274314 -0.059409 0.455924 -v -0.277269 -0.059409 1.044928 -v -0.277269 -0.059409 1.044928 -v 0.018710 -0.059409 0.751903 -v 0.018710 -0.059409 0.751903 -v 0.310562 -0.284876 0.174379 -v 0.310562 -0.284876 0.174379 -v 0.312656 -0.493109 0.175698 -v 0.312656 -0.493109 0.175698 -v 0.756674 -0.485861 0.615125 -v 0.756674 -0.485861 0.615125 -v 0.754580 -0.277629 0.613806 -v 0.754580 -0.277629 0.613806 -v 0.166175 -0.493644 0.323718 -v 0.166175 -0.493644 0.323718 -v 0.610193 -0.486397 0.763145 -v 0.610193 -0.486397 0.763145 -v 0.164081 -0.285412 0.322399 -v 0.164081 -0.285412 0.322399 -v 0.608100 -0.278164 0.761826 -v 0.608100 -0.278164 0.761826 -v -0.003547 -0.492176 -0.225280 -v -0.003547 -0.492176 -0.225280 -v 0.122877 -0.492176 -0.300752 -v 0.122877 -0.492176 -0.300752 -v 0.085372 -0.492176 -0.095910 -v 0.085372 -0.492176 -0.095910 -v 0.737403 -0.492176 -0.188238 -v 0.737403 -0.492176 -0.188238 -v -0.003547 -0.283929 -0.225280 -v -0.003547 -0.283929 -0.225280 -v 0.699898 -0.492176 0.016604 -v 0.699898 -0.492176 0.016604 -v 0.737403 -0.283929 -0.188238 -v 0.737403 -0.283929 -0.188238 -v 0.699898 -0.283929 0.016604 -v 0.699898 -0.283929 0.016604 -v 0.085372 -0.283929 -0.095910 -v 0.085372 -0.283929 -0.095910 -v 0.122877 -0.283929 -0.300752 -v 0.122877 -0.283929 -0.300752 -v -0.277410 -0.495736 1.072976 -v -0.277410 -0.495736 1.072976 -v -0.598342 -0.495736 0.748808 -v -0.598342 -0.495736 0.748808 -v -0.274174 -0.495736 0.427876 -v -0.274174 -0.495736 0.427876 -v 0.046758 -0.495736 0.752044 -v 0.046758 -0.495736 0.752044 -v -0.598342 -0.039576 0.748808 -v -0.598342 -0.039576 0.748808 -v -0.274174 -0.039576 0.427876 -v -0.274174 -0.039576 0.427876 -v -0.277410 -0.039576 1.072976 -v -0.277410 -0.039576 1.072976 -v 0.046758 -0.039576 0.752044 -v 0.046758 -0.039576 0.752044 -v -0.500000 -0.497427 1.000000 -v 0.500000 -0.497427 1.000000 -v -0.500000 -0.497427 0.000000 -v 0.500000 -0.497427 0.000000 -vt 0.625000 0.375000 -vt 0.500000 0.375000 -vt 0.500000 0.000000 -vt 0.625000 0.000000 -vt 0.500000 0.375000 -vt 0.437500 0.375000 -vt 0.437500 0.000000 -vt 0.500000 0.000000 -vt 0.437500 0.375000 -vt 0.312500 0.375000 -vt 0.312500 0.000000 -vt 0.437500 0.000000 -vt 0.562500 0.375000 -vt 0.562500 0.500000 -vt 0.437500 0.500000 -vt 0.437500 0.375000 -vt 0.437500 0.375000 -vt 0.437500 0.500000 -vt 0.312500 0.500000 -vt 0.312500 0.375000 -vt 0.125000 0.375000 -vt 0.125000 0.000000 -vt 0.187500 0.000000 -vt 0.187500 0.375000 -vt 0.812500 0.375000 -vt 0.875000 0.375000 -vt 0.875000 0.000000 -vt 0.812500 0.000000 -vt 0.750000 0.375000 -vt 0.812500 0.375000 -vt 0.812500 0.000000 -vt 0.750000 0.000000 -vt 0.187500 0.375000 -vt 0.187500 0.500000 -vt 0.125000 0.500000 -vt 0.125000 0.375000 -vt 0.000000 0.375000 -vt 0.062500 0.375000 -vt 0.062500 0.000000 -vt 0.000000 0.000000 -vt 0.500000 0.750000 -vt 0.375000 0.750000 -vt 0.375000 0.500000 -vt 0.500000 0.500000 -vt 0.375000 0.750000 -vt 0.250000 0.750000 -vt 0.250000 0.500000 -vt 0.375000 0.500000 -vt 0.250000 0.750000 -vt 0.125000 0.750000 -vt 0.125000 0.500000 -vt 0.250000 0.500000 -vt 0.375000 0.750000 -vt 0.375000 1.000000 -vt 0.250000 1.000000 -vt 0.250000 0.750000 -vt 0.250000 0.750000 -vt 0.250000 1.000000 -vt 0.125000 1.000000 -vt 0.125000 0.750000 -vt 0.187500 0.375000 -vt 0.250000 0.375000 -vt 0.250000 0.000000 -vt 0.187500 0.000000 -vt 0.062500 0.375000 -vt 0.062500 0.000000 -vt 0.125000 0.000000 -vt 0.125000 0.375000 -vt 0.062500 0.375000 -vt 0.125000 0.375000 -vt 0.125000 0.000000 -vt 0.062500 0.000000 -vt 0.750000 0.375000 -vt 0.812500 0.375000 +o Corpse_Cube.002 +v -0.355892 -0.491048 -0.777268 +v -0.195967 -0.491048 -0.173075 +v -0.355892 -0.303548 -0.777268 +v -0.195967 -0.303548 -0.173075 +v -0.174634 -0.491048 -0.825246 +v -0.014709 -0.491048 -0.221053 +v -0.174634 -0.303548 -0.825246 +v -0.014709 -0.303548 -0.221053 +v 0.702052 -0.491048 0.006353 +v 0.087397 -0.491048 -0.106893 +v 0.702052 -0.303548 0.006353 +v 0.087397 -0.303548 -0.106893 +v 0.736026 -0.491048 -0.178044 +v 0.121371 -0.491048 -0.291289 +v 0.736026 -0.303548 -0.178044 +v 0.121371 -0.303548 -0.291289 +v 0.617185 -0.491048 0.754127 +v 0.171932 -0.491048 0.315521 +v 0.617185 -0.303548 0.754127 +v 0.171932 -0.303548 0.315521 +v 0.748767 -0.491048 0.620551 +v 0.303514 -0.491048 0.181945 +v 0.748767 -0.303548 0.620551 +v 0.303514 -0.303548 0.181945 +v -0.614225 -0.491048 -0.109879 +v -0.350397 -0.491048 0.456707 +v -0.614225 -0.303548 -0.109879 +v -0.350397 -0.303548 0.456707 +v -0.444249 -0.491048 -0.189028 +v -0.180421 -0.491048 0.377559 +v -0.444249 -0.303548 -0.189028 +v -0.180421 -0.303548 0.377559 +v -0.187500 -0.490804 -0.190104 +v -0.187500 -0.490803 0.434896 +v -0.187500 -0.303304 -0.190104 +v -0.187500 -0.303303 0.434896 +v 0.187500 -0.490804 -0.190104 +v 0.187500 -0.490803 0.434896 +v 0.187500 -0.303304 -0.190104 +v 0.187500 -0.303303 0.434896 +v -0.268083 -0.491048 0.468701 +v -0.557024 -0.491048 0.754274 +v -0.268083 -0.116048 0.468701 +v -0.557024 -0.116048 0.754274 +v -0.004477 -0.491048 0.735416 +v -0.293418 -0.491048 1.020989 +v -0.004477 -0.116048 0.735416 +v -0.293418 -0.116048 1.020989 +v -0.562500 -0.497427 1.125000 +v 0.437500 -0.497427 1.125000 +v 0.437500 -0.497427 0.125000 +v -0.562500 -0.497427 0.125000 +vt 0.757812 0.156250 +vt 0.757812 0.468750 +vt 0.710938 0.468750 +vt 0.710938 0.156250 +vt 0.664062 0.468750 +vt 0.664062 0.156250 +vt 0.617188 0.468750 +vt 0.617188 0.156250 +vt 0.804688 0.156250 +vt 0.804688 0.468750 +vt 0.664062 0.062500 +vt 0.617188 0.062500 +vt 0.664062 0.562500 +vt 0.617188 0.562500 +vt 0.859375 0.156250 +vt 0.906250 0.156250 +vt 0.906250 0.468750 +vt 0.859375 0.468750 +vt 0.953125 0.156250 +vt 0.953125 0.468750 +vt 1.000000 0.156250 +vt 1.000000 0.468750 +vt 0.812500 0.156250 +vt 0.812500 0.468750 +vt 0.953125 0.062500 +vt 1.000000 0.062500 +vt 1.000000 0.562500 +vt 0.953125 0.562500 +vt 0.953125 0.593750 +vt 0.906250 0.593750 +vt 0.906250 0.906250 +vt 0.953125 0.906250 +vt 0.859375 0.593750 +vt 0.859375 0.906250 +vt 0.812500 0.593750 +vt 0.812500 0.906250 +vt 1.000000 0.593750 +vt 1.000000 0.906250 +vt 0.859375 0.500000 vt 0.812500 0.500000 -vt 0.750000 0.500000 -vt 0.687500 0.375000 -vt 0.750000 0.375000 -vt 0.750000 0.500000 -vt 0.687500 0.500000 -vt 0.187500 0.375000 -vt 0.187500 0.000000 -vt 0.250000 0.000000 -vt 0.250000 0.375000 -vt 0.125000 0.375000 -vt 0.187500 0.375000 -vt 0.187500 0.000000 -vt 0.125000 0.000000 -vt 0.000000 0.375000 -vt 0.000000 0.000000 -vt 0.062500 0.000000 -vt 0.062500 0.375000 -vt 0.250000 0.375000 -vt 0.250000 0.000000 -vt 0.312500 0.000000 -vt 0.312500 0.375000 -vt 0.000000 0.750000 -vt 0.000000 0.500000 -vt 0.125000 0.500000 -vt 0.125000 0.750000 -vt 0.125000 0.375000 -vt 0.125000 0.500000 -vt 0.062500 0.500000 -vt 0.062500 0.375000 -vt 0.687500 0.375000 -vt 0.750000 0.375000 -vt 0.750000 0.000000 -vt 0.687500 0.000000 -vt 0.625000 0.375000 -vt 0.687500 0.375000 -vt 0.687500 0.000000 -vt 0.625000 0.000000 -vt 0.625000 0.375000 -vt 0.625000 0.000000 -vt 0.687500 0.000000 -vt 0.687500 0.375000 -vt 0.687500 0.375000 -vt 0.687500 0.500000 -vt 0.750000 0.500000 -vt 0.750000 0.375000 -vt 0.687500 0.375000 -vt 0.687500 0.000000 -vt 0.750000 0.000000 -vt 0.750000 0.375000 -vt 0.187500 0.375000 -vt 0.125000 0.375000 -vt 0.125000 0.500000 -vt 0.187500 0.500000 -vt 0.750000 0.375000 -vt 0.750000 0.000000 -vt 0.812500 0.000000 -vt 0.812500 0.375000 -vt 0.750000 0.375000 -vt 0.750000 0.500000 -vt 0.812500 0.500000 -vt 0.812500 0.375000 -vt 0.812500 0.375000 -vt 0.812500 0.000000 -vt 0.875000 0.000000 -vt 0.875000 0.375000 -vt 0.125000 0.375000 -vt 0.062500 0.375000 -vt 0.062500 0.500000 -vt 0.125000 0.500000 -vt 1.000000 0.750000 -vt 0.875000 0.750000 -vt 0.875000 0.500000 -vt 1.000000 0.500000 -vt 0.875000 0.750000 -vt 0.750000 0.750000 -vt 0.750000 0.500000 -vt 0.875000 0.500000 -vt 0.750000 0.750000 -vt 0.625000 0.750000 -vt 0.625000 0.500000 -vt 0.750000 0.500000 -vt 0.875000 0.750000 -vt 0.875000 1.000000 -vt 0.750000 1.000000 -vt 0.750000 0.750000 -vt 0.750000 0.750000 -vt 0.750000 1.000000 -vt 0.625000 1.000000 -vt 0.625000 0.750000 -vt 0.500000 0.750000 -vt 0.500000 0.500000 -vt 0.625000 0.500000 -vt 0.625000 0.750000 -vt 1.000000 1.000000 +vt 0.812500 1.000000 +vt 0.859375 1.000000 +vt 0.664062 0.593750 +vt 0.664062 0.906250 +vt 0.710938 0.906250 +vt 0.710938 0.593750 +vt 0.757812 0.906250 +vt 0.757812 0.593750 +vt 0.804688 0.906250 +vt 0.804688 0.593750 +vt 0.617188 0.593750 +vt 0.617188 0.906250 +vt 0.757812 0.500000 +vt 0.804688 0.500000 +vt 0.757812 1.000000 +vt 0.804688 1.000000 +vt 0.382812 0.093750 +vt 0.382812 0.406250 +vt 0.335938 0.406250 +vt 0.335938 0.093750 +vt 0.242188 0.406250 +vt 0.242188 0.093750 +vt 0.195312 0.406250 +vt 0.195312 0.093750 +vt 0.101562 0.406250 +vt 0.101562 0.093750 +vt 0.101562 -0.000000 +vt 0.195312 -0.000000 +vt 0.195312 0.500000 +vt 0.101562 0.500000 +vt 0.375000 0.609375 +vt 0.375000 0.812500 +vt 0.281250 0.812500 +vt 0.281250 0.609375 +vt 0.187500 0.812500 +vt 0.187500 0.609375 +vt 0.093750 0.812500 +vt 0.093750 0.609375 +vt 0.000000 0.812500 +vt 0.000000 0.609375 +vt 0.000000 0.421875 +vt 0.093750 0.421875 +vt 0.093750 1.000000 vt 0.000000 1.000000 -vt 0.000000 0.000000 -vt 1.000000 0.000000 -vn 0.0000 -1.0000 -0.0000 +vt 0.999900 0.000100 +vt 0.999900 0.999900 +vt 0.000100 0.999900 +vt 0.000100 0.000100 +vn -0.9667 0.0000 0.2559 +vn -0.0000 1.0000 -0.0000 +vn 0.9667 0.0000 -0.2559 +vn 0.0000 -1.0000 0.0000 +vn -0.2559 0.0000 -0.9667 +vn 0.2559 0.0000 0.9667 +vn -0.1812 0.0000 0.9834 +vn 0.1812 0.0000 -0.9834 +vn 0.9834 0.0000 0.1812 +vn -0.9834 0.0000 -0.1812 +vn -0.7018 0.0000 0.7124 +vn 0.7018 0.0000 -0.7124 +vn 0.7124 0.0000 0.7018 +vn -0.7124 0.0000 -0.7018 +vn -0.9065 0.0000 0.4221 +vn 0.9065 0.0000 -0.4221 +vn -0.4221 0.0000 -0.9065 +vn 0.4221 0.0000 0.9065 vn -1.0000 0.0000 0.0000 -vn 0.0000 1.0000 0.0000 +vn 1.0000 0.0000 0.0000 vn 0.0000 0.0000 -1.0000 vn 0.0000 0.0000 1.0000 -vn 0.1801 -0.0000 -0.9836 -vn -0.0026 -0.9999 -0.0116 -vn 0.9064 0.0026 -0.4225 -vn -0.2588 0.0000 -0.9659 -vn -0.9659 0.0000 0.2588 -vn -0.7036 0.0000 -0.7106 -vn 0.7036 -0.0000 0.7106 -vn 0.7106 -0.0000 -0.7036 -vn -0.7106 0.0000 0.7036 -vn 0.7107 0.0116 0.7034 -vn -0.7107 -0.0116 -0.7034 -vn 0.9659 -0.0000 -0.2588 -vn -0.1801 -0.0000 0.9836 -vn 1.0000 0.0000 0.0000 -vn 0.2588 -0.0000 0.9659 -vn 0.0026 0.9999 0.0116 -vn -0.9064 -0.0026 0.4225 -vn -0.7034 -0.0026 0.7108 -vn 0.4225 -0.0116 0.9063 -vn -0.0101 0.9999 -0.0063 -vn 0.9836 0.0000 0.1801 -vn 0.7034 0.0026 -0.7108 -vn -0.4225 0.0116 -0.9063 -vn 0.0101 -0.9999 0.0063 -vn -0.9836 0.0000 -0.1801 -g Player_Cube_Character +vn -0.7029 0.0000 -0.7112 +vn 0.7029 0.0000 0.7112 +vn 0.7112 0.0000 -0.7029 +vn -0.7112 0.0000 0.7029 +g Corpse_Cube.002_Character s off -f 59/1/1 3/2/1 1/3/1 22/4/1 -f 65/5/2 4/6/2 2/7/2 67/8/2 -f 69/9/3 57/10/3 63/11/3 71/12/3 -f 21/13/4 61/14/4 68/15/4 72/16/4 -f 70/17/5 66/18/5 24/19/5 23/20/5 -f 48/21/6 145/22/6 46/23/6 135/24/6 -f 7/25/7 6/26/7 10/27/7 11/28/7 -f 8/29/8 77/30/8 79/31/8 12/32/8 -f 33/33/9 34/34/9 13/35/9 14/36/9 -f 15/37/10 16/38/10 99/39/10 93/40/10 -f 103/41/11 19/42/11 17/43/11 38/44/11 -f 109/45/3 20/46/3 18/47/3 111/48/3 -f 113/49/12 101/50/12 107/51/12 115/52/12 -f 37/53/13 105/54/13 112/55/13 116/56/13 -f 114/57/14 110/58/14 40/59/14 39/60/14 -f 35/61/1 95/62/1 94/63/1 89/64/1 -f 149/65/3 43/66/3 45/67/3 151/68/3 -f 97/69/3 141/70/3 91/71/3 100/72/3 -f 25/73/15 28/74/15 27/75/15 26/76/15 -f 32/77/16 29/78/16 30/79/16 31/80/16 -f 47/81/1 139/82/1 44/83/1 42/84/1 -f 36/85/17 133/86/17 90/87/17 92/88/17 -f 137/89/18 143/90/18 147/91/18 41/92/18 -f 60/93/19 62/94/19 64/95/19 58/96/19 -f 104/97/1 106/98/1 108/99/1 102/100/1 -f 98/101/20 96/102/20 134/103/20 142/104/20 -f 5/105/21 85/106/21 87/107/21 9/108/21 -f 81/109/22 73/110/22 75/111/22 83/112/22 -f 125/113/23 127/114/23 131/115/23 129/116/23 -f 74/117/24 82/118/24 78/119/24 86/120/24 -f 130/121/25 132/122/25 123/123/25 117/124/25 -f 146/125/26 148/126/26 144/127/26 140/128/26 -f 118/129/27 124/130/27 121/131/27 119/132/27 -f 88/133/28 80/134/28 84/135/28 76/136/28 -f 120/137/29 122/138/29 128/139/29 126/140/29 -f 150/141/30 152/142/30 136/143/30 138/144/30 -f 155/145/11 51/146/11 49/147/11 54/148/11 -f 161/149/3 52/150/3 50/151/3 163/152/3 -f 165/153/12 153/154/12 159/155/12 167/156/12 -f 53/157/13 157/158/13 164/159/13 168/160/13 -f 166/161/14 162/162/14 56/163/14 55/164/14 -f 156/165/1 158/166/1 160/167/1 154/168/1 -g Player_Cube_Blood -f 169/169/3 170/170/3 172/171/3 171/172/3 +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 3/4/2 4/3/2 8/5/2 7/6/2 +f 7/6/3 8/5/3 6/7/3 5/8/3 +f 5/9/4 6/10/4 2/2/4 1/1/4 +f 3/11/5 7/6/5 5/8/5 1/12/5 +f 8/5/6 4/13/6 2/14/6 6/7/6 +f 9/15/7 11/16/7 12/17/7 10/18/7 +f 11/16/2 15/19/2 16/20/2 12/17/2 +f 15/19/8 13/21/8 14/22/8 16/20/8 +f 13/23/4 9/15/4 10/18/4 14/24/4 +f 11/25/9 9/26/9 13/21/9 15/19/9 +f 16/20/10 14/22/10 10/27/10 12/28/10 +f 17/29/11 19/30/11 20/31/11 18/32/11 +f 19/30/2 23/33/2 24/34/2 20/31/2 +f 23/33/12 21/35/12 22/36/12 24/34/12 +f 21/37/4 17/29/4 18/32/4 22/38/4 +f 19/39/13 17/40/13 21/35/13 23/33/13 +f 24/34/14 22/36/14 18/41/14 20/42/14 +f 25/43/15 26/44/15 28/45/15 27/46/15 +f 27/46/2 28/45/2 32/47/2 31/48/2 +f 31/48/16 32/47/16 30/49/16 29/50/16 +f 29/51/4 30/52/4 26/44/4 25/43/4 +f 27/53/17 31/48/17 29/50/17 25/54/17 +f 32/47/18 28/55/18 26/56/18 30/49/18 +f 33/57/19 34/58/19 36/59/19 35/60/19 +f 35/60/2 36/59/2 40/61/2 39/62/2 +f 39/62/20 40/61/20 38/63/20 37/64/20 +f 37/64/4 38/63/4 34/65/4 33/66/4 +f 35/67/21 39/68/21 37/64/21 33/66/21 +f 40/69/22 36/70/22 34/65/22 38/63/22 +f 41/71/23 42/72/23 44/73/23 43/74/23 +f 43/74/2 44/73/2 48/75/2 47/76/2 +f 47/76/24 48/75/24 46/77/24 45/78/24 +f 45/78/4 46/77/4 42/79/4 41/80/4 +f 43/81/25 47/82/25 45/78/25 41/80/25 +f 48/83/26 44/84/26 42/79/26 46/77/26 +g Corpse_Cube.002_Blood +s 1 +f 49/85/2 50/86/2 51/87/2 52/88/2 diff --git a/mods/lobby/player_callbacks.lua b/mods/lobby/player_callbacks.lua index 8447a93..928e200 100644 --- a/mods/lobby/player_callbacks.lua +++ b/mods/lobby/player_callbacks.lua @@ -50,20 +50,21 @@ minetest.register_on_dieplayer(function(player) local traitor = lobby.traitors[map_id] local param2 = minetest.dir_to_facedir(player:get_look_dir()) local pos_node = minetest.get_node(pos) + local tone = player_attributes:get_int('tone') + local corpse_col = 'lobby:corpse_'..tone if pos_node.name ~= 'air' then local air = minetest.find_node_near(pos, 1, {'air'}) if air then - minetest.set_node(air, {name = 'lobby:corpse', param2 = param2}) + minetest.set_node(air, {name = corpse_col, param2 = param2}) lobby.corpse_entry(air, map_id) pos = air end else - minetest.set_node(pos, {name = 'lobby:corpse', param2 = param2}) + minetest.set_node(pos, {name = corpse_col, param2 = param2}) lobby.corpse_entry(pos, map_id) end local meta = minetest.get_meta(pos) meta:set_string('infotext', name..'\'s Corpse.') - gamer.player_set_textures(player,{'lobby_ghost.png'}) player:set_nametag_attributes({ color = {a = 0, r = 255, g = 255, b = 255} }) @@ -102,11 +103,10 @@ minetest.register_on_respawnplayer(function(player) return true else local player_attributes = player:get_meta() - gamer.player_set_textures(player,{'gamer_skin.png'}) player:set_nametag_attributes({ color = {a = 255, r = 255, g = 255, b = 255} }) - player:set_properties({visual_size = {x = 1, y = 1}, collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}}) + player:set_properties({visual_size = {x = 10, y = 10}, collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}}) player:set_pos(lobby.spawn_pos) player_attributes:set_string('mode', 'solo') return true diff --git a/mods/lobby/textures/lobby_corpse.png b/mods/lobby/textures/lobby_corpse.png index 60d74ed..9f9f9a1 100644 Binary files a/mods/lobby/textures/lobby_corpse.png and b/mods/lobby/textures/lobby_corpse.png differ diff --git a/mods/lobby/textures/lobby_ghost.png b/mods/lobby/textures/lobby_ghost.png deleted file mode 100644 index 5a6d63d..0000000 Binary files a/mods/lobby/textures/lobby_ghost.png and /dev/null differ