Class MiraShipStatus<RoomType>

Represents a room object for the Mira HQ map.

See ShipStatusEvents for events to listen to.

Type Parameters

Hierarchy

Properties

roomDoors: Partial<Record<SystemType, number[]>>
components: Networkable<any, NetworkableEvents<Hostable<any>>, RoomType>[]
dirtyBit: number

The dirty state of this component.

flags: number

Flags for this object, see SpawnFlag.

initialSpawnCenter: Vector2
meetingSpawnCenter: Vector2
netId: number

The net ID of this component.

ownerId: number

The ID of the owner of this component.

player?: PlayerData<RoomType>

The player that this component belongs to.

room: RoomType

The room that this component belongs to.

spawnRadius: number
spawnType: SpawnType

The type of object that this component belongs to.

systems: AllSystems

Methods

  • Returns void

  • Parameters

    Returns void

  • Returns void

  • Parameters

    • delta: number

    Returns void

  • Returns void

  • Parameters

    Returns boolean

  • Returns void

  • Randomly assign players to each enabled role with a certain probability. Called just after a game is started and emits a RoomAssignRolesEvent which can be used to alter which players are assigned which roles.

    Returns Promise<void>

  • Randomly assign tasks to all players, using data from @skeldjs/data.

    Returns Promise<void>

  • Whether or not this object

    Returns boolean

  • Despawns the component from the room it belongs in.

    Returns void

  • Type Parameters

    • Event extends BasicEvent<Event>

    Parameters

    • event: Event

    Returns Promise<Event>

  • Type Parameters

    • Event extends BasicEvent<Event>

    Parameters

    • event: Event

    Returns Promise<Event>

  • Type Parameters

    • Event extends BasicEvent<Event>

    Parameters

    • event: Event

    Returns Event

  • Get the door IDs used to connect to a room.

    Returns

    The door IDs that connect to the room.

    Parameters

    • room: SystemType

      The room to get the door IDs for.

    Returns never[]

  • Type Parameters

    • Event extends BasicEvent<Event> = BasicEvent

    Parameters

    • event: string

    Returns Listener<Event>[]

  • Assign a list of roles to a pool of players, eliminating both players from the player list and also roles from the role list, and without regard for room settings (i.e. the chances of each role appearing or the maximum number of assignments for the role).

    Returns

    The role assignments (i.e. a map of player to roles) that have either collectively been assigned (if roleAssignments is passed) or been assigned just as part of this method.

    Parameters

    • playerPool: PlayerData<Hostable<any>>[]

      The pool of players to assign a list of roles to.

    • maxAssignable: number

      The maximum number of players that cn be assigned a role from this list.

    • roleList: typeof BaseRole[]

      The list of roles to assign to players.

    • Optional roleAssignments: Map<PlayerData<Hostable<any>>, typeof BaseRole>

      A map of role assigments (i.e. a map of player to roles) to act as a collective output to this method.

    Returns Map<PlayerData<Hostable<any>>, typeof BaseRole>

  • Specifically assign a pool of players to each role in a specific team.

    Returns

    The role assignments (i.e. a map of player to roles) that have either collectively been assigned (if roleAssignments is passed) or been assigned just as part of this method.

    Parameters

    • playerPool: PlayerData<Hostable<any>>[]

      The entire list of players that can be assigned a role, whether or not they already have a role. Note that this is not a list of players to be assigned a role from this team, but it is instead every possible player who could be assigned one.

    • settings: Partial<Record<RoleType, RoleChanceSettings>>

      Role settings to use when calculating how many players should assigned a specific role.

    • roleTeam: RoleTeamType

      The team of roles to assign.

    • maxAssignable: number

      The maximum number of players that can be assigned a role from this team. For example, it could be the set number of impostors configured in the game settings.

    • Optional defaultRole: typeof BaseRole

      The default role to assign to each player

    • Optional roleAssignments: Map<PlayerData<Hostable<any>>, typeof BaseRole>

      A map of role assigments (i.e. a map of player to roles) to act as a collective output to this method.

    Returns Map<PlayerData<Hostable<any>>, typeof BaseRole>

  • Specifically assign a pool of players to each role in a list, with regard to the room settings (i.e. the chance of each role appearing or the maximum number of assignments for the role).

    Returns

    The role assignments (i.e. a map of player to roles) that have either collectively been assigned (if roleAssignments is passed) or been assigned just as part of this method.

    Parameters

    • playerPool: PlayerData<Hostable<any>>[]

      The entire list of players that can be assigned a role, whether or not they already have a role. Note that this is not a list of players to be assigned a role from this team, but it is instead every possible player who could be assigned one.

    • settings: Partial<Record<RoleType, RoleChanceSettings>>

      Role settings to use when calculating how many players should assigned a specific role.

    • teamRoles: typeof BaseRole[]
    • maxAssignable: number

      The maximum number of players that can be assigned a role from this team. For example, it could be the set number of impostors configured in the game settings.

    • Optional defaultRole: typeof BaseRole

      The default role to assign to each player

    • Optional roleAssignments: Map<PlayerData<Hostable<any>>, typeof BaseRole>

      A map of role assigments (i.e. a map of player to roles) to act as a collective output to this method.

    Returns Map<PlayerData<Hostable<any>>, typeof BaseRole>

  • Get the spawn position of a player whether they are about to spawn after starting or whether they are about to spawn after a meeting.

    Returns

    The spawn position of the player.

    Parameters

    • player: number | PlayerData<Hostable<any>>

      The player or player ID to determine the position of.

    • initialSpawn: boolean

      Whther or not this is a spawn after starting the game.

    Returns Vector2

  • Get all tasks for this map.

    Returns

    A list of tasks for this map.

    Returns TaskInfo[]

  • Type Parameters

    • EventName extends "component.spawn" | "component.despawn" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles"

    Parameters

    Returns void

  • Type Parameters

    • K extends BasicEvent<K>

    Parameters

    • event: string
    • listener: Listener<K>

    Returns void

  • Type Parameters

    • EventName extends "component.spawn" | "component.despawn" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles"

    Parameters

    Returns (() => void)

      • (): void
      • Returns void

  • Type Parameters

    • K extends BasicEvent<K>

    Parameters

    • event: string
    • listener: Listener<K>

    Returns (() => void)

      • (): void
      • Returns void

  • Type Parameters

    • EventName extends "component.spawn" | "component.despawn" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles"

    Parameters

    Returns (() => void)

      • (): void
      • Returns void

  • Type Parameters

    • K extends BasicEvent<K>

    Parameters

    • event: string
    • listener: Listener<K>

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • event: string

    Returns void

  • Spawn this component if does not exist in the room it belongs in.

    Returns void

  • Teleport a player to their spawn position, calculated using getSpawnPosition.

    Parameters

    • player: PlayerData<Hostable<any>>

      The player to determine the position of.

    • initialSpawn: boolean

      Whether or not this is a spawn after starting the game.

    Returns void

  • Try to assign a ghost role to a specific dead player.

    Parameters

    Returns Promise<void>

  • Type Parameters

    • EventName extends "component.spawn" | "component.despawn" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles"

    Parameters

    • event: EventName

    Returns Promise<ShipStatusEvents<RoomType>[EventName]>

  • Parameters

    • event: string

    Returns Promise<BasicEvent>

  • Type Parameters

    • EventName extends "component.spawn" | "component.despawn" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles"

    Parameters

    • event: EventName
    • filter: ((ev: ShipStatusEvents<RoomType>[EventName]) => boolean | Promise<boolean>)
        • (ev: ShipStatusEvents<RoomType>[EventName]): boolean | Promise<boolean>
        • Parameters

          Returns boolean | Promise<boolean>

    Returns Promise<ShipStatusEvents<RoomType>[EventName]>

  • Type Parameters

    • K extends BasicEvent<K>

    Parameters

    • event: string
    • filter: ((ev: K) => boolean | Promise<boolean>)
        • (ev: K): boolean | Promise<boolean>
        • Parameters

          • ev: K

          Returns boolean | Promise<boolean>

    Returns Promise<BasicEvent>

Constructors

Accessors

  • get owner(): RoomType
  • Returns RoomType

Generated using TypeDoc