Browse Source

remove modifiers from weapon and armor

pbs
jake 4 years ago
parent
commit
92c34b2d28
  1. 10
      src/bin/main.rs
  2. 2
      src/entity/gateway/postgres/models.rs
  3. 2
      src/entity/item/armor.rs
  4. 3
      src/entity/item/weapon.rs
  5. 2
      src/login/character.rs
  6. 5
      src/ship/drops/generic_armor.rs
  7. 5
      src/ship/drops/generic_weapon.rs
  8. 2
      src/ship/drops/rare_drop_table.rs
  9. 1
      src/ship/shops/armor.rs
  10. 1
      src/ship/shops/weapon.rs
  11. 15
      tests/test_bank.rs
  12. 3
      tests/test_item_actions.rs
  13. 4
      tests/test_item_pickup.rs
  14. 2
      tests/test_rooms.rs

10
src/bin/main.rs

@ -84,7 +84,6 @@ fn main() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -119,8 +118,7 @@ fn main() {
attrs: [Some(item::weapon::WeaponAttribute{attr: item::weapon::Attribute::Hit, value: 40}),
Some(item::weapon::WeaponAttribute{attr: item::weapon::Attribute::Dark, value: 30}),
None,],
tekked: true,
modifiers: Vec::new(),
tekked: false,
}
),
location: ItemLocation::Inventory {
@ -138,7 +136,6 @@ fn main() {
Some(item::weapon::WeaponAttribute{attr: item::weapon::Attribute::Dark, value: 30}),
None,],
tekked: true,
modifiers: Vec::new(),
}
),
location: ItemLocation::Inventory {
@ -156,7 +153,6 @@ fn main() {
Some(item::weapon::WeaponAttribute{attr: item::weapon::Attribute::Dark, value: 100}),
None,],
tekked: true,
modifiers: Vec::new(),
}
),
location: ItemLocation::Inventory {
@ -174,7 +170,6 @@ fn main() {
Some(item::weapon::WeaponAttribute{attr: item::weapon::Attribute::Dark, value: 100}),
None,],
tekked: true,
modifiers: Vec::new(),
}
),
location: ItemLocation::Inventory {
@ -192,7 +187,6 @@ fn main() {
Some(item::weapon::WeaponAttribute{attr: item::weapon::Attribute::Dark, value: 100}),
Some(item::weapon::WeaponAttribute{attr: item::weapon::Attribute::Native, value: 100}),],
tekked: true,
modifiers: Vec::new(),
}
),
location: ItemLocation::Inventory {
@ -257,7 +251,6 @@ fn main() {
Some(item::weapon::WeaponAttribute{attr: item::weapon::Attribute::Dark, value: 80}),
None,],
tekked: false,
modifiers: Vec::new(),
}
),
location: ItemLocation::Bank {
@ -273,7 +266,6 @@ fn main() {
dfp: 0,
evp: 0,
slots: 4,
modifiers: Vec::new(),
}
),
location: ItemLocation::Inventory {

2
src/entity/gateway/postgres/models.rs

@ -316,7 +316,6 @@ impl Into<weapon::Weapon> for PgWeapon {
grind: self.grind,
attrs: attrs,
tekked: self.tekked,
modifiers: Vec::new(),
}
}
}
@ -347,7 +346,6 @@ impl Into<armor::Armor> for PgArmor {
dfp: self.dfp,
evp: self.evp,
slots: self.slots,
modifiers: Vec::new(),
}
}
}

2
src/entity/item/armor.rs

