Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Added super weapons #2

Open
wants to merge 5 commits into
base: development
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
data/
data/
.vscode/
45 changes: 30 additions & 15 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
const express = require('express');
const warapi = require('./warapi.js');

const express = require('express');
const app = express();

app.use('/map', express.static('public'));

app.get('/map/api/dynamic', function(request, response) {
response.sendFile(__dirname + '/data/dynamic.json');
app.get('/map', (request, response) => {
response.sendFile(__dirname + '/views/index.html');
});

app.get('/map/api/static', function(request, response) {
response.sendFile(__dirname + '/data/static.json');
// Shard 1
app.get('/map/api/live-1/war', (request, response) => {
response.sendFile(__dirname + '/data/live-1/war.json');
});

app.get('/map/api/activemaps', function(request, response) {
response.sendFile(__dirname + '/data/activemaps.json');
app.get('/map/api/live-1/regions', (request, response) => {
response.sendFile(__dirname + '/data/live-1/regions.json');
});
app.get('/map/api/live-1/dynamic', (request, response) => {
response.sendFile(__dirname + '/data/live-1/dynamic.json');
});
app.get('/map/api/live-1/static', (request, response) => {
response.sendFile(__dirname + '/data/live-1/static.json');
});

app.get('/map', function(request, response) {
response.sendFile(__dirname + '/views/index.html');
// Shard 2
app.get('/map/api/live-2/war', (request, response) => {
response.sendFile(__dirname + '/data/live-2/war.json');
});
app.get('/map/api/live-2/regions', (request, response) => {
response.sendFile(__dirname + '/data/live-2/regions.json');
});
app.get('/map/api/live-2/dynamic', (request, response) => {
response.sendFile(__dirname + '/data/live-2/dynamic.json');
});
app.get('/map/api/live-2/static', (request, response) => {
response.sendFile(__dirname + '/data/live-2/static.json');
});

const port = 3002;
app.listen(port, () => {
console.log(`App listening at http://localhost:${port}`)
});
console.log(`App listening at ${port}`);

warapi.updateWarData();
setInterval(warapi.updateWarData, 60000);
warapi.updateWarData();
setInterval(warapi.updateWarData, 60000);
});
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "foxhole-war-map",
"version": "4.0.0",
"version": "4.3.0",
"description": "",
"main": "app.js",
"scripts": {
Expand Down
Binary file added public/icons/MapIconIntelCenter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconIntelCenterColonial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconIntelCenterWarden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconStormCannon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconStormCannonColonial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconStormCannonWarden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconTownBaseTier1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconTownBaseTier1Colonial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconTownBaseTier1Warden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconTownBaseTier2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconTownBaseTier2Colonial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconTownBaseTier2Warden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconTownBaseTier3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconTownBaseTier3Colonial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/MapIconTownBaseTier3Warden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions public/js/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const map = L.map("map", {
mapLayers.RegionNames,
mapLayers.RegionBorders,

mapLayers.StaticBases,
mapLayers.TownBases,
mapLayers.RelicBases,
mapLayers.Keeps,
mapLayers.Safehouses,
Expand All @@ -39,7 +39,7 @@ const map = L.map("map", {
mapLayers.Shipyards,
mapLayers.ConstructionYards,
mapLayers.MassProductionFactories,
mapLayers.SeaPorts,
mapLayers.Seaports,
mapLayers.EngineeringCenters,

mapLayers.SalvageFields,
Expand All @@ -50,6 +50,9 @@ const map = L.map("map", {
mapLayers.ComponentMines,
mapLayers.SulfurMines,
mapLayers.OilWells,

mapLayers.StormCannons,
mapLayers.IntelCenters,
]
});

Expand Down
36 changes: 24 additions & 12 deletions public/js/MapIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ const MapIcon = L.Icon.extend({
}
});

export const StaticBase1 = [
new MapIcon({iconUrl: "./icons/MapIconStaticBase1.png"}),
new MapIcon({iconUrl: "./icons/MapIconStaticBase1Colonial.png"}),
new MapIcon({iconUrl: "./icons/MapIconStaticBase1Warden.png"})
export const TownBase1 = [
new MapIcon({iconUrl: "./icons/MapIconTownBaseTier1.png"}),
new MapIcon({iconUrl: "./icons/MapIconTownBaseTier1Colonial.png"}),
new MapIcon({iconUrl: "./icons/MapIconTownBaseTier1Warden.png"})
]

export const StaticBase2 = [
new MapIcon({iconUrl: "./icons/MapIconStaticBase2.png"}),
new MapIcon({iconUrl: "./icons/MapIconStaticBase2Colonial.png"}),
new MapIcon({iconUrl: "./icons/MapIconStaticBase2Warden.png"})
export const TownBase2 = [
new MapIcon({iconUrl: "./icons/MapIconTownBaseTier2.png"}),
new MapIcon({iconUrl: "./icons/MapIconTownBaseTier2Colonial.png"}),
new MapIcon({iconUrl: "./icons/MapIconTownBaseTier2Warden.png"})
]

export const StaticBase3 = [
new MapIcon({iconUrl: "./icons/MapIconStaticBase3.png"}),
new MapIcon({iconUrl: "./icons/MapIconStaticBase3Colonial.png"}),
new MapIcon({iconUrl: "./icons/MapIconStaticBase3Warden.png"})
export const TownBase3 = [
new MapIcon({iconUrl: "./icons/MapIconTownBaseTier3.png"}),
new MapIcon({iconUrl: "./icons/MapIconTownBaseTier3Colonial.png"}),
new MapIcon({iconUrl: "./icons/MapIconTownBaseTier3Warden.png"})
]

export const Safehouse = [
Expand Down Expand Up @@ -60,6 +60,18 @@ export const CoastalGun = [
new MapIcon({iconUrl: "./icons/MapIconCoastalGunWarden.png"})
]

export const StormCannon = [
new MapIcon({iconUrl: "./icons/MapIconStormCannon.png"}),
new MapIcon({iconUrl: "./icons/MapIconStormCannonColonial.png"}),
new MapIcon({iconUrl: "./icons/MapIconStormCannonWarden.png"})
]

export const IntelCenter = [
new MapIcon({iconUrl: "./icons/MapIconIntelCenter.png"}),
new MapIcon({iconUrl: "./icons/MapIconIntelCenterColonial.png"}),
new MapIcon({iconUrl: "./icons/MapIconIntelCenterWarden.png"})
]

export const Armory = [
new MapIcon({iconUrl: "./icons/MapIconArmory.png"}),
new MapIcon({iconUrl: "./icons/MapIconArmoryColonial.png"}),
Expand Down
41 changes: 38 additions & 3 deletions public/js/MapItem.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import * as MapIcon from './MapIcons.js';
import * as MapData from './MapRegions.js';
import { mapLayers } from "./MapLayers.js";
import { mapLayers } from './MapLayers.js';
import { regions } from './MapRegions.js';

export default class MapItem{
constructor(regionId, teamId, iconType, x, y, flags) {
this.regionId = regionId;
this.regionName = MapData.regions[regionId-3].name;

const region = regions.find(x => x.id === regionId);
this.regionName = region.name;
this.iconType = iconType;
this.x = x;
this.y = y;
Expand All @@ -31,6 +34,7 @@ export default class MapItem{
}

switch(iconType) {
/*
case 5:
this.description = 'Town Hall (Tier 1)';
this.iconImage = MapIcon.StaticBase1[this.teamId];
Expand All @@ -49,6 +53,7 @@ export default class MapItem{
this.layer = mapLayers.StaticBases;
this.pane = 'basesPane';
break;
*/
case 11:
this.description = 'Hospital';
this.iconImage = MapIcon.Hospital[this.teamId];
Expand Down Expand Up @@ -201,7 +206,7 @@ export default class MapItem{
case 52:
this.description = 'Seaport';
this.iconImage = MapIcon.Seaport[this.teamId];
this.layer = mapLayers.SeaPorts;
this.layer = mapLayers.Seaports;
this.pane = 'structuresPane';
break;
case 53:
Expand All @@ -210,6 +215,36 @@ export default class MapItem{
this.layer = mapLayers.CoastalGuns;
this.pane = 'structuresPane';
break;
case 56:
this.description = 'Town Base (Tier 1)';
this.iconImage = MapIcon.TownBase1[this.teamId];
this.layer = mapLayers.TownBases;
this.pane = 'basesPane';
break;
case 57:
this.description = 'Town Base (Tier 2)';
this.iconImage = MapIcon.TownBase2[this.teamId];
this.layer = mapLayers.TownBases;
this.pane = 'basesPane';
break;
case 58:
this.description = 'Town Base (Tier 3)';
this.iconImage = MapIcon.TownBase3[this.teamId];
this.layer = mapLayers.TownBases;
this.pane = 'basesPane';
break;
case 59:
this.description = 'Storm Cannon';
this.iconImage = MapIcon.StormCannon[this.teamId];
this.layer = mapLayers.StormCannons;
this.pane = 'structuresPane';
break;
case 60:
this.description = 'Intel Center';
this.iconImage = MapIcon.IntelCenter[this.teamId];
this.layer = mapLayers.IntelCenters;
this.pane = 'structuresPane';
break;
default:
console.log('Unknown IconType - ' + iconType);
}
Expand Down
Loading