Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add submerged hear through cams #304

Open
wants to merge 6 commits into
base: nightly
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/common/AmongUsState.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CameraLocation, MapType } from './AmongusMap';
import { MapType } from './AmongusMap';
import { ModsType } from './Mods';

export interface AmongUsState {
Expand All @@ -11,7 +11,7 @@ export interface AmongUsState {
clientId: number;
hostId: number;
comsSabotaged: boolean;
currentCamera: CameraLocation;
currentCamera: number;
map: MapType;
lightRadius: number;
lightRadiusChanged: boolean;
Expand Down
24 changes: 22 additions & 2 deletions src/common/AmongusMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,19 @@ export enum CameraLocation {
SouthWest, // CARGO BAY
NorthWest, // MEETING ROOM
Skeld,
NONE,
NONE = -1,
}

export enum SubmergedCamLocation {
NONE = -1,
START = 10,
LowerHall = 10,
Electrical,
LowerLobby,
UpperHall,
Central,
Comms,
UpperLobby,
}

export interface CamerasMap {
Expand Down Expand Up @@ -68,7 +80,15 @@ export const AmongUsMaps: { [key in MapType]: AmongUsMap } = {
},
},
[MapType.SUBMERGED]: {
cameras: {},
cameras: {
[SubmergedCamLocation.LowerHall]: {x: -2.69, y: -28.45},
[SubmergedCamLocation.Electrical]: { x: 8.74, y: -24.58},
[SubmergedCamLocation.LowerLobby]: { x: 8.03, y: -38.03},
[SubmergedCamLocation.UpperHall]: { x: -10.46, y: 19.67 },
[SubmergedCamLocation.Central]: { x: 3.22, y: 24.07},
[SubmergedCamLocation.Comms]: { x: 10, y: 23.48},
[SubmergedCamLocation.UpperLobby]: { x: 7.09, y: 10.28},
},
},
[MapType.UNKNOWN]: defaultMap,
};
Expand Down
14 changes: 12 additions & 2 deletions src/main/GameReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { IpcOverlayMessages, IpcRendererMessages } from '../common/ipc-messages'
import { GameState, AmongUsState, Player } from '../common/AmongUsState';
import { fetchOffsetLookup, fetchOffsetsJson, IOffsets, IOffsetsLookup } from './offsetStore';
import Errors from '../common/Errors';
import { CameraLocation, MapType } from '../common/AmongusMap';
import { CameraLocation, MapType, SubmergedCamLocation } from '../common/AmongusMap';
import { GenerateAvatars, numberToColorHex } from './avatarGenerator';
import { RainbowColorId } from '../renderer/cosmetics';
import { platform } from 'os';
Expand Down Expand Up @@ -224,7 +224,7 @@ export default class GameReader {
this.isLocalGame = lobbyCodeInt === 32; // is local game
let lightRadius = 1;
let comsSabotaged = false;
let currentCamera = CameraLocation.NONE;
let currentCamera: number = CameraLocation.NONE;
let map = MapType.UNKNOWN;
let maxPlayers = 10;
const closedDoors: number[] = [];
Expand Down Expand Up @@ -338,6 +338,16 @@ export default class GameReader {
currentCamera = CameraLocation.Skeld;
}
}
} else if (map === MapType.SUBMERGED) {
const currentCameraId = SubmergedCamLocation.NONE;
// TODO: Read from memory
// Probably from SubmarineSurvillanceMinigame.SelectedCam int
const currentCamEnabled = false;
// TODO: Read from memory based off of currentCameraId
// Probably from SubmarineSecuritySabotageSystem.FixedCams List<byte>
if (currentCamEnabled) {
currentCamera = (currentCameraId + SubmergedCamLocation.START) as SubmergedCamLocation;
}
}
}
if (map !== MapType.MIRA_HQ) {
Expand Down