made the switch to using bracket-lib directly, instead of rltk wrapper
this should solve the build issues; it makes using the non-crashing github build a lot easier, because it lets the explicit rltk dependency be removed.
This commit is contained in:
parent
455b8f2d80
commit
85efe13dc5
93 changed files with 1528 additions and 770 deletions
|
|
@ -12,10 +12,10 @@ use crate::{
|
|||
ObfuscatedName,
|
||||
Position,
|
||||
WantsToPickupItem,
|
||||
Renderable,
|
||||
};
|
||||
use specs::prelude::*;
|
||||
use crate::data::messages;
|
||||
use bracket_lib::prelude::*;
|
||||
|
||||
pub struct ItemCollectionSystem {}
|
||||
|
||||
|
|
@ -52,7 +52,9 @@ impl<'a> System<'a> for ItemCollectionSystem {
|
|||
|
||||
for pickup in wants_pickup.join() {
|
||||
positions.remove(pickup.item);
|
||||
backpack.insert(pickup.item, InBackpack { owner: pickup.collected_by }).expect("Unable to pickup item.");
|
||||
backpack
|
||||
.insert(pickup.item, InBackpack { owner: pickup.collected_by })
|
||||
.expect("Unable to pickup item.");
|
||||
equipment_changed
|
||||
.insert(pickup.collected_by, EquipmentChanged {})
|
||||
.expect("Unable to insert EquipmentChanged.");
|
||||
|
|
@ -76,7 +78,7 @@ impl<'a> System<'a> for ItemCollectionSystem {
|
|||
).0
|
||||
)
|
||||
)
|
||||
.colour(rltk::WHITE)
|
||||
.colour(WHITE)
|
||||
.period()
|
||||
.log();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use crate::{
|
|||
};
|
||||
use specs::prelude::*;
|
||||
use crate::data::messages;
|
||||
use bracket_lib::prelude::*;
|
||||
|
||||
pub struct ItemDropSystem {}
|
||||
|
||||
|
|
@ -52,7 +53,9 @@ impl<'a> System<'a> for ItemDropSystem {
|
|||
) = data;
|
||||
|
||||
for (entity, to_drop) in (&entities, &wants_drop).join() {
|
||||
equipment_changed.insert(entity, EquipmentChanged {}).expect("Unable to insert EquipmentChanged.");
|
||||
equipment_changed
|
||||
.insert(entity, EquipmentChanged {})
|
||||
.expect("Unable to insert EquipmentChanged.");
|
||||
let mut dropper_pos: Position = Position { x: 0, y: 0 };
|
||||
{
|
||||
let dropped_pos = positions.get(entity).unwrap();
|
||||
|
|
@ -83,7 +86,7 @@ impl<'a> System<'a> for ItemDropSystem {
|
|||
).0
|
||||
)
|
||||
)
|
||||
.colour(rltk::WHITE)
|
||||
.colour(WHITE)
|
||||
.period()
|
||||
.log();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ use crate::{
|
|||
};
|
||||
use specs::prelude::*;
|
||||
use crate::data::messages;
|
||||
use bracket_lib::prelude::*;
|
||||
|
||||
pub struct ItemEquipSystem {}
|
||||
|
||||
|
|
@ -66,7 +67,11 @@ impl<'a> System<'a> for ItemEquipSystem {
|
|||
// Remove any items target has in item's slot
|
||||
let mut can_equip = true;
|
||||
let mut to_unequip: Vec<Entity> = Vec::new();
|
||||
for (item_entity, already_equipped, _name) in (&entities, &equipped, &names).join() {
|
||||
for (item_entity, already_equipped, _name) in (
|
||||
&entities,
|
||||
&equipped,
|
||||
&names,
|
||||
).join() {
|
||||
if already_equipped.owner == target && already_equipped.slot == target_slot {
|
||||
if let Some(beatitude) = beatitudes.get(item_entity) {
|
||||
if beatitude.buc == BUC::Cursed {
|
||||
|
|
@ -85,7 +90,7 @@ impl<'a> System<'a> for ItemEquipSystem {
|
|||
None
|
||||
).0
|
||||
)
|
||||
.colour(rltk::WHITE)
|
||||
.colour(WHITE)
|
||||
.append("!");
|
||||
identified_beatitude
|
||||
.insert(item_entity, IdentifiedBeatitude {})
|
||||
|
|
@ -101,15 +106,25 @@ impl<'a> System<'a> for ItemEquipSystem {
|
|||
}
|
||||
for item in to_unequip.iter() {
|
||||
equipped.remove(*item);
|
||||
backpack.insert(*item, InBackpack { owner: target }).expect("Unable to insert backpack");
|
||||
backpack
|
||||
.insert(*item, InBackpack { owner: target })
|
||||
.expect("Unable to insert backpack");
|
||||
if target == *player_entity {
|
||||
logger = logger
|
||||
.append(messages::YOU_REMOVE_ITEM)
|
||||
.colour(item_colour(*item, &beatitudes))
|
||||
.append_n(
|
||||
obfuscate_name(*item, &names, &magic_items, &obfuscated_names, &beatitudes, &dm, None).0
|
||||
obfuscate_name(
|
||||
*item,
|
||||
&names,
|
||||
&magic_items,
|
||||
&obfuscated_names,
|
||||
&beatitudes,
|
||||
&dm,
|
||||
None
|
||||
).0
|
||||
)
|
||||
.colour(rltk::WHITE)
|
||||
.colour(WHITE)
|
||||
.period();
|
||||
}
|
||||
}
|
||||
|
|
@ -134,7 +149,7 @@ impl<'a> System<'a> for ItemEquipSystem {
|
|||
None
|
||||
).0
|
||||
)
|
||||
.colour(rltk::WHITE)
|
||||
.colour(WHITE)
|
||||
.period();
|
||||
logger.log();
|
||||
identified_items
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use crate::{
|
|||
WantsToRemoveItem,
|
||||
BUC,
|
||||
};
|
||||
use rltk::prelude::*;
|
||||
use bracket_lib::prelude::*;
|
||||
use specs::prelude::*;
|
||||
use crate::data::messages;
|
||||
|
||||
|
|
@ -99,7 +99,9 @@ impl<'a> System<'a> for ItemRemoveSystem {
|
|||
.log();
|
||||
}
|
||||
}
|
||||
backpack.insert(to_remove.item, InBackpack { owner: entity }).expect("Unable to insert backpack");
|
||||
backpack
|
||||
.insert(to_remove.item, InBackpack { owner: entity })
|
||||
.expect("Unable to insert backpack");
|
||||
}
|
||||
|
||||
wants_remove.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue