diff --git a/.gitignore b/.gitignore
index 5b5fbba..659f560 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
build/
.import/
+assets/export/*.import
diff --git a/TODO.md b/TODO.md
index 4d0f357..9decdf6 100644
--- a/TODO.md
+++ b/TODO.md
@@ -10,9 +10,10 @@
* make the help text indicate (flash, etc.)
3. Sound effects
* on hit
- * on piece lost
- * on piece kill
- * on opponent victory
* if possible, a small bit of background music
4. Further visual polish
5. New units
+
+Bugs
+
+ * if the player has no possible moves, there is no way to continue: add a skip turn button
diff --git a/assets/export/dust.wav b/assets/export/dust.wav
new file mode 100644
index 0000000..b602f3a
Binary files /dev/null and b/assets/export/dust.wav differ
diff --git a/assets/export/end_song.ogg b/assets/export/end_song.ogg
new file mode 100644
index 0000000..64dd102
Binary files /dev/null and b/assets/export/end_song.ogg differ
diff --git a/assets/export/hehe.wav b/assets/export/hehe.wav
new file mode 100644
index 0000000..ed49035
Binary files /dev/null and b/assets/export/hehe.wav differ
diff --git a/assets/export/huh.wav b/assets/export/huh.wav
new file mode 100644
index 0000000..497edeb
Binary files /dev/null and b/assets/export/huh.wav differ
diff --git a/assets/export/impossible.wav b/assets/export/impossible.wav
new file mode 100644
index 0000000..780fa4c
Binary files /dev/null and b/assets/export/impossible.wav differ
diff --git a/assets/export/stop_that.wav b/assets/export/stop_that.wav
new file mode 100644
index 0000000..7f343da
Binary files /dev/null and b/assets/export/stop_that.wav differ
diff --git a/assets/export/thinkyoucan.wav b/assets/export/thinkyoucan.wav
new file mode 100644
index 0000000..b5e6a25
Binary files /dev/null and b/assets/export/thinkyoucan.wav differ
diff --git a/assets/export/yammering.wav b/assets/export/yammering.wav
new file mode 100644
index 0000000..c6a3ac1
Binary files /dev/null and b/assets/export/yammering.wav differ
diff --git a/assets/source/end_song.aup b/assets/source/end_song.aup
new file mode 100644
index 0000000..3800046
--- /dev/null
+++ b/assets/source/end_song.aup
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/source/end_song_data/eff/d1f/eff1f07e.au b/assets/source/end_song_data/eff/d1f/eff1f07e.au
new file mode 100644
index 0000000..546c87f
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1f07e.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1f098.au b/assets/source/end_song_data/eff/d1f/eff1f098.au
new file mode 100644
index 0000000..eabcd2c
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1f098.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1f367.au b/assets/source/end_song_data/eff/d1f/eff1f367.au
new file mode 100644
index 0000000..853b83d
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1f367.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1f38c.au b/assets/source/end_song_data/eff/d1f/eff1f38c.au
new file mode 100644
index 0000000..427c2dc
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1f38c.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1f498.au b/assets/source/end_song_data/eff/d1f/eff1f498.au
new file mode 100644
index 0000000..006ae1c
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1f498.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1f6a7.au b/assets/source/end_song_data/eff/d1f/eff1f6a7.au
new file mode 100644
index 0000000..254dc27
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1f6a7.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1fa33.au b/assets/source/end_song_data/eff/d1f/eff1fa33.au
new file mode 100644
index 0000000..a23b173
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1fa33.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1faec.au b/assets/source/end_song_data/eff/d1f/eff1faec.au
new file mode 100644
index 0000000..9c45f97
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1faec.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1fb3b.au b/assets/source/end_song_data/eff/d1f/eff1fb3b.au
new file mode 100644
index 0000000..6788f0d
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1fb3b.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1fbf8.au b/assets/source/end_song_data/eff/d1f/eff1fbf8.au
new file mode 100644
index 0000000..01ab64d
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1fbf8.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1fe75.au b/assets/source/end_song_data/eff/d1f/eff1fe75.au
new file mode 100644
index 0000000..c98bf01
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1fe75.au differ
diff --git a/assets/source/end_song_data/eff/d1f/eff1ff48.au b/assets/source/end_song_data/eff/d1f/eff1ff48.au
new file mode 100644
index 0000000..ba999be
Binary files /dev/null and b/assets/source/end_song_data/eff/d1f/eff1ff48.au differ
diff --git a/assets/source/voice_clips.aup b/assets/source/voice_clips.aup
new file mode 100644
index 0000000..f57d92a
--- /dev/null
+++ b/assets/source/voice_clips.aup
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f05b.au b/assets/source/voice_clips_data/eff/d1f/eff1f05b.au
new file mode 100644
index 0000000..55334ab
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f05b.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f19d.au b/assets/source/voice_clips_data/eff/d1f/eff1f19d.au
new file mode 100644
index 0000000..f6b294e
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f19d.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f349.au b/assets/source/voice_clips_data/eff/d1f/eff1f349.au
new file mode 100644
index 0000000..0599d35
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f349.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f454.au b/assets/source/voice_clips_data/eff/d1f/eff1f454.au
new file mode 100644
index 0000000..e8fac90
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f454.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f5f8.au b/assets/source/voice_clips_data/eff/d1f/eff1f5f8.au
new file mode 100644
index 0000000..370646a
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f5f8.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f701.au b/assets/source/voice_clips_data/eff/d1f/eff1f701.au
new file mode 100644
index 0000000..0e59c74
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f701.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f750.au b/assets/source/voice_clips_data/eff/d1f/eff1f750.au
new file mode 100644
index 0000000..64e3925
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f750.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f7ea.au b/assets/source/voice_clips_data/eff/d1f/eff1f7ea.au
new file mode 100644
index 0000000..55334ab
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f7ea.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f80e.au b/assets/source/voice_clips_data/eff/d1f/eff1f80e.au
new file mode 100644
index 0000000..39abe7f
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f80e.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f871.au b/assets/source/voice_clips_data/eff/d1f/eff1f871.au
new file mode 100644
index 0000000..53f87da
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f871.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1fabb.au b/assets/source/voice_clips_data/eff/d1f/eff1fabb.au
new file mode 100644
index 0000000..0849483
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1fabb.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1fb3a.au b/assets/source/voice_clips_data/eff/d1f/eff1fb3a.au
new file mode 100644
index 0000000..5d41129
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1fb3a.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1fbaa.au b/assets/source/voice_clips_data/eff/d1f/eff1fbaa.au
new file mode 100644
index 0000000..f6b294e
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1fbaa.au differ
diff --git a/assets/source/voice_clips_data/eff/d1f/eff1fd44.au b/assets/source/voice_clips_data/eff/d1f/eff1fd44.au
new file mode 100644
index 0000000..3429da2
Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1fd44.au differ
diff --git a/src/Game.gd b/src/Game.gd
index 574e96d..1e40f67 100644
--- a/src/Game.gd
+++ b/src/Game.gd
@@ -36,6 +36,15 @@ var reinforcements = null
var reinforcements_size = 0
var reinforcements_coords = []
+const on_ai_lose_piece = {
+ 50: "/root/Game/Huh",
+ 75: "/root/Game/StopThat",
+ 90: "/root/Game/Yammering",
+}
+const on_player_lose_piece = {
+ 75: "/root/Game/Hehe",
+ 90: "/root/Game/Dust",
+}
const piece_types = {
"pawn": "res://src/pieces/Pawn.tscn",
"rook": "res://src/pieces/Rook.tscn",
@@ -267,6 +276,7 @@ func _on_quit_game_pressed():
get_tree().quit()
func reset_game_state():
+ get_node("/root/Game/EndSong").stop()
self.is_player_turn = true
self.turn = 0
for p in get_tree().get_nodes_in_group("pieces"):
@@ -405,6 +415,7 @@ func _on_new_turn():
self.reinforcements = 2 # 2 turns away
self.reinforcements_size = 4
get_node("BottomBar/Help").set_text("Multiple opponent reinforcements detected inbound")
+ get_node("/root/Game/ThinkYouCan").play()
self.flash_help = 3
if self.reinforcements == null and not just_spawned:
var chance = lerp(0, 50, 1 - float(opponent_pieces.size())/16.0)
@@ -438,9 +449,11 @@ func _process(delta):
player_victory = true
get_node("/root/Game/TopBar/Bottom/Instruction").set_text("Game over")
if not player_victory:
+ get_node("/root/Game/EndSong").play()
get_node("/root/Game/BottomBar/Help").set_text("Unsurprisingly, the result was known before-hand.")
else:
get_node("/root/Game/BottomBar/Help").set_text("Well, I'll be damned. I didn't think this would happen!")
+ get_node("/root/Game/Impossible").play()
# Show a popup for new one, or quit
self._on_escape(true)
if self.current_state == 1:
@@ -459,6 +472,15 @@ func _process(delta):
if target_square['piece'] != null:
# @TODO If the target doesn't die, we need to bounce back
target_square['piece'].queue_free()
+ var c = self.rng.randi() % 100
+ var index_to_play = null
+ for idx in self.on_player_lose_piece.keys():
+ if c < idx:
+ break
+ index_to_play = idx
+ if index_to_play != null:
+ print("ai loss Chance to play: ", c, " got index ", index_to_play)
+ get_node(self.on_player_lose_piece[index_to_play]).play()
var square = square_of_piece(self.ai_piece)
square['piece'] = null
target_square['piece'] = self.ai_piece
@@ -532,6 +554,15 @@ func _physics_process(delta):
if dest_square['piece'] != null:
# @TODO If the target doesn't die, we need to bounce back
dest_square['piece'].queue_free()
+ var c = self.rng.randi() % 100
+ var index_to_play = null
+ for idx in self.on_ai_lose_piece.keys():
+ if c < idx:
+ break
+ index_to_play = idx;
+ if index_to_play != null:
+ print("ai loss Chance to play: ", c, " got index ", index_to_play)
+ get_node(self.on_ai_lose_piece[index_to_play]).play()
square['piece'] = null
dest_square['piece'] = piece
piece.set_position(Vector2(dest_square['x']*128, dest_square['y']*128))
@@ -545,3 +576,35 @@ func _physics_process(delta):
self.landing_piece = null
+
+
+func _on_EndSong_finished():
+ get_node("/root/Game/EndSong").stop()
+
+
+func _on_Yammering_finished():
+ get_node("/root/Game/Yammering").stop()
+
+
+func _on_Dust_finished():
+ get_node("/root/Game/Dust").stop()
+
+
+func _on_ThinkYouCan_finished():
+ get_node("/root/Game/ThinkYouCan").stop()
+
+
+func _on_Impossible_finished():
+ get_node("/root/Game/Impossible").stop()
+
+
+func _on_Hehe_finished():
+ get_node("/root/Game/Hehe").stop()
+
+
+func _on_Huh_finished():
+ get_node("/root/Game/Huh").stop()
+
+
+func _on_StopThat_finished():
+ get_node("/root/Game/StopThat").stop()
diff --git a/src/Game.tscn b/src/Game.tscn
index 67bb0ab..9635881 100644
--- a/src/Game.tscn
+++ b/src/Game.tscn
@@ -1,10 +1,18 @@
-[gd_scene load_steps=7 format=2]
+[gd_scene load_steps=15 format=2]
[ext_resource path="res://src/Game.gd" type="Script" id=1]
[ext_resource path="res://src/Playfield.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/large font.tres" type="DynamicFont" id=3]
[ext_resource path="res://assets/source/Bitstream Vera Sans Mono Bold Nerd Font Complete.ttf" type="DynamicFontData" id=4]
[ext_resource path="res://src/EndMenu.tscn" type="PackedScene" id=5]
+[ext_resource path="res://assets/export/end_song.ogg" type="AudioStream" id=6]
+[ext_resource path="res://assets/export/impossible.wav" type="AudioStream" id=7]
+[ext_resource path="res://assets/export/thinkyoucan.wav" type="AudioStream" id=8]
+[ext_resource path="res://assets/export/yammering.wav" type="AudioStream" id=9]
+[ext_resource path="res://assets/export/stop_that.wav" type="AudioStream" id=10]
+[ext_resource path="res://assets/export/huh.wav" type="AudioStream" id=11]
+[ext_resource path="res://assets/export/dust.wav" type="AudioStream" id=12]
+[ext_resource path="res://assets/export/hehe.wav" type="AudioStream" id=13]
[sub_resource type="DynamicFont" id=1]
size = 24
@@ -98,3 +106,37 @@ valign = 1
[node name="EndMenu" parent="." instance=ExtResource( 5 )]
visible = true
+
+[node name="EndSong" type="AudioStreamPlayer" parent="."]
+stream = ExtResource( 6 )
+volume_db = 4.0
+autoplay = true
+
+[node name="Yammering" type="AudioStreamPlayer" parent="."]
+stream = ExtResource( 9 )
+
+[node name="Dust" type="AudioStreamPlayer" parent="."]
+stream = ExtResource( 12 )
+
+[node name="ThinkYouCan" type="AudioStreamPlayer" parent="."]
+stream = ExtResource( 8 )
+
+[node name="Impossible" type="AudioStreamPlayer" parent="."]
+stream = ExtResource( 7 )
+
+[node name="Hehe" type="AudioStreamPlayer" parent="."]
+stream = ExtResource( 13 )
+
+[node name="Huh" type="AudioStreamPlayer" parent="."]
+stream = ExtResource( 11 )
+
+[node name="StopThat" type="AudioStreamPlayer" parent="."]
+stream = ExtResource( 10 )
+[connection signal="finished" from="EndSong" to="." method="_on_EndSong_finished"]
+[connection signal="finished" from="Yammering" to="." method="_on_Yammering_finished"]
+[connection signal="finished" from="Dust" to="." method="_on_Dust_finished"]
+[connection signal="finished" from="ThinkYouCan" to="." method="_on_ThinkYouCan_finished"]
+[connection signal="finished" from="Impossible" to="." method="_on_Impossible_finished"]
+[connection signal="finished" from="Hehe" to="." method="_on_Hehe_finished"]
+[connection signal="finished" from="Huh" to="." method="_on_Huh_finished"]
+[connection signal="finished" from="StopThat" to="." method="_on_StopThat_finished"]