@ -303,7 +303,6 @@ pub struct Armor {
pub dfp: u8,
pub evp: u8,
pub slots: u8,
pub modifiers: Vec<ArmorModifier>
}
impl Armor {
@ -324,7 +323,6 @@ impl Armor {
dfp: data[6],
evp: data[8],
slots: data[5],
modifiers: Vec::new(),
})
}
else {

3
src/entity/item/weapon.rs

@ -1371,7 +1371,6 @@ pub struct Weapon {
pub grind: u8,
pub attrs: [Option<WeaponAttribute>; 3],
pub tekked: bool,
pub modifiers: Vec<WeaponModifier>
}
@ -1383,7 +1382,6 @@ impl Weapon {
grind: 0,
attrs: [None; 3],
tekked: true,
modifiers: Vec::new(),
}
}
@ -1452,7 +1450,6 @@ impl Weapon {
a[2],
],
tekked: t,
modifiers: Vec::new(),
})
}
else {

2
src/login/character.rs

@ -220,7 +220,6 @@ async fn new_character<EG: EntityGateway>(entity_gateway: &mut EG, user: &UserAc
special: None,
attrs: [None; 3],
tekked: true,
modifiers: Vec::new(),
}),
location: ItemLocation::Inventory {
character_id: character.id,
@ -234,7 +233,6 @@ async fn new_character<EG: EntityGateway>(entity_gateway: &mut EG, user: &UserAc
dfp: 0,
evp: 0,
slots: 0,
modifiers: Vec::new(),
}),
location: ItemLocation::Inventory {
character_id: character.id,

5
src/ship/drops/generic_armor.rs

@ -107,7 +107,6 @@ impl GenericArmorTable {
dfp: dfp_modifier as u8,
evp: evp_modifier as u8,
slots: slots as u8,
modifiers: Vec::new(),
}))
}
}
@ -127,28 +126,24 @@ mod test {
dfp: 0,
evp: 0,
slots: 1,
modifiers: Vec::new(),
})));
assert!(gat.get_drop(&MapArea::Caves3, &mut rng) == Some(ItemDropType::Armor(Armor {
armor: ArmorType::AbsorbArmor,
dfp: 1,
evp: 1,
slots: 1,
modifiers: Vec::new(),
})));
assert!(gat.get_drop(&MapArea::Forest2, &mut rng) == Some(ItemDropType::Armor(Armor {
armor: ArmorType::HyperFrame,
dfp: 0,
evp: 0,
slots: 0,
modifiers: Vec::new(),
})));
assert!(gat.get_drop(&MapArea::DarkFalz, &mut rng) == Some(ItemDropType::Armor(Armor {
armor: ArmorType::ImperialArmor,
dfp: 2,
evp: 1,
slots: 0,
modifiers: Vec::new(),
})));
}
}

5
src/ship/drops/generic_weapon.rs

@ -503,7 +503,6 @@ impl GenericWeaponTable {
grind: weapon_grind as u8,
attrs: weapon_attributes,
tekked: weapon_special.is_none(),
modifiers: Vec::new(),
}))
}
}
@ -525,7 +524,6 @@ mod test {
grind: 0,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
})));
let gwt = GenericWeaponTable::new(Episode::One, Difficulty::Hard, SectionID::Skyly);
@ -535,7 +533,6 @@ mod test {
grind: 2,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
})));
let gwt = GenericWeaponTable::new(Episode::One, Difficulty::VeryHard, SectionID::Skyly);
@ -545,7 +542,6 @@ mod test {
grind: 0,
attrs: [None, None, None],
tekked: false,
modifiers: Vec::new(),
})));
let gwt = GenericWeaponTable::new(Episode::One, Difficulty::Ultimate, SectionID::Skyly);
@ -555,7 +551,6 @@ mod test {
grind: 0,
attrs: [Some(WeaponAttribute {attr: Attribute::ABeast, value: 30}), Some(WeaponAttribute {attr: Attribute::Dark, value: 30}), None],
tekked: true,
modifiers: Vec::new(),
})));
}
}

2
src/ship/drops/rare_drop_table.rs

