pub fn weapon_entity(ecs: &mut World, x: i32, y: i32, owner: Entity) -> Entity {
    ecs.create_entity()
        .with(Position { x: x, y: y })
        .with(Renderable {
            glyph: rltk::to_cp437('*'),
            fg: RGB::named(rltk::YELLOW),
            bg: RGB::named(rltk::BLACK),
            render_order: 0,
        })
        .with(WeaponStats { power: 8, owner: owner })
        .with(CombatStats {
            max_hp: 30,
            hp: 30,
            stamina: 1,
            max_stamina: 1,
            defense: 20,
            power: 8,
        })
        .with(Name { name: "Player Weapon".to_string() })
        .with(BlocksTile {})
        .marked::<SimpleMarker<SerializeMe>>()
        .build()
}
/// Spawns the weapon and returns the entity object.
Spawns the weapon and returns the entity object.
Spawns the weapon and returns the entity object .
pub fn weapon_entity(ecs: &mut World, x: i32, y: i32, owner: Entity) -> Entity {
    ecs.create_entity()
        .with(Position { x: x, y: y })
        .with(Renderable {
            glyph: rltk::to_cp437('*'),
            fg: RGB::named(rltk::YELLOW),
            bg: RGB::named(rltk::BLACK),
            render_order: 0,
        })
        .with(WeaponStats { power: 8, owner: owner })
        .with(CombatStats {
            max_hp: 30,
            hp: 30,
            stamina: 1,
            max_stamina: 1,
            defense: 20,
            power: 8,
        })
        .with(Name { name: "Player Weapon".to_string() })
        .with(BlocksTile {})
        .marked::<SimpleMarker<SerializeMe>>()
        .build()
}
pub fn weapon_entity ( ecs : & mut World , x : i32 , y : i32 , owner : Entity ) -> Entity { ecs . create_entity ( ) . with ( Position { x : x , y : y } ) . with ( Renderable { glyph : rltk :: to_cp437 ( '*' ) , fg : RGB :: named ( rltk :: YELLOW ) , bg : RGB :: named ( rltk :: BLACK ) , render_order : 0 , } ) . with ( WeaponStats { power : 8 , owner : owner } ) . with ( CombatStats { max_hp : 30 , hp : 30 , stamina : 1 , max_stamina : 1 , defense : 20 , power : 8 , } ) . with ( Name { name : " " . to_string ( ) } ) . with ( BlocksTile { } ) . marked :: < SimpleMarker < SerializeMe > > ( ) . build ( ) }
Spawns the weapon and returns the entity object.
Spawns the weapon and returns the entity object .
ecs
&mut World
x
i32
y
i32
owner
Entity