Skip to content

Commit

Permalink
feat: add miner's helmet
Browse files Browse the repository at this point in the history
  • Loading branch information
Picoseconds committed Aug 16, 2020
1 parent 5d8328e commit bfecc71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/moomoo/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ export default class Game {
}

if (player.isAttacking && player.selectedWeapon != Weapons.Shield && player.buildItem == -1) {
let hat = getHat(player.hatID);

if (Date.now() - player.lastHitTime >= player.getWeaponHitTime()) {
let nearbyPlayers = player.getNearbyPlayers(this.state);

Expand All @@ -470,7 +472,6 @@ export default class Game {
weaponVariant
);

let hat = getHat(player.hatID);
let hitPlayerHat = getHat(hitPlayer.hatID);

if (hat && hat.dmgMultO)
Expand Down Expand Up @@ -529,7 +530,6 @@ export default class Game {
for (let hitGameObject of hitGameObjects) {
if (hitGameObject.health !== -1) {
let dmgMult = 1;
let hat = getHat(player.hatID);

if (hat && hat.bDmg)
dmgMult *= hat.bDmg;
Expand Down Expand Up @@ -594,6 +594,9 @@ export default class Game {
break;
}

if (hitGameObject.type !== GameObjectType.GoldMine)
player.points += (hat?.extraGold || 0) * gather;

player.client?.socket.send(
packetFactory.serializePacket(
new Packet(PacketType.WIGGLE, [
Expand Down

0 comments on commit bfecc71

Please sign in to comment.