Skip to content

Commit 3b59631

Browse files
committed
updaet
1 parent b89711c commit 3b59631

File tree

7 files changed

+160
-22
lines changed

7 files changed

+160
-22
lines changed

public/favicon.ico

21.1 KB
Binary file not shown.

public/index.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
<title>Arras.io APS++</title>
1212
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700">
1313
<link rel="stylesheet" href="/main.css" />
14-
<link rel="icon" type="image/png" sizes="96x96" href="//arras.io/favicon/96x96.png">
15-
<link rel="icon" type="image/png" sizes="16x16" href="//arras.io/favicon/96x96.png">
14+
<link rel="icon" href="/favicon.ico" type="image/x-icon">
1615
<link rel="manifest" href="/lib/json/manifest.json">
1716
<meta name="msapplication-TileColor" content="#8abc3f">
1817
<meta name="theme-color" content="#8abc3f">
@@ -30,7 +29,7 @@
3029
<div class="startMenuHolder">
3130
<div class="sliderHolder">
3231
<div class="slider" id="startMenuSlidingContent">
33-
<center><img src="https://arras.io/favicon/96x96.png" /></center>
32+
<center><img width=92 height=92 src="/round.png" /></center>
3433
<h1 id="gameName">APS++</h1>
3534
<div id="serverName">
3635
<h4 class="nopadding">Connecting...</h4>

public/round.png

24.6 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// An addon is guaranteed to run only after all groups are loaded.
2+
// This is helpful, if your group relies on all other definitions already being loaded.
3+
// Addons that are dependant on other addons should be named something like
4+
// "[PARENT ADDON NAME]-[EXTENSION NAME].js", to make sure that it would run after that addon ran.
5+
6+
const { base } = require('../constants.js');
7+
8+
module.exports = ({ Class }) => {
9+
10+
// This addon is disabled by default.
11+
// You can also disable addons by not making them end with '.js'
12+
// If you want to enable, simply make the line below just not run.
13+
return console.log('[exampleAddon.js] Addon disabled by default');
14+
15+
let MAX_CHILDREN = 0,
16+
GUNS = [],
17+
TURRETS = [],
18+
19+
alreadySeen = [],
20+
next = ['basic'],
21+
22+
// We don't loop infinitely, because that's a bad idea if someone makes a circular upgrade path.
23+
// Also, RECURSION BAD. RECURSION BAD. RECURSION BAD. RECURSION BAD. RECURSION BAD. RECURSION BAD.
24+
limit = 1000;
25+
while (next.length && limit--) {
26+
let current = next;
27+
next = [];
28+
for (let i = 0; i < current.length; i++) {
29+
30+
// Handle string definition references
31+
let now = current[i];
32+
if ("string" == typeof now) {
33+
if (!(now in Class)) throw Error(`Definition ${now} is attempted to be gotten but does not exist!`);
34+
now = Class[now];
35+
}
36+
37+
// Handles tanks with multiple ways to upgrade to them, like Overgunner.
38+
if (alreadySeen.includes(now.LABEL)) continue;
39+
alreadySeen.push(now.LABEL);
40+
41+
// Add guns, turrets and additional max child count to our current list of stuff for our abomination to have.
42+
if (now.MAX_CHILDREN) MAX_CHILDREN += now.MAX_CHILDREN;
43+
if (now.GUNS) GUNS.push(...now.GUNS);
44+
if (now.TURRETS) TURRETS.push(...now.TURRETS);
45+
46+
// Add upgrades of current tank to next iteration
47+
for (let key of Object.keys(now)) if (key.startsWith('UPGRADES_TIER_')) next.push(...now[key]);
48+
}
49+
}
50+
51+
// This adds the tank to the definitions and to the memes menu
52+
Class.abomination = {
53+
PARENT: ["genericTank"],
54+
LABEL: "The Abomination",
55+
SKILL_CAP: Array(10).fill(15),
56+
BODY: {
57+
ACCELERATION: base.ACCEL * 0.2,
58+
SPEED: base.SPEED * 0.2,
59+
HEALTH: base.HEALTH * 5,
60+
DAMAGE: base.DAMAGE * 5,
61+
PENETRATION: base.PENETRATION * 5,
62+
SHIELD: base.SHIELD * 5,
63+
REGEN: base.REGEN * 5,
64+
FOV: base.FOV * 2,
65+
DENSITY: base.DENSITY * 5,
66+
PUSHABILITY: 0.2,
67+
HETERO: 3,
68+
},
69+
MAX_CHILDREN, GUNS, TURRETS
70+
}
71+
Class.memes.UPGRADES_TIER_0.push("abomination");
72+
};

server/modules/definitions/combined.js

+27-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
let fs = require('fs'),
2-
groups = fs.readdirSync('./groups');
3-
4-
module.exports = {};
2+
groups = fs.readdirSync('./groups'),
3+
addons = fs.readdirSync('./addons'),
4+
Class = {},
5+
definitionCount = 0;
56

