[Add] Ways of death.
[Add] Generation area is now larger.
This commit is contained in:
parent
a24caab545
commit
3724a3121e
@ -6,7 +6,7 @@
|
|||||||
const float Player::PLAYER_SPEED = Character::CHARACTER_SPEED + 0.5f;
|
const float Player::PLAYER_SPEED = Character::CHARACTER_SPEED + 0.5f;
|
||||||
|
|
||||||
// Amount of Exp needed every level
|
// Amount of Exp needed every level
|
||||||
const int Player::EXP_TABLE[10] = {
|
const int Player::EXP_TABLE[MAX_LEVEL] = {
|
||||||
10,
|
10,
|
||||||
30,
|
30,
|
||||||
90,
|
90,
|
||||||
@ -16,7 +16,17 @@ const int Player::EXP_TABLE[10] = {
|
|||||||
1000,
|
1000,
|
||||||
2000,
|
2000,
|
||||||
3500,
|
3500,
|
||||||
5000
|
5000,
|
||||||
|
6500,
|
||||||
|
8500,
|
||||||
|
10250,
|
||||||
|
12000,
|
||||||
|
15000,
|
||||||
|
25000,
|
||||||
|
50000,
|
||||||
|
65000,
|
||||||
|
80000,
|
||||||
|
100000
|
||||||
};
|
};
|
||||||
|
|
||||||
Player::Player(LevelGen *mapArg) : Character(mapArg) {
|
Player::Player(LevelGen *mapArg) : Character(mapArg) {
|
||||||
@ -122,6 +132,10 @@ void Player::SetLevel(int level) {
|
|||||||
if(_exp < 0) {
|
if(_exp < 0) {
|
||||||
_exp = 0;
|
_exp = 0;
|
||||||
}
|
}
|
||||||
|
if(_level == MAX_LEVEL) {
|
||||||
|
eventHistory->LogEvent("YOU BEAT IT! I'M SO PROUD!");
|
||||||
|
eventHistory->LogEvent("*Sheds Tear*");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SetExp(int exp) {
|
void Player::SetExp(int exp) {
|
||||||
|
@ -27,7 +27,7 @@ public:
|
|||||||
void SetExpLiteral(int exp) { _exp = exp; }
|
void SetExpLiteral(int exp) { _exp = exp; }
|
||||||
void SetHealthLiteral(int health) { _health = health; }
|
void SetHealthLiteral(int health) { _health = health; }
|
||||||
|
|
||||||
static const int MAX_LEVEL = 10;
|
static const int MAX_LEVEL = 20;
|
||||||
static const int EXP_TABLE[MAX_LEVEL];
|
static const int EXP_TABLE[MAX_LEVEL];
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -138,7 +138,32 @@ void WorldManager::OnPlayerAttack(Player* player) {
|
|||||||
npc->OnAttack();
|
npc->OnAttack();
|
||||||
|
|
||||||
if(npc->GetHealth() <= 0) {
|
if(npc->GetHealth() <= 0) {
|
||||||
eventHistory->LogEvent("Killed Bald Naked Dude!");
|
|
||||||
|
// Please note:
|
||||||
|
// Naked dudes are known to be sensitive to spicy food.
|
||||||
|
|
||||||
|
char* waysOfDeath[] = {
|
||||||
|
"Choked Naked Dude!",
|
||||||
|
"Stabbed Naked Dude!",
|
||||||
|
"Urinated Acid on Naked Dude!",
|
||||||
|
"Killed Naked Dude with a dildo!",
|
||||||
|
"Poured Tabasco on Naked Dude!",
|
||||||
|
"Threw Acid on Naked Dude!",
|
||||||
|
"Slapped Naked Dude with Dead Fish!",
|
||||||
|
"Killed Naked Dude with a Pistol!",
|
||||||
|
"Ate Naked Dude's brain!",
|
||||||
|
"Slaughtered Naked Dude!",
|
||||||
|
"Roasted Naked Dude!",
|
||||||
|
"Paper Sprayed Naked Dude!",
|
||||||
|
"Stoned Naked Dude!",
|
||||||
|
"Slayed Naked Dude with a Katana!",
|
||||||
|
"Thew Chili Peppers on Naked Dude!",
|
||||||
|
"Used Karate on Naked Dude!",
|
||||||
|
"Beat the shit out of Naked Dude!",
|
||||||
|
"FUS RO DAH!"
|
||||||
|
};
|
||||||
|
|
||||||
|
eventHistory->LogEvent(waysOfDeath[rand() % (sizeof(waysOfDeath)/sizeof(char*))]);
|
||||||
|
|
||||||
int expGain = 3 + (rand() % 2);
|
int expGain = 3 + (rand() % 2);
|
||||||
player->SetExp(player->GetExp() + expGain);
|
player->SetExp(player->GetExp() + expGain);
|
||||||
|
@ -63,8 +63,8 @@ private:
|
|||||||
static const int TILE_ARRAY_SIZE = 150;
|
static const int TILE_ARRAY_SIZE = 150;
|
||||||
MapTile _tile[TILE_ARRAY_SIZE][TILE_ARRAY_SIZE];
|
MapTile _tile[TILE_ARRAY_SIZE][TILE_ARRAY_SIZE];
|
||||||
|
|
||||||
static const int BOUNDARIES_X = (SCREEN_WIDTH / TILE_WIDTH) - 2;
|
static const int BOUNDARIES_X = (SCREEN_WIDTH / TILE_WIDTH);
|
||||||
static const int BOUNDARIES_Y = (SCREEN_HEIGHT / TILE_HEIGHT) - 1;
|
static const int BOUNDARIES_Y = (SCREEN_HEIGHT / TILE_HEIGHT);
|
||||||
|
|
||||||
TextureManager _tileTextures;
|
TextureManager _tileTextures;
|
||||||
TextureManager _entityTextures;
|
TextureManager _entityTextures;
|
||||||
|
Loading…
Reference in New Issue
Block a user