From ff2ae85299f909c5d23b746aede72625caba6440 Mon Sep 17 00:00:00 2001 From: Andy Newjack Date: Sun, 19 Apr 2020 23:37:48 -0300 Subject: [PATCH] add mag colors --- src/entity/item/mag.rs | 8 ++++---- src/login/character.rs | 1 + src/ship/drops/rare_drop_table.rs | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/entity/item/mag.rs b/src/entity/item/mag.rs index fc9fc5e..1c01392 100644 --- a/src/entity/item/mag.rs +++ b/src/entity/item/mag.rs @@ -184,7 +184,7 @@ pub struct Mag { pub synchro: u8, pub iq: u8, pub photon_blast: [Option; 3], - // color + pub color: u8, } @@ -197,10 +197,10 @@ impl Mag { result[6..8].copy_from_slice(&self.pow.to_le_bytes()); result[8..10].copy_from_slice(&self.dex.to_le_bytes()); result[10..12].copy_from_slice(&self.mnd.to_le_bytes()); - //result[12] = color - result[14] = self.photon_blast_count(); - result[13] = self.iq; result[12] = self.synchro; + result[13] = self.iq; + result[14] = self.photon_blast_count(); + result[15] = self.color; result } diff --git a/src/login/character.rs b/src/login/character.rs index 74a462e..4da83b4 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -250,6 +250,7 @@ fn new_character(entity_gateway: &mut EG, user: &UserAccountE synchro: 20, iq: 0, photon_blast: [None; 3], + color: character.appearance.costume as u8, }), location: ItemLocation::Inventory { character_id: character.id, diff --git a/src/ship/drops/rare_drop_table.rs b/src/ship/drops/rare_drop_table.rs index 04fa477..56d564c 100644 --- a/src/ship/drops/rare_drop_table.rs +++ b/src/ship/drops/rare_drop_table.rs @@ -143,6 +143,7 @@ impl RareDropTable { iq: 0, synchro: 20, photon_blast: [None; 3], + color: rng.gen_range(0, 18), }) } }