more fixes to machete but not working yet
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=112 format=4 uid="uid://6agmt1hqlhww"]
|
||||
[gd_scene load_steps=111 format=4 uid="uid://6agmt1hqlhww"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_sbpvn"]
|
||||
[ext_resource type="PackedScene" uid="uid://brl0bsqjl5dg3" path="res://assets/mac_10.tscn" id="2_fn4vb"]
|
||||
@@ -39,7 +39,6 @@
|
||||
[ext_resource type="PackedScene" uid="uid://cucqbjb8bcha5" path="res://assets/blunderbuss_pickup.tscn" id="38_1e38i"]
|
||||
[ext_resource type="PackedScene" uid="uid://cdpxctwwi12j" path="res://assets/ladder_collision_check.tscn" id="41_brca2"]
|
||||
[ext_resource type="PackedScene" uid="uid://h05qay3qri4e" path="res://assets/switch_1.tscn" id="42_rmbqr"]
|
||||
[ext_resource type="PackedScene" uid="uid://bshuvj6xeaiiq" path="res://assets/machete.tscn" id="43_k8ftm"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcmd7elfjhppe" path="res://assets/tree_1.tscn" id="43_o23bq"]
|
||||
[ext_resource type="PackedScene" uid="uid://hp4xn8oqdxnd" path="res://assets/machete_pickup.tscn" id="44_j62x2"]
|
||||
[ext_resource type="PackedScene" uid="uid://dlhjacsike5a4" path="res://assets/oildrum1.tscn" id="45_eatji"]
|
||||
@@ -2032,11 +2031,8 @@ transform = Transform3D(1, 0, 0, 0, 0.589387, 0, 0, 0, 1, 3.73803, -5.75175, 15.
|
||||
[node name="Switch1" parent="." instance=ExtResource("42_rmbqr")]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -1.63531, 1.62721, 8.4082)
|
||||
|
||||
[node name="Machete" parent="." instance=ExtResource("43_k8ftm")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.44723, 1.44374, 9.96268)
|
||||
|
||||
[node name="machete_pickup" parent="." instance=ExtResource("44_j62x2")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.60621, 1.38605, 10.9619)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.74172, 0.204712, 11.2157)
|
||||
|
||||
[connection signal="body_entered" from="Room1/RoomCheck" to="Room1/RoomCheck" method="_on_body_entered"]
|
||||
[connection signal="body_exited" from="Room1/RoomCheck" to="Room1/RoomCheck" method="_on_body_exited"]
|
||||
|
||||
@@ -35,6 +35,7 @@ func _process(delta):
|
||||
|
||||
func _on_timer_timeout():
|
||||
collision_shape.disabled = true
|
||||
gravity_scale = .1
|
||||
await get_tree().create_timer(1).timeout
|
||||
queue_free()
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -209,6 +209,8 @@ func pickup_spawn(randomized):
|
||||
i_weight = 1.0 - clamp(float(player.ammo_reserve[str(i)]) / float(expected_ammo["shotgun"]),0,1)
|
||||
4:
|
||||
i_weight = 1.0 - clamp(float(player.ammo_reserve[str(i)]) / float(expected_ammo["rocket"]),0,1)
|
||||
5:
|
||||
i_weight = 0
|
||||
if i_weight > ammo_weight:
|
||||
ammo_weight = i_weight
|
||||
ammo_type_weight[i] = i_weight + drop_chance_minimum
|
||||
|
||||
@@ -44,7 +44,7 @@ func _physics_process(delta):
|
||||
if body.has_method("hit"):
|
||||
hit_indicator.play()
|
||||
enemy_particles.emitting = true
|
||||
ray.get_collider().hit(bullet_damage)
|
||||
body.hit(bullet_damage)
|
||||
|
||||
#bullethole effect
|
||||
body.add_child(instance_bullethole)
|
||||
|
||||
15
scripts/melee_collision.gd
Normal file
15
scripts/melee_collision.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Area3D
|
||||
|
||||
var bullet_damage
|
||||
|
||||
@onready var machete: Node3D = $"../.."
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
bullet_damage = machete.bullet_damage
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
@@ -5,6 +5,7 @@ extends Node3D
|
||||
@export var gun_name : String
|
||||
@export var gun_icon : Texture2D
|
||||
@export_enum("Light", "Medium", "Heavy", "Shotgun", "Rocket","Melee") var ammo_type: int
|
||||
@export var collision_shape : Node
|
||||
@export var fov_zoom_amt = 0
|
||||
@export var ads : bool = false
|
||||
@export var recoil_amount : Vector3 = Vector3(0,.2,.2)
|
||||
@@ -31,7 +32,7 @@ var gun_index
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass
|
||||
collision_shape.disabled = true
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
@@ -46,8 +47,23 @@ func shoot(delta):
|
||||
player.recoil.add_gun_recoil(recoil_amount.x)
|
||||
SignalBus.emit_signal("shot_fired")
|
||||
|
||||
func collider_enable():
|
||||
collision_shape.disabled = false
|
||||
|
||||
func collider_disable():
|
||||
collision_shape.disabled = true
|
||||
|
||||
func swapped_out():
|
||||
queue_free()
|
||||
|
||||
func vibration():
|
||||
Input.start_joy_vibration(0,.1,.5,.1)
|
||||
|
||||
|
||||
func _on_area_3d_body_entered(body: Node3D) -> void:
|
||||
if body.has_method("hit"):
|
||||
body.hit(bullet_damage)
|
||||
|
||||
if body.is_in_group("breakable"):
|
||||
var current_velocity = transform.basis * Vector3(0,0,-1)
|
||||
body.breaking(current_velocity)
|
||||
|
||||
Reference in New Issue
Block a user