|
|
@ -46,13 +46,13 @@ impl<'a> CharacterBytesBuilder<'a> { |
|
|
|
let level = self.level.unwrap();
|
|
|
|
character::Character {
|
|
|
|
name: libpso::utf8_to_utf16_array!(character.name, 16),
|
|
|
|
hp: stats.hp,
|
|
|
|
atp: stats.atp,
|
|
|
|
mst: stats.mst,
|
|
|
|
evp: stats.evp,
|
|
|
|
dfp: stats.dfp,
|
|
|
|
hp: stats.hp + character.materials.hp as u16 * 2,
|
|
|
|
atp: stats.atp + character.materials.power as u16 * 2,
|
|
|
|
mst: stats.mst + character.materials.mind as u16 * 2,
|
|
|
|
evp: stats.evp + character.materials.evade as u16 * 2,
|
|
|
|
dfp: stats.dfp + character.materials.def as u16 * 2,
|
|
|
|
ata: stats.ata,
|
|
|
|
lck: stats.lck,
|
|
|
|
lck: stats.lck + character.materials.luck as u16 * 2,
|
|
|
|
level: level,
|
|
|
|
section_id: character.section_id.into(),
|
|
|
|
ch_class: character.char_class.into(),
|
|
|
@ -158,7 +158,6 @@ impl<'a> FullCharacterBytesBuilder<'a> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn build(self) -> character::FullCharacter {
|
|
|
|
let character = self.character.unwrap();
|
|
|
|
let stats = self.stats.unwrap();
|
|
|
@ -169,6 +168,13 @@ impl<'a> FullCharacterBytesBuilder<'a> { |
|
|
|
let symbol_chat = self.symbol_chat.unwrap();
|
|
|
|
let tech_menu = self.tech_menu.unwrap();
|
|
|
|
|
|
|
|
let mut inventory_items = inventory.as_client_inventory_items();
|
|
|
|
inventory_items[7].material_count = character.materials.power as u8;
|
|
|
|
inventory_items[8].material_count = character.materials.mind as u8;
|
|
|
|
inventory_items[9].material_count = character.materials.evade as u8;
|
|
|
|
inventory_items[10].material_count = character.materials.def as u8;
|
|
|
|
inventory_items[11].material_count = character.materials.luck as u8;
|
|
|
|
|
|
|
|
character::FullCharacter {
|
|
|
|
character: CharacterBytesBuilder::new()
|
|
|
|
.character(&character)
|
|
|
@ -177,7 +183,9 @@ impl<'a> FullCharacterBytesBuilder<'a> { |
|
|
|
.build(),
|
|
|
|
inventory: character::Inventory {
|
|
|
|
item_count: inventory.count() as u8,
|
|
|
|
items: inventory.as_client_inventory_items(),
|
|
|
|
items: inventory_items,
|
|
|
|
hp_mats_used: character.materials.hp as u8 * 2,
|
|
|
|
tp_mats_used: character.materials.tp as u8 * 2,
|
|
|
|
..character::Inventory::default()
|
|
|
|
},
|
|
|
|
key_team_config: character::KeyTeamConfig {
|
|
|
|