mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-27 13:14:15 -08:00
shield hit absorbtion
This commit is contained in:
@@ -52,14 +52,14 @@ impl Enterprise {
|
||||
|
||||
view::enterprise_hit(&hit_strength, §or);
|
||||
|
||||
// absorb into shields
|
||||
self.shields = (self.shields - hit_strength).max(0);
|
||||
|
||||
if self.shields <= 0 {
|
||||
view::enterprise_destroyed();
|
||||
self.destroyed = true
|
||||
}
|
||||
|
||||
// report shields
|
||||
view::shields_hit(self.shields);
|
||||
// take damage if strength is greater than 20
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,3 +191,7 @@ pub fn shields_set(value: u16) {
|
||||
println!("Deflector control room report:
|
||||
'Shields now at {value} units per your command.'")
|
||||
}
|
||||
|
||||
pub fn shields_hit(shields: u16) {
|
||||
println!(" <Shields down to {shields} units>")
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ Started after movement and display of stats was finished (no energy management o
|
||||
- [x] remove energy on move
|
||||
- [x] shields
|
||||
- [x] shield control
|
||||
- [ ] shield hit absorption
|
||||
- [x] shield hit absorption
|
||||
- [ ] subsystem damage
|
||||
- and support for reports
|
||||
- [ ] lrs?
|
||||
|
||||
Reference in New Issue
Block a user