diff --git a/ships/corvette01/corvette01.tres b/ships/corvette01/corvette01.tres index d7d0ba6b..71736165 100644 --- a/ships/corvette01/corvette01.tres +++ b/ships/corvette01/corvette01.tres @@ -7,7 +7,7 @@ script = ExtResource("1_3j2tk") mass_kg = 10.0 hull = 40.0 -shield = 0.0 +shield = 80.0 thrust = 200.0 torque = 8.0 hyperspace_arrival_radius = 8.0 @@ -15,5 +15,5 @@ energy = 100.0 energy_recharge_rate = 5.0 thrust_energy_consumption = 8.0 turning_energy_consumption = 5.0 -shield_recharge_rate = 0.0 +shield_recharge_rate = 5.0 weapons = Array[Resource("res://weapons/weapon_def.gd")]([ExtResource("2_paw6l")]) diff --git a/ships/ship.gd b/ships/ship.gd index 468a55e2..aa5ee194 100644 --- a/ships/ship.gd +++ b/ships/ship.gd @@ -280,14 +280,14 @@ func _physics_process(delta: float) -> void: self._recharge_shield(delta) func _recharge_energy(delta: float) -> void: - if is_zero_approx(self.ship_def.energy_recharge_rate) or is_equal_approx(self.energy, self.ship_def.energy): + if self.freeze or is_zero_approx(self.ship_def.energy_recharge_rate) or is_equal_approx(self.energy, self.ship_def.energy): return self.energy = minf(self.energy + self.ship_def.energy_recharge_rate * delta, self.ship_def.energy) self.emit_signal("ship_energy_changed", self) func _recharge_shield(delta: float) -> void: - if is_zero_approx(self.ship_def.shield_recharge_rate) or is_equal_approx(self.shield, self.ship_def.shield): + if self.freeze or is_zero_approx(self.ship_def.shield_recharge_rate) or is_equal_approx(self.shield, self.ship_def.shield): return var recharge := self.ship_def.shield_recharge_rate * delta