7+
console.log(`Loading ${groups.length} groups...`);
68
for (let filename of groups) {
9+
console.log(`Loading group: ${filename}`);
710
let group = require('./groups/' + filename);
811
for (let key in group) {
9-
if (module.exports[key]) {
10-
console.warn("WARNING: " + key + ' is present in multiple definition groups!');
12+
if (key in Class) {
13+
console.warn(`WARNING: ${key} is present in multiple definition groups!`);
14+
} else {
15+
definitionCount++;
1116
}
12-
module.exports[key] = group[key];
17+
Class[key] = group[key];
1318
}
1419
}
1520

16-
let definitionCount = Object.keys(module.exports).length;
21+
console.log(`Loading ${addons.length} addons...`);
22+
for (let filename of addons) {
23+
if (!filename.endsWith('.js')) continue;
24+
25+
console.log(`Loading addon: ${filename}`);
26+
27+
require('./addons/' + filename)({ Class });
28+
}
1729

1830
// "Flattening" refers to removing PARENT attributes and applying the parents' attributes to the definition themselves, if not overwritten later on.
1931
if (c.flattenDefintions) {
@@ -23,8 +35,8 @@ if (c.flattenDefintions) {
2335

2436
// Support for string definition references
2537
if ("string" == typeof definition) {
26-
if (definition in module.exports) {
27-
definition = module.exports[definition];
38+
if (definition in Class) {
39+
definition = Class[definition];
2840
} else {
2941
throw Error(`Definition ${definition} is attempted to be gotten but does not exist!`);
3042
}
@@ -47,10 +59,12 @@ if (c.flattenDefintions) {
4759
return output;
4860
};
4961

50-
for (let key in module.exports) {
51-
flattened[key] = flatten(module.exports[key]);
62+
for (let key in Class) {
63+
flattened[key] = flatten(Class[key]);
5264
}
53-
module.exports = flattened;
65+
Class = flattened;
66+
definitionCount = Object.keys(Class).length;
5467
}
5568

56-
console.log(`Combined ${groups.length} definition groups into ${definitionCount} definitions${c.flattenDefintions ? ' with flattening enabled' : ''}!`);
69+
console.log(`Combined ${groups.length} definition groups and ${addons.length} addons into ${definitionCount} ${c.flattenDefintions ? 'flattened ' : ''}definitions!`);
70+
module.exports = Class;

server/modules/definitions/facilitators.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ exports.skillSet = (args) => {
5858

5959
// FUNCTIONS
6060
exports.dereference = type => {
61+
let now = current[i];
62+
if ("string" == typeof now) {
63+
if (!(now in Class)) throw Error(`Definition ${now} is attempted to be gotten but does not exist!`);
64+
now = Class[now];
65+
}
66+
6167
let output = JSON.parse(JSON.stringify(type));
6268
if (type.GUNS) {
6369
for (let i = 0; i < type.GUNS.length; i++) {
@@ -577,7 +583,7 @@ exports.makeCeption = (type, name = -1, options = {}) => {
577583
independent: true,
578584
};
579585
if (options.type != null) {
580-
type = options.type;
586+
turret.type = options.type;
581587
}
582588
if (options.size != null) {
583589
turret.size = options.size;
@@ -614,16 +620,16 @@ exports.makeCeption = (type, name = -1, options = {}) => {
614620
return output;
615621
}
616622

617-
exports.makeDeco = (shapes, color = 16) => {
618-
if (exports["deco" + shapes + "_" + color] == null) {
619-
exports["deco" + shapes + "_" + color] = {
623+
exports.makeDeco = (shape, color = 16) => {
624+
if (exports["deco" + shape + "_" + color] == null) {
625+
exports["deco" + shape + "_" + color] = {
620626
PARENT: ["genericEntity"],
621-
SHAPE: shapes,
627+
SHAPE: shape,
622628
COLOR: color,
623629
INDEPENDENT: true,
624630
};
625631
}
626-
return exports["deco" + shapes + "_" + color];
632+
return exports["deco" + shape + "_" + color];
627633
}
628634

629635
//unfinished lolo

server/modules/definitions/groups/misc.js

+47
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,53 @@ const { combineStats, skillSet } = require('../facilitators.js');
22
const { base, gunCalcNames } = require('../constants.js');
33
const g = require('../gunvals.js');
44

5+
// OBSTACLES
6+
exports.rock = {
7+
TYPE: "wall",
8+
DAMAGE_CLASS: 1,
9+
LABEL: "Rock",
10+
FACING_TYPE: "turnWithSpeed",
11+
SHAPE: -9,
12+
BODY: {
13+
PUSHABILITY: 0,
14+
HEALTH: 10000,
15+
SHIELD: 10000,
16+
REGEN: 1000,
17+
DAMAGE: 1,
18+
RESIST: 100,
19+
STEALTH: 1,
20+
},
21+
VALUE: 0,
22+
SIZE: 60,
23+
COLOR: 16,
24+
VARIES_IN_SIZE: true,
25+
ACCEPTS_SCORE: false,
26+
};
27+
exports.stone = {
28+
PARENT: ["rock"],
29+
LABEL: "Stone",
30+
SIZE: 32,
31+
SHAPE: -7,
32+
};
33+
exports.moon = {
34+
PARENT: ["rock"],
35+
LABEL: "Moon",
36+
SIZE: 60,
37+
SHAPE: 0,
38+
};
39+
exports.gravel = {
40+
PARENT: ["rock"],
41+
LABEL: "Gravel",
42+
SIZE: 16,
43+
SHAPE: -7,
44+
};
45+
exports.wall = {
46+
PARENT: ["rock"],
47+
LABEL: "Wall",
48+
SIZE: 25,
49+
SHAPE: 4,
50+
};
51+
552
// DOMINATORS
653
exports.dominationBody = {
754
LABEL: "",

0 commit comments

Comments
 (0)