WIP: 2.10
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
use rltk::{FontCharType, RandomNumberGenerator, RGB};
|
||||
use specs::prelude::*;
|
||||
use specs::saveload::{MarkedBuilder, SimpleMarker};
|
||||
|
||||
use crate::{AreaOfEffect, BlocksTile, CombatStats, Confusion, Consumable, InflictsDamage, Item, MAP_WIDTH, MAX_ITEMS, MAX_MONSTER, Monster, Name, Player, Position, Potion, ProvidesHealing, Ranged, Renderable, Viewshed};
|
||||
use crate::{AreaOfEffect, BlocksTile, CombatStats, Confusion, Consumable, InflictsDamage, Item, MAP_WIDTH, MAX_ITEMS, MAX_MONSTER, Monster, Name, Player, Position, ProvidesHealing, Ranged, Renderable, SerializeMe, Viewshed};
|
||||
use crate::rect::Rect;
|
||||
|
||||
pub fn player(ecs: &mut World, player_x: i32, player_y: i32) -> Entity {
|
||||
@@ -31,6 +32,7 @@ pub fn player(ecs: &mut World, player_x: i32, player_y: i32) -> Entity {
|
||||
defense: 2,
|
||||
power: 5,
|
||||
})
|
||||
.marked::<SimpleMarker<SerializeMe>>()
|
||||
.build()
|
||||
}
|
||||
|
||||
@@ -79,6 +81,7 @@ fn monster<S: ToString>(ecs: &mut World, x: i32, y: i32, glyph: FontCharType, na
|
||||
defense: 1,
|
||||
power: 4,
|
||||
})
|
||||
.marked::<SimpleMarker<SerializeMe>>()
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -146,6 +149,7 @@ pub fn health_potion(ecs: &mut World, x: i32, y: i32) {
|
||||
.with(Item {})
|
||||
.with(Consumable {})
|
||||
.with(ProvidesHealing { heal_amount: 8 })
|
||||
.marked::<SimpleMarker<SerializeMe>>()
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -165,6 +169,7 @@ pub fn magic_missile_scroll(ecs: &mut World, x: i32, y: i32) {
|
||||
.with(Consumable {})
|
||||
.with(Ranged { range: 6 })
|
||||
.with(InflictsDamage { damage: 8 })
|
||||
.marked::<SimpleMarker<SerializeMe>>()
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -185,6 +190,7 @@ pub fn fireball_scroll(ecs: &mut World, x: i32, y: i32) {
|
||||
.with(Ranged { range: 6 })
|
||||
.with(InflictsDamage { damage: 20 })
|
||||
.with(AreaOfEffect { radius: 3 })
|
||||
.marked::<SimpleMarker<SerializeMe>>()
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -204,10 +210,10 @@ pub fn confusion_scroll(ecs: &mut World, x: i32, y: i32) {
|
||||
.with(Consumable {})
|
||||
.with(Ranged { range: 6 })
|
||||
.with(Confusion { turns: 4 })
|
||||
.marked::<SimpleMarker<SerializeMe>>()
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
pub fn random_item(ecs: &mut World, x: i32, y: i32) {
|
||||
let roll: i32;
|
||||
{
|
||||
|
Reference in New Issue
Block a user