👽 interstellar delivery

This commit is contained in:
anyreso 2024-10-16 21:43:01 +00:00
parent 547c97bfba
commit 97c8292858
257 changed files with 7309 additions and 4637 deletions

View file

@ -4,15 +4,16 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://dmf12llra7aq5"
path.s3tc="res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.s3tc.ctex"
path.etc2="res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://entities/player/assets/jetpackfx/Particle01.png"
dest_files=["res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.s3tc.ctex"]
dest_files=["res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.s3tc.ctex", "res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.etc2.ctex"]
[params]

View file

@ -4,15 +4,16 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://ct1v5iadtpadm"
path.s3tc="res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.s3tc.ctex"
path.etc2="res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://entities/player/assets/jetpackfx/smoke_01.png"
dest_files=["res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.s3tc.ctex"]
dest_files=["res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.s3tc.ctex", "res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.etc2.ctex"]
[params]

View file

@ -4,15 +4,16 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://doxo4vfn0bjlp"
path.s3tc="res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.s3tc.ctex"
path.etc2="res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://entities/player/assets/jetpackfx/smoke_02.png"
dest_files=["res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.s3tc.ctex"]
dest_files=["res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.s3tc.ctex", "res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.etc2.ctex"]
[params]

View file

@ -4,8 +4,9 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://ia3bdpe4rm1m"
path.bptc="res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.bptc.ctex"
path.astc="res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={}
@ -13,7 +14,7 @@ generator_parameters={}
[deps]
source_file="res://entities/player/assets/vanguard_0.png"
dest_files=["res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.bptc.ctex"]
dest_files=["res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.bptc.ctex", "res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.astc.ctex"]
[params]

View file

@ -4,8 +4,9 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://bvgfmpb2l1juf"
path.bptc="res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.bptc.ctex"
path.astc="res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={}
@ -13,7 +14,7 @@ generator_parameters={}
[deps]
source_file="res://entities/player/assets/vanguard_1.png"
dest_files=["res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.bptc.ctex"]
dest_files=["res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.bptc.ctex", "res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.astc.ctex"]
[params]

View file

@ -4,8 +4,9 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://vtrbc3eja3df"
path.bptc="res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.bptc.ctex"
path.astc="res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={}
@ -13,7 +14,7 @@ generator_parameters={}
[deps]
source_file="res://entities/player/assets/vanguard_2.png"
dest_files=["res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.bptc.ctex"]
dest_files=["res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.bptc.ctex", "res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.astc.ctex"]
[params]

View file

@ -12,79 +12,81 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Node
class_name PlayerInputController extends Node
@export var jetting : bool = false
@export var skiing : bool = false
@export var direction : Vector2 = Vector2.ZERO
@export var camera_rotation : Vector2
@export var jetting:bool = false
@export var skiing:bool = false
@export var direction:Vector2
@export var camera_rotation:Vector2
signal jumped
signal fired_primary
signal throwed_flag
signal jump
signal primary(pressed: bool)
signal throw(pressed: bool)
var _mouse_sensitivity:float = .0
func _enter_tree() -> void:
update_multiplayer_authority(0)
func update_multiplayer_authority(player_id : int) -> void:
set_multiplayer_authority(player_id)
# @NOTE: This is a workaround for player node being too integrated with the
# multiplayer layer and blocks player inputs in singleplayer if not set.
set_multiplayer_authority(1)
func _unhandled_input(event: InputEvent) -> void:
if is_multiplayer_authority():
var mouse_mode : Input.MouseMode = Input.get_mouse_mode()
var mouse_mode: Input.MouseMode = Input.get_mouse_mode()
direction = Input.get_vector("left", "right", "forward", "backward")
jetting = Input.is_action_pressed("secondary")
skiing = Input.is_action_pressed("ski")
# isolate mouse events
if event is InputEventMouseMotion:
if mouse_mode == Input.MOUSE_MODE_CAPTURED:
# update camera with mouse position relative to last frame
_update_camera(event.relative)
if event is InputEventMouseButton:
elif event is InputEventMouseButton:
# @NOTE: there could be a control setting for direction
if event.button_index == MOUSE_BUTTON_WHEEL_UP and event.pressed:
_cycle.rpc(1)
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN and event.pressed:
_cycle.rpc(-1)
if event is InputEventKey:
elif event is InputEventKey:
match event.keycode:
KEY_1: _select.rpc(0)
KEY_2: _select.rpc(1)
KEY_3: _select.rpc(2)
direction = Input.get_vector("left", "right", "forward", "backward")
if Input.is_action_just_pressed("jump_and_jet"):
if event.is_action("primary"):
_primary.rpc(event.pressed)
if Input.is_action_just_pressed("secondary"):
_jump.rpc()
if Input.is_action_just_pressed("fire_primary"):
_fire_primary.rpc()
if Input.is_action_just_pressed("throw_flag"):
_throw_flag.rpc()
jetting = Input.is_action_pressed("jump_and_jet")
skiing = Input.is_action_pressed("ski")
func _update_camera(relative_motion : Vector2) -> void:
if event.is_action("throw") and not event.echo:
_throw.rpc(event.pressed)
func _update_camera(relative_motion:Vector2) -> void:
# reverse y axis
if Settings.get_value("controls", "inverted_y_axis"):
relative_motion.y *= -1.0
_mouse_sensitivity = Settings.get_value("controls", "mouse_sensitivity")
# clamp vertical rotation (head motion)
camera_rotation.y -= relative_motion.y * Settings.get_value("controls", "mouse_sensitivity") / 100
camera_rotation.y = clamp(camera_rotation.y, deg_to_rad(-90.0), deg_to_rad(90.0))
camera_rotation.x -= relative_motion.y * _mouse_sensitivity / 100
camera_rotation.x = clamp(camera_rotation.x, deg_to_rad(-90.0), deg_to_rad(90.0))
# wrap horizontal rotation (to prevent accumulation)
camera_rotation.x -= relative_motion.x * Settings.get_value("controls", "mouse_sensitivity") / 100
camera_rotation.x = wrapf(camera_rotation.x, deg_to_rad(0.0), deg_to_rad(360.0))
camera_rotation.y -= relative_motion.x * _mouse_sensitivity / 100
camera_rotation.y = wrapf(camera_rotation.y, deg_to_rad(0.0), deg_to_rad(360.0))
@rpc("call_local", "reliable")
@rpc("authority", "call_local", "reliable")
func _jump() -> void:
jumped.emit()
jump.emit()
@rpc("call_local", "reliable")
func _fire_primary() -> void:
fired_primary.emit()
@rpc("authority", "call_local", "reliable")
func _primary(pressed: bool) -> void:
primary.emit(pressed)
@rpc("call_local", "reliable")
func _cycle(shift : int) -> void:
@rpc("authority", "call_local", "reliable")
func _cycle(shift:int) -> void:
%Inventory.cycle(shift)
@rpc("call_local", "reliable")
func _select(index : int) -> void:
@rpc("authority", "call_local", "reliable")
func _select(index:int) -> void:
%Inventory.select(index)
@rpc("call_local", "reliable")
func _throw_flag() -> void:
throwed_flag.emit()
@rpc("authority", "call_local", "reliable")
func _throw(pressed: bool) -> void:
throw.emit(pressed)

