Skip to content

Commit

Permalink
Merge pull request #46 from Breadp4ck/hand_withOUT_ring
Browse files Browse the repository at this point in the history
Add hand without ring. Fix minor. Add area trigger for sanya.
  • Loading branch information
TheActualTwinkle authored Apr 7, 2023
2 parents 8a41b41 + 5ec7388 commit 8028d2a
Show file tree
Hide file tree
Showing 15 changed files with 2,857 additions and 33 deletions.
2 changes: 1 addition & 1 deletion player/hand/hand_animation.gd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func on_spell_chooosed(spell_type: Globals.SpellType) -> void:
particles.process_material.color = Color.MEDIUM_PURPLE
Globals.SpellType.TIMESTOP:
particles.process_material.color = Color.BLACK
Globals.SpellType.WIND:
Globals.SpellType.LOCKPICK:
particles.process_material.color = Color.LIGHT_CYAN

state_machine.travel("OpenPalm")
Expand Down
35 changes: 18 additions & 17 deletions player/hand/hand_with_ring.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ states/Shaking/node = SubResource("AnimationNodeAnimation_02uwb")
states/Shaking/position = Vector2(549, 50)
states/Start/position = Vector2(216, 156)
transitions = ["Start", "Calm", SubResource("AnimationNodeStateMachineTransition_28s1e"), "Calm", "Focus", SubResource("AnimationNodeStateMachineTransition_1c2rv"), "Focus", "Shaking", SubResource("AnimationNodeStateMachineTransition_on0ju"), "Shaking", "Drop", SubResource("AnimationNodeStateMachineTransition_sdrhg"), "Drop", "Calm", SubResource("AnimationNodeStateMachineTransition_4ta65"), "Calm", "OpenPalm", SubResource("AnimationNodeStateMachineTransition_kg7ws"), "OpenPalm", "PalmShaking", SubResource("AnimationNodeStateMachineTransition_jk1tv"), "PalmShaking", "Cast", SubResource("AnimationNodeStateMachineTransition_ljk1q"), "PalmShaking", "Calm", SubResource("AnimationNodeStateMachineTransition_dm2w2"), "Cast", "PalmShaking", SubResource("AnimationNodeStateMachineTransition_elc36")]
graph_offset = Vector2(-65, 99.3348)
graph_offset = Vector2(-84, 11.3348)

