core icon indicating copy to clipboard operation
core copied to clipboard

Add more player stat fields

Open builder-247 opened this issue 7 years ago • 2 comments

processPlayerData handles modifying the player object from Hypixel API to the wanted format.

The game specific objects are created using the functions processStats object. You can assign default values by adding an equal sign in object parameters e.g. coins = 0 defaults the coins value to 0. The return statement return the stats object for the minigame. If (and when) some field's name needs to be changed, it can be achieved as described below:

return {
  kills: coins,
}

This would return the coins field with the name kills.

For an example adding kills and deaths fields to Warlords, processors/games/Battleground.js file should be modified in the following way:

module.exports = ({
  // This part destructs the values from the game object returned by the Hypixel API
  coins = 0,
  kills = 0,
  deaths = 0,
}) => ({
  coins,  
  kills,
  deaths,
});

Example (TKR stats)

Resources for stats to be added:

Progress:

  • [x] Arena
  • [x] Blitz
  • [x] Turbo Kart racers
  • [x] Paintball
  • [x] Quake
  • [x] Arcade - Missing advanced Zombies stats
  • [ ] Warlords
  • [x] Bedwars
  • [x] Build Battle
  • [x] Duels
  • [x] Cops and Crims
  • [ ] Murder Mystery
  • [ ] SkyClash
  • [x] SkyWars
  • [x] Speed UHC
  • [x] Smash Heroes - Partial progress
  • [ ] TNT Games
  • [ ] Crazy Walls
  • [x] UHC
  • [x] VampireZ
  • [x] Walls
  • [ ] MegaWalls
  • [x] The Pit
  • [x] SkyBlock - Partial progress

builder-247 avatar Sep 10 '18 14:09 builder-247

Working on Warlords.

builder-247 avatar Jun 08 '19 14:06 builder-247

More skywars stats added in #679

TheMysterys avatar Aug 05 '21 07:08 TheMysterys