basic core building

This commit is contained in:
Jim 2025-08-24 20:13:22 -04:00
parent f5d022d1d0
commit af45237701
Signed by: jim
GPG key ID: 3236D2F059A7C0AC
11 changed files with 146 additions and 11 deletions

View file

@ -2,7 +2,7 @@
#![allow(clippy::type_complexity)]
#![allow(clippy::too_many_arguments)]
use bevy::{audio::Sample, prelude::*};
use bevy::prelude::*;
pub struct CombatPlugin;
@ -55,7 +55,11 @@ pub struct Defense {
impl Defense {
pub fn calc_damage(&self, incoming_damage: f32) -> f32 {
(incoming_damage - self.amount * 0.5).max(0.0)
let min_damage = 0.1;
if incoming_damage < min_damage {
return 0.;
}
(incoming_damage - self.amount * 0.5).max(min_damage)
}
pub fn new(amount: f32) -> Self {