[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_gw4rh"]

Expand Down Expand Up @@ -1180,6 +1180,7 @@ tracks/22/keys = PackedFloat32Array(0, 1, 0.045988, 0.116805, -0.159748, 0.97914
[sub_resource type="Animation" id="Animation_medp8"]
resource_name = "Calm"
length = 4.0
loop_mode = 1
tracks/0/type = "rotation_3d"
tracks/0/imported = true
tracks/0/enabled = true
Expand Down Expand Up @@ -2629,99 +2630,99 @@ bones/1/name = "Forearm"
bones/1/parent = -1
bones/1/rest = Transform3D(0.608348, -0.322621, 0.725141, -0.582004, 0.439853, 0.683959, -0.539614, -0.83812, 0.0798168, 0.483534, -0.376819, -0.0415892)
bones/1/enabled = true
bones/1/position = Vector3(0.462586, -0.369233, -0.0738398)
bones/1/rotation = Quaternion(-0.105911, 0.844171, -0.52542, -0.00960757)
bones/1/position = Vector3(0.483534, -0.376819, -0.0415892)
bones/1/rotation = Quaternion(-0.521699, 0.4335, -0.0889049, 0.729386)
bones/1/scale = Vector3(1, 1, 1)
bones/2/name = "Palm"
bones/2/parent = 1
bones/2/rest = Transform3D(0.999271, 0.00861575, -0.0371949, -0.0276055, 0.836031, -0.547987, 0.0263747, 0.548615, 0.835659, 2.23517e-08, 0.193401, 5.58794e-09)
bones/2/enabled = true
bones/2/position = Vector3(2.23517e-08, 0.193401, 5.58794e-09)
bones/2/rotation = Quaternion(0.286173, -0.0165894, -0.00945242, 0.957988)
bones/2/rotation = Quaternion(0.286734, -0.017038, -0.00889267, 0.957817)
bones/2/scale = Vector3(1, 1, 1)
bones/3/name = "Pinky1"
bones/3/parent = 2
bones/3/rest = Transform3D(0.847815, -0.219024, 0.482947, -0.0814102, 0.846165, 0.526665, -0.524005, -0.485832, 0.699561, 0.0670238, 0.0825537, -0.0511939)
bones/3/enabled = true
bones/3/position = Vector3(0.0670238, 0.0825537, -0.0511939)
bones/3/position = Vector3(0.0485341, 0.0799059, -0.0442145)
bones/3/rotation = Quaternion(-0.274813, 0.273308, 0.0373513, 0.921078)
bones/3/scale = Vector3(1, 1, 1)
bones/4/name = "Pinky2"
bones/4/parent = 3
bones/4/rest = Transform3D(0.992498, -0.12225, -0.00170724, 0.12194, 0.988772, 0.0863768, -0.00887153, -0.0859369, 0.996261, -3.72529e-09, 0.0550049, -2.23517e-08)
bones/4/enabled = true
bones/4/position = Vector3(-3.72529e-09, 0.0550049, -2.23517e-08)
bones/4/rotation = Quaternion(-0.0431999, 0.00179612, 0.0612198, 0.997187)
bones/4/rotation = Quaternion(-0.268271, -0.0833762, 0.23387, 0.930798)
bones/4/scale = Vector3(1, 1, 1)
bones/5/name = "Pinky3"
bones/5/parent = 4
bones/5/rest = Transform3D(0.998286, -0.0579772, -0.00803433, 0.0576854, 0.997798, -0.0327389, 0.00991474, 0.0322193, 0.999432, -9.31323e-09, 0.0406663, -2.98023e-08)
bones/5/enabled = true
bones/5/position = Vector3(-9.31323e-09, 0.0406663, -2.98023e-08)
bones/5/rotation = Quaternion(0.0162486, -0.00448979, 0.0289319, 0.999439)
bones/5/rotation = Quaternion(-0.15284, -0.0421203, 0.110227, 0.981181)
bones/5/scale = Vector3(1, 1, 1)
bones/6/name = "Ring1"
bones/6/parent = 2
bones/6/rest = Transform3D(0.953258, -0.0409258, 0.299374, -0.109005, 0.877488, 0.467047, -0.281812, -0.47785, 0.832011, 0.0360043, 0.119696, 0.0116578)
bones/6/enabled = true
bones/6/position = Vector3(0.0360043, 0.119696, 0.0116578)
bones/6/rotation = Quaternion(-0.24686, 0.151838, -0.0177861, 0.956916)
bones/6/rotation = Quaternion(-0.322005, 0.215872, 0.0228056, 0.921516)
bones/6/scale = Vector3(1, 1, 1)
bones/7/name = "Ring2"
bones/7/parent = 6
bones/7/rest = Transform3D(0.890739, -0.1065, -0.441862, 0.17785, 0.976314, 0.123206, 0.418275, -0.18833, 0.888582, 1.49012e-08, 0.0559291, -2.39816e-08)
bones/7/enabled = true
bones/7/position = Vector3(1.49012e-08, 0.0559291, -2.39816e-08)
bones/7/rotation = Quaternion(-0.0803779, -0.22192, 0.0733639, 0.968973)
bones/7/rotation = Quaternion(-0.203, -0.156969, 0.177326, 0.950109)
bones/7/scale = Vector3(1, 1, 1)
bones/8/name = "Ring3"
bones/8/parent = 7
bones/8/rest = Transform3D(0.588843, -0.39607, 0.704552, 0.0757811, 0.894917, 0.43975, -0.804687, -0.205552, 0.55698, 2.23517e-08, 0.050095, 1.11759e-08)
bones/8/enabled = true
bones/8/position = Vector3(2.23517e-08, 0.050095, 1.11759e-08)
bones/8/rotation = Quaternion(-0.18503, 0.432751, 0.135296, 0.871886)
bones/8/rotation = Quaternion(-0.251263, 0.422308, 0.0123616, 0.870844)
bones/8/scale = Vector3(1, 1, 1)
bones/9/name = "Middle1"
bones/9/parent = 2
bones/9/rest = Transform3D(0.986956, -0.151988, 0.0530838, 0.107078, 0.865952, 0.488529, -0.120219, -0.476473, 0.870931, -0.0238354, 0.142874, 0.0186928)
bones/9/enabled = true
bones/9/position = Vector3(-0.0238354, 0.142874, 0.0186928)
bones/9/rotation = Quaternion(-0.250036, 0.0449035, 0.0671253, 0.964863)
bones/9/rotation = Quaternion(-0.33582, 0.0741115, 0.084426, 0.935203)
bones/9/scale = Vector3(1, 1, 1)
bones/10/name = "Middle2"
bones/10/parent = 9
bones/10/rest = Transform3D(0.98812, 0.0915543, -0.123436, -0.0371331, 0.921617, 0.386321, 0.14913, -0.377148, 0.914068, -2.23517e-08, 0.0640407, -1.86265e-08)
bones/10/enabled = true
bones/10/position = Vector3(-2.23517e-08, 0.0640407, -1.86265e-08)
bones/10/rotation = Quaternion(-0.195215, -0.0696939, -0.0329047, 0.977728)
bones/10/rotation = Quaternion(-0.385622, -0.0112677, 0.0472816, 0.921376)
bones/10/scale = Vector3(1, 1, 1)
bones/11/name = "Middle3"
bones/11/parent = 10
bones/11/rest = Transform3D(0.995679, -0.0928168, 0.00305258, 0.0885189, 0.958487, 0.271046, -0.0280835, -0.269605, 0.962561, 1.86265e-08, 0.0557822, -3.72529e-09)
bones/11/enabled = true
bones/11/position = Vector3(1.86265e-08, 0.0557822, -3.72529e-09)
bones/11/rotation = Quaternion(-0.136592, 0.00786634, 0.0458133, 0.989536)
bones/11/rotation = Quaternion(-0.120178, 0.00353001, 0.0360047, 0.992093)
bones/11/scale = Vector3(1, 1, 1)
bones/12/name = "Index1"
bones/12/parent = 2
bones/12/rest = Transform3D(0.951576, -0.292448, 0.0947488, 0.211213, 0.845912, 0.489716, -0.223365, -0.445989, 0.866719, -0.0740538, 0.104808, 0.0224593)
bones/12/enabled = true
bones/12/position = Vector3(-0.0740538, 0.104808, 0.0224593)
bones/12/rotation = Quaternion(-0.24441, 0.0830927, 0.131558, 0.957106)
bones/12/rotation = Quaternion(-0.142353, -0.0604479, 0.123665, 0.980198)
bones/12/scale = Vector3(1, 1, 1)
bones/13/name = "Index2"
bones/13/parent = 12
bones/13/rest = Transform3D(0.944366, 0.274277, 0.181505, -0.300637, 0.943673, 0.1382, -0.133376, -0.185078, 0.973631, 2.23517e-08, 0.0541292, 1.86265e-09)
bones/13/enabled = true
bones/13/position = Vector3(2.23517e-08, 0.0541292, 1.86265e-09)
bones/13/rotation = Quaternion(-0.0822542, 0.0801179, -0.14628, 0.982557)
bones/13/rotation = Quaternion(-0.366303, 0.191996, -0.0839728, 0.906591)
bones/13/scale = Vector3(1, 1, 1)
bones/14/name = "Index3"
bones/14/parent = 13
bones/14/rest = Transform3D(0.991889, 0.126396, 0.0134022, -0.126947, 0.99039, 0.0548868, -0.00633592, -0.056143, 0.998403, -2.23517e-08, 0.0488645, 1.11759e-08)
bones/14/enabled = true
bones/14/position = Vector3(-2.23517e-08, 0.0488645, 1.11759e-08)
bones/14/rotation = Quaternion(-0.0278247, 0.00494649, -0.0634894, 0.997582)
bones/14/rotation = Quaternion(-0.267179, 0.0418984, -0.0344598, 0.962119)
bones/14/scale = Vector3(1, 1, 1)
bones/15/name = "Index1.001"
bones/15/parent = 12
Expand All @@ -2742,7 +2743,7 @@ bones/17/parent = 16
bones/17/rest = Transform3D(0.908257, 0.411001, 0.0784032, -0.411819, 0.911245, -0.00618717, -0.0739874, -0.0266684, 0.996903, -7.45058e-09, 0.0599257, 1.76951e-08)
bones/17/enabled = true
bones/17/position = Vector3(-7.45058e-09, 0.0599257, 1.76951e-08)
bones/17/rotation = Quaternion(-0.00524202, 0.0390033, -0.210595, 0.976781)
bones/17/rotation = Quaternion(0.118173, 0.132543, -0.294539, 0.938996)
bones/17/scale = Vector3(1, 1, 1)
bones/18/name = "Thumb3"
bones/18/parent = 17
Expand Down
2,577 changes: 2,577 additions & 0 deletions player/hand/hand_without_ring.tscn

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions player/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const INTERACT_RAY_LENGTH: float = 3.0
@onready var shadesmar_env: Environment = load("res://player/shadesmar_env.tres")
@onready var gui: GUI = $GUI

@onready var hand_ring: Node3D = $Body/hand_with_ring
@onready var hand: Node3D = $Body/hand_without_ring

var can_input: bool = true:
get:
return (not is_jumping) and (transition_tween == null or not transition_tween.is_running()) and (not is_spell_delay)
Expand Down Expand Up @@ -67,7 +70,11 @@ func _input(event: InputEvent) -> void:
want_interact = true

if event.is_action_pressed("jump_to_plane"):
effects.play("hop")
var inventory_item_types: Array = []
for i in Inventory.items.size():
inventory_item_types.push_back(Inventory.items[i].type)
if inventory_item_types.has(InventoryItem.Type.RING):
effects.play("hop")

var transition = get_pressed_movement_transition()
if transition == -1:
Expand Down Expand Up @@ -250,9 +257,12 @@ func interact() -> void:
intersection.collider.interacted.emit(null)
print("hit some shit")

if intersection.collider is InventoryItem and intersection.collider.type == InventoryItem.Type.BOOK:
gui.toggle_book()

if intersection.collider is InventoryItem:
if intersection.collider.type == InventoryItem.Type.BOOK:
gui.toggle_book()
elif intersection.collider.type == InventoryItem.Type.RING:
hand.visible = false
hand_ring.visible = true

want_interact = false

Expand Down
7 changes: 5 additions & 2 deletions player/player.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[ext_resource type="PackedScene" uid="uid://cq2cbtc63fkp7" path="res://spells/fire_spell.tscn" id="6_7r8ka"]
[ext_resource type="Script" path="res://player/speech_recognition.gd" id="6_gxi0n"]
[ext_resource type="PackedScene" uid="uid://cynjrogfl7ks2" path="res://player/hand/hand_with_ring.tscn" id="7_j8jkj"]
[ext_resource type="PackedScene" uid="uid://bdptjf5n1xaqu" path="res://spells/wind_spell.tscn" id="8_f7els"]
[ext_resource type="PackedScene" uid="uid://dug0lui71my67" path="res://player/hand/hand_without_ring.tscn" id="10_ykexg"]
[ext_resource type="PackedScene" uid="uid://y8o54gbbmy7x" path="res://spells/repair_spell.tscn" id="11_mvv62"]
[ext_resource type="PackedScene" uid="uid://die2clnm3gt6u" path="res://spells/destruct_spell.tscn" id="13_mm8ql"]
[ext_resource type="PackedScene" uid="uid://dpe3c4jm65lo1" path="res://spells/timestop_spell.tscn" id="16_opg8d"]
Expand Down Expand Up @@ -342,8 +342,12 @@ target_position = Vector3(0, 0, -2)
collision_mask = 65
collide_with_areas = true

[node name="hand_without_ring" parent="Body" instance=ExtResource("10_ykexg")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0.2)

[node name="hand_with_ring" parent="Body" node_paths=PackedStringArray("spell_caster") instance=ExtResource("7_j8jkj")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0.2)
visible = false
spell_caster = NodePath("../../SpellCaster")

[node name="HitBox" type="Area3D" parent="Body"]
Expand All @@ -357,7 +361,6 @@ shape = SubResource("CapsuleShape3D_2q3p1")
script = ExtResource("5_jpbmn")
fire_spell_scene = ExtResource("6_7r8ka")
destruct_spell_scene = ExtResource("13_mm8ql")
wind_spell_scene = ExtResource("8_f7els")
repair_spell_scene = ExtResource("11_mvv62")
timestop_spell_scene = ExtResource("16_opg8d")
teleport_spell_scene = ExtResource("17_c6sm3")
Expand Down
2 changes: 1 addition & 1 deletion player/speech_recognition.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extends Node
@export var spells = {
"fire": Globals.SpellType.FIRE,
"destruction": Globals.SpellType.DESTRUCT,
"wind": Globals.SpellType.WIND,
"lockpick": Globals.SpellType.LOCKPICK,
"repair": Globals.SpellType.REPAIR,
"time": Globals.SpellType.TIMESTOP,
"teleport": Globals.SpellType.TELEPORT
Expand Down
6 changes: 3 additions & 3 deletions player/spell_caster.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ signal choose_canceled()

@export var fire_spell_scene: PackedScene
@export var destruct_spell_scene: PackedScene
@export var wind_spell_scene: PackedScene
@export var lockpick_spell_scene: PackedScene
@export var repair_spell_scene: PackedScene
@export var timestop_spell_scene: PackedScene
@export var teleport_spell_scene: PackedScene
Expand Down Expand Up @@ -63,8 +63,8 @@ func get_spell(spell_type: Globals.SpellType) -> Spell:
return fire_spell_scene.instantiate()
Globals.SpellType.DESTRUCT:
return destruct_spell_scene.instantiate()
Globals.SpellType.WIND:
return wind_spell_scene.instantiate()
Globals.SpellType.LOCKPICK:
return lockpick_spell_scene.instantiate()
Globals.SpellType.REPAIR:
return repair_spell_scene.instantiate()
Globals.SpellType.TIMESTOP:
Expand Down
2 changes: 1 addition & 1 deletion singletons/globals.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enum WorldPlane {
enum SpellType{
FIRE = 0,
DESTRUCT,
WIND,
LOCKPICK,
REPAIR,
TIMESTOP,
TELEPORT,
Expand Down
2 changes: 1 addition & 1 deletion speech_recognition/spells.dict
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fire K AA T UW N
destruction AH V AA D AH K EH D AA V R AH
wind K AH B AE B
lock K AH B AE B
repair HH OW K AH S P OW K AH S
time T AY M
teleport T EH L AH P AO R T
Loading

0 comments on commit 8028d2a

Please sign in to comment.