<commit_before>import store from 'APP/app/store'
import { toggleChatBox } from 'APP/app/reducers/chat'

import EntityPrefab from './EntityPrefab'
import HealthBar from './HealthBar.js'
import Weapon from './Weapon'
import HUD from './HUD'

import armorProperties from '../properties/armorProperties.json'
import playerProperties from '../properties/playerProperties.json'
import itemProperties from '../properties/itemProperties.json'

import { socket, GameGroups } from '../sockets'

/* global StackQuest, Phaser */

// client side class for Playable Characters
export default class Player extends EntityPrefab {
  constructor(game, name, player) {
    super(game, name, { x: player.x, y: player.y }, player.class)

    GameGroups.players.add(this)

    this.player = player
    this.anchor.set(0.5, 0.2)
    this.orientation = 'down'

    this.lastSpecialAttack = Date.now()

    this.absorbProperties(playerProperties[player.class])

    this.stats.hp = player.hp
    this.setAnimationFrames(this)
    this.killCount = 0
    this.lootCount = 0
    this.loadControls = this.loadControls.bind(this)
    this.loadControls()
    this.chatToggleTime = Date.now()

    this.movePlayer = this.movePlayer.bind(this)
    this.moveOther = this.moveOther.bind(this)

    this.bulletPool = this.game.add.group()

    this.equipSpecial = this.equipSpecial.bind(this)
    this.equipSpecial(this.specialKey)
    this.specialAttack = this.specialAttack.bind(this)

    this.equipWeapon = this.equipWeapon.bind(this)
    this.equipWeapon(this.weaponKey)
    this.attack = this.attack.bind(this)

    this.equipArmor = this.equipArmor.bind(this)
    this.equipArmor(this.armorKey)

    this.takeDamage = this.takeDamage.bind(this)
    this.respawn = this.respawn.bind(this)
    this.playerHealthBar = new HealthBar(game, { x: player.x, y: player.y - 10 })
    this.computeLifeBar()
    this.recoverHp = this.recoverHp.bind(this)

    this.pickUpItem = this.pickUpItem.bind(this)
    this.savePlayer = this.savePlayer.bind(this)
  }

  equipSpecial(specialKey) {
    this.special = new Weapon(this.game, this, specialKey)
    this.special.name = specialKey
    return true
  }
  equipWeapon(weaponKey) {
    this.weapon = new Weapon(this.game, this, weaponKey)
    this.weapon.name = weaponKey
    return true
  }

  equipArmor(armorKey) {
    this.armor = armorProperties[armorKey]
    this.armor.name = armorKey
    return true
  }

  loadControls() {
    this.cursors = {}
    this.cursors.up = this.game.input.keyboard.addKey(Phaser.Keyboard.W)
    this.cursors.down = this.game.input.keyboard.addKey(Phaser.Keyboard.S)
    this.cursors.right = this.game.input.keyboard.addKey(Phaser.Keyboard.D)
    this.cursors.left = this.game.input.keyboard.addKey(Phaser.Keyboard.A)
    this.cursors.space = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR)
    this.cursors.chat = this.game.input.keyboard.addKey(Phaser.Keyboard.TAB)
    this.cursors.board = this.game.input.keyboard.addKey(Phaser.Keyboard.B)
    this.cursors.click = this.game.input.activePointer

    this.cursors.board.onDown.add(this.toggleHUDBoards, this)
  }

  chat() {
    if (this.cursors.chat.isDown) {
      if (Date.now() - this.chatToggleTime > 150) {
        store.dispatch(toggleChatBox())
        this.chatToggleTime = Date.now()
      }
      if (store.getState().chat.showChat) {
        this.game.input.keyboard.removeKey(Phaser.Keyboard.W)
        this.game.input.keyboard.removeKey(Phaser.Keyboard.S)
        this.game.input.keyboard.removeKey(Phaser.Keyboard.D)
        this.game.input.keyboard.removeKey(Phaser.Keyboard.A)
      } else {
        this.loadControls()
      }
    }
  }
<commit_msg>fix player chat by removing b and spacebar<commit_after>import store from 'APP/app/store'
import { toggleChatBox } from 'APP/app/reducers/chat'

import EntityPrefab from './EntityPrefab'
import HealthBar from './HealthBar.js'
import Weapon from './Weapon'
import HUD from './HUD'

