aboutsummaryrefslogtreecommitdiff
path: root/client/player/character/headwear
diff options
context:
space:
mode:
Diffstat (limited to 'client/player/character/headwear')
-rw-r--r--client/player/character/headwear/cat_ears.gd14
-rw-r--r--client/player/character/headwear/devil_horn.res (renamed from client/player/character/headwear/horn.res)bin5892 -> 5892 bytes
-rw-r--r--client/player/character/headwear/devil_horns.tscn2
-rw-r--r--client/player/character/headwear/propeller_hat.tscn7
4 files changed, 22 insertions, 1 deletions
diff --git a/client/player/character/headwear/cat_ears.gd b/client/player/character/headwear/cat_ears.gd
index fbf2c8e2..19273243 100644
--- a/client/player/character/headwear/cat_ears.gd
+++ b/client/player/character/headwear/cat_ears.gd
@@ -1,5 +1,6 @@
# Hurry Curry! - a game about cooking
# Copyright 2025 nokoe
+# Copyright 2025 tpart
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -19,6 +20,8 @@ extends Node3D
const EAR_ROTATION := deg_to_rad(20.)
var ear_target := 0.
+@onready var character: Character = get_parent().get_parent().get_parent().get_parent()
+
func set_inner_mat(mat: BaseMaterial3D):
$Left.set_surface_override_material(1, mat)
$Right.set_surface_override_material(1, mat)
@@ -28,7 +31,18 @@ func set_outer_mat(mat: BaseMaterial3D):
$Left.set_surface_override_material(0, mat)
$Right.set_surface_override_material(0, mat)
+func _ready() -> void:
+ set_inner_mat(character.main.get_active_material(0))
+ set_outer_mat(character.hair_mesh.get_active_material(0))
+
+var t := 0.
func _process(delta: float) -> void:
if visible:
$Right.rotation.z = G.interpolate_angle($Right.rotation.z, ear_target + EAR_ROTATION, delta * 10.)
$Left.rotation.z = G.interpolate_angle($Left.rotation.z, PI + ear_target + EAR_ROTATION, delta * 10.)
+ if character.walking:
+ t += delta
+ ear_target = sin(t * character.WALK_ANIM_SPEED) * 0.075 if character.walking else 0.
+ else:
+ t = 0
+ ear_target = 0.
diff --git a/client/player/character/headwear/horn.res b/client/player/character/headwear/devil_horn.res
index aab67051..aab67051 100644
--- a/client/player/character/headwear/horn.res
+++ b/client/player/character/headwear/devil_horn.res
Binary files differ
diff --git a/client/player/character/headwear/devil_horns.tscn b/client/player/character/headwear/devil_horns.tscn
index 52dcdd77..d952b480 100644
--- a/client/player/character/headwear/devil_horns.tscn
+++ b/client/player/character/headwear/devil_horns.tscn
@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://ciw1ngkslskaw"]
-[ext_resource type="ArrayMesh" uid="uid://mwaobrw3mab4" path="res://player/character/headwear/horn.res" id="1_kadxh"]
+[ext_resource type="ArrayMesh" uid="uid://mwaobrw3mab4" path="res://player/character/headwear/devil_horn.res" id="1_kadxh"]
[node name="DevilHorns" type="Node3D"]
diff --git a/client/player/character/headwear/propeller_hat.tscn b/client/player/character/headwear/propeller_hat.tscn
new file mode 100644
index 00000000..e913da9e
--- /dev/null
+++ b/client/player/character/headwear/propeller_hat.tscn
@@ -0,0 +1,7 @@
+[gd_scene load_steps=2 format=3 uid="uid://dd60wq65on6cf"]
+
+[ext_resource type="ArrayMesh" uid="uid://cxftkcxlde6m2" path="res://player/character/headwear/propeller.res" id="1_24m5a"]
+
+[node name="PropellerHat" type="MeshInstance3D"]
+transform = Transform3D(0.3, 0, 0, 0, -1.31134e-08, -0.3, 0, 0.3, -1.31134e-08, 0, 0.165, 0.45)
+mesh = ExtResource("1_24m5a")