View file

@ -14,140 +14,230 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
class_name Player extends RigidBody3D
enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD }
signal killed(victim: Player, killer:int)
signal died(player : Player, killer_id : int)
## Emitted when a source wants to damage this body
signal damage(source: Node, target: Node, amount: int)
@export var iff : IFF
@export var health_component : HealthComponent
@export var flag_carry_component : FlagCarryComponent
@export var walkable_surface_sensor : ShapeCast3D
@export var match_participant : MatchParticipant
## Emitted when the player respawns, see [member Player.respawn].
signal respawned(player: Player)
## The inventory component can store up to [member Inventory.slots] objects. It
## also has specific slots to hold grenades, packs and a flag.
@export var inventory : Inventory
@export var tp_mesh : Vanguard
@export var iff:IFF
## This is the player [Health] component.
@export var health:Health
@export var flag_carry_component:FlagCarryComponent
@export var walkable_surface_sensor:ShapeCast3D
@export var hud:HUD
## The inventory component can store up to [member Inventory.slots] nodes.
@export var inventory:Inventory
@export var tp_mesh:Vanguard
@export var third_person:Node3D
@export var pivot : Node3D
@export var camera : Camera3D
@export_category("Parameters")
@export var ground_speed : float = 48 / 3.6 # m/s
@export var aerial_control_force : int = 400
@export var jump_height : float = 2.0
@export var max_floor_angle : float = 60
@export var ground_speed:float = 48 / 3.6 # m/s
@export var aerial_control_force:int = 400
@export var jump_height:float = 1.0
@export var max_floor_angle:float = 60
@export_group("Jetpack")
@export var energy: float = 100.0
@export var energy_charge_rate : float = 20 # energy per second
@export var energy_drain_rate : float = 25 # energy per second
@export var energy_max : float = 100.
@export var jetpack_force_factor : float = 2.
@export var jetpack_horizontal_force : float = 600
@export var jetpack_vertical_force : float = 800
@export var energy_charge_rate:float = 25 # energy per second
@export var energy_drain_rate:float = 25 # energy per second
@export var energy_max:float = 100.
@export var jetpack_force_factor:float = 2.
@export var jetpack_horizontal_force:float = 600
@export var jetpack_vertical_force:float = 1200
@export_group("State")
@export var player_state : PlayerState = PlayerState.PLAYER_ALIVE
@export var input : Node
@export var input: PlayerInputController
@onready var camera : Camera3D = %Pivot/Camera3D
@onready var hud : CanvasLayer = $HUD
@onready var animation_player : AnimationPlayer = $AnimationPlayer
@onready var collision_shape : CollisionShape3D = $CollisionShape3D
@onready var jetpack_particles : Array = $ThirdPerson/Mesh/JetpackFX.get_children()
@onready var animation_player:AnimationPlayer = $AnimationPlayer
@onready var collision_shape:CollisionShape3D = $CollisionShape3D
@onready var _jetpack_particles:Array = tp_mesh.get_node("JetpackFX").get_children()
var g : float = ProjectSettings.get_setting("physics/3d/default_gravity") # in m/s²
var gravity : Vector3 = g * ProjectSettings.get_setting("physics/3d/default_gravity_vector")
var _jumping : bool = false
var g:float = ProjectSettings.get_setting("physics/3d/default_gravity") # in m/s²
var gravity:Vector3 = g * ProjectSettings.get_setting("physics/3d/default_gravity_vector")
var _jumping:bool = false
static var pawn_player : Player
static var pawn_player:Player
@export var username:String = "Newblood":
set = set_username
@export var peer_id:int = 1:
set = set_peer_id
@export var team_id:int = -1
signal username_changed(new_username:int)
signal peer_id_changed(new_peer_id:int)
func set_username(new_username:String) -> void:
username = new_username
username_changed.emit(username)
func set_peer_id(new_peer_id:int) -> void:
remove_from_group(str(peer_id))
peer_id = new_peer_id
add_to_group(str(peer_id))
peer_id_changed.emit(peer_id)
# Maximum duration for pumping force when throwing a flag, in seconds.
@export var throw_duration_max := 1.2
var throw_timer := Timer.new()
func _ready() -> void:
match_participant.player_id_changed.connect(_setup_pawn)
match_participant.player_id_changed.connect(input.update_multiplayer_authority)
match_participant.username_changed.connect(iff._on_username_changed)
input.set_multiplayer_authority(peer_id)
health_component.health_changed.connect(hud.health_bar.set_value)
health_component.health_changed.connect(iff.health_bar.set_value)
health_component.health_changed.emit(health_component.health)
health_component.health_zeroed.connect(die)
username_changed.connect(iff.set_username)
username_changed.emit(username) # trigger initial signal
inventory.selection_changed.connect(_on_inventory_selection_changed)
health.updated.connect(hud.health_bar.set_value)
health.updated.connect(iff.health_bar.set_value)
health.killed.connect(_on_killed)
input.jump.connect(_jump)
input.throw.connect(_on_throw)
throw_timer.one_shot = true
add_child(throw_timer)
# bind inventory
inventory.selected.connect(func(node: Node) -> void:
if node is Weapon:
if not input.primary.is_connected(node._on_primary):
input.primary.connect(node._on_primary)
if not node.ammo_changed.is_connected(hud._on_ammo_changed):
node.ammo_changed.connect(hud._on_ammo_changed)
node.ammo_changed.emit(node.ammo)
)
input.fired_primary.connect(_trigger)
input.jumped.connect(_jump)
input.throwed_flag.connect(_throw_flag)
func _process(_delta : float) -> void:
%Pivot.global_transform.basis = Basis.from_euler(Vector3(input.camera_rotation.y, input.camera_rotation.x, 0.0))
if not _is_pawn():
tp_mesh.global_transform.basis = Basis.from_euler(Vector3(.0, input.camera_rotation.x + PI, 0.0))
if match_participant and pawn_player:
if pawn_player.match_participant.team_id == match_participant.team_id:
iff.fill = Color.GREEN
else:
iff.fill = Color.RED
func _physics_process(delta : float) -> void:
_update_jetpack_energy(delta)
func _setup_pawn(_new_player_id : int) -> void:
inventory.unselected.connect(func(node: Node) -> void:
if node is Weapon:
if input.primary.is_connected(node._on_primary):
input.primary.disconnect(node._on_primary)
if node is AutomaticWeapon: node._on_primary(false) # release trigger
if node.ammo_changed.is_connected(hud._on_ammo_changed):
node.ammo_changed.disconnect(hud._on_ammo_changed)
hud.ammo_label.text = ""
)
inventory.select(0)
if Game.type is Singleplayer:
damage.connect(
func(_source: Node, target: Node, amount: int) -> void:
target.health.damage(amount, 0))
if _is_pawn():
pawn_player = self
camera.current = true
camera.fov = Settings.get_value("video", "fov")
pawn_player = self
iff.hide()
# hide hud on pawn when scoreboard is visible in multiplayer
if Game.type is Multiplayer:
Game.type.scoreboard.visibility_changed.connect(
func() -> void: hud.set_visible(!Game.type.scoreboard.visible))
# forward this peer env settings to current viewport world env
var world: World3D = get_viewport().find_world_3d()
if not world.environment:
world.environment = Game.environment
world.environment.sdfgi_enabled = Game.environment.sdfgi_enabled
world.environment.glow_enabled = Game.environment.glow_enabled
world.environment.ssao_enabled = Game.environment.ssao_enabled
world.environment.ssr_enabled = Game.environment.ssr_enabled
world.environment.ssr_max_steps = Game.environment.ssr_max_steps
world.environment.ssil_enabled = Game.environment.ssil_enabled
world.environment.volumetric_fog_enabled = Game.environment.volumetric_fog_enabled
else:
$ThirdPerson.show()
third_person.show()
%Inventory.hide()
hud.hide()
func _process(_delta:float) -> void:
if not _is_pawn():
if Game.type is Multiplayer and Game.type.mode == Multiplayer.Mode.FREE_FOR_ALL:
iff.fill = Color.RED
elif is_instance_valid(pawn_player) and team_id:
iff.fill = Color.GREEN if team_id == pawn_player.team_id else Color.RED
_update_third_person_animations()
if not is_alive():
return
# compute target rotation from input.camera_rotation
var target_euler := Vector3(input.camera_rotation.x, input.camera_rotation.y, 0.0)
# smoothly interpolate rotation of pivot node towards target rotation
pivot.global_transform.basis = pivot.global_transform.basis.slerp(Basis.from_euler(target_euler), .6)
if not _is_pawn():
# compute target rotation from input.camera_rotation
var tp_target_euler := Vector3(.0, input.camera_rotation.y + PI, 0.0)
# smoothly interpolate rotation of third person node towards target rotation
tp_mesh.global_transform.basis = tp_mesh.global_transform.basis.slerp(Basis.from_euler(tp_target_euler), .6)
else:
if hud.throw_progress.is_visible_in_tree():
var time_elapsed: float = throw_duration_max - throw_timer.time_left
hud.throw_progress.set_value(time_elapsed / throw_duration_max * 100)
func _physics_process(delta:float) -> void:
_update_jetpack_energy(delta)
func _is_pawn() -> bool:
var peer_is_pawn : bool = multiplayer.get_unique_id() == match_participant.player_id
return Global.type is Singleplayer or peer_is_pawn
if Game.type is Multiplayer:
if Game.type.is_peer_connected():
return multiplayer.get_unique_id() == peer_id
else:
queue_free()
return true
func _on_throw(pressed: bool) -> void:
if pressed:
throw_timer.start(throw_duration_max)
hud.throw_progress.visible = true
else:
var time_left: float = throw_timer.time_left
throw_timer.stop()
var time_elapsed: float = throw_duration_max - time_left
var throw_force: float = \
time_elapsed / throw_duration_max * flag_carry_component.throw_force
flag_carry_component.throw(linear_velocity,
clamp(throw_force, 5., flag_carry_component.throw_force))
hud.throw_progress.visible = false
# @NOTE: this method works only because `tp_mesh` duplicates weapons meshes from the inventory
func _on_inventory_selection_changed(_selected : Node3D, index : int) -> void:
func _on_inventory_selection_changed(_selected:Node3D, index:int) -> void:
# hide any visible weapon
for child in tp_mesh.hand_attachment.get_children():
child.hide()
# get corresponding selected weapon mesh for third person
var tp_weapon : Node3D = tp_mesh.hand_attachment.get_child(index)
var tp_weapon:Node3D = tp_mesh.hand_attachment.get_child(index)
if tp_weapon:
tp_weapon.show()
func _trigger() -> void:
if not _is_player_dead() and inventory.selected:
if inventory.selected.has_method("trigger"):
inventory.selected.trigger()
else:
push_warning("cannot trigger weapon")
func _jump() -> void:
if _is_player_dead():
if not is_alive():
return
_jumping = true
func _throw_flag() -> void:
flag_carry_component.throw(linear_velocity, self)
func is_on_floor() -> bool:
return walkable_surface_sensor.is_colliding()
func _is_skiing() -> bool:
return input.skiing
func _handle_aerial_control(direction : Vector3) -> void:
func _handle_aerial_control(direction:Vector3) -> void:
if not input.jetting and not is_on_floor():
apply_force(direction * aerial_control_force)
func _handle_jetpack(direction : Vector3) -> void:
func _handle_jetpack(direction:Vector3) -> void:
if input.jetting and energy > 0:
var up_vector : Vector3 = Vector3.UP * jetpack_vertical_force * jetpack_force_factor
var side_vector : Vector3 = direction * jetpack_horizontal_force * jetpack_force_factor
var up_vector:Vector3 = Vector3.UP * jetpack_vertical_force * jetpack_force_factor
var side_vector:Vector3 = direction * jetpack_horizontal_force * jetpack_force_factor
apply_force(up_vector + side_vector)
display_jetpack_particles()
for particle: GPUParticles3D in _jetpack_particles:
particle.emitting = true
func _update_jetpack_energy(delta : float) -> void:
func _update_jetpack_energy(delta:float) -> void:
if input.jetting and energy > 0:
energy -= energy_drain_rate * delta
else:
@ -155,35 +245,32 @@ func _update_jetpack_energy(delta : float) -> void:
energy = clamp(energy, 0, energy_max)
hud.energy_bar.value = energy
func _integrate_forces(_state : PhysicsDirectBodyState3D) -> void:
# retrieve user's direction vector
var _input_dir : Vector2 = input.direction
# compute direction in local space
var _direction : Vector3 = (transform.basis * Vector3(_input_dir.x, 0, _input_dir.y)).normalized()
_update_third_person_animations()
if _is_player_dead():
func _integrate_forces(_state:PhysicsDirectBodyState3D) -> void:
if not is_alive():
return
# retrieve user's direction vector
var _input_dir:Vector2 = input.direction
# compute direction in local space
var _direction:Vector3 = (transform.basis * Vector3(_input_dir.x, 0, _input_dir.y)).normalized()
# adjust direction based on spring arm rotation
_direction = _direction.rotated(Vector3.UP, %Pivot.rotation.y)
# adjust direction based on pivot rotation
_direction = _direction.rotated(Vector3.UP, pivot.rotation.y)
_handle_aerial_control(_direction)
_handle_jetpack(_direction)
# handle ski
if _is_skiing():
physics_material_override.friction = 0
# zero-damping ski
if is_on_floor() and input.skiing:
linear_damp = lerp(linear_damp, .0, .1)
else:
physics_material_override.friction = 1
linear_damp = lerp(
linear_damp,
ProjectSettings.get_setting("physics/3d/default_linear_damp") + .05,
.2)
if is_on_floor():
if not _direction.is_zero_approx() and not _is_skiing():
if not _direction.is_zero_approx() and not input.skiing:
# retrieve collision normal
var normal : Vector3 = walkable_surface_sensor.get_collision_normal(0)
var normal:Vector3 = walkable_surface_sensor.get_collision_normal(0)
# calculate the angle between the ground normal and the up vector
var slope_angle : float = rad_to_deg(acos(normal.dot(Vector3.UP)))
var slope_angle:float = rad_to_deg(acos(normal.dot(Vector3.UP)))
# check if the slope angle exceeds the maximum slope angle
if slope_angle <= max_floor_angle:
# adjust direction based on the floor normal to align with the slope
@ -192,16 +279,19 @@ func _integrate_forces(_state : PhysicsDirectBodyState3D) -> void:
linear_velocity = lerp(linear_velocity, _direction * ground_speed, .1)
if _jumping:
var v : float = sqrt(2 * g * jump_height)
apply_central_impulse(Vector3(0, mass * v, 0))
var v:float = sqrt(2. * g * jump_height)
apply_central_impulse(Vector3(0., mass * v, 0.))
_jumping = false
# set ski state
physics_material_override.friction = !input.skiing
_handle_aerial_control(_direction)
_handle_jetpack(_direction)
func _update_third_person_animations() -> void:
if _is_pawn():
return
if _is_player_dead():
if not is_alive():
tp_mesh.set_ground_state(Vanguard.GroundState.GROUND_STATE_DEAD)
return
@ -209,32 +299,34 @@ func _update_third_person_animations() -> void:
tp_mesh.set_ground_state(Vanguard.GroundState.GROUND_STATE_GROUNDED)
else:
tp_mesh.set_ground_state(Vanguard.GroundState.GROUND_STATE_MID_AIR)
var local_velocity : Vector3 = (tp_mesh.global_basis.inverse() * linear_velocity)
const bias : float = 1.2 # Basically match feet speed with ground speed
var local_velocity:Vector3 = (tp_mesh.global_basis.inverse() * linear_velocity)
const bias:float = 1.2 # Basically match feet speed with ground speed
tp_mesh.set_locomotion(Vector2(local_velocity.x, local_velocity.z), bias)
func _is_player_dead() -> bool:
return player_state != PlayerState.PLAYER_ALIVE
func is_alive() -> bool:
assert(health)
return health.state == health.HealthState.ALIVE
func die(killer_id : int) -> void:
flag_carry_component.drop(self)
player_state = PlayerState.PLAYER_DEAD
func has_flag() -> bool:
return flag_carry_component._flag != null
func _on_killed(by_peer_id:int) -> void:
flag_carry_component.drop(linear_velocity)
if _is_pawn():
animation_player.play("death")
died.emit(self, killer_id)
killed.emit(self, by_peer_id)
@rpc("call_local", "reliable")
func respawn(location : Vector3) -> void:
@rpc("authority", "call_local", "reliable")
func respawn(location: Vector3) -> void:
animation_player.stop()
player_state = PlayerState.PLAYER_ALIVE
linear_velocity = Vector3()
health_component.heal_full()
position = location
linear_velocity = Vector3.ZERO
health.heal()
global_position = location
for weapon: Weapon in inventory.get_children():
weapon.set_ammo.rpc(weapon.max_ammo)
respawned.emit(self)
func _exit_tree() -> void:
player_state = PlayerState.PLAYER_DEAD
flag_carry_component.drop(self)
func display_jetpack_particles() -> void:
for particle: GPUParticles3D in jetpack_particles:
particle.emitting = true
flag_carry_component.drop(linear_velocity)

