Remove level from create_ship and CreateShip.

This commit is contained in:
Avi Weinstock 2021-03-22 19:26:58 -04:00 committed by Marcel Märtens
parent deb9358c3a
commit 75f1b0f5e0
6 changed files with 4 additions and 12 deletions

View File

@ -126,7 +126,6 @@ pub enum ServerEvent {
CreateShip {
pos: comp::Pos,
ship: comp::ship::Body,
level: u16,
mountable: bool,
agent: Option<comp::Agent>,
rtsim_entity: Option<RtSimEntity>,

View File

@ -1008,7 +1008,7 @@ fn handle_spawn_airship(
});
let mut builder = server
.state
.create_ship(pos, comp::ship::Body::DefaultAirship, 1, true)
.create_ship(pos, comp::ship::Body::DefaultAirship, true)
.with(LightEmitter {
col: Rgb::new(1.0, 0.65, 0.2),
strength: 2.0,

View File

@ -114,12 +114,11 @@ pub fn handle_create_ship(
server: &mut Server,
pos: comp::Pos,
ship: comp::ship::Body,
level: u16,
mountable: bool,
agent: Option<Agent>,
rtsim_entity: Option<RtSimEntity>,
) {
let mut entity = server.state.create_ship(pos, ship, level, mountable);
let mut entity = server.state.create_ship(pos, ship, mountable);
if let Some(agent) = agent {
entity = entity.with(agent);
}

View File

@ -165,11 +165,10 @@ impl Server {
ServerEvent::CreateShip {
pos,
ship,
level,
mountable,
agent,
rtsim_entity,
} => handle_create_ship(self, pos, ship, level, mountable, agent, rtsim_entity),
} => handle_create_ship(self, pos, ship, mountable, agent, rtsim_entity),
ServerEvent::CreateWaypoint(pos) => handle_create_waypoint(self, pos),
ServerEvent::ClientDisconnect(entity) => {
frontend_events.push(handle_client_disconnect(self, entity))

View File

@ -115,7 +115,6 @@ impl<'a> System<'a> for Sys {
comp::Body::Ship(ship) => ServerEvent::CreateShip {
pos,
ship,
level: 1,
mountable: false,
agent,
rtsim_entity,

View File

@ -46,7 +46,6 @@ pub trait StateExt {
&mut self,
pos: comp::Pos,
ship: comp::ship::Body,
level: u16,
mountable: bool,
) -> EcsEntityBuilder;
/// Build a projectile
@ -231,7 +230,6 @@ impl StateExt for State {
&mut self,
pos: comp::Pos,
ship: comp::ship::Body,
level: u16,
mountable: bool,
) -> EcsEntityBuilder {
let mut builder = self
@ -252,10 +250,8 @@ impl StateExt for State {
.with(comp::CharacterState::default())
// TODO: some of these are required in order for the character_behavior system to
// recognize a possesed airship; that system should be refactored to use `.maybe()`
.with(comp::Energy::new(ship.into(), level))
//.with(comp::Health::new(ship.into(), level))
.with(comp::Energy::new(ship.into(), 0))
.with(comp::Stats::new("Airship".to_string()))
.with(comp::Buffs::default())
.with(comp::Combo::default());
if mountable {