Browse Source

mag item init

pbs
jake 5 years ago
parent
commit
0dbd588e3b
  1. 176
      src/entity/item/mag.rs
  2. 1
      src/entity/item/mod.rs

176
src/entity/item/mag.rs

@ -0,0 +1,176 @@
use serde::{Serialize, Deserialize};
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
pub enum MagType {
Mag,
Varuna,
Mitra,
Surya,
Vayu,
Varaha,
Kama,
Ushasu,
Apsaras,
Kumara,
Kaitabha,
Tapas,
Bhirava,
Kalki,
Rudra,
Marutah,
Yaksa,
Sita,
Garuda,
Nandin,
Ashvinau,
Ribhava,
Soma,
Ila,
Durga,
Vritra,
Namuci,
Sumba,
Naga,
Pitri,
Kabanda,
Ravana,
Marica,
Soniti,
Preta,
Andhaka,
Bana,
Naraka,
Madhu,
Churel,
Robochao,
OpaOpa,
Pian,
Chao,
ChuChu,
KapuKapu,
AngelsWing,
DevilsWing,
Elenor,
MarkIII,
MasterSystem,
Genesis,
SegaSaturn,
Dreamcast,
Hamburger,
PanzersTail,
DevilsTail,
Deva,
Rati,
Savitri,
Rukmin,
Pushan,
Diwari,
Sato,
Bhima,
Nidra,
}
impl MagType {
pub fn value(&self) -> [u8; 3] {
match self {
MagType::Mag => [0x02, 0x00, 0x00],
MagType::Varuna => [0x02, 0x01, 0x00],
MagType::Mitra => [0x02, 0x02, 0x00],
MagType::Surya => [0x02, 0x03, 0x00],
MagType::Vayu => [0x02, 0x04, 0x00],
MagType::Varaha => [0x02, 0x05, 0x00],
MagType::Kama => [0x02, 0x06, 0x00],
MagType::Ushasu => [0x02, 0x07, 0x00],
MagType::Apsaras => [0x02, 0x08, 0x00],
MagType::Kumara => [0x02, 0x09, 0x00],
MagType::Kaitabha => [0x02, 0x0A, 0x00],
MagType::Tapas => [0x02, 0x0B, 0x00],
MagType::Bhirava => [0x02, 0x0C, 0x00],
MagType::Kalki => [0x02, 0x0D, 0x00],
MagType::Rudra => [0x02, 0x0E, 0x00],
MagType::Marutah => [0x02, 0x0F, 0x00],
MagType::Yaksa => [0x02, 0x10, 0x00],
MagType::Sita => [0x02, 0x11, 0x00],
MagType::Garuda => [0x02, 0x12, 0x00],
MagType::Nandin => [0x02, 0x13, 0x00],
MagType::Ashvinau => [0x02, 0x14, 0x00],
MagType::Ribhava => [0x02, 0x15, 0x00],
MagType::Soma => [0x02, 0x16, 0x00],
MagType::Ila => [0x02, 0x17, 0x00],
MagType::Durga => [0x02, 0x18, 0x00],
MagType::Vritra => [0x02, 0x19, 0x00],
MagType::Namuci => [0x02, 0x1A, 0x00],
MagType::Sumba => [0x02, 0x1B, 0x00],
MagType::Naga => [0x02, 0x1C, 0x00],
MagType::Pitri => [0x02, 0x1D, 0x00],
MagType::Kabanda => [0x02, 0x1E, 0x00],
MagType::Ravana => [0x02, 0x1F, 0x00],
MagType::Marica => [0x02, 0x20, 0x00],
MagType::Soniti => [0x02, 0x21, 0x00],
MagType::Preta => [0x02, 0x22, 0x00],
MagType::Andhaka => [0x02, 0x23, 0x00],
MagType::Bana => [0x02, 0x24, 0x00],
MagType::Naraka => [0x02, 0x25, 0x00],
MagType::Madhu => [0x02, 0x26, 0x00],
MagType::Churel => [0x02, 0x27, 0x00],
MagType::Robochao => [0x02, 0x28, 0x00],
MagType::OpaOpa => [0x02, 0x29, 0x00],
MagType::Pian => [0x02, 0x2A, 0x00],
MagType::Chao => [0x02, 0x2B, 0x00],
MagType::ChuChu => [0x02, 0x2C, 0x00],
MagType::KapuKapu => [0x02, 0x2D, 0x00],
MagType::AngelsWing => [0x02, 0x2E, 0x00],
MagType::DevilsWing => [0x02, 0x2F, 0x00],
MagType::Elenor => [0x02, 0x30, 0x00],
MagType::MarkIII => [0x02, 0x31, 0x00],
MagType::MasterSystem => [0x02, 0x32, 0x00],
MagType::Genesis => [0x02, 0x33, 0x00],
MagType::SegaSaturn => [0x02, 0x34, 0x00],
MagType::Dreamcast => [0x02, 0x35, 0x00],
MagType::Hamburger => [0x02, 0x36, 0x00],
MagType::PanzersTail => [0x02, 0x37, 0x00],
MagType::DevilsTail => [0x02, 0x38, 0x00],
MagType::Deva => [0x02, 0x39, 0x00],
MagType::Rati => [0x02, 0x3A, 0x00],
MagType::Savitri => [0x02, 0x3B, 0x00],
MagType::Rukmin => [0x02, 0x3C, 0x00],
MagType::Pushan => [0x02, 0x3D, 0x00],
MagType::Diwari => [0x02, 0x3E, 0x00],
MagType::Sato => [0x02, 0x3F, 0x00],
MagType::Bhima => [0x24, 0x00, 0x00],
MagType::Nidra => [0x24, 0x10, 0x00],
}
}
}
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum PhotonBlast {
Farlla,
Estlla,
Leilla,
Pilla,
Golla,
MyllaYoulla,
}
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct Mag {
pub unit: MagType,
pub def: u32,
pub pow: u32,
pub dex: u32,
pub mnd: u32,
pub synchro: u8,
pub iq: u8,
pub photon_blast: [Option<PhotonBlast>; 3],
// color
}
impl Mag {
pub fn as_bytes(&self) -> [u8; 16] {
let mut result = [0; 16];
result
}
}

1
src/entity/item/mod.rs

@ -3,6 +3,7 @@ pub mod armor;
pub mod shield;
pub mod tool;
pub mod unit;
pub mod mag;
//use libpso::item;
use libpso::character::character;

Loading…
Cancel
Save