diff --git a/components/Bullets/Parrier.tscn b/components/Bullets/Parrier.tscn index 7c223af..706c2e2 100644 --- a/components/Bullets/Parrier.tscn +++ b/components/Bullets/Parrier.tscn @@ -97,7 +97,7 @@ tracks/3/interp = 1 tracks/3/loop_wrap = true tracks/3/keys = { "handle_modes": PackedInt32Array(2, 2), -"points": PackedFloat32Array(1, 0, 0, 0.3, 0, 0, -1, 0, 0, 0), +"points": PackedFloat32Array(1, 0, 0, 0.1, 0, 0, -1, 0, 0, 0), "times": PackedFloat32Array(0, 1) } diff --git a/components/Weapons/Tree.tscn b/components/Weapons/Tree.tscn index 9deb604..0bd088b 100644 --- a/components/Weapons/Tree.tscn +++ b/components/Weapons/Tree.tscn @@ -5,4 +5,5 @@ [node name="Tree" instance=ExtResource("1_0lbwr")] script = ExtResource("2_jsuc8") -cooldown = 200.0 +oneShoot = true +cooldown = 0.0 diff --git a/scripts/Contents/Characters/Rooster.gd b/scripts/Contents/Characters/Rooster.gd index 5fac0e3..bed3a06 100644 --- a/scripts/Contents/Characters/Rooster.gd +++ b/scripts/Contents/Characters/Rooster.gd @@ -49,15 +49,22 @@ func tryLaunch(action: String, weaponIndex: int): if Input.is_action_just_pressed(action): if len(weapons) > weaponIndex: var weapon = weapons[weaponIndex] - if weapon.chargable and weapon.canAttackBy(self): + if weapon.chargable and weapon.canAttackBy(self ): chargeStartTime[weaponIndex] = Time.get_ticks_msec() chargeParticle.emitting = true chargeParticle.speed_scale = 1 + if Input.is_action_just_pressed(action): + if len(weapons) > weaponIndex: + var weapon = weapons[weaponIndex] + if weapon.oneShoot: + tryAttack(weaponIndex) if Input.is_action_pressed(action): - if chargeStartTime.has(weaponIndex): - chargeParticle.speed_scale += 0.01 * self.fields.get(FieldStore.Entity.CHARGE_SPEED) - else: - tryAttack(weaponIndex) + if len(weapons) > weaponIndex: + var weapon = weapons[weaponIndex] + if chargeStartTime.has(weaponIndex): + chargeParticle.speed_scale += 0.01 * self.fields.get(FieldStore.Entity.CHARGE_SPEED) + elif !weapon.oneShoot: + tryAttack(weaponIndex) if Input.is_action_just_released(action): if chargeStartTime.has(weaponIndex): var startTime = chargeStartTime[weaponIndex] diff --git a/scripts/Structs/Weapon.gd b/scripts/Structs/Weapon.gd index f18be06..1e3e67c 100644 --- a/scripts/Structs/Weapon.gd +++ b/scripts/Structs/Weapon.gd @@ -9,6 +9,7 @@ class_name Weapon @export var soulLevel: int = 1 @export var costBeachball: int = 500 @export var chargable: bool = false +@export var oneShoot: bool = false @export var store: Dictionary = { "atk": 10 }