|
|
@ -68,20 +68,12 @@ impl ActiveInventory { |
|
|
|
|
|
|
|
// does this do anything?
|
|
|
|
inventory[index].equipped = match item.item {
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Weapon(Weapon {equipped: true, ..}), ..}) => 1,
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Armor(Armor {equipped: true, ..}), ..}) => 1,
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Shield(Shield {equipped: true, ..}), ..}) => 1,
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Unit(Unit{equipped: true, ..}), ..}) => 1,
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Mag(Mag{equipped: true, ..}), ..}) => 1,
|
|
|
|
StackedItem::Individual(Item {location: ItemLocation::Inventory{ equipped: true, ..}, ..}) => 1,
|
|
|
|
_ => 0,
|
|
|
|
};
|
|
|
|
// because this actually equips the item
|
|
|
|
inventory[index].flags |= match item.item {
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Weapon(Weapon {equipped: true, ..}), ..}) => 8,
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Armor(Armor {equipped: true, ..}), ..}) => 8,
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Shield(Shield {equipped: true, ..}), ..}) => 8,
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Unit(Unit {equipped: true, ..}), ..}) => 8,
|
|
|
|
StackedItem::Individual(Item {item: ItemDetail::Mag(Mag{equipped: true, ..}), ..}) => 8,
|
|
|
|
StackedItem::Individual(Item {location: ItemLocation::Inventory{ equipped: true, ..}, ..}) => 8,
|
|
|
|
_ => 0,
|
|
|
|
};
|
|
|
|
inventory
|
|
|
@ -189,13 +181,13 @@ mod test { |
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
index: 0,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|
item: ItemDetail::Weapon(item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Saber,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None; 3],
|
|
|
|
equipped: false,
|
|
|
|
tekked: true,
|
|
|
|
})
|
|
|
|
};
|
|
|
@ -203,7 +195,8 @@ mod test { |
|
|
|
id: ItemEntityId(2),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
index: 1
|
|
|
|
index: 1,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|
item: ItemDetail::Tool(Tool {
|
|
|
|
tool: item::tool::ToolType::Monofluid,
|
|
|
@ -214,13 +207,13 @@ mod test { |
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
index: 2,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|
item: ItemDetail::Weapon(item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 12,
|
|
|
|
special: None,
|
|
|
|
attrs: [None; 3],
|
|
|
|
equipped: false,
|
|
|
|
tekked: true,
|
|
|
|
})
|
|
|
|
};
|
|
|
@ -228,7 +221,8 @@ mod test { |
|
|
|
id: ItemEntityId(4),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
index: 1
|
|
|
|
index: 1,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|
item: ItemDetail::Tool(Tool {
|
|
|
|
tool: item::tool::ToolType::Monofluid,
|
|
|
@ -238,7 +232,8 @@ mod test { |
|
|
|
id: ItemEntityId(5),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
index: 1
|
|
|
|
index: 1,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|
item: ItemDetail::Tool(Tool {
|
|
|
|
tool: item::tool::ToolType::Monofluid,
|
|
|
@ -249,13 +244,13 @@ mod test { |
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
index: 3,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|
item: ItemDetail::Weapon(item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 12,
|
|
|
|
special: None,
|
|
|
|
attrs: [None; 3],
|
|
|
|
equipped: false,
|
|
|
|
tekked: true,
|
|
|
|
})
|
|
|
|
};
|
|
|
@ -263,7 +258,8 @@ mod test { |
|
|
|
id: ItemEntityId(7),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
index: 4
|
|
|
|
index: 4,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|
item: ItemDetail::Tool(Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
@ -273,7 +269,8 @@ mod test { |
|
|
|
id: ItemEntityId(8),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
index: 4
|
|
|
|
index: 4,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|
item: ItemDetail::Tool(Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
@ -283,7 +280,8 @@ mod test { |
|
|
|
id: ItemEntityId(9),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
index: 4
|
|
|
|
index: 4,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|
item: ItemDetail::Tool(Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|