diff --git a/components/Bullets/BigLaser.tscn b/components/Bullets/BigLaser.tscn index 4fa4bec..24b3de5 100644 --- a/components/Bullets/BigLaser.tscn +++ b/components/Bullets/BigLaser.tscn @@ -3,3 +3,6 @@ [ext_resource type="PackedScene" uid="uid://8gjjfju6p3fh" path="res://components/Bullets/Common/LaserCommoner.tscn" id="1_ukbip"] [node name="BigLaser" instance=ExtResource("1_ukbip")] +needEnergy = 100.0 +knockback = 10.0 +recoil = 4.0 diff --git a/components/Bullets/Common/LaserCommoner.tscn b/components/Bullets/Common/LaserCommoner.tscn index f6c4f39..e51dc7e 100644 --- a/components/Bullets/Common/LaserCommoner.tscn +++ b/components/Bullets/Common/LaserCommoner.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=20 format=3 uid="uid://8gjjfju6p3fh"] +[gd_scene load_steps=18 format=3 uid="uid://8gjjfju6p3fh"] [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_f67dy"] [ext_resource type="Script" path="res://scripts/Contents/Bullets/BigLaser.gd" id="2_tdbxh"] @@ -31,14 +31,8 @@ point_count = 2 [sub_resource type="CurveTexture" id="CurveTexture_nimkb"] curve = SubResource("Curve_7w1gn") -[sub_resource type="Gradient" id="Gradient_ki7oc"] -colors = PackedColorArray(0.546875, 0.546875, 0.546875, 1, 1, 1, 1, 1) - -[sub_resource type="GradientTexture1D" id="GradientTexture1D_csn21"] -gradient = SubResource("Gradient_ki7oc") - [sub_resource type="Gradient" id="Gradient_krx08"] -offsets = PackedFloat32Array(0, 0.450382) +offsets = PackedFloat32Array(0, 0.553435) colors = PackedColorArray(1, 1, 1, 1, 1, 0, 0, 1) [sub_resource type="GradientTexture1D" id="GradientTexture1D_l66oc"] @@ -58,7 +52,6 @@ gravity = Vector3(0, 0, 0) scale_min = 3.0 scale_max = 15.0 color_ramp = SubResource("GradientTexture1D_l66oc") -color_initial_ramp = SubResource("GradientTexture1D_csn21") alpha_curve = SubResource("CurveTexture_iykvy") [sub_resource type="Animation" id="Animation_1rif1"] @@ -218,10 +211,8 @@ fields = { 1: 25, 2: 1 } -needEnergy = 100.0 autoSpawnAnimation = true freeAfterSpawn = true -knockback = 10.0 [node name="texture" parent="." index="0"] sprite_frames = SubResource("SpriteFrames_yip5k") diff --git a/scripts/Contents/Bullets/BigLaser.gd b/scripts/Contents/Bullets/BigLaser.gd index 2940966..34386ff 100644 --- a/scripts/Contents/Bullets/BigLaser.gd +++ b/scripts/Contents/Bullets/BigLaser.gd @@ -15,4 +15,4 @@ func applyDot(): await TickTool.millseconds(100 / launcher.fields[FieldStore.Entity.ATTACK_SPEED]) return true func succeedToHit(_dmg: float): - fields[FieldStore.Bullet.DAMAGE] *= 1.05 + fields[FieldStore.Bullet.DAMAGE] *= 1.03 diff --git a/scripts/Contents/Wave.gd b/scripts/Contents/Wave.gd index d8881e4..5ba8341 100644 --- a/scripts/Contents/Wave.gd +++ b/scripts/Contents/Wave.gd @@ -12,7 +12,7 @@ static var current: int = 0 static var data: Array[Wave] = [ # entity, minCount, maxCount, isBoss, from, to, per create(preload("res://components/Characters/Hen.tscn"), 1, 5, false, 0, INF, 1), - create(preload("res://components/Characters/Chick.tscn"), 0, 0, true, 8, INF, 5), + create(preload("res://components/Characters/Chick.tscn"), 0, 0, true, 0, INF, 5), ] static func create( diff --git a/scripts/Statemachine/BulletBase.gd b/scripts/Statemachine/BulletBase.gd index d107d88..1fe5d13 100644 --- a/scripts/Statemachine/BulletBase.gd +++ b/scripts/Statemachine/BulletBase.gd @@ -15,6 +15,7 @@ class_name BulletBase @export var autoLoopAnimation: bool = false @export var freeAfterSpawn: bool = false @export var knockback: float = 0 # 击退力,物理引擎单位 +@export var recoil: float = 0 # 后坐力,物理引擎单位 @onready var animator: AnimationPlayer = $"%animator" @onready var hitbox: CollisionShape2D = $"%hitbox" @@ -46,6 +47,7 @@ func _process(_delta: float) -> void: destroy() func _physics_process(_delta: float) -> void: if is_instance_valid(launcher) and (launcher.isPlayer() or is_instance_valid(launcher.currentFocusedBoss)): + launcher.position -= Vector2.from_angle(rotation) * recoil ai() func hit(target: Node): diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 3b8dc9d..82ab6a6 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -83,7 +83,7 @@ func _ready(): currentFocusedBoss = get_tree().get_nodes_in_group("players")[0] applyLevel() health = fields.get(FieldStore.Entity.MAX_HEALTH) - energy = fields.get(FieldStore.Entity.MAX_ENERGY) * 0.5 + energy = fields.get(FieldStore.Entity.MAX_ENERGY) healthChanged.connect( func(newHealth): if is_instance_valid(statebar): diff --git a/scripts/Statemachine/UIState.gd b/scripts/Statemachine/UIState.gd index fd66c49..c4ca70d 100644 --- a/scripts/Statemachine/UIState.gd +++ b/scripts/Statemachine/UIState.gd @@ -26,7 +26,7 @@ func _process(_delta): bossbar.visible = !!bossbar.entity func _physics_process(_delta): if is_instance_valid(player): - energyLabel.text = "%.2f" % player.energy + energyLabel.text = "%.2f" % clamp(player.energy, 0, player.fields.get(FieldStore.Entity.MAX_ENERGY)) energyMaxLabel.text = "%.1f" % player.fields.get(FieldStore.Entity.MAX_ENERGY) for i in items.get_children(): var item = i as ItemShow