@ -104,7 +104,6 @@ impl RareDropTable {
grind: 0,
attrs: self.attribute_table.generate_rare_attributes(map_area, rng),
tekked: false,
modifiers: Vec::new(),
})
},
@ -114,7 +113,6 @@ impl RareDropTable {
dfp: self.armor_stats.dfp_modifier(&armor, rng) as u8,
evp: self.armor_stats.evp_modifier(&armor, rng) as u8,
slots: self.armor_stats.slots(map_area, rng) as u8,
modifiers: Vec::new(),
})
},
RareDropItem::Shield(shield) => {

1
src/ship/shops/armor.rs

@ -71,7 +71,6 @@ impl ShopItem for ArmorShopItem {
dfp: 0,
evp: 0,
slots: *slot as u8,
modifiers: Vec::new()
})
},
ArmorShopItem::Barrier(barrier) => {

1
src/ship/shops/weapon.rs

@ -142,7 +142,6 @@ impl ShopItem for WeaponShopItem {
grind: self.grind as u8,
attrs: [self.attributes[0], self.attributes[1], None],
tekked: true,
modifiers: Vec::new(),
}
)
}

15
tests/test_bank.rs

@ -27,7 +27,6 @@ async fn test_bank_items_sent_in_character_login() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -69,7 +68,6 @@ async fn test_request_bank_items() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -167,7 +165,6 @@ async fn test_request_bank_items_sorted() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -196,7 +193,6 @@ async fn test_request_bank_items_sorted() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -247,7 +243,6 @@ async fn test_deposit_individual_item() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {
@ -263,7 +258,6 @@ async fn test_deposit_individual_item() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {
@ -623,7 +617,6 @@ async fn test_deposit_individual_item_in_full_bank() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {
@ -642,7 +635,6 @@ async fn test_deposit_individual_item_in_full_bank() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -722,7 +714,6 @@ async fn test_deposit_stacked_item_in_full_bank() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -819,7 +810,6 @@ async fn test_deposit_stacked_item_in_full_bank_with_partial_stack() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -998,7 +988,6 @@ async fn test_withdraw_individual_item() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -1358,7 +1347,6 @@ async fn test_withdraw_individual_item_in_full_inventory() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Bank {
@ -1378,7 +1366,6 @@ async fn test_withdraw_individual_item_in_full_inventory() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {
@ -1454,7 +1441,6 @@ async fn test_withdraw_stacked_item_in_full_inventory() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {
@ -1537,7 +1523,6 @@ async fn test_withdraw_stacked_item_in_full_inventory_with_partial_stack() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {

3
tests/test_item_actions.rs

@ -25,7 +25,6 @@ async fn test_equip_unit_from_equip_menu() {
dfp: 0,
evp: 0,
slots: 4,
modifiers: Vec::new(),
}),
location: item::ItemLocation::Inventory {
character_id: char1.id,
@ -112,7 +111,6 @@ async fn test_unequip_armor_with_units() {
dfp: 0,
evp: 0,
slots: 4,
modifiers: Vec::new(),
}),
location: item::ItemLocation::Inventory {
character_id: char1.id,
@ -190,7 +188,6 @@ async fn test_sort_items() {
dfp: 0,
evp: 0,
slots: 4,
modifiers: Vec::new(),
}),
location: item::ItemLocation::Inventory {
character_id: char1.id,

4
tests/test_item_pickup.rs

@ -172,7 +172,6 @@ async fn test_pick_up_meseta_when_inventory_full() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {
@ -252,7 +251,6 @@ async fn test_pick_up_partial_stacked_item_when_inventory_is_otherwise_full() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {
@ -345,7 +343,6 @@ async fn test_can_not_pick_up_item_when_inventory_full() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {
@ -364,7 +361,6 @@ async fn test_can_not_pick_up_item_when_inventory_full() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {

2
tests/test_rooms.rs

@ -29,7 +29,6 @@ async fn test_item_ids_reset_when_rejoining_rooms() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {
@ -49,7 +48,6 @@ async fn test_item_ids_reset_when_rejoining_rooms() {
special: None,
attrs: [None, None, None],
tekked: true,
modifiers: Vec::new(),
}
),
location: item::ItemLocation::Inventory {

Loading…
Cancel
Save