Skip to content

Commit

Permalink
Improvements yeee
Browse files Browse the repository at this point in the history
  • Loading branch information
codergautam committed Dec 23, 2023
1 parent 2436413 commit 14714c5
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 13 deletions.
3 changes: 2 additions & 1 deletion client/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export function sinceFrom(dateString: string) {

export function fixDate(inputDate: Date) {
// https://stackoverflow.com/a/14569783
return new Date( inputDate.getTime() + Math.abs(inputDate.getTimezoneOffset()*60000) )
// return new Date( inputDate.getTime() + Math.abs(inputDate.getTimezoneOffset()*60000) )
return inputDate;
}

export function lastSeen(dateString: string) {
Expand Down
4 changes: 1 addition & 3 deletions client/src/ui/game/Leaderboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
position: fixed;
top: 10px;
right: 10px;
width: 300px;
width: fit-content;
padding: 5px;
color: white;
font-family: Arial, Helvetica, sans-serif;
Expand Down Expand Up @@ -35,7 +35,5 @@
.leaderboard-line {
display: block;
font-size: 22px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
1 change: 1 addition & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dependencies": {
"dotenv": "^16.1.4",
"jsonwebtoken": "^9.0.2",
"leo-profanity": "^1.7.0",
"poly-decomp": "^0.3.0",
"protobufjs": "^7.2.5",
"sat": "^0.9.0",
Expand Down
1 change: 1 addition & 0 deletions server/src/game/biomes/Safezone.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Safezone extends Biome {
} else {
player.viewport.zoom.multiplier *= 0.9;
player.sword.damage.multiplier = 0;
player.sword.knockback.multiplier['biome'] = 0;
}
}

Expand Down
3 changes: 3 additions & 0 deletions server/src/game/entities/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const config = require('../../config');
const { clamp, calculateGemsXP } = require('../../helpers');
const { skins } = require('../../cosmetics.json');

const filter = require('leo-profanity');

class Player extends Entity {
constructor(game, name) {
super(game, Types.Entity.Player);
Expand Down Expand Up @@ -286,6 +288,7 @@ class Player extends Entity {
if (message.length === '') return;

message = message.slice(0, 35);
message = filter.clean(message);
this.chatMessage = message;
this.chatMessageTimer.renew();
}
Expand Down
4 changes: 2 additions & 2 deletions server/src/game/entities/mobs/Moose.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ class MooseMob extends Entity {
this.movementTimer = new Timer(0, 3, 4);
this.stayTimer = new Timer(3, 2, 3);
this.angryTimer = new Timer(0, 6, 8);
this.damage = new Property(this.size / 5);
this.damage = new Property(this.size / 20);
this.isMoving = false;
this.targetAngle = this.angle;
this.startAngle = this.angle;

this.health = new Health(50, 2);
this.speed = new Property(30);
this.speed = new Property(10);
this.target = null;
this.targets.push(Types.Entity.Player);

Expand Down
3 changes: 1 addition & 2 deletions server/src/game/evolutions/Berserker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ module.exports = class Berserker extends Evolution {
applyAbilityEffects() {
this.player.sword.damage.multiplier *= 1.6;
this.player.sword.knockback.multiplier['ability'] = 1.8;
this.player.speed.multiplier *= 1.6;
this.player.knockbackResistance.multiplier *= 1.2;
this.player.speed.multiplier *= 1.8;
this.player.sword.swingDuration.multiplier['ability'] = 0.5;
}

Expand Down
6 changes: 3 additions & 3 deletions server/src/game/evolutions/Tank.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = class Tank extends Evolution {
static type = Types.Evolution.Tank;
static level = 5;
static abilityDuration = 10;
static abilityCooldown = 60;
static abilityCooldown = 90;

applyAbilityEffects() {
this.player.sword.damage.multiplier *= 2;
Expand All @@ -27,8 +27,8 @@ module.exports = class Tank extends Evolution {
this.player.shape.setScale(1.25);
this.player.sword.damage.multiplier *= 1.25;
this.player.sword.knockback.multiplier['ability'] = 1.25;
this.player.knockbackResistance.multiplier *= 2;
this.player.health.max.multiplier *= 1.6;
this.player.knockbackResistance.multiplier *= 1.25;
this.player.health.max.multiplier *= 1.25;
this.player.health.regen.multiplier *= 1.25;
//TODO: Damagecooldown: 1.1
}
Expand Down
4 changes: 2 additions & 2 deletions server/src/game/maps/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Types = require('../Types');

module.exports = {
coinsCount: 0,
aiPlayersCount: 50,
aiPlayersCount: 20,
biomes: [
{
type: Types.Biome.Safezone,
Expand Down Expand Up @@ -223,7 +223,7 @@ module.exports = {
},
{
type: Types.Entity.Moose,
amount: 10,
amount: 5,
position: 'random',
respawnable: true,
size: [170, 230],
Expand Down
18 changes: 18 additions & 0 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ ecdsa-sig-formatter@1.0.11:
dependencies:
safe-buffer "^5.0.1"

french-badwords-list@^1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/french-badwords-list/-/french-badwords-list-1.0.7.tgz#8ed2442cb20fa2781c38b5a75c944f8e91a73c08"
integrity sha512-H1ziKs2PJh2+UXZ9oCGJ/rRQpsI9NBykGf2Sc7WaKaj1OnWFuBXfsvANTdRcfVmOghGQaUmRyZ1hJOPbDpy04Q==

jsonwebtoken@^9.0.2:
version "9.0.2"
resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3"
Expand Down Expand Up @@ -112,6 +117,14 @@ jws@^3.2.2:
jwa "^1.4.1"
safe-buffer "^5.0.1"

leo-profanity@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/leo-profanity/-/leo-profanity-1.7.0.tgz#4c7e77a0a1376afdff44a727235d08a489a57d93"
integrity sha512-88j1R08jrQzOib9Yxk4nxrzMlrHJi3DzFzAmv0L4APQ+ciGEfJ1rftVEvFjoqL0m+0KGFL3csQGRlxXGnYrA7w==
optionalDependencies:
french-badwords-list "^1.0.6"
russian-bad-words "^0.5.0"

lodash.includes@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f"
Expand Down Expand Up @@ -187,6 +200,11 @@ protobufjs@^7.2.5:
"@types/node" ">=13.7.0"
long "^5.0.0"

russian-bad-words@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/russian-bad-words/-/russian-bad-words-0.5.0.tgz#d4abcdc55f7af37606cdbac44bcb9e0bde6c3855"
integrity sha512-euNvEYki6iYYpkNbeudW+lEMMYGEmN7EBwVF8ezlbv0bZoQpVYB7W10cCeUIGV7Ed50sJynLQ0c559q5iI0ejQ==

safe-buffer@^5.0.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
Expand Down

0 comments on commit 14714c5

Please sign in to comment.