Compare commits
No commits in common. "29a98c686cb46dfa7d24d375dae5faa587b71308" and "6545f54cfcb75c7ff1b4904f74752c2589e9475e" have entirely different histories.
29a98c686c
...
6545f54cfc
@ -6,7 +6,6 @@
|
||||
[ext_resource type="PackedScene" uid="uid://2sfy0vq0fqt3" path="res://scenes/ui/player_listing.tscn" id="4_okac2"]
|
||||
[ext_resource type="PackedScene" uid="uid://ffh5txda3j1" path="res://scenes/ui/chat_box.tscn" id="5_cv68x"]
|
||||
[ext_resource type="Texture2D" uid="uid://bdfqu6p74pfwe" path="res://raw_assets/crosshair/Crosshair 1.png" id="6_7awel"]
|
||||
[ext_resource type="AudioStream" uid="uid://bfg31e3s4jv8c" path="res://raw_assets/sfx/Hit.mp3" id="7_dguuj"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_3nx84"]
|
||||
glow_enabled = true
|
||||
@ -180,9 +179,6 @@ text = "100"
|
||||
label_settings = SubResource("LabelSettings_7awel")
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="hit_sound" type="AudioStreamPlayer" parent="." unique_id=1224745673]
|
||||
stream = ExtResource("7_dguuj")
|
||||
|
||||
[connection signal="pressed" from="pause_menu/v_box_container/settings" to="settings" method="open"]
|
||||
[connection signal="pressed" from="pause_menu/v_box_container/exit_to_lobby" to="." method="exit_to_lobby"]
|
||||
[connection signal="pressed" from="pause_menu/v_box_container/exit" to="." method="exit"]
|
||||
|
||||
@ -878,14 +878,6 @@ impl Game {
|
||||
|
||||
// Handle for when a player is killed, run both on client and server
|
||||
pub fn on_kill(&mut self, source: DamageSource, player_id: u16) {
|
||||
if let DamageSource::Player(source_player_id) = source
|
||||
&& let Some(player) = self.find_player(source_player_id)
|
||||
&& let Some(character) = player.character.clone()
|
||||
&& let Ok(mut local_player) = character.try_cast::<LocalPlayer>()
|
||||
{
|
||||
local_player.bind_mut().play_local_hit_sound();
|
||||
}
|
||||
|
||||
let total_prev_kills: u16 = self.players.iter().map(|p| p.data.kills).sum();
|
||||
|
||||
if let Some(chat) = &mut Chat::singleton() {
|
||||
@ -905,8 +897,6 @@ impl Game {
|
||||
};
|
||||
|
||||
if let Some(player) = self.find_player_mut(player_id) {
|
||||
player.killing_spree = 0;
|
||||
player.killing_spree_cd = 0.;
|
||||
player.data.deaths += 1;
|
||||
}
|
||||
self.run_deferred(move |s| {
|
||||
|
||||
@ -2,8 +2,8 @@ use std::{f32::consts::PI, ops::Neg};
|
||||
|
||||
use godot::{
|
||||
classes::{
|
||||
AudioStreamPlayer, Button, Camera3D, CharacterBody3D, CollisionShape3D, ICharacterBody3D,
|
||||
Input, InputEvent, InputEventMouseMotion, Label, Panel, PanelContainer, input::MouseMode,
|
||||
Button, Camera3D, CharacterBody3D, CollisionShape3D, ICharacterBody3D, Input, InputEvent,
|
||||
InputEventMouseMotion, Label, Panel, PanelContainer, input::MouseMode,
|
||||
},
|
||||
obj::WithBaseField,
|
||||
prelude::*,
|
||||
@ -68,8 +68,6 @@ pub struct LocalPlayer {
|
||||
#[export]
|
||||
health_label: Option<Gd<Label>>,
|
||||
#[export]
|
||||
hit_sound: Option<Gd<AudioStreamPlayer>>,
|
||||
#[export]
|
||||
health: i32,
|
||||
|
||||
pub player_id: Option<u16>,
|
||||
@ -655,12 +653,6 @@ impl LocalPlayer {
|
||||
camera.set_fov(settings.fov as f32);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn play_local_hit_sound(&mut self) {
|
||||
if let Some(hit_sound) = &mut self.hit_sound {
|
||||
hit_sound.play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[godot_dyn]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user