Added per enemy taunts and other tweaks
This commit is contained in:
@@ -8,7 +8,7 @@ font = ExtResource("1_7a4sr")
|
||||
font_size = 500
|
||||
outline_color = Color(1, 1, 1, 0.498039)
|
||||
|
||||
[node name="PickupAnnounce" type="Label"]
|
||||
[node name="DeadAnnounce" type="Label"]
|
||||
visible = false
|
||||
offset_right = 3440.0
|
||||
offset_bottom = 1440.0
|
||||
|
||||
@@ -1072,6 +1072,7 @@ fire_mode = 1
|
||||
recoil_amount = Vector3(0.25, 0.1, 0.1)
|
||||
max_ammo = 6
|
||||
bullet_damage = 5
|
||||
kick_amount = 2
|
||||
bullet_force_mod = 10
|
||||
bullet_speed = 1500
|
||||
bullet_drop = 0.0
|
||||
|
||||
@@ -744,6 +744,7 @@ money = ExtResource("6_ihv2y")
|
||||
health_pickup = ExtResource("7_i7u4i")
|
||||
die_particles = ExtResource("7_w22oa")
|
||||
damage_number = ExtResource("9_rmegy")
|
||||
taunts = Array[String](["did i do that?", "you've been on my shitlist", "you like that?? you want more??", "you should try dodging", "schwing!", "hows your gut now you big cup of dumdum juice?!"])
|
||||
|
||||
[node name="TurretLook" type="RayCast3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00161432, 1.62046, 0.00134204)
|
||||
|
||||
@@ -67,6 +67,7 @@ script = ExtResource("1_fcu8x")
|
||||
enemy_type = 1
|
||||
damage = 3.0
|
||||
pushback = 15.0
|
||||
taunts = ["anybody got a toothpick?", "now that's what i call stake night", "now i gotta clean all this off"]
|
||||
|
||||
[node name="Spikes1" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("ArrayMesh_atemo")
|
||||
|
||||
@@ -34,33 +34,35 @@ func _physics_process(delta):
|
||||
if distance_from_player.length() > 1.5:
|
||||
visible = true
|
||||
|
||||
if ray.is_colliding() and !ray.get_collider().is_in_group("player"):
|
||||
if ray.is_colliding():
|
||||
var body = ray.get_collider()
|
||||
if !body.is_in_group("player"):
|
||||
|
||||
mesh.visible = false
|
||||
ray.enabled = false
|
||||
|
||||
if ray.get_collider().is_in_group("enemy_target"):
|
||||
if body.is_in_group("enemy_target"):
|
||||
hit_indicator.play()
|
||||
enemy_particles.emitting = true
|
||||
SignalBus.emit_signal("enemy_hit")
|
||||
ray.get_collider().hit(bullet_damage)
|
||||
|
||||
#bullethole effect
|
||||
ray.get_collider().add_child(instance_bullethole)
|
||||
body.add_child(instance_bullethole)
|
||||
instance_bullethole.global_transform.origin = ray.get_collision_point()
|
||||
if (abs(ray.get_collision_normal().y) > 0.99):
|
||||
instance_bullethole.look_at(ray.get_collision_point() + ray.get_collision_normal(), Vector3(0,0,1))
|
||||
else:
|
||||
instance_bullethole.look_at(ray.get_collision_point() + ray.get_collision_normal())
|
||||
|
||||
if ray.get_collider().is_in_group("switch"):
|
||||
ray.get_collider().hit()
|
||||
if body.is_in_group("switch"):
|
||||
body.hit()
|
||||
|
||||
#move rigidbodies
|
||||
if ray.get_collider().is_in_group("scene_rigidbody"):
|
||||
ray.get_collider().linear_velocity += transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
||||
if body.is_in_group("scene_rigidbody"):
|
||||
body.linear_velocity += transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
||||
|
||||
if ray.get_collider().is_in_group("breakable"):
|
||||
if body.is_in_group("breakable"):
|
||||
var current_velocity = transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
||||
ray.get_collider().breaking(current_velocity)
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ func _ready():
|
||||
#highlight target
|
||||
if target != null:
|
||||
var taunt_spawn = ENEMY_TAUNT.instantiate()
|
||||
taunt_spawn.text = taunt_spawn.taunts.pick_random()
|
||||
taunt_spawn.text = target.taunts.pick_random()
|
||||
target.add_child(taunt_spawn)
|
||||
taunt_spawn.global_transform.origin = target.global_position + Vector3(0,2,0)
|
||||
taunt_node = taunt_spawn
|
||||
|
||||
@@ -5,15 +5,6 @@ var start_position
|
||||
const SPEED = 3
|
||||
const SCALE_SPEED = 80
|
||||
|
||||
var taunts = ["hows your gut now you big cup of dumdum juice?",
|
||||
"did i do that?",
|
||||
"schwing!",
|
||||
"hee hee",
|
||||
"stop trying",
|
||||
"you're on my shitlist",
|
||||
"you like that?? you want more???",
|
||||
"try dodging it next time",
|
||||
"yowza!"]
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
|
||||
@@ -7,6 +7,7 @@ extends Node3D
|
||||
@export var hitscan_enabled : bool = false
|
||||
@export var fov_zoom_amt = .98
|
||||
@export var recoil_amount : Vector3 = Vector3(.2,.05,.05)
|
||||
@export var kick_amount : float = .1
|
||||
@export var max_ammo = 15
|
||||
@export var start_mags = 3
|
||||
@export var bullet_damage = 1
|
||||
@@ -91,13 +92,12 @@ func shoot(delta):
|
||||
audio_fire.pitch_scale = 1 + rng.randf_range(-fire_pitch_scale_amt,fire_pitch_scale_amt)
|
||||
audio_fire.play()
|
||||
anim_player.play("shoot")
|
||||
|
||||
bullet_fire()
|
||||
hitscan_fire()
|
||||
spawn_casing()
|
||||
|
||||
player.recoil.add_recoil(Vector3(0,recoil_amount.y,recoil_amount.z),10,10)
|
||||
player.recoil.add_gun_recoil(recoil_amount.x)
|
||||
#player.velocity += player.bullet_ray.global_basis * Vector3(0,0, kick_amount)
|
||||
if fire_mode != 0:
|
||||
cycle_count -= 1
|
||||
|
||||
|
||||
@@ -369,6 +369,10 @@ func _physics_process(delta):
|
||||
interact_ray.get_collider().linear_velocity += interact_ray.global_transform.basis * Vector3(0,0, -KICK_AMOUNT)
|
||||
if held_item != null:
|
||||
release_moveable()
|
||||
elif held_item != null:
|
||||
kick_audio.play()
|
||||
held_item.linear_velocity += interact_ray.global_transform.basis * Vector3(0,0, -KICK_AMOUNT)
|
||||
release_moveable()
|
||||
|
||||
if level_control.health <= 0:
|
||||
level_control.die()
|
||||
|
||||
@@ -134,7 +134,7 @@ func shoot(delta):
|
||||
audio_fire.pitch_scale = 1 + rng.randf_range(-fire_pitch_scale_amt,fire_pitch_scale_amt)
|
||||
audio_fire.play()
|
||||
anim_player.play("shoot") #actual bullet spawn triggered by animation
|
||||
|
||||
player.velocity += player.bullet_ray.global_basis * Vector3(0,0, kick_amount)
|
||||
if fire_mode != 0:
|
||||
cycle_count -= 1
|
||||
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
extends Node
|
||||
|
||||
@export_group("Main")
|
||||
@export var room_lockdown : bool = false
|
||||
@export_group("Key")
|
||||
@export var key_drop : bool = false
|
||||
@export_enum("Silver", "Gold", "Special") var key_type: int
|
||||
@export var special_key_name : String
|
||||
@export_group("Item Drops")
|
||||
@export var ammo_drop_enabled = true
|
||||
@export var stamina_drop_enabled = true
|
||||
@export var health_drop_enabled = true
|
||||
@export var money_drop_enabled = true
|
||||
|
||||
var enemies = []
|
||||
var doors = []
|
||||
@@ -21,7 +31,6 @@ func _ready():
|
||||
i.room_entered.connect(room_entered)
|
||||
i.room_exited.connect(room_exited)
|
||||
|
||||
print("Doors: " + str(doors))
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
@@ -54,7 +63,7 @@ func _process(delta):
|
||||
# loot on last enemy
|
||||
if enemies.size() == 1:
|
||||
for i in enemies:
|
||||
i.loot_amount = 30 #later get this number from level manager
|
||||
i.loot_amount = 20 #assign loot to the last enemy drop from this section
|
||||
i.last_enemy = true
|
||||
|
||||
func last_enemy_dead():
|
||||
|
||||
@@ -26,6 +26,8 @@ const MAX_AV = 10
|
||||
@export var health_pickup : Resource
|
||||
@export var die_particles : Resource
|
||||
@export var damage_number : Resource
|
||||
@export_group("Taunts")
|
||||
@export var taunts : Array[String] = []
|
||||
|
||||
@onready var level_control = get_tree().current_scene
|
||||
@onready var nav_agent = $NavigationAgent3D
|
||||
@@ -108,7 +110,7 @@ func _process(delta):
|
||||
move_and_slide()
|
||||
|
||||
if dying:
|
||||
turret.global_rotation.y += 100 * delta
|
||||
turret.global_rotation.y += 200 * delta
|
||||
#fire(barrel_1)
|
||||
#fire(barrel_2)
|
||||
|
||||
@@ -117,20 +119,16 @@ func _process(delta):
|
||||
|
||||
|
||||
func _on_area_3d_body_part_hit(dam,bullet_damage):
|
||||
if !dying:
|
||||
health -= dam * bullet_damage
|
||||
print("health: " + str(health))
|
||||
if health <= 0:
|
||||
dying_throws()
|
||||
|
||||
|
||||
func _on_prefire_timer_timeout():
|
||||
#barrel 1 fire
|
||||
fire(barrel_1)
|
||||
#barrel 2 fire
|
||||
fire(barrel_2)
|
||||
|
||||
turret_material.emission_enabled = false
|
||||
|
||||
prefire_timer.stop()
|
||||
postfire_timer.start()
|
||||
|
||||
@@ -205,7 +203,7 @@ func drop_loot(number_of_drops):
|
||||
var av_z = randf_range(-MAX_AV,MAX_AV)
|
||||
|
||||
# Random Item Drop
|
||||
rand_item.position = self.global_position
|
||||
rand_item.position = self.global_position + Vector3(0,2,0) #added height to spawn location since origin is on the ground
|
||||
rand_item.transform.basis = self.global_transform.basis
|
||||
rand_item.linear_velocity += self.global_transform.basis * Vector3(lv_x,lv_y,lv_z)
|
||||
rand_item.angular_velocity += self.global_transform.basis * Vector3(av_x,av_y,av_z)
|
||||
|
||||
@@ -3,10 +3,12 @@ extends Node3D
|
||||
@export_enum("Enemy", "Trap") var enemy_type: int
|
||||
@export var damage : float = 1
|
||||
@export var pushback : float = 5
|
||||
@onready var outline_meshes = [$Spikes1/MeshInstance3D]
|
||||
@export var taunts : Array[String] = []
|
||||
|
||||
@onready var outline_meshes = [$Spikes1/MeshInstance3D]
|
||||
@onready var ray_cast: RayCast3D = $RayCast3D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
Reference in New Issue
Block a user