From 6888928fbbff27029a4cedbab96f24d31b39e53d Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Tue, 21 Nov 2023 21:23:20 -0500 Subject: [PATCH] starting work on final boss fight --- graphics/enemy/boss/famira-wip.png | Bin 0 -> 2863 bytes graphics/enemy/boss/famira-wip.png.import | 35 +++++++++ maps/boss/boss3_arena.gd | 3 + maps/boss/boss3_arena.tscn | 85 +++++----------------- objects/enemy/boss/famira.gd | 84 +++++++++++++++++++++ objects/enemy/boss/famira.tscn | 36 +++++++++ objects/enemy/boss/sg2083.tscn | 72 +++++++++++------- scripts/sprite_ext.gd | 3 +- 8 files changed, 222 insertions(+), 96 deletions(-) create mode 100644 graphics/enemy/boss/famira-wip.png create mode 100644 graphics/enemy/boss/famira-wip.png.import create mode 100644 maps/boss/boss3_arena.gd create mode 100644 objects/enemy/boss/famira.gd create mode 100644 objects/enemy/boss/famira.tscn diff --git a/graphics/enemy/boss/famira-wip.png b/graphics/enemy/boss/famira-wip.png new file mode 100644 index 0000000000000000000000000000000000000000..025c5a3035820e28762fc1c5db032a3fdd26adc9 GIT binary patch literal 2863 zcmV+~3()k5P)EX>4Tx04R}tkv&MmKp2MKri!8!2djuUWT;MdQ4z;lg(6f4wL+^7CYSy}lZGV4 z#ZhoAIQX+zb#QUk)xlK|1b;wWU7QqMq{Q!%LW>yhIPT%S?|r%Z4iM^Prdb^^K+|nA zm57U(?5f!Hie7{;L~~GPmN6$uN%)Shdj$A?7v)+0b$^aNHD@s(AQH!zVcNtS#50?= z!FiuJ%!;x~d`>)J(glehxvqHp#<}3Kz%#>UIyFxmCKd~Ath6yJni}ymaYWU0$`>*o ztDLtuYvn3y-jlyDl+#z1xlU^o2`pj>5=1DdqJ%PRL}}Mav5=zkxQ~Ct^-JVZ$W;O( z#{w$QAiI9>Klt5SD?c^qC57TZ=ZoWfi~(J{K%?e3-^Y&AI01ssz?I(eSL(p*C+W48 z7C8d?w}Ff6mZt0hmpj1llOdb3D+Or@`8@D`M&FbL25y0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)Dl`RfW>5f+g}(pQS+V z4yL(K^0unoE37S^H>dbP6hA8zNs-4M2QI;DdLSM~`+ZaO3gRML&j=^HX@TV2EyJ}l zIp+GEHso~x=Av*$PeA|^0Vcxn0kcs7#1Ii+BHZ#V#xYkSaiQ(LaZCi5Xqa1uw@yMi zc_kMTu`2&A%_HZQ0+>MQ5m=@q5dusEnA^tkO*bU~%vCB#-en1xBMYCLirAaGM(-$$ zV-|+-AnycXbrC{%F z$SDOBIVK{<++C@#+9QQ1`ArWSB>-jv*giFWYFlgP1K}2`yIcVCXg3W}vZ-rD4i~D} zYQ5bcj_Ig^&w0C8%kMUXvAdyB{2+=SWJ>`&h4xwFnBK5zZWGXATC~9Rh?Xeh^?H1egdg5dusE zmbYXkP%x$=z&wE;Nbau#9hPief$JAPwXG2-I znU?jvl7Q(sr?fifsE}E@`PTJZ3FQctc0$~;K5SYy_HR*O)%Z*c zgOUZpgmQO9&SWTM*G@t4g8(y9k#liNXKP_K)k$Z7ceIRd1b=E z^~#P8`vsJb4n--BW7_hukuSIRsMI179223<9dlSd={$T(i)x-_Z?Os-W_AG6Pd<4A zC3FS>GlvXm0puiy1W3nV{vpB&$#)}bV^9%bzCkK-t?TD6pqd{c*f4Z!$$9KDWF);n z`2c{HII|Ndn{DV?aV}c9rA^qXT#n<=+WFbjoN#fPKt4Idh(Z-V?{Tx1p#vb1RbPf4 zCcLr^d2!6g@SgGP^l+DSSm2<}U?$=0u}w-v=ynYy(Wfn#Z#bWB?!+82qB}xoLojuA zsGbBQk3u*CQ=cm9(Sy8`-BD+CLaOrImZE{sAjed106r85Q}VKfI-*9&bzg_0*B>uX z(3C+p*qJgp9-PGY>s8? z!pGdzLp!xN@Tx`6pJ-rNAYF0q)d-$Eos;Fs)D!4ph>65JCtcgb+dqA%qY@2qA void: + rng.seed = "HEROMARK2".hash() + _decide_action() + + +func _physics_process(delta: float) -> void: + match current_action: + "chase": + if chase_cast.is_colliding(): + print("huh") + _decide_action() + else: + print("hehe") + position.x -= chase_speed * delta + + +func _decide_action() -> void: + # fill array based on weights + var weighted_decisions := [] + for k in decisions.keys(): + for i in decisions[k]: + weighted_decisions.append(k) + # choose an action + current_action = weighted_decisions[rng.randi() % weighted_decisions.size()] + # act based on new action + match current_action: + "wait": + wait() + "chase": + chase() + "punch": + if punch_cast.is_colliding(): + punch() + else: + current_action = "chase" + chase() + "beam": + beam() + + +func wait() -> void: + print("waiting") + yield(get_tree().create_timer(wait_time, false), "timeout") + _decide_action() + + +func chase() -> void: + # TODO: play animation + print("chasing") + + +func punch() -> void: + # TODO: play animation + print("PUNCH") + yield(get_tree().create_timer(wait_time, false), "timeout") + _decide_action() + + +func beam() -> void: + # TODO: play animation and stuff + print("BEAM") + yield(get_tree().create_timer(wait_time, false), "timeout") + _decide_action() diff --git a/objects/enemy/boss/famira.tscn b/objects/enemy/boss/famira.tscn new file mode 100644 index 0000000..11e1147 --- /dev/null +++ b/objects/enemy/boss/famira.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://objects/enemy/boss/famira.gd" type="Script" id=1] +[ext_resource path="res://graphics/enemy/boss/famira-wip.png" type="Texture" id=2] +[ext_resource path="res://shaders/beam_cycle.gdshader" type="Shader" id=3] +[ext_resource path="res://graphics/enemy/boss/stg_2600/beam_gradient.png" type="Texture" id=4] + +[sub_resource type="ShaderMaterial" id=10] +shader = ExtResource( 3 ) +shader_param/cycle_speed = 1.0 +shader_param/gradient = ExtResource( 4 ) + +[node name="Famira" type="Node2D"] +script = ExtResource( 1 ) + +[node name="Sprite" type="Sprite" parent="."] +material = SubResource( 10 ) +position = Vector2( 23, -83 ) +texture = ExtResource( 2 ) +flip_h = true + +[node name="PunchCast" type="RayCast2D" parent="."] +position = Vector2( 0, -32 ) +enabled = true +cast_to = Vector2( -120, 0 ) +collision_mask = 4 +collide_with_areas = true +collide_with_bodies = false + +[node name="ChaseCast" type="RayCast2D" parent="."] +position = Vector2( 0, -16 ) +enabled = true +cast_to = Vector2( -80, 0 ) +collision_mask = 4 +collide_with_areas = true +collide_with_bodies = false diff --git a/objects/enemy/boss/sg2083.tscn b/objects/enemy/boss/sg2083.tscn index c576f33..3f870ea 100644 --- a/objects/enemy/boss/sg2083.tscn +++ b/objects/enemy/boss/sg2083.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=37 format=2] +[gd_scene load_steps=38 format=2] [ext_resource path="res://shaders/color_noise.gdshader" type="Shader" id=1] [ext_resource path="res://graphics/enemy/boss/stg_2600/tailpipes.png" type="Texture" id=2] @@ -1018,10 +1018,10 @@ tracks/6/keys = { "times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1 ), "transitions": PoolRealArray( 1, 1, 1, 1, 1 ), "update": 0, -"values": [ 51.0254, 203.4, 223.8, -3444.5, 51.0254 ] +"values": [ 51.0254, 23.4, 43.8, 55.0, 51.0254 ] } tracks/7/type = "value" -tracks/7/path = NodePath("Axle/JointBack/LegBack/KneeBack:rotation_degrees") +tracks/7/path = NodePath("Axle/JointBack/LegBack:rotation_degrees") tracks/7/interp = 1 tracks/7/loop_wrap = true tracks/7/imported = false @@ -1030,18 +1030,6 @@ tracks/7/keys = { "times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1 ), "transitions": PoolRealArray( 1, 1, 1, 1, 1 ), "update": 0, -"values": [ 0.0, -180.0, -180.0, 3510.0, 0.0 ] -} -tracks/8/type = "value" -tracks/8/path = NodePath("Axle/JointBack/LegBack:rotation_degrees") -tracks/8/interp = 1 -tracks/8/loop_wrap = true -tracks/8/imported = false -tracks/8/enabled = true -tracks/8/keys = { -"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1 ), -"transitions": PoolRealArray( 1, 1, 1, 1, 1 ), -"update": 0, "values": [ -26.8344, -19.6257, -38.4223, -35.1608, -26.8344 ] } @@ -1303,7 +1291,10 @@ tracks/1/keys = { "values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0.833333 ), Color( 1, 1, 1, 0.666667 ), Color( 1, 1, 1, 0.5 ), Color( 1, 1, 1, 0.333333 ), Color( 1, 1, 1, 0.166667 ), Color( 1, 1, 1, 0 ) ] } -[node name="2600" type="Node2D"] +[sub_resource type="RectangleShape2D" id=26] +extents = Vector2( 33.5, 76 ) + +[node name="2083" type="Node2D"] script = ExtResource( 19 ) __meta__ = { "_edit_horizontal_guides_": [ 168.0, 128.0, 157.0 ], @@ -1326,7 +1317,7 @@ position = Vector2( 42, 78 ) scale = Vector2( -1, 1 ) [node name="JointBack" type="Sprite" parent="Axle"] -modulate = Color( 0.75, 0.75, 0.75, 1 ) +modulate = Color( 0.74902, 0.74902, 0.74902, 1 ) position = Vector2( -10, -4 ) z_index = -1 texture = ExtResource( 7 ) @@ -1380,12 +1371,10 @@ __meta__ = { "_gizmo_extents_": 4.0 } -[node name="KneeBack" type="Sprite" parent="Axle/JointBack/LegBack/KneeBack"] -texture = ExtResource( 8 ) -hframes = 8 -script = ExtResource( 10 ) -fps = 4.0 -rotation_lock = 0.0 +[node name="KneeGraphic" type="RemoteTransform2D" parent="Axle/JointBack/LegBack/KneeBack"] +remote_path = NodePath("../../../../KneeBack") +update_rotation = false +update_scale = false [node name="Head" type="Sprite" parent="Axle"] unique_name_in_owner = true @@ -1545,15 +1534,15 @@ scale = Vector2( 1, -1 ) [node name="Position1" type="Position2D" parent="Axle/Head/BulletPositions"] position = Vector2( 6.08833, 2.28882e-05 ) -rotation = 3.14159 +rotation = 2.87979 [node name="Position2" type="Position2D" parent="Axle/Head/BulletPositions"] position = Vector2( 6.08832, 8.00003 ) -rotation = 3.57792 +rotation = 3.14159 [node name="Position3" type="Position2D" parent="Axle/Head/BulletPositions"] position = Vector2( 6.08832, 16 ) -rotation = 4.01426 +rotation = 3.40339 [node name="JointFront" type="Sprite" parent="Axle"] position = Vector2( 11, -4 ) @@ -1605,8 +1594,26 @@ __meta__ = { "_gizmo_extents_": 4.0 } -[node name="KneeFront" type="Sprite" parent="Axle/JointFront/LegFront"] -position = Vector2( 3.8147e-06, 36 ) +[node name="KneeGraphic" type="RemoteTransform2D" parent="Axle/JointFront/LegFront"] +position = Vector2( 7.62939e-06, 36 ) +remote_path = NodePath("../../../KneeFront") +update_rotation = false +update_scale = false + +[node name="KneeBack" type="Sprite" parent="Axle"] +modulate = Color( 0.74902, 0.74902, 0.74902, 1 ) +position = Vector2( 6.25089, 28.1233 ) +scale = Vector2( 1, -1 ) +z_index = -1 +texture = ExtResource( 8 ) +hframes = 8 +script = ExtResource( 10 ) +fps = 4.0 +ping_pong = true +rotation_lock = 0.0 + +[node name="KneeFront" type="Sprite" parent="Axle"] +position = Vector2( 27.2509, 28.1233 ) texture = ExtResource( 8 ) hframes = 8 script = ExtResource( 10 ) @@ -1630,5 +1637,14 @@ __meta__ = { anims/RESET = SubResource( 17 ) anims/explode = SubResource( 18 ) +[node name="DetectionBox" type="Area2D" parent="."] +collision_layer = 4 +collision_mask = 0 +monitoring = false + +[node name="CollisionShape2D" type="CollisionShape2D" parent="DetectionBox"] +position = Vector2( 53.5, 92 ) +shape = SubResource( 26 ) + [connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_finished"] [connection signal="area_entered" from="Axle/Head/Beam/Hitbox" to="." method="_on_Hitbox_area_entered"] diff --git a/scripts/sprite_ext.gd b/scripts/sprite_ext.gd index 7b31681..72c8e91 100644 --- a/scripts/sprite_ext.gd +++ b/scripts/sprite_ext.gd @@ -25,7 +25,8 @@ var _time: float = 0.0 func _process(delta): # rotation lock if not is_nan(rotation_lock): - global_rotation_degrees = rotation_lock + set_deferred("global_rotation_degrees", rotation_lock) +# global_rotation_degrees = rotation_lock # do not animate if paused if stopped: return