2022-01-28 00:48:54 +01:00
|
|
|
use std::collections::HashMap;
|
|
|
|
|
2022-01-26 15:42:42 +01:00
|
|
|
use rltk::{FontCharType, RandomNumberGenerator, RGB};
|
|
|
|
use specs::prelude::*;
|
2022-01-27 18:28:40 +01:00
|
|
|
use specs::saveload::{MarkedBuilder, SimpleMarker};
|
2022-01-26 15:42:42 +01:00
|
|
|
|
2022-01-28 00:48:54 +01:00
|
|
|
use crate::random_table::RandomTable;
|
2022-01-26 15:42:42 +01:00
|
|
|
use crate::rect::Rect;
|
2022-01-30 14:24:56 +01:00
|
|
|
use crate::{AreaOfEffect, BlocksTile, CombatStats, Confusion, Consumable, DefenseBonus, EntryTrigger, EquipmentSlot, Equippable, Hidden, HungerClock, HungerState, InflictsDamage, Item, MagicMapper, MeleePowerBonus, Monster, Name, Player, Position, ProvidesFood, ProvidesHealing, Ranged, Renderable, SerializeMe, SingleActivation, Viewshed, MAP_WIDTH, MAX_MONSTER, Map, TileType};
|
2022-01-26 15:42:42 +01:00
|
|
|
|
|
|
|
pub fn player(ecs: &mut World, player_x: i32, player_y: i32) -> Entity {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position {
|
|
|
|
x: player_x,
|
|
|
|
y: player_y,
|
|
|
|
})
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('@'),
|
|
|
|
fg: RGB::named(rltk::YELLOW),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
render_order: 0,
|
|
|
|
})
|
|
|
|
.with(Player {})
|
|
|
|
.with(Viewshed {
|
|
|
|
visible_tiles: Vec::new(),
|
|
|
|
range: 8,
|
|
|
|
dirty: true,
|
|
|
|
})
|
|
|
|
.with(Name {
|
|
|
|
name: "Player".to_string(),
|
|
|
|
})
|
|
|
|
.with(CombatStats {
|
|
|
|
max_hp: 30,
|
|
|
|
hp: 30,
|
|
|
|
defense: 2,
|
|
|
|
power: 5,
|
|
|
|
})
|
2022-01-29 00:31:00 +01:00
|
|
|
.with(HungerClock {
|
|
|
|
duration: 20,
|
|
|
|
state: HungerState::WellFed,
|
|
|
|
})
|
2022-01-27 18:28:40 +01:00
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
2022-01-26 15:42:42 +01:00
|
|
|
.build()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn orc(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
monster(ecs, x, y, rltk::to_cp437('o'), "Orc")
|
|
|
|
}
|
|
|
|
|
|
|
|
fn goblin(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
monster(ecs, x, y, rltk::to_cp437('g'), "Goblin")
|
|
|
|
}
|
|
|
|
|
|
|
|
fn monster<S: ToString>(ecs: &mut World, x: i32, y: i32, glyph: FontCharType, name: S) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph,
|
|
|
|
fg: RGB::named(rltk::RED),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
render_order: 1,
|
|
|
|
})
|
|
|
|
.with(Viewshed {
|
|
|
|
visible_tiles: Vec::new(),
|
|
|
|
range: 8,
|
|
|
|
dirty: true,
|
|
|
|
})
|
|
|
|
.with(Monster {})
|
|
|
|
.with(Name {
|
|
|
|
name: name.to_string(),
|
|
|
|
})
|
|
|
|
.with(BlocksTile {})
|
|
|
|
.with(CombatStats {
|
|
|
|
max_hp: 16,
|
|
|
|
hp: 16,
|
|
|
|
defense: 1,
|
|
|
|
power: 4,
|
|
|
|
})
|
2022-01-27 18:28:40 +01:00
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
2022-01-26 15:42:42 +01:00
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
2022-01-28 00:48:54 +01:00
|
|
|
#[allow(clippy::map_entry)]
|
2022-01-30 14:24:56 +01:00
|
|
|
pub fn spawn_room(ecs: &mut World, room: &Rect, map_depth: i32, map: &Map) {
|
2022-01-28 00:48:54 +01:00
|
|
|
let spawn_table = room_table(map_depth);
|
|
|
|
let mut spawn_points: HashMap<usize, String> = HashMap::new();
|
2022-01-26 15:42:42 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
let mut rng = ecs.write_resource::<RandomNumberGenerator>();
|
2022-01-28 00:48:54 +01:00
|
|
|
let num_spawns = rng.roll_dice(1, MAX_MONSTER + 3) + (map_depth - 1) - 3;
|
2022-01-26 15:42:42 +01:00
|
|
|
|
2022-01-28 00:48:54 +01:00
|
|
|
for _i in 0..num_spawns {
|
2022-01-26 15:42:42 +01:00
|
|
|
let mut added = false;
|
2022-01-28 00:48:54 +01:00
|
|
|
let mut tried = 0;
|
|
|
|
while !added && tried < 20 {
|
2022-01-26 15:42:42 +01:00
|
|
|
let x = (room.x1 + rng.roll_dice(1, i32::abs(room.x2 - room.x1))) as usize;
|
|
|
|
let y = (room.y1 + rng.roll_dice(1, i32::abs(room.y2 - room.y1))) as usize;
|
|
|
|
let idx = (y * MAP_WIDTH) + x;
|
2022-01-30 14:24:56 +01:00
|
|
|
if !spawn_points.contains_key(&idx) && map.tiles[idx] != TileType::Wall {
|
2022-01-28 00:48:54 +01:00
|
|
|
spawn_points.insert(idx, spawn_table.roll(&mut rng));
|
2022-01-26 15:42:42 +01:00
|
|
|
added = true;
|
2022-01-28 00:48:54 +01:00
|
|
|
} else {
|
|
|
|
tried += 1;
|
2022-01-26 15:42:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-28 00:48:54 +01:00
|
|
|
for spawn in spawn_points.iter() {
|
|
|
|
let x = (*spawn.0 % MAP_WIDTH) as i32;
|
|
|
|
let y = (*spawn.0 / MAP_WIDTH) as i32;
|
|
|
|
|
|
|
|
match spawn.1.as_ref() {
|
|
|
|
"Goblin" => goblin(ecs, x, y),
|
|
|
|
"Orc" => orc(ecs, x, y),
|
|
|
|
"Health Potion" => health_potion(ecs, x, y),
|
|
|
|
"Fireball Scroll" => fireball_scroll(ecs, x, y),
|
|
|
|
"Confusion Scroll" => confusion_scroll(ecs, x, y),
|
|
|
|
"Magic Missile Scroll" => magic_missile_scroll(ecs, x, y),
|
2022-01-28 14:06:20 +01:00
|
|
|
"Dagger" => dagger(ecs, x, y),
|
|
|
|
"Longsword" => longsword(ecs, x, y),
|
|
|
|
"Shield" => shield(ecs, x, y),
|
|
|
|
"Tower Shield" => tower_shield(ecs, x, y),
|
|
|
|
"Helmet" => helmet(ecs, x, y),
|
|
|
|
"Breastplate" => breastplate(ecs, x, y),
|
|
|
|
"Leggings" => leggings(ecs, x, y),
|
|
|
|
"Sabatons" => sabatons(ecs, x, y),
|
2022-01-29 00:31:00 +01:00
|
|
|
"Rations" => rations(ecs, x, y),
|
2022-01-29 14:14:34 +01:00
|
|
|
"Magic Mapping Scroll" => magic_mapper_scroll(ecs, x, y),
|
2022-01-29 16:07:01 +01:00
|
|
|
"Bear Trap" => bear_trap(ecs, x, y),
|
2022-01-28 00:48:54 +01:00
|
|
|
_ => {}
|
|
|
|
}
|
2022-01-26 15:42:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn health_potion(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('i'),
|
|
|
|
fg: RGB::named(rltk::MAGENTA),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
render_order: 2,
|
|
|
|
})
|
|
|
|
.with(Name {
|
|
|
|
name: "Health Potion".to_string(),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
2022-01-27 14:31:31 +01:00
|
|
|
.with(Consumable {})
|
|
|
|
.with(ProvidesHealing { heal_amount: 8 })
|
2022-01-27 18:28:40 +01:00
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
2022-01-26 15:42:42 +01:00
|
|
|
.build();
|
|
|
|
}
|
2022-01-27 14:31:31 +01:00
|
|
|
|
|
|
|
pub fn magic_missile_scroll(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437(')'),
|
|
|
|
fg: RGB::named(rltk::CYAN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
render_order: 2,
|
|
|
|
})
|
|
|
|
.with(Name {
|
|
|
|
name: "Magic Missile Scroll".to_string(),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Consumable {})
|
|
|
|
.with(Ranged { range: 6 })
|
2022-01-27 19:42:51 +01:00
|
|
|
.with(InflictsDamage { damage: 20 })
|
2022-01-27 18:28:40 +01:00
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
2022-01-27 14:31:31 +01:00
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn fireball_scroll(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437(')'),
|
2022-01-27 19:42:51 +01:00
|
|
|
fg: RGB::named(rltk::ORANGE),
|
2022-01-27 14:31:31 +01:00
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
render_order: 2,
|
|
|
|
})
|
|
|
|
.with(Name {
|
|
|
|
name: "Fireball Scroll".to_string(),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Consumable {})
|
|
|
|
.with(Ranged { range: 6 })
|
|
|
|
.with(InflictsDamage { damage: 20 })
|
|
|
|
.with(AreaOfEffect { radius: 3 })
|
2022-01-27 18:28:40 +01:00
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
2022-01-27 14:31:31 +01:00
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn confusion_scroll(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437(')'),
|
2022-01-27 19:42:51 +01:00
|
|
|
fg: RGB::named(rltk::PINK),
|
2022-01-27 14:31:31 +01:00
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
render_order: 2,
|
|
|
|
})
|
|
|
|
.with(Name {
|
|
|
|
name: "Confusion Scroll".to_string(),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Consumable {})
|
|
|
|
.with(Ranged { range: 6 })
|
|
|
|
.with(Confusion { turns: 4 })
|
2022-01-27 18:28:40 +01:00
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
2022-01-27 14:31:31 +01:00
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
2022-01-28 00:48:54 +01:00
|
|
|
pub fn room_table(map_depth: i32) -> RandomTable {
|
|
|
|
RandomTable::new()
|
|
|
|
.add("Goblin", 10)
|
|
|
|
.add("Orc", 1 + map_depth)
|
|
|
|
.add("Health Potion", 7)
|
|
|
|
.add("Fireball Scroll", 2 + map_depth)
|
|
|
|
.add("Confusion Scroll", 2 + map_depth)
|
|
|
|
.add("Magic Missile Scroll", 4)
|
2022-01-28 14:06:20 +01:00
|
|
|
.add("Dagger", 3)
|
|
|
|
.add("Longsword", map_depth - 1)
|
|
|
|
.add("Shield", 3)
|
|
|
|
.add("Tower Shield", map_depth - 1)
|
|
|
|
.add("Helmet", map_depth - 2)
|
|
|
|
.add("Breastplate", map_depth - 3)
|
|
|
|
.add("Leggings", map_depth - 4)
|
|
|
|
.add("Sabatons", map_depth - 4)
|
2022-01-29 00:31:00 +01:00
|
|
|
.add("Rations", 10)
|
2022-01-29 14:14:34 +01:00
|
|
|
.add("Magic Mapping Scroll", 2)
|
2022-01-29 16:07:01 +01:00
|
|
|
.add("Bear Trap", 2)
|
2022-01-28 14:06:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn dagger(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('/'),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::CYAN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Dagger".to_string(),
|
|
|
|
})
|
|
|
|
.with(Equippable {
|
|
|
|
slot: EquipmentSlot::Melee,
|
|
|
|
})
|
|
|
|
.with(MeleePowerBonus { power: 2 })
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn longsword(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('/'),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::CYAN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Longsword".to_string(),
|
|
|
|
})
|
|
|
|
.with(Equippable {
|
|
|
|
slot: EquipmentSlot::Melee,
|
|
|
|
})
|
|
|
|
.with(MeleePowerBonus { power: 4 })
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn shield(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('('),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::CYAN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Shield".to_string(),
|
|
|
|
})
|
|
|
|
.with(Equippable {
|
|
|
|
slot: EquipmentSlot::Shield,
|
|
|
|
})
|
|
|
|
.with(DefenseBonus { defense: 1 })
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn tower_shield(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('('),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::CYAN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Tower Shield".to_string(),
|
|
|
|
})
|
|
|
|
.with(Equippable {
|
|
|
|
slot: EquipmentSlot::Shield,
|
|
|
|
})
|
|
|
|
.with(DefenseBonus { defense: 3 })
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn helmet(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('^'),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::CYAN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Helmet".to_string(),
|
|
|
|
})
|
|
|
|
.with(Equippable {
|
|
|
|
slot: EquipmentSlot::Head,
|
|
|
|
})
|
|
|
|
.with(DefenseBonus { defense: 1 })
|
|
|
|
.with(MeleePowerBonus { power: 1 })
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn breastplate(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('x'),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::CYAN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Breastplate".to_string(),
|
|
|
|
})
|
|
|
|
.with(Equippable {
|
|
|
|
slot: EquipmentSlot::Chest,
|
|
|
|
})
|
|
|
|
.with(DefenseBonus { defense: 2 })
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn leggings(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('"'),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::CYAN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Leggings".to_string(),
|
|
|
|
})
|
|
|
|
.with(Equippable {
|
|
|
|
slot: EquipmentSlot::Legs,
|
|
|
|
})
|
|
|
|
.with(DefenseBonus { defense: 1 })
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn sabatons(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437(','),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::CYAN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Sabatons".to_string(),
|
|
|
|
})
|
|
|
|
.with(Equippable {
|
|
|
|
slot: EquipmentSlot::Feet,
|
|
|
|
})
|
|
|
|
.with(DefenseBonus { defense: 1 })
|
|
|
|
.with(MeleePowerBonus { power: 1 })
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
2022-01-27 14:31:31 +01:00
|
|
|
}
|
2022-01-29 00:31:00 +01:00
|
|
|
|
|
|
|
fn rations(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('%'),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::GREEN),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Rations".to_string(),
|
|
|
|
})
|
2022-01-29 00:31:16 +01:00
|
|
|
.with(Consumable {})
|
|
|
|
.with(ProvidesFood {})
|
2022-01-29 00:31:00 +01:00
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
|
|
|
}
|
2022-01-29 14:14:34 +01:00
|
|
|
|
|
|
|
fn magic_mapper_scroll(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437(')'),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::CYAN3),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Item {})
|
|
|
|
.with(Name {
|
|
|
|
name: "Scroll to Magic Mapping".to_string(),
|
|
|
|
})
|
|
|
|
.with(Consumable {})
|
|
|
|
.with(MagicMapper {})
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
2022-01-29 16:07:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn bear_trap(ecs: &mut World, x: i32, y: i32) {
|
|
|
|
ecs.create_entity()
|
|
|
|
.with(Position { x, y })
|
|
|
|
.with(Renderable {
|
|
|
|
glyph: rltk::to_cp437('^'),
|
|
|
|
render_order: 2,
|
|
|
|
fg: RGB::named(rltk::RED),
|
|
|
|
bg: RGB::named(rltk::BLACK),
|
|
|
|
})
|
|
|
|
.with(Name {
|
|
|
|
name: "Bear Trap".to_string(),
|
|
|
|
})
|
|
|
|
.with(Hidden {})
|
|
|
|
.with(EntryTrigger {})
|
|
|
|
.with(InflictsDamage { damage: 6 })
|
|
|
|
.with(SingleActivation {})
|
|
|
|
.marked::<SimpleMarker<SerializeMe>>()
|
|
|
|
.build();
|
|
|
|
}
|