remove placeholder weapons and add M16A2
78
init.lua
@ -22,7 +22,7 @@ end
|
||||
--Core---------------------------------------------
|
||||
|
||||
first_person_shooter = {}
|
||||
first_person_shooter.tick_rate = 60
|
||||
first_person_shooter.tick_rate = 120
|
||||
first_person_shooter.last_update_time = 0
|
||||
first_person_shooter.maximum_speed_smoothing_samples = 3
|
||||
first_person_shooter.players_metadata = {}
|
||||
@ -188,78 +188,40 @@ end
|
||||
|
||||
--Register Weapons---------------------------------
|
||||
|
||||
first_person_shooter.register_weapon("first_person_shooter:m1_garand", {
|
||||
description = "M1 Garand",
|
||||
icon = "m1_garand_icon.png",
|
||||
first_person_shooter.register_weapon("first_person_shooter:m16a2", {
|
||||
description = "M16A2",
|
||||
icon = "m16a2_icon.png",
|
||||
muzzle_velocity = 100,
|
||||
animation_framerate = 60,
|
||||
animation_framerate = 120,
|
||||
animations = {
|
||||
["idle"] = {
|
||||
texture_prefix = "m1_garand_idle",
|
||||
texture_prefix = "m16a2_idle",
|
||||
total_frames = 1,
|
||||
},
|
||||
["aim_idle"] = {
|
||||
texture_prefix = "m1_garand_aimidle",
|
||||
texture_prefix = "m16a2_aimidle",
|
||||
total_frames = 1,
|
||||
},
|
||||
["aim_transition"] = {
|
||||
texture_prefix = "m1_garand_aim",
|
||||
total_frames = 7,
|
||||
},
|
||||
["fire"] = {
|
||||
texture_prefix = "m1_garand_fire",
|
||||
total_frames = 12,
|
||||
},
|
||||
["aim_fire"] = {
|
||||
texture_prefix = "m1_garand_aimfire",
|
||||
total_frames = 12,
|
||||
},
|
||||
["reload"] = {
|
||||
texture_prefix = "m1_garand_reload",
|
||||
total_frames = 83,
|
||||
},
|
||||
},
|
||||
sounds = {
|
||||
["fire"] = {
|
||||
sound_name = "m1_garand_fire",
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
first_person_shooter.register_weapon("first_person_shooter:m1911", {
|
||||
description = "M1911",
|
||||
icon = "m1911_icon.png",
|
||||
muzzle_velocity = 30,
|
||||
animation_framerate = 60,
|
||||
animations = {
|
||||
["idle"] = {
|
||||
texture_prefix = "m1911_idle",
|
||||
total_frames = 1,
|
||||
},
|
||||
["aim_idle"] = {
|
||||
texture_prefix = "m1911_aimidle",
|
||||
total_frames = 1,
|
||||
},
|
||||
["aim_transition"] = {
|
||||
texture_prefix = "m1911_aim",
|
||||
total_frames = 7,
|
||||
},
|
||||
["fire"] = {
|
||||
texture_prefix = "m1911_fir",
|
||||
total_frames = 10,
|
||||
},
|
||||
["aim_fire"] = {
|
||||
texture_prefix = "m1911_aimfir",
|
||||
texture_prefix = "m16a2_aim",
|
||||
total_frames = 11,
|
||||
},
|
||||
["fire"] = {
|
||||
texture_prefix = "m16a2_fire",
|
||||
total_frames = 12,
|
||||
},
|
||||
["aim_fire"] = {
|
||||
texture_prefix = "m16a2_aimfire",
|
||||
total_frames = 12,
|
||||
},
|
||||
["reload"] = {
|
||||
texture_prefix = "m1911_reload",
|
||||
total_frames = 51,
|
||||
texture_prefix = "m16a2_idle",
|
||||
total_frames = 1,
|
||||
},
|
||||
},
|
||||
sounds = {
|
||||
["fire"] = {
|
||||
sound_name = "m1911_fire",
|
||||
sound_name = "m16a2_fire",
|
||||
}
|
||||
},
|
||||
})
|
||||
@ -401,7 +363,7 @@ first_person_shooter.update_players = function(deltaTime)
|
||||
player_metadata.player:hud_remove(player_metadata.weapon_hud_element)
|
||||
player_metadata.weapon_hud_element = player_metadata.player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
text = animation_data.weapon_state_animation.texture_prefix .. animation_data.frame_number .. ".png",
|
||||
text = animation_data.weapon_state_animation.texture_prefix .. "." .. animation_data.frame_number .. ".png",
|
||||
position = {
|
||||
x = 0.5 - breathing_x_offset - movement_x_offset,
|
||||
y = 0.55 - breathing_y_offset - movement_y_offset
|
||||
|
BIN
sounds/m16a2_fire.1.ogg
Normal file
BIN
sounds/m16a2_fire.2.ogg
Normal file
BIN
sounds/m16a2_fire.3.ogg
Normal file
BIN
textures - Copy/bullet.png
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
textures - Copy/m16a2_aim (1).png
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
textures - Copy/m16a2_aim (10).png
Normal file
After Width: | Height: | Size: 157 KiB |
BIN
textures - Copy/m16a2_aim (11).png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
textures - Copy/m16a2_aim (2).png
Normal file
After Width: | Height: | Size: 281 KiB |
BIN
textures - Copy/m16a2_aim (3).png
Normal file
After Width: | Height: | Size: 272 KiB |
BIN
textures - Copy/m16a2_aim (4).png
Normal file
After Width: | Height: | Size: 272 KiB |
BIN
textures - Copy/m16a2_aim (5).png
Normal file
After Width: | Height: | Size: 245 KiB |
BIN
textures - Copy/m16a2_aim (6).png
Normal file
After Width: | Height: | Size: 222 KiB |
BIN
textures - Copy/m16a2_aim (7).png
Normal file
After Width: | Height: | Size: 206 KiB |
BIN
textures - Copy/m16a2_aim (8).png
Normal file
After Width: | Height: | Size: 185 KiB |
BIN
textures - Copy/m16a2_aim (9).png
Normal file
After Width: | Height: | Size: 164 KiB |
BIN
textures - Copy/m16a2_aimfire (1).png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
textures - Copy/m16a2_aimfire (10).png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
textures - Copy/m16a2_aimfire (11).png
Normal file
After Width: | Height: | Size: 146 KiB |
BIN
textures - Copy/m16a2_aimfire (12).png
Normal file
After Width: | Height: | Size: 144 KiB |
BIN
textures - Copy/m16a2_aimfire (2).png
Normal file
After Width: | Height: | Size: 166 KiB |
BIN
textures - Copy/m16a2_aimfire (3).png
Normal file
After Width: | Height: | Size: 160 KiB |
BIN
textures - Copy/m16a2_aimfire (4).png
Normal file
After Width: | Height: | Size: 163 KiB |
BIN
textures - Copy/m16a2_aimfire (5).png
Normal file
After Width: | Height: | Size: 158 KiB |
BIN
textures - Copy/m16a2_aimfire (6).png
Normal file
After Width: | Height: | Size: 156 KiB |
BIN
textures - Copy/m16a2_aimfire (7).png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
textures - Copy/m16a2_aimfire (8).png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
textures - Copy/m16a2_aimfire (9).png
Normal file
After Width: | Height: | Size: 149 KiB |
BIN
textures - Copy/m16a2_aimidle (1).png
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
textures - Copy/m16a2_fire (1).png
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
textures - Copy/m16a2_fire (10).png
Normal file
After Width: | Height: | Size: 256 KiB |
BIN
textures - Copy/m16a2_fire (11).png
Normal file
After Width: | Height: | Size: 260 KiB |
BIN
textures - Copy/m16a2_fire (12).png
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
textures - Copy/m16a2_fire (2).png
Normal file
After Width: | Height: | Size: 282 KiB |
BIN
textures - Copy/m16a2_fire (3).png
Normal file
After Width: | Height: | Size: 273 KiB |
BIN
textures - Copy/m16a2_fire (4).png
Normal file
After Width: | Height: | Size: 293 KiB |
BIN
textures - Copy/m16a2_fire (5).png
Normal file
After Width: | Height: | Size: 268 KiB |
BIN
textures - Copy/m16a2_fire (6).png
Normal file
After Width: | Height: | Size: 258 KiB |
BIN
textures - Copy/m16a2_fire (7).png
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
textures - Copy/m16a2_fire (8).png
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
textures - Copy/m16a2_fire (9).png
Normal file
After Width: | Height: | Size: 256 KiB |
BIN
textures - Copy/m16a2_icon.png
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
textures - Copy/m16a2_idle (1).png
Normal file
After Width: | Height: | Size: 289 KiB |
8
textures/FileNameSanitizer.linq
Normal file
@ -0,0 +1,8 @@
|
||||
<Query Kind="Statements" />
|
||||
|
||||
var directory = @"D:\Games\minetest-5.0.1-win64\mods\first_person_shooter\textures";
|
||||
foreach (var filePath in Directory.GetFiles(directory, "*.png"))
|
||||
{
|
||||
var fileInfo = new FileInfo(filePath);
|
||||
File.Move(filePath, $@"{fileInfo.DirectoryName}\{fileInfo.Name.ToLower().Replace("(", string.Empty).Replace(")", string.Empty).Replace(" ", ".")}");
|
||||
}
|
BIN
textures/m16a2_aim.1.png
Normal file
After Width: | Height: | Size: 281 KiB |
BIN
textures/m16a2_aim.10.png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
textures/m16a2_aim.11.png
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
textures/m16a2_aim.2.png
Normal file
After Width: | Height: | Size: 272 KiB |
BIN
textures/m16a2_aim.3.png
Normal file
After Width: | Height: | Size: 272 KiB |
BIN
textures/m16a2_aim.4.png
Normal file
After Width: | Height: | Size: 245 KiB |
BIN
textures/m16a2_aim.5.png
Normal file
After Width: | Height: | Size: 222 KiB |
BIN
textures/m16a2_aim.6.png
Normal file
After Width: | Height: | Size: 206 KiB |
BIN
textures/m16a2_aim.7.png
Normal file
After Width: | Height: | Size: 185 KiB |
BIN
textures/m16a2_aim.8.png
Normal file
After Width: | Height: | Size: 164 KiB |
BIN
textures/m16a2_aim.9.png
Normal file
After Width: | Height: | Size: 157 KiB |
BIN
textures/m16a2_aimfire.1.png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
textures/m16a2_aimfire.10.png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
textures/m16a2_aimfire.11.png
Normal file
After Width: | Height: | Size: 146 KiB |
BIN
textures/m16a2_aimfire.12.png
Normal file
After Width: | Height: | Size: 144 KiB |
BIN
textures/m16a2_aimfire.2.png
Normal file
After Width: | Height: | Size: 166 KiB |
BIN
textures/m16a2_aimfire.3.png
Normal file
After Width: | Height: | Size: 160 KiB |
BIN
textures/m16a2_aimfire.4.png
Normal file
After Width: | Height: | Size: 163 KiB |
BIN
textures/m16a2_aimfire.5.png
Normal file
After Width: | Height: | Size: 158 KiB |
BIN
textures/m16a2_aimfire.6.png
Normal file
After Width: | Height: | Size: 156 KiB |
BIN
textures/m16a2_aimfire.7.png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
textures/m16a2_aimfire.8.png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
textures/m16a2_aimfire.9.png
Normal file
After Width: | Height: | Size: 149 KiB |
BIN
textures/m16a2_aimidle.1.png
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
textures/m16a2_fire.1.png
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
textures/m16a2_fire.10.png
Normal file
After Width: | Height: | Size: 256 KiB |
BIN
textures/m16a2_fire.11.png
Normal file
After Width: | Height: | Size: 260 KiB |
BIN
textures/m16a2_fire.12.png
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
textures/m16a2_fire.2.png
Normal file
After Width: | Height: | Size: 282 KiB |
BIN
textures/m16a2_fire.3.png
Normal file
After Width: | Height: | Size: 273 KiB |
BIN
textures/m16a2_fire.4.png
Normal file
After Width: | Height: | Size: 293 KiB |
BIN
textures/m16a2_fire.5.png
Normal file
After Width: | Height: | Size: 268 KiB |
BIN
textures/m16a2_fire.6.png
Normal file
After Width: | Height: | Size: 258 KiB |
BIN
textures/m16a2_fire.7.png
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
textures/m16a2_fire.8.png
Normal file
After Width: | Height: | Size: 254 KiB |
BIN
textures/m16a2_fire.9.png
Normal file
After Width: | Height: | Size: 256 KiB |
BIN
textures/m16a2_icon.png
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
textures/m16a2_idle.1.png
Normal file
After Width: | Height: | Size: 289 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 89 KiB |