This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "AssistantLib.h" | |
#include <iostream> | |
using namespace std; | |
AssistantLib::AssistantLib(string name, int status, int noBooksHandled) | |
: Librarian(name, status, noBooksHandled, AssistantLibrarian) {} | |
void AssistantLib::AssignBook(Librarian* otherLibrarian) { | |
if (otherLibrarian->GetType() == AssistantLibrarian && otherLibrarian->GetStatus() < Status) otherLibrarian->IncreaseBooksHandled(); | |
else cout << "Assistant librarians cannot assign books to other assistant librarians" << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code is a general use case, meaning that it's auto enabled for all guilds, to make it per guild you'll have to moidfy it yourself | |
// This is done in the messageCreate event | |
// The channel that the level up message will be sent to, by default this should be the current channel unless you have a feature that has a custom level up channel | |
const levelUpChannel = message.channel; | |
// Accessing the data base and checking if the message author has an existing account/schema | |
let userData = await pointSchema.findOne({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
What this does: | |
It checks if the users RP [XP] is larger than or equal to the required XP to level up, if larger than we have extra XP, we check if that extra XP can level the user up again and if it can't we set it as carryOverXp | |
*/ | |
//This is the function that calculates the amount of XP required to level up once, you can of course change this to your own equation | |
//If you'd like to learn more about the mathmatics behind level systems go here: https://pavcreations.com/level-systems-and-character-growth-in-rpg-games/ | |
function RPRequiredToLevelUp(rank) { | |
return rank * 800 + (rank - 1) * 400; | |
} | |
//This function takes in the user's current rank (before it's updated), currentRP : the user's current XP before any addition, addedRP (the user's XP after addition) |