Skip to content

Commit

Permalink
Merge pull request #18 from chao813/fix/upgrade
Browse files Browse the repository at this point in the history
add upgrade, chests, hire commands
  • Loading branch information
chao813 committed Mar 30, 2021
2 parents 11ae03b + cd60a65 commit 5c2f457
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 3 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ If player profile is not found in fortnitetracker.com, fall back to using Fortni
- Purple : KD > 3
- Display current stats for the squad. If a username is provided, display only stats for that player (ex: `!track LigmaBalls12`).")
- Display stats difference of a player or the squad, or average stats of the opponents played today (ex: `!stats diff`, `!stats diff LigmaBalls12`, `!stats played`)."
- Display average stats of all opponents faced today
- Show map of all upgrade locations
- Show map of all bunker chest locations
- Show map of all hireable NPC locations

## Usage
```
Expand All @@ -63,6 +67,14 @@ If player profile is not found in fortnitetracker.com, fall back to using Fortni
!stats opponents
!stats noobs
!stats enemy
!upgrade
!gold
!chests
!loot
!hire
```

## Examples
Expand Down Expand Up @@ -93,7 +105,7 @@ Player Found (Fortnite API search):
```
![Alt text](/images/example.png?raw=true)

Player Found and Streaming:
Player Found (Fortnite API search) and Streaming:
```
!hunted Fresh
```
Expand All @@ -105,4 +117,9 @@ Stats Difference for Squad:
```
![Alt text](/images/stats_diff_example.png?raw=true)

Average Stats of all Opponent Faced Today:
```
!stats noobs
```
![Alt text](/images/stats_noobs_example.png?raw=true)

4 changes: 2 additions & 2 deletions clients/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ def _calculate_skill_rate_indicator(overall_kd):
return "Aim Botters"
elif overall_kd >= 3:
return "Sweats"
elif overall_kd < 3 and overall_kd >= 2:
elif overall_kd >= 2:
return "High"
elif overall_kd < 2 and overall_kd >= 1:
elif overall_kd >= 1:
return "Medium"
else:
return "Bots"
Expand Down
26 changes: 26 additions & 0 deletions commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@
"command": "rate",
"aliases": ["gg"],
"description": "Rate how good opponents are today"
},
"Upgrade Locations": {
"command": "upgrade",
"aliases": ["gold"],
"description": "Show map of upgrade locations"
},
"Chest Locations": {
"command": "chests",
"aliases": ["loot"],
"description": "Show map of chest locations"
},
"Hireable NPC Locations": {
"command": "hire",
"description": "Show map of hireable NPC locations"
}
}

Expand Down Expand Up @@ -56,4 +70,16 @@
RATE_DESCRIPTION = COMMANDS["Rate Difficulty"]["description"]
RATE_ALIASES = COMMANDS["Rate Difficulty"]["aliases"]

# Upgrade Locations
UPGRADE_COMMAND = COMMANDS["Upgrade Locations"]["command"]
UPGRADE_DESCRIPTION = COMMANDS["Upgrade Locations"]["description"]
UPGRADE_ALIASES = COMMANDS["Upgrade Locations"]["aliases"]

# Chest Locations
CHESTS_COMMAND = COMMANDS["Chest Locations"]["command"]
CHESTS_DESCRIPTION = COMMANDS["Chest Locations"]["description"]
CHESTS_ALIASES = COMMANDS["Chest Locations"]["aliases"]

# Hireable NPC Locations
HIRE_COMMAND = COMMANDS["Hireable NPC Locations"]["command"]
HIRE_DESCRIPTION = COMMANDS["Hireable NPC Locations"]["description"]
40 changes: 40 additions & 0 deletions fortnite_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
from logging.handlers import TimedRotatingFileHandler

import discord
from discord.ext.commands import Bot

import commands
Expand Down Expand Up @@ -132,6 +133,45 @@ async def rate(ctx, silent=False):
""" Rate how good opponents are today """
await stats.rate_opponent_stats_today(ctx)

@bot.command(name=commands.UPGRADE_COMMAND, help=commands.UPGRADE_DESCRIPTION,
aliases=commands.UPGRADE_ALIASES)
async def upgrade(ctx, silent=False):
""" Show map of upgrade locations """
await ctx.send("https://img.fortniteintel.com/wp-content/uploads/2021/03/17151906/Fortnite-Season-6-upgrade-locations.jpg.webp")

@bot.command(name=commands.HIRE_COMMAND, help=commands.HIRE_DESCRIPTION)
async def hire(ctx, silent=False):
""" Show map of hireable NPC locations """
await ctx.send("https://img.fortniteintel.com/wp-content/uploads/2021/03/29172627/Fortnite-hire-NPCs-768x748.jpg.webp")

@bot.command(name=commands.CHESTS_COMMAND, help=commands.CHESTS_DESCRIPTION,
aliases=commands.CHESTS_ALIASES)
async def chests(ctx, silent=False):
""" Show map of bunker and regular chest locations """
chest_location_details = ("1 - Inside a tower that’s located toward the northwest corner of the main structure. \n"
"2 - Buried in a field to the south of Stealthy Stronghold on a small hill, outside of the walls. \n"
"3 - In the house with a red roof under the staircase toward the western part of the town. \n"
"4 - In the attic of a house toward the landmark’s west. \n"
"5 - In the building that’s half covered in sand, and the Bunker chest will be waiting for you in its basement. \n"
"6 - Southeast of the landmark in the sand. \n"
"7 - In a small campsite west of the Green Steel Bridge. \n"
"8 - Head over to the house with storm shelter toward the southeastern corner of the landmark. \n"
"9 - In the attic of a house, located toward the southeastern part of the town. \n"
"10 - In a field, east of Flopper Pond. \n"
"11 - In the shack that’s on the top. \n"
"12 - Near a road that’s west of Durr Burger. \n"
"13 - Next to the control panel in a house toward the northern edge of the landmark. \n"
"14 - In a house on the southwestern edge of the landmark. \n"
"15 - In the flowery fields toward Retail Row’s west. \n"
"16 - In a field in between Loot Lake and Lazy Lake. \n"
"17 - Inside of the attic. \n"
"18 - In the basement of the house and you’ll need to destroy the floor beneath the table with your harvesting tool to access the room. \n"
"19 - In the large house in the flower fields, located toward the southwest of Misty Meadows. \n"
"20 - In a shack. \n"
"21 - In the crossroads between Sweaty Sand and Holly Hedges. \n"
"22 - Under the sand along the shore line. \n")
await ctx.send("https://cdn1.dotesports.com/wp-content/uploads/2021/03/25194519/fortnite-bunker-loc-1024x864.png")
await ctx.send("```" + chest_location_details + "```")

@bot.command(name=commands.STATS_COMMAND, help="returns the stats based on parameters provided")
async def stats_operations(ctx, *params):
Expand Down
Binary file added images/stats_noobs_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5c2f457

Please sign in to comment.