1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use noisy_float::prelude::*;
use serde::{Deserialize, Serialize};
use super::attribute::Attribute;
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub enum WeaponTargetType {
Ground,
Air,
Any,
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct WeaponBonus {
against: Attribute,
damage: R32,
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct Weapon {
target_type: WeaponTargetType,
damage_per_hit: R32,
damage_splash: R32,
attacks: u32,
range: R32,
cooldown: R32,
bonuses: Vec<WeaponBonus>,
}