weapon % fix v2 and give the level 199 guy a 100h hell gun
This commit is contained in:
parent
895891fabc
commit
332f22f34e
@ -3,8 +3,7 @@ use serde::{Serialize, Deserialize};
|
|||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Ord, PartialOrd)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Ord, PartialOrd)]
|
||||||
pub enum Attribute {
|
pub enum Attribute {
|
||||||
None,
|
Native = 1,
|
||||||
Native,
|
|
||||||
ABeast,
|
ABeast,
|
||||||
Machine,
|
Machine,
|
||||||
Dark,
|
Dark,
|
||||||
@ -26,8 +25,7 @@ impl WeaponAttribute {
|
|||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||||
pub enum WeaponSpecial {
|
pub enum WeaponSpecial {
|
||||||
None,
|
Draw = 1,
|
||||||
Draw,
|
|
||||||
Drain,
|
Drain,
|
||||||
Fill,
|
Fill,
|
||||||
Gush,
|
Gush,
|
||||||
@ -893,15 +891,16 @@ impl Weapon {
|
|||||||
let mut result = [0u8; 16];
|
let mut result = [0u8; 16];
|
||||||
result[0..3].copy_from_slice(&self.weapon.value());
|
result[0..3].copy_from_slice(&self.weapon.value());
|
||||||
result[3] = self.grind;
|
result[3] = self.grind;
|
||||||
result[4] = self.special.unwrap_or(WeaponSpecial::None).value();
|
result[4] = self.special.map(|s| s.value()).unwrap_or(0);
|
||||||
|
|
||||||
if self.tekked == false {
|
if self.tekked == false {
|
||||||
result[4] += 0x80
|
result[4] += 0x80
|
||||||
};
|
};
|
||||||
|
|
||||||
result[6..8].copy_from_slice(&self.attrs[0].unwrap_or(WeaponAttribute{attr: Attribute::None, value: 0}).value());
|
result[6..8].copy_from_slice(&self.attrs[0].map(|s| s.value()).unwrap_or([0,0]));
|
||||||
result[8..10].copy_from_slice(&self.attrs[1].unwrap_or(WeaponAttribute{attr: Attribute::None, value: 0}).value());
|
result[8..10].copy_from_slice(&self.attrs[1].map(|s| s.value()).unwrap_or([0,0]));
|
||||||
result[10..12].copy_from_slice(&self.attrs[2].unwrap_or(WeaponAttribute{attr: Attribute::None, value: 0}).value());
|
result[10..12].copy_from_slice(&self.attrs[2].map(|s| s.value()).unwrap_or([0,0]));
|
||||||
|
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,8 +87,10 @@ fn main() {
|
|||||||
item::weapon::Weapon {
|
item::weapon::Weapon {
|
||||||
weapon: item::weapon::WeaponType::Handgun,
|
weapon: item::weapon::WeaponType::Handgun,
|
||||||
grind: 5,
|
grind: 5,
|
||||||
special: None,
|
special: Some(item::weapon::WeaponSpecial::Hell),
|
||||||
attrs: [None; 3],
|
attrs: [Some(item::weapon::WeaponAttribute{attr: item::weapon::Attribute::Hit, value: 100}),
|
||||||
|
None,
|
||||||
|
None,],
|
||||||
tekked: true,
|
tekked: true,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user