Skip to content

Commit 23e4e7e

Browse files
authored
Merge pull request #26 from ZakisM/development
Merge development to master
2 parents 2bbbb78 + fd9ade9 commit 23e4e7e

File tree

27 files changed

+1074
-325
lines changed

27 files changed

+1074
-325
lines changed

Cargo.lock

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bl3_save_edit_core/src/bl3_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use serde::Deserialize;
1010
use strum::{Display, EnumString};
1111
use tracing::warn;
1212

13-
use crate::bl3_save::arbitrary_bits::{ArbitraryBitVec, ArbitraryBits};
13+
use crate::arbitrary_bits::{ArbitraryBitVec, ArbitraryBits};
1414
use crate::game_data::{BALANCE_NAME_MAPPING, BALANCE_TO_INV_KEY};
1515
use crate::parser::read_be_signed_int;
1616
use crate::resources::{
@@ -172,7 +172,7 @@ pub enum WeaponType {
172172
Shotgun,
173173
#[strum(to_string = "SMG")]
174174
Smg,
175-
#[strum(to_string = "AR")]
175+
#[strum(to_string = "Assault Rifle")]
176176
Ar,
177177
#[strum(to_string = "Sniper")]
178178
Sniper,

bl3_save_edit_core/src/bl3_save/character_data.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pub struct CharacterData {
4040
pub character: Character,
4141
player_class: PlayerClass,
4242
player_level: i32,
43+
ability_points: i32,
4344
guardian_rank: i32,
4445
head_skin_selected: GameDataKv,
4546
character_skin_selected: GameDataKv,
@@ -64,7 +65,15 @@ impl CharacterData {
6465
.map(|p| p.player_class_path.as_str())
6566
.context("failed to read player class")?,
6667
)?;
68+
6769
let player_level = experience_to_level(character.experience_points)?;
70+
71+
let ability_points = character
72+
.ability_data
73+
.as_ref()
74+
.context("failed to read Player ability data")?
75+
.ability_points;
76+
6877
let guardian_rank = character
6978
.guardian_rank_character_data
7079
.as_ref()
@@ -348,6 +357,7 @@ impl CharacterData {
348357
character,
349358
player_class,
350359
player_level,
360+
ability_points,
351361
guardian_rank,
352362
head_skin_selected,
353363
character_skin_selected,
@@ -448,6 +458,26 @@ impl CharacterData {
448458
Ok(())
449459
}
450460

461+
pub fn ability_points(&self) -> i32 {
462+
self.ability_points
463+
}
464+
465+
pub fn set_ability_points(&mut self, ability_points: i32) -> Result<()> {
466+
let ability_data = self
467+
.character
468+
.ability_data
469+
.as_mut()
470+
.context("failed to read Player ability data")?;
471+
472+
if ability_points != ability_data.ability_points {
473+
ability_data.ability_points = ability_points;
474+
475+
self.ability_points = ability_points;
476+
}
477+
478+
Ok(())
479+
}
480+
451481
pub fn guardian_rank(&self) -> i32 {
452482
self.guardian_rank
453483
}

bl3_save_edit_core/src/bl3_save/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use crate::parser::{decrypt, encrypt, HeaderType};
1313
use crate::{file_helper, parser};
1414

1515
pub mod ammo;
16-
pub mod arbitrary_bits;
1716
pub mod challenge_data;
1817
pub mod character_data;
1918
pub mod fast_travel_unlock_data;

bl3_save_edit_core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pub mod arbitrary_bits;
12
pub mod bl3_item;
23
pub mod bl3_profile;
34
pub mod bl3_save;
Lines changed: 18 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)