diff --git a/components/Characters/Bear.tscn b/components/Characters/Bear.tscn index a97030d..de5a468 100644 --- a/components/Characters/Bear.tscn +++ b/components/Characters/Bear.tscn @@ -8,7 +8,7 @@ [ext_resource type="AudioStream" uid="uid://cqh2yvwcy83gg" path="res://resources/sounds/bossAttack/Bear/Sprint.ogg" id="6_x3jmu"] [ext_resource type="AudioStream" uid="uid://ce8xjsh68momv" path="res://resources/sounds/bossAttack/Bear/Arrow7-2.ogg" id="7_0r2df"] [ext_resource type="AudioStream" uid="uid://dd18jfva1knwm" path="res://resources/sounds/bossAttack/Bear/LightGun.ogg" id="8_qagkm"] -[ext_resource type="Texture2D" uid="uid://b5e6ndswcmq48" path="res://resources/characters/bear/FurryR.jpg" id="10_m7811"] +[ext_resource type="Texture2D" uid="uid://cgngjuc21l4xq" path="res://resources/characters/bear/FurryR.png" id="9_av1u2"] [ext_resource type="Shader" path="res://shaders/RedTemprature.gdshader" id="12_j8sas"] [ext_resource type="Texture2D" uid="uid://df6ly7iydtcwx" path="res://resources/characters/bear/FurryR-mask.png" id="13_v2sdb"] @@ -16,7 +16,7 @@ animations = [{ "frames": [{ "duration": 1.0, -"texture": ExtResource("10_m7811") +"texture": ExtResource("9_av1u2") }], "loop": true, "name": &"idle", @@ -24,7 +24,7 @@ animations = [{ }, { "frames": [{ "duration": 1.0, -"texture": ExtResource("10_m7811") +"texture": ExtResource("9_av1u2") }], "loop": true, "name": &"walk", @@ -32,7 +32,7 @@ animations = [{ }] [sub_resource type="RectangleShape2D" id="RectangleShape2D_akdh6"] -size = Vector2(335, 344) +size = Vector2(100, 100) [sub_resource type="Animation" id="Animation_sxh2u"] length = 0.001 @@ -167,14 +167,9 @@ stream = ExtResource("8_qagkm") stream = ExtResource("8_qagkm") [node name="texture" parent="." index="2"] -position = Vector2(0, -80) sprite_frames = SubResource("SpriteFrames_6tgxs") -[node name="hurtbox" parent="texture" index="0"] -visible = false - [node name="hitbox" parent="texture/hurtbox" index="0"] -position = Vector2(-2.5, -1) shape = SubResource("RectangleShape2D_akdh6") [node name="animator" parent="texture" index="1"] @@ -194,12 +189,11 @@ texture = ExtResource("13_v2sdb") [node name="mask" type="Sprite2D" parent="texture" index="7"] unique_name_in_owner = true -visible = false material = SubResource("ShaderMaterial_6h05p") texture = ExtResource("13_v2sdb") [node name="statebar" parent="." index="3"] -position = Vector2(0, -284) +position = Vector2(0, -114) [node name="movebox" parent="." index="4"] disabled = true diff --git a/resources/characters/bear/FurryR-mask.png b/resources/characters/bear/FurryR-mask.png index 6123065..3f7468c 100644 Binary files a/resources/characters/bear/FurryR-mask.png and b/resources/characters/bear/FurryR-mask.png differ diff --git a/resources/characters/bear/FurryR.jpg b/resources/characters/bear/FurryR.jpg deleted file mode 100644 index 8f3c45b..0000000 Binary files a/resources/characters/bear/FurryR.jpg and /dev/null differ diff --git a/resources/characters/bear/FurryR.png b/resources/characters/bear/FurryR.png new file mode 100644 index 0000000..69f48a1 Binary files /dev/null and b/resources/characters/bear/FurryR.png differ diff --git a/resources/characters/bear/FurryR.jpg.import b/resources/characters/bear/FurryR.png.import similarity index 68% rename from resources/characters/bear/FurryR.jpg.import rename to resources/characters/bear/FurryR.png.import index a347386..c8a92de 100644 --- a/resources/characters/bear/FurryR.jpg.import +++ b/resources/characters/bear/FurryR.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://b5e6ndswcmq48" -path="res://.godot/imported/FurryR.jpg-f305957108e2f1f86811a398be97c85f.ctex" +uid="uid://cgngjuc21l4xq" +path="res://.godot/imported/FurryR.png-5850392cbd69fd4762536751d27e9e17.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resources/characters/bear/FurryR.jpg" -dest_files=["res://.godot/imported/FurryR.jpg-f305957108e2f1f86811a398be97c85f.ctex"] +source_file="res://resources/characters/bear/FurryR.png" +dest_files=["res://.godot/imported/FurryR.png-5850392cbd69fd4762536751d27e9e17.ctex"] [params] diff --git a/scripts/Contents/Characters/Bear.gd b/scripts/Contents/Characters/Bear.gd index b5bb433..5201f9d 100644 --- a/scripts/Contents/Characters/Bear.gd +++ b/scripts/Contents/Characters/Bear.gd @@ -11,12 +11,11 @@ func register(): attackCooldownMap[0] = 3000 attackCooldownMap[1] = 10000 attackCooldownMap[2] = 8000 - attackCooldownMap[3] = 13000 + attackCooldownMap[3] = 5000 attackCooldownMap[4] = 4500 attackCooldownMap[5] = 5500 attackCooldownMap[6] = 10000 attackCooldownMap[7] = 9000 - sprintMultiplier = 60 healthChanged.connect( func(newHealth): setStage(1 if newHealth < fields[FieldStore.Entity.MAX_HEALTH] * 0.5 else 0) @@ -56,15 +55,17 @@ func attack(type): elif type == 3: if !is_instance_valid(currentFocusedBoss): return false await sprintTo(currentFocusedBoss.position - Vector2(MathTool.randc_from([500, -500]), 0), 0.25) - playSound("attack3") sprintParticle.emitting = true canRunAi = false - await TickTool.millseconds(900) + currentInvinsible = true + playSound("attack3") + await TickTool.millseconds(500) BulletBase.generate(preload("res://components/Bullets/BearSprint.tscn"), self, weaponPos, 0) await trySprint() sprintParticle.emitting = false canRunAi = true await sprintTo(currentFocusedBoss.position + MathTool.randv2_range(400), 0.25) + currentInvinsible = false return false elif type == 4: playSound("attack4") @@ -109,4 +110,8 @@ func attack(type): return false return true func sprint(): - move((currentFocusedBoss.position - position).normalized() * Vector2(1, 0) * sprintMultiplier, true) + var dir = sign((currentFocusedBoss.position - position).x) + velocity = Vector2(dir, 0) +func sprintAi(): + velocity.x *= 1.2 + return abs(velocity.x) >= 1000000 diff --git a/scripts/Contents/Characters/Chick.gd b/scripts/Contents/Characters/Chick.gd index 161987c..7df66de 100644 --- a/scripts/Contents/Characters/Chick.gd +++ b/scripts/Contents/Characters/Chick.gd @@ -12,7 +12,7 @@ func register(): attackCooldownMap[1] = 6000 attackCooldownMap[2] = 2000 attackCooldownMap[3] = 500 - sprintMultiplier = 30 + sprintMultiplier = 45 func spawn(): texture.play("walk") diff --git a/scripts/Contents/Wave.gd b/scripts/Contents/Wave.gd index bbeb0d8..0a6024f 100644 --- a/scripts/Contents/Wave.gd +++ b/scripts/Contents/Wave.gd @@ -15,18 +15,17 @@ static var WAVE_NORMAL = [ Wave.create(preload("res://components/Characters/Bear.tscn"), 0, 0, true, 19, INF, 10), ] static var WAVE_TESTBOSS = [ - Wave.create(preload("res://components/Characters/Chick.tscn"), 0, 0, true, 0, INF, 1), Wave.create(preload("res://components/Characters/Bear.tscn"), 0, 0, true, 0, INF, 1), - Wave.create(preload("res://components/Characters/KukeMC.tscn"), 0, 0, true, 0, INF, 1), ] -static var data = [] +static var data = WAVE_TESTBOSS static func customStart(): - var furryr = EntityBase.generate(preload("res://components/Characters/Bear.tscn"), MathTool.randv2_range(500), true, false) - var kukemc = EntityBase.generate(preload("res://components/Characters/KukeMC.tscn"), MathTool.randv2_range(500), true, false) - EntityBase.generate(preload("res://components/Characters/Chick.tscn"), MathTool.randv2_range(500), true, false) - furryr.currentFocusedBoss = kukemc - kukemc.currentFocusedBoss = furryr + pass + # var furryr = EntityBase.generate(preload("res://components/Characters/Bear.tscn"), MathTool.randv2_range(500), true, false) + # var kukemc = EntityBase.generate(preload("res://components/Characters/KukeMC.tscn"), MathTool.randv2_range(500), true, false) + # EntityBase.generate(preload("res://components/Characters/Chick.tscn"), MathTool.randv2_range(500), true, false) + # furryr.currentFocusedBoss = kukemc + # kukemc.currentFocusedBoss = furryr static func create( entity_: PackedScene, minCount_: int = 1, diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 834765c..43b5240 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -175,6 +175,7 @@ func timeLived(): func setStage(stage: int): if currentStage == stage: return + currentInvinsible = true canRunAi = false var oldStage = currentStage currentStage = stage @@ -185,6 +186,7 @@ func setStage(stage: int): stageAnimator.play("enter") await stageAnimator.animation_finished canRunAi = true + currentInvinsible = false func applyLevel(): fields[FieldStore.Entity.MAX_HEALTH] *= (1 + GameRule.entityHealthIncreasePerWave * (GameRule.difficulty + 1)) ** level fields[FieldStore.Entity.DAMAGE_MULTIPILER] *= (1 + GameRule.entityDamageIncreasePerWave * (GameRule.difficulty + 1)) ** level