diff options
Diffstat (limited to 'scenes')
-rw-r--r-- | scenes/LegallyDistinctPaperclipAssistant/paperclip.gd | 6 | ||||
-rw-r--r-- | scenes/LegallyDistinctPaperclipAssistant/window.tscn | 20 | ||||
-rw-r--r-- | scenes/main.gd | 52 | ||||
-rw-r--r-- | scenes/main.tscn | 1 | ||||
-rw-r--r-- | scenes/microgames/ad/ad_window.tscn | 2 | ||||
-rw-r--r-- | scenes/microgames/fish_stonk.tscn | 7 | ||||
-rw-r--r-- | scenes/microgames/fishin/fishin.gd | 10 |
7 files changed, 80 insertions, 18 deletions
diff --git a/scenes/LegallyDistinctPaperclipAssistant/paperclip.gd b/scenes/LegallyDistinctPaperclipAssistant/paperclip.gd index 3a87c66..6624498 100644 --- a/scenes/LegallyDistinctPaperclipAssistant/paperclip.gd +++ b/scenes/LegallyDistinctPaperclipAssistant/paperclip.gd @@ -1,5 +1,7 @@ extends Window +signal intro_finished + const START_TEXT = "Hi, I'm your legally\ndistinct paperclip\nassistant,\nClippette..." const TOUCHED = "Don't touch me!" @@ -53,3 +55,7 @@ func _on_timer_timeout() -> void: func start_dialogue(): $AnimationPlayer.play("intro") + + +func finish_intro(): + intro_finished.emit() diff --git a/scenes/LegallyDistinctPaperclipAssistant/window.tscn b/scenes/LegallyDistinctPaperclipAssistant/window.tscn index 6af02fa..6cd3902 100644 --- a/scenes/LegallyDistinctPaperclipAssistant/window.tscn +++ b/scenes/LegallyDistinctPaperclipAssistant/window.tscn @@ -190,10 +190,24 @@ tracks/6/path = NodePath("Label:visible") tracks/6/interp = 1 tracks/6/loop_wrap = true tracks/6/keys = { -"times": PackedFloat32Array(0, 16.9422), -"transitions": PackedFloat32Array(1, 1), +"times": PackedFloat32Array(0, 16.9422, 18), +"transitions": PackedFloat32Array(1, 1, 1), "update": 1, -"values": [true, false] +"values": [true, false, true] +} +tracks/7/type = "method" +tracks/7/imported = false +tracks/7/enabled = true +tracks/7/path = NodePath(".") +tracks/7/interp = 1 +tracks/7/loop_wrap = true +tracks/7/keys = { +"times": PackedFloat32Array(18), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"finish_intro" +}] } [sub_resource type="Animation" id="Animation_umwwq"] diff --git a/scenes/main.gd b/scenes/main.gd index d128e3f..8fe50aa 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -1,5 +1,8 @@ extends Node2D +var fishes = [Fishin.FishType.GAR, Fishin.FishType.SALMON, Fishin.FishType.BASS, Fishin.FishType.HUMUHUMUNUKUNUKUAPUA_A, Fishin.FishType.CATFSIH, Fishin.FishType.DOGFISH, Fishin.FishType.ANGLERFISH, Fishin.FishType.MOBY_DICK, Fishin.FishType.LEAPING_SMACKEREL] +var fish_seen: Array + # Called when the node enters the scene tree for the first time. func _ready() -> void: pass @@ -13,13 +16,29 @@ func _process(delta: float) -> void: func _on_microgame_spawn_timer_timeout() -> void: - print("WAAAHAHAHA MICROGAMES") - # Spawn a microgame window - var window_scene = preload("res://scenes/microgames/ad/ad_window.tscn") - var window_instance = window_scene.instantiate() - - print(type_string(typeof(window_instance))) + var window_instance = null + if (randf() < 0.25): + var window_scene = preload("res://scenes/microgames/microgame_window.tscn") + window_instance = window_scene.instantiate() + + var fishin_scene = preload("res://scenes/microgames/fishin/node_2d.tscn") + var fishin_instance = fishin_scene.instantiate() + + var stonk_scene = preload("res://scenes/stockticker/Stock Ticker.tscn") + var stonk_instance = stonk_scene.instantiate() + + stonk_instance.buy.connect($"Score window (real)/Score window"._on_stock_ticker_buy) + stonk_instance.sell.connect($"Score window (real)/Score window"._on_stock_ticker_sell) + + fishin_instance.fish_chosen.connect(stonk_instance._on_fishin_fish_chosen) + fishin_instance.win.connect(on_other_fishin_win.bind(fishin_instance, stonk_instance, window_instance)) + + window_instance.add_child(stonk_instance) + window_instance.add_child(fishin_instance) + else: + var window_scene = preload("res://scenes/microgames/ad/ad_window.tscn") + window_instance = window_scene.instantiate() add_child(window_instance) @@ -48,15 +67,15 @@ func _on_microgame_lose(window: MicrogameWindow): $"Score window (real)/Score window".net_worth.timesEquals(0.8) -func _on_fishin_win() -> void: +func _on_fishin_win(fish_caught: Fishin.FishType) -> void: $Fishin.queue_free() $"Stock ticker".start() - $"Microgame spawn timer".start() $Clippette.visible = true $Clippette.start_dialogue() $"Score window (real)".visible = true + fish_seen.push_back(fish_caught) $Music.play() - + func _on_score_window_donezo() -> void: for child in get_children(): @@ -77,3 +96,18 @@ func _on_score_window_donezo() -> void: var gameover_scene_instance = gameover_scene.instantiate() new_window.add_child(gameover_scene_instance) add_child(new_window) + + +# This is the one for the fishing microgame that appears after the first one +func on_other_fishin_win(fish_caught: Fishin.FishType, fishin: Fishin, stonk, window: Window): + if not (fish_caught in fish_seen): + fish_seen.push_back(fish_caught) + fishin.queue_free() + stonk.start() + else: + window.queue_free() + + +func _on_clippette_intro_finished() -> void: + _on_microgame_spawn_timer_timeout() + $"Microgame spawn timer".start() diff --git a/scenes/main.tscn b/scenes/main.tscn index 4de6e4f..9191200 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -348,6 +348,7 @@ stream = ExtResource("11_33353") stream = ExtResource("12_xycxa") [connection signal="timeout" from="Microgame spawn timer" to="." method="_on_microgame_spawn_timer_timeout"] +[connection signal="intro_finished" from="Clippette" to="." method="_on_clippette_intro_finished"] [connection signal="donezo" from="Score window (real)/Score window" to="." method="_on_score_window_donezo"] [connection signal="buy" from="Stock ticker" to="Score window (real)/Score window" method="_on_stock_ticker_buy"] [connection signal="sell" from="Stock ticker" to="Score window (real)/Score window" method="_on_stock_ticker_sell"] diff --git a/scenes/microgames/ad/ad_window.tscn b/scenes/microgames/ad/ad_window.tscn index dd89a93..1d4d78d 100644 --- a/scenes/microgames/ad/ad_window.tscn +++ b/scenes/microgames/ad/ad_window.tscn @@ -26,7 +26,7 @@ [ext_resource type="Texture2D" uid="uid://diqk5cl2rehkg" path="res://scenes/microgames/ad/ad_images/wizard_sexy.png" id="24_ipkoa"] [ext_resource type="Texture2D" uid="uid://x1m2v51rug76" path="res://scenes/microgames/ad/ad_images/wtf.png" id="25_o5yc3"] -[node name="Window" instance=ExtResource("1_gtv65")] +[node name="Window2" instance=ExtResource("1_gtv65")] title = "Check out this special offer [Click Here]" size = Vector2i(824, 604) content_scale_size = Vector2i(0, 0) diff --git a/scenes/microgames/fish_stonk.tscn b/scenes/microgames/fish_stonk.tscn new file mode 100644 index 0000000..68a1f40 --- /dev/null +++ b/scenes/microgames/fish_stonk.tscn @@ -0,0 +1,7 @@ +[gd_scene load_steps=2 format=3 uid="uid://ddn5p54b5cop1"] + +[ext_resource type="PackedScene" uid="uid://c4s4pigu4pr48" path="res://scenes/microgames/fishin/node_2d.tscn" id="1_phxek"] + +[node name="FishStonk" type="Node2D"] + +[node name="Fishin" parent="." instance=ExtResource("1_phxek")] diff --git a/scenes/microgames/fishin/fishin.gd b/scenes/microgames/fishin/fishin.gd index 9f62755..d52e449 100644 --- a/scenes/microgames/fishin/fishin.gd +++ b/scenes/microgames/fishin/fishin.gd @@ -1,4 +1,5 @@ extends Node2D +class_name Fishin enum FishType { GAR, @@ -12,7 +13,7 @@ enum FishType { LEAPING_SMACKEREL, } -signal win +signal win(fish_type: FishType) signal lose signal fish_chosen(fish_sprite: Sprite2D, fish_name: String) @@ -33,6 +34,7 @@ var in_game_timer: Timer var succfail_timer: Timer var success_timer: Timer +var fish_choice var gar var salmon var bass @@ -107,9 +109,7 @@ func _on_texture_button_button_up() -> void: happy.visible = true # show fish - var fish_choice: FishType = randi_range(0,len(fishes)) - - fish_choice = FishType.MOBY_DICK + fish_choice = randi_range(0,len(fishes)) match fish_choice: FishType.GAR: @@ -225,4 +225,4 @@ func _on_success_fail_timeout() -> void: func _on_success_timeout() -> void: - win.emit() + win.emit(fish_choice) |