import armorProperties from '../properties/armorProperties.json'
import playerProperties from '../properties/playerProperties.json'
import itemProperties from '../properties/itemProperties.json'

import { socket, GameGroups } from '../sockets'

/* global StackQuest, Phaser */

// client side class for Playable Characters
export default class Player extends EntityPrefab {
  constructor(game, name, player) {
    super(game, name, { x: player.x, y: player.y }, player.class)

    GameGroups.players.add(this)

    this.player = player
    this.anchor.set(0.5, 0.2)
    this.orientation = 'down'

    this.lastSpecialAttack = Date.now()

    this.absorbProperties(playerProperties[player.class])

    this.stats.hp = player.hp
    this.setAnimationFrames(this)
    this.killCount = 0
    this.lootCount = 0
    this.loadControls = this.loadControls.bind(this)
    this.loadControls()
    this.chatToggleTime = Date.now()

    this.movePlayer = this.movePlayer.bind(this)
    this.moveOther = this.moveOther.bind(this)

    this.bulletPool = this.game.add.group()

    this.equipSpecial = this.equipSpecial.bind(this)
    this.equipSpecial(this.specialKey)
    this.specialAttack = this.specialAttack.bind(this)

    this.equipWeapon = this.equipWeapon.bind(this)
    this.equipWeapon(this.weaponKey)
    this.attack = this.attack.bind(this)

    this.equipArmor = this.equipArmor.bind(this)
    this.equipArmor(this.armorKey)

    this.takeDamage = this.takeDamage.bind(this)
    this.respawn = this.respawn.bind(this)
    this.playerHealthBar = new HealthBar(game, { x: player.x, y: player.y - 10 })
    this.computeLifeBar()
    this.recoverHp = this.recoverHp.bind(this)

    this.pickUpItem = this.pickUpItem.bind(this)
    this.savePlayer = this.savePlayer.bind(this)
  }

  equipSpecial(specialKey) {
    this.special = new Weapon(this.game, this, specialKey)
    this.special.name = specialKey
    return true
  }
  equipWeapon(weaponKey) {
    this.weapon = new Weapon(this.game, this, weaponKey)
    this.weapon.name = weaponKey
    return true
  }

  equipArmor(armorKey) {
    this.armor = armorProperties[armorKey]
    this.armor.name = armorKey
    return true
  }

  loadControls() {
    this.cursors = {}
    this.cursors.up = this.game.input.keyboard.addKey(Phaser.Keyboard.W)
    this.cursors.down = this.game.input.keyboard.addKey(Phaser.Keyboard.S)
    this.cursors.right = this.game.input.keyboard.addKey(Phaser.Keyboard.D)
    this.cursors.left = this.game.input.keyboard.addKey(Phaser.Keyboard.A)
    this.cursors.space = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR)
    this.cursors.chat = this.game.input.keyboard.addKey(Phaser.Keyboard.TAB)
    this.cursors.board = this.game.input.keyboard.addKey(Phaser.Keyboard.B)
    this.cursors.click = this.game.input.activePointer

    this.cursors.board.onDown.add(this.toggleHUDBoards, this)
  }

  chat() {
    if (this.cursors.chat.isDown) {
      if (Date.now() - this.chatToggleTime > 150) {
        store.dispatch(toggleChatBox())
        this.chatToggleTime = Date.now()
      }
      if (store.getState().chat.showChat) {
        this.game.input.keyboard.removeKey(Phaser.Keyboard.W)
        this.game.input.keyboard.removeKey(Phaser.Keyboard.S)
        this.game.input.keyboard.removeKey(Phaser.Keyboard.D)
        this.game.input.keyboard.removeKey(Phaser.Keyboard.A)
        this.game.input.keyboard.removeKey(Phaser.Keyboard.SPACEBAR)
        this.game.input.keyboard.removeKey(Phaser.Keyboard.B)
      } else {
        this.loadControls()
      }
    }
  }

{'fraction_non_alphanumeric': 0.12529992002132764, 'fraction_numerical': 0.002932551319648094, 'mean_word_length': 3.377479579929988, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2090931', 'n_tokens_mistral': 2575, 'n_tokens_neox': 2512, 'n_words': 391}