-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"Heat" mechanic, where overheating disables ship controls
- Loading branch information
Showing
27 changed files
with
280 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
extends SaveableResource | ||
class_name HeatSink | ||
|
||
## Accumulates heat that is generated by ship functions and inflicted in combat. | ||
## | ||
## When heat exceeds the maximum capacity of the heat sink, the ship's controls become inoperable. | ||
|
||
## The maximum heat capacity for this sink. | ||
@export var max_heat: float: | ||
set(value): | ||
assert(value >= 0.0, "Heat capacity must be non-negative") | ||
if is_equal_approx(max_heat, value): | ||
return | ||
|
||
max_heat = value | ||
self.emit_changed() | ||
|
||
## The current heat level. | ||
## | ||
## Unlike other, similar mechanics, this value can exceed [member max_heat], at which point the ship controls are disabled. | ||
@export var heat: float: | ||
set(value): | ||
if is_equal_approx(heat, value): | ||
return | ||
|
||
heat = maxf(value, 0.0) | ||
self.emit_changed() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extends Node3D | ||
class_name Radiator | ||
|
||
## Radiates heat away from a [HeatSink] into vacuum. | ||
|
||
## How much heat is radiated away per second. | ||
@export var rate: float | ||
|
||
var heat_sink: HeatSink | ||
|
||
func _physics_process(delta: float) -> void: | ||
self.heat_sink.heat -= self.rate * delta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.