View file

@ -1,22 +1,20 @@
[gd_scene load_steps=45 format=3 uid="uid://cbhx1xme0sb7k"]
[gd_scene load_steps=44 format=3 uid="uid://cbhx1xme0sb7k"]
[ext_resource type="Script" path="res://entities/player/player.gd" id="1_mk68k"]
[ext_resource type="Script" path="res://entities/player/player.gd" id="1_y2i7h"]
[ext_resource type="PackedScene" uid="uid://bbeecp3jusppn" path="res://interfaces/hud/iffs/IFF.tscn" id="2_s5wgp"]
[ext_resource type="PackedScene" uid="uid://bcv81ku26xo" path="res://interfaces/hud/hud.tscn" id="3_ccety"]
[ext_resource type="Shape3D" uid="uid://cb8esdlnottdn" path="res://entities/player/resources/collider.tres" id="4_8kvcy"]
[ext_resource type="Script" path="res://entities/components/inventory.gd" id="8_768qh"]
[ext_resource type="Script" path="res://entities/components/health.gd" id="4_55muf"]
[ext_resource type="Script" path="res://entities/components/inventory.gd" id="6_du54c"]
[ext_resource type="PackedScene" uid="uid://drbefw6akui2v" path="res://entities/player/vanguard.tscn" id="8_eiy7q"]
[ext_resource type="Script" path="res://entities/components/flag_carry_component.gd" id="8_pdfbn"]
[ext_resource type="Texture2D" uid="uid://ct1v5iadtpadm" path="res://entities/player/assets/jetpackfx/smoke_01.png" id="9_4pant"]
[ext_resource type="PackedScene" uid="uid://c8co0qa2omjmh" path="res://entities/weapons/space_gun/space_gun.tscn" id="9_achlo"]
[ext_resource type="Texture2D" uid="uid://doxo4vfn0bjlp" path="res://entities/player/assets/jetpackfx/smoke_02.png" id="10_5b1bx"]
[ext_resource type="Texture2D" uid="uid://dmf12llra7aq5" path="res://entities/player/assets/jetpackfx/Particle01.png" id="11_6ndfi"]
[ext_resource type="Script" path="res://addons/smoothing/smoothing.gd" id="11_k330l"]
[ext_resource type="Script" path="res://entities/components/health_component.gd" id="14_ctgxn"]
[ext_resource type="PackedScene" uid="uid://b0xql5hi0b52y" path="res://entities/weapons/chaingun/chaingun.tscn" id="15_io0a3"]
[ext_resource type="PackedScene" uid="uid://cstl7yxc75572" path="res://entities/weapons/grenade_launcher/grenade_launcher.tscn" id="16_4xs2j"]
[ext_resource type="PackedScene" uid="uid://d3l7fvbdg6m5g" path="res://entities/flag/assets/flag.glb" id="18_7nkei"]
[ext_resource type="Script" path="res://entities/components/match_participant.gd" id="18_t2jrs"]
[ext_resource type="Script" path="res://entities/player/inputs_sync.gd" id="18_v4iu1"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_clur0"]
@ -24,8 +22,35 @@ resource_local_to_scene = true
bounce = 1.0
absorbent = true
[sub_resource type="SphereShape3D" id="SphereShape3D_hwe6e"]
radius = 0.2
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_h0a20"]
radius = 0.25
[sub_resource type="Animation" id="Animation_eoxkv"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Pivot:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0.625, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Pivot:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_yqgrk"]
resource_name = "death"
@ -51,11 +76,12 @@ tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0.5, 0), Vector3(0, -0.114794, 0)]
"values": [Vector3(0, 0.625, 0), Vector3(0, 0.625, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_hg307"]
_data = {
"RESET": SubResource("Animation_eoxkv"),
"death": SubResource("Animation_yqgrk")
}
@ -169,83 +195,88 @@ material = SubResource("StandardMaterial3D_2jwv2")
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_rqdp6"]
properties/0/path = NodePath(".:linear_velocity")
properties/0/spawn = false
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath(".:position")
properties/1/spawn = false
properties/1/spawn = true
properties/1/replication_mode = 1
properties/2/path = NodePath("HealthComponent:health")
properties/2/spawn = false
properties/2/path = NodePath(".:peer_id")
properties/2/spawn = true
properties/2/replication_mode = 2
properties/3/path = NodePath(".:player_state")
properties/3/spawn = false
properties/3/path = NodePath(".:username")
properties/3/spawn = true
properties/3/replication_mode = 2
properties/4/path = NodePath(".:team_id")
properties/4/spawn = true
properties/4/replication_mode = 2
properties/5/path = NodePath("Health:value")
properties/5/spawn = true
properties/5/replication_mode = 2
properties/6/path = NodePath("Pivot/FlagCarryComponent:visible")
properties/6/spawn = true
properties/6/replication_mode = 2
properties/7/path = NodePath("Health:state")
properties/7/spawn = true
properties/7/replication_mode = 1
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_5j4ew"]
properties/0/path = NodePath(".:direction")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/0/replication_mode = 2
properties/1/path = NodePath(".:jetting")
properties/1/spawn = true
properties/1/replication_mode = 2
properties/2/path = NodePath(".:camera_rotation")
properties/2/spawn = true
properties/2/replication_mode = 1
properties/2/replication_mode = 2
properties/3/path = NodePath(".:skiing")
properties/3/spawn = true
properties/3/replication_mode = 2
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_7na0c"]
properties/0/path = NodePath(".:username")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath(".:player_id")
properties/1/spawn = true
properties/1/replication_mode = 1
properties/2/path = NodePath(".:team_id")
properties/2/spawn = true
properties/2/replication_mode = 1
[sub_resource type="SphereShape3D" id="SphereShape3D_hwe6e"]
radius = 0.2
[node name="Player" type="RigidBody3D" node_paths=PackedStringArray("iff", "health_component", "flag_carry_component", "walkable_surface_sensor", "match_participant", "inventory", "tp_mesh", "input") groups=["Player"]]
[node name="Player" type="RigidBody3D" node_paths=PackedStringArray("iff", "health", "flag_carry_component", "walkable_surface_sensor", "hud", "inventory", "tp_mesh", "third_person", "pivot", "camera", "input")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
collision_mask = 2147483649
collision_priority = 9.0
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
mass = 75.0
mass = 80.0
physics_material_override = SubResource("PhysicsMaterial_clur0")
gravity_scale = 1.2
can_sleep = false
continuous_cd = true
script = ExtResource("1_mk68k")
linear_damp_mode = 1
linear_damp = 0.15
script = ExtResource("1_y2i7h")
iff = NodePath("IFF")
health_component = NodePath("HealthComponent")
health = NodePath("Health")
flag_carry_component = NodePath("Pivot/FlagCarryComponent")
walkable_surface_sensor = NodePath("WalkableSurfaceSensor")
match_participant = NodePath("MatchParticipant")
hud = NodePath("HUD")
inventory = NodePath("Pivot/Inventory")
tp_mesh = NodePath("ThirdPerson/Mesh")
jump_height = 1.5
third_person = NodePath("ThirdPerson")
pivot = NodePath("Pivot")
camera = NodePath("Pivot/Camera3D")
max_floor_angle = 80.0
input = NodePath("Inputs")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = ExtResource("4_8kvcy")
[node name="IFF" parent="." instance=ExtResource("2_s5wgp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0)
fill = Color(0, 1, 0, 1)
[node name="HealthComponent" type="Area3D" parent="." node_paths=PackedStringArray("match_participant")]
script = ExtResource("14_ctgxn")
match_participant = NodePath("../MatchParticipant")
[node name="Health" type="Area3D" parent="." node_paths=PackedStringArray("collider")]
script = ExtResource("4_55muf")
collider = NodePath("CollisionShape3D")
[node name="CollisionShape3D" type="CollisionShape3D" parent="HealthComponent"]
shape = ExtResource("4_8kvcy")
[node name="WalkableSurfaceSensor" type="ShapeCast3D" parent="."]
transform = Transform3D(1.05, 0, 0, 0, 1.05, 0, 0, 0, 1.05, 0, -0.85, 0)
shape = SubResource("SphereShape3D_hwe6e")
target_position = Vector3(0, 0, 0)
collision_mask = 2147483648
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = ExtResource("4_8kvcy")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Health"]
shape = SubResource("CapsuleShape3D_h0a20")
[node name="HUD" parent="." instance=ExtResource("3_ccety")]
@ -253,21 +284,19 @@ shape = ExtResource("4_8kvcy")
libraries = {
"": SubResource("AnimationLibrary_hg307")
}
autoplay = "shoot"
autoplay = "RESET"
playback_default_blend_time = 0.05
[node name="Pivot" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.625, 0)
[node name="Camera3D" type="Camera3D" parent="Pivot"]
fov = 90.0
near = 0.1
[node name="Inventory" type="Node3D" parent="Pivot"]
unique_name_in_owner = true
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0.15, -0.2, -0.45)
script = ExtResource("8_768qh")
script = ExtResource("6_du54c")
[node name="SpaceGun" parent="Pivot/Inventory" instance=ExtResource("9_achlo")]
@ -297,84 +326,55 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0,
spine_ik_target_attachment = NodePath("../../Pivot/SpineIKTarget")
[node name="Skeleton3D" parent="ThirdPerson/Mesh/Node" index="0"]
bones/0/position = Vector3(-0.0048219, 0.946668, 0.00678214)
bones/0/rotation = Quaternion(-0.0341192, -0.409249, -0.0209221, 0.911545)
bones/2/rotation = Quaternion(-0.00595832, -0.0014545, 0.0101407, 0.99993)
bones/4/rotation = Quaternion(0.0691268, 0.00227406, 0.0147948, 0.997496)
bones/6/rotation = Quaternion(0.160951, 0.00623474, 0.0096637, 0.986895)
bones/8/rotation = Quaternion(0.675761, -0.399581, 0.409695, 0.464577)
bones/10/rotation = Quaternion(0.212344, -0.0870591, -0.287653, 0.929831)
bones/12/rotation = Quaternion(0.0811501, 0.206806, -0.754068, 0.618084)
bones/14/rotation = Quaternion(0.00943715, 0.0971687, -0.145046, 0.984597)
bones/20/rotation = Quaternion(-0.123455, 0.0248346, 0.23344, 0.964183)
bones/24/rotation = Quaternion(0.0450683, -0.000817796, 0.0508488, 0.997689)
bones/26/rotation = Quaternion(0.100545, -1.16532e-07, 0.00792588, 0.994901)
bones/28/rotation = Quaternion(0.288532, -1.83796e-07, 0.0227447, 0.9572)
bones/32/rotation = Quaternion(0.00674081, -0.0316083, 0.105474, 0.993897)
bones/34/rotation = Quaternion(0.780684, 4.23384e-08, 0.0615407, 0.621889)
bones/36/rotation = Quaternion(0.580978, -1.56224e-07, 0.0457976, 0.81263)
bones/40/rotation = Quaternion(0.0913739, 0.113691, 0.100265, 0.984211)
bones/42/rotation = Quaternion(0.836841, 4.40546e-07, 0.0659669, 0.543457)
bones/44/rotation = Quaternion(0.633142, 6.48257e-09, 0.04991, 0.772425)
bones/50/rotation = Quaternion(0.729888, -4.88266e-08, 0.0575362, 0.681141)
bones/52/rotation = Quaternion(0.624011, -9.63141e-08, 0.04919, 0.779865)
bones/56/rotation = Quaternion(-0.0254885, 0.0439755, -0.00910637, 0.998666)
bones/58/rotation = Quaternion(-0.0119802, 0.289956, -0.0527053, 0.955513)
bones/62/rotation = Quaternion(0.689943, 0.375565, -0.410267, 0.463261)
bones/64/rotation = Quaternion(0.337746, -0.290519, 0.159479, 0.880961)
bones/66/rotation = Quaternion(0.540371, -0.580679, 0.406779, 0.453147)
bones/68/position = Vector3(-1.77636e-17, 0.240718, 0)
bones/68/rotation = Quaternion(0.0150529, -0.289001, 0.0720108, 0.954498)
bones/70/rotation = Quaternion(0.155965, 0.0109114, -0.00107202, 0.987702)
bones/72/rotation = Quaternion(0.563923, 4.19095e-08, -0.0577906, 0.823803)
bones/74/rotation = Quaternion(0.285209, 0.0197164, -0.0936782, 0.953673)
bones/78/rotation = Quaternion(0.057484, -0.0698946, -0.0100642, 0.995846)
bones/80/rotation = Quaternion(0.433127, 5.44824e-08, -0.0443866, 0.900239)
bones/82/rotation = Quaternion(0.274138, -1.97906e-08, -0.0280937, 0.96128)
bones/86/rotation = Quaternion(0.244152, 0.0521336, 0.176446, 0.952123)
bones/88/rotation = Quaternion(0.0146391, -1.48637e-07, -0.121951, 0.992428)
bones/90/rotation = Quaternion(-0.147655, -0.0737763, 0.197847, 0.966236)
bones/94/rotation = Quaternion(0.180682, 0.0832945, -0.00387314, 0.980001)
bones/96/rotation = Quaternion(0.245651, -6.35919e-08, -0.0251742, 0.969032)
bones/98/rotation = Quaternion(0.246432, 7.6252e-08, -0.0252543, 0.968831)
bones/102/rotation = Quaternion(0.179829, 0.0890365, -0.000307644, 0.97966)
bones/104/rotation = Quaternion(0.388149, 1.28057e-07, -0.0397774, 0.920738)
bones/106/rotation = Quaternion(0.372324, -1.37021e-07, -0.0381557, 0.927318)
bones/110/rotation = Quaternion(-0.167577, 0.223934, 0.958827, 0.0492099)
bones/112/rotation = Quaternion(-0.466474, -0.0088339, -0.0232928, 0.884184)
bones/114/rotation = Quaternion(0.575696, 0.0793941, -0.0250592, 0.813414)
bones/116/rotation = Quaternion(0.355062, 0.0493655, 0.0246355, 0.933213)
bones/120/rotation = Quaternion(0.115252, 0.282473, 0.945749, -0.111737)
bones/122/rotation = Quaternion(-0.494906, -0.0647935, 0.0183973, 0.866332)
bones/124/rotation = Quaternion(0.417677, -0.0431149, 0.00625689, 0.90755)
bones/126/rotation = Quaternion(0.397818, -0.0427722, -0.00601182, 0.916447)
[node name="HandAttachment" parent="ThirdPerson/Mesh/Node/Skeleton3D" index="0"]
transform = Transform3D(-0.152214, 0.0548832, 0.986823, 0.933991, 0.334546, 0.125459, -0.323252, 0.94078, -0.102183, -0.261612, 1.14328, 0.0896011)
transform = Transform3D(-0.152213, 0.0548833, 0.986823, 0.933991, 0.334546, 0.125458, -0.323252, 0.94078, -0.102183, -0.261612, 1.14328, 0.0896012)
[node name="grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.6068e-14, -1.19209e-07, 9.53674e-07)
[node name="grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D/grip" index="0"]
layers = 2
[node name="main" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.6068e-14, -1.19209e-07, 9.53674e-07)
[node name="main" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D/main" index="0"]
layers = 2
[node name="sides" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.6068e-14, -1.19209e-07, 9.53674e-07)
[node name="sides" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D/sides" index="0"]
layers = 2
[node name="BarrelsInner" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="BarrelsInner" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D/BarrelsInner" index="0"]
layers = 2
[node name="BarrelsOuter" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="BarrelsOuter" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D/BarrelsOuter" index="0"]
layers = 2
[node name="Base" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Base" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D/Base" index="0"]
layers = 2
[node name="Grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="3"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Barrels" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun" index="3"]
transform = Transform3D(-1, 0, 8.9407e-08, 8.47504e-08, 0, 1, 0, 1, -3.72529e-09, -5.96046e-08, 0, -0.55315)
[node name="Grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D/Grip" index="0"]
layers = 2
[node name="Barrels" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun" index="2"]
transform = Transform3D(-1, 0, 8.74227e-08, 8.74227e-08, 0, 1, 0, 1, 0, -2.32831e-10, 0.692504, 0.756307)
[node name="Skeleton3D" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature" index="0"]
bones/0/rotation = Quaternion(0, 0.707107, 0.707107, 0)
@ -385,17 +385,33 @@ bones/3/rotation = Quaternion(0, 0.707107, 0.707107, 0)
[node name="barrel" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19209e-07, 0)
[node name="barrel" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D/barrel" index="0"]
layers = 2
[node name="grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.082471, -0.0653242)
[node name="grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D/grip" index="0"]
layers = 2
[node name="main" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19209e-07, 0)
[node name="main" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D/main" index="0"]
layers = 2
[node name="vanguard_Mesh" parent="ThirdPerson/Mesh/Node/Skeleton3D" index="1"]
layers = 2
[node name="vanguard_visor" parent="ThirdPerson/Mesh/Node/Skeleton3D" index="2"]
layers = 2
[node name="JetpackFX" type="Node3D" parent="ThirdPerson/Mesh"]
transform = Transform3D(0.467164, -0.312366, -0.827155, -0.12476, 0.902867, -0.41142, 0.875325, 0.295397, 0.382816, 0.143745, 0.353192, -0.140279)
[node name="Smoke1" type="GPUParticles3D" parent="ThirdPerson/Mesh/JetpackFX"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.150648, 0)
layers = 2
emitting = false
lifetime = 0.5
one_shot = true
@ -405,6 +421,7 @@ draw_pass_1 = SubResource("QuadMesh_hegkl")
[node name="Smoke2" type="GPUParticles3D" parent="ThirdPerson/Mesh/JetpackFX"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.108846, 0)
layers = 2
emitting = false
lifetime = 0.5
one_shot = true
@ -413,6 +430,7 @@ process_material = SubResource("ParticleProcessMaterial_l8e6j")
draw_pass_1 = SubResource("QuadMesh_aeure")
[node name="Fire1" type="GPUParticles3D" parent="ThirdPerson/Mesh/JetpackFX"]
layers = 2
emitting = false
amount = 16
lifetime = 0.3
@ -421,12 +439,7 @@ fixed_fps = 60
process_material = SubResource("ParticleProcessMaterial_q1vdw")
draw_pass_1 = SubResource("QuadMesh_uc7ts")
[node name="Smoothing" type="Node3D" parent="."]
script = ExtResource("11_k330l")
target = NodePath("..")
flags = 3
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
[node name="MultiplayerSync" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_rqdp6")
[node name="Inputs" type="Node" parent="."]
@ -435,11 +448,14 @@ script = ExtResource("18_v4iu1")
[node name="InputsSync" type="MultiplayerSynchronizer" parent="Inputs"]
replication_config = SubResource("SceneReplicationConfig_5j4ew")
[node name="MatchParticipant" type="Node" parent="."]
script = ExtResource("18_t2jrs")
[node name="WalkableSurfaceSensor" type="ShapeCast3D" parent="."]
transform = Transform3D(1.05, 0, 0, 0, 1.05, 0, 0, 0, 1.05, 0, -0.85, 0)
shape = SubResource("SphereShape3D_hwe6e")
target_position = Vector3(0, 0, 0)
max_results = 16
collision_mask = 2147483648
[node name="MatchParticipantSync" type="MultiplayerSynchronizer" parent="MatchParticipant"]
replication_config = SubResource("SceneReplicationConfig_7na0c")
[connection signal="child_entered_tree" from="Pivot/Inventory" to="Pivot/Inventory" method="_on_child_entered_tree"]
[editable path="ThirdPerson/Mesh"]
[editable path="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun"]

View file

@ -1,4 +1,5 @@
[gd_resource type="CapsuleShape3D" format=3 uid="uid://cb8esdlnottdn"]
[resource]
resource_local_to_scene = true
radius = 0.25

View file

@ -1,3 +1,17 @@
# This file is part of open-fpsz.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
class_name Vanguard extends Node
@export var spine_ik_target_attachment : Marker3D