Compare commits
10 Commits
47fb60e1c9
...
ff72fb5dc0
Author | SHA1 | Date | |
---|---|---|---|
ff72fb5dc0 | |||
655a557778 | |||
03a462632f | |||
6c27a1510b | |||
410b31c96a | |||
b4137467a7 | |||
d61342b9f1 | |||
b04884e44a | |||
546909b4aa | |||
535533206f |
2
src/.gitignore
vendored
2
src/.gitignore
vendored
@ -1 +1,3 @@
|
||||
testing*
|
||||
cc3k.zip
|
||||
|
||||
|
@ -7,12 +7,12 @@
|
||||
#include <sstream>
|
||||
|
||||
#include "constants.h"
|
||||
#include "input/file_input.h"
|
||||
#include "output/file_output.h"
|
||||
#include "input/console_input.h"
|
||||
#include "output/console_output.h"
|
||||
#include "input/curses_input.h"
|
||||
#include "output/curses_output.h"
|
||||
#include "file_input.h"
|
||||
#include "file_output.h"
|
||||
#include "console_input.h"
|
||||
#include "console_output.h"
|
||||
#include "curses_input.h"
|
||||
#include "curses_output.h"
|
||||
#include "rng.h"
|
||||
|
||||
feature proc_args(int argc, char **argv,
|
||||
@ -348,7 +348,7 @@ const char *POTIONS_LIST = "\
|
||||
Gets 3x final ATK multiplier;\n\
|
||||
Gets 0.5x final DEF multiplier;\n\
|
||||
Lasts 12 turns.\n\n\
|
||||
- Bezerk Brew (BB):\n\
|
||||
- Berzerk Brew (BB):\n\
|
||||
Gets 2x basic ATK multiplier;\n\
|
||||
Gets 0.5x basic DEF multiplier;\n\
|
||||
Lasts 15 turns.\n\n\
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "assassin.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
assassin::assassin(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, race::ASSASSIN} {};
|
@ -1,7 +1,7 @@
|
||||
#ifndef __ASSASSIN_H__
|
||||
#define __ASSASSIN_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
|
||||
class assassin final: public player_base {
|
||||
inline static const fraction INF_HIT_RATE = {0x3F3F3F3F, 1};
|
@ -1,6 +1,6 @@
|
||||
#include "baby_dragon.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
baby_dragon::baby_dragon(RNG *rng, const feature enabled_features,
|
||||
const position &pos, const int gen_room_num):
|
@ -1,7 +1,7 @@
|
||||
#ifndef __BABY_DRAGON_H__
|
||||
#define __BABY_DRAGON_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class baby_dragon final: public enemy_base {
|
||||
public:
|
24
src/berzerk_brew.cc
Normal file
24
src/berzerk_brew.cc
Normal file
@ -0,0 +1,24 @@
|
||||
#include "berzerk_brew.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "constants.h"
|
||||
|
||||
berzerk_brew::berzerk_brew(const position &pos):
|
||||
potion{potion_type::BERZERK_BREW, DURATION, pos} {}
|
||||
|
||||
void berzerk_brew::apply(const enum race &race, int &HP, int &ATK,
|
||||
int &DEF, fraction &base_hit_rate) {
|
||||
if (remaining_duration != 0) {
|
||||
ATK *= ATK_MUL * (race == DROW ? DROW_POTION_MUL : 1);
|
||||
DEF *= DEF_MUL * (race == DROW ? DROW_POTION_MUL : 1);
|
||||
--remaining_duration;
|
||||
}
|
||||
}
|
||||
|
||||
int berzerk_brew::get_priority() const {
|
||||
return CALC_MID;
|
||||
}
|
||||
|
||||
const char *berzerk_brew::get_name() const {
|
||||
return "BB";
|
||||
}
|
@ -1,14 +1,14 @@
|
||||
#ifndef __BEZERK_BREW_H__
|
||||
#define __BEZERK_BREW_H__
|
||||
#ifndef __BERZERK_BREW_H__
|
||||
#define __BERZERK_BREW_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class bezerk_brew final: public potion {
|
||||
class berzerk_brew final: public potion {
|
||||
static const int ATK_MUL = 2;
|
||||
inline static const float DEF_MUL = 0.5f;
|
||||
static const int DURATION = 15;
|
||||
public:
|
||||
bezerk_brew(const position &pos);
|
||||
berzerk_brew(const position &pos);
|
||||
void apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||
fraction &base_hit_rate) override;
|
||||
int get_priority() const override;
|
@ -1,7 +1,7 @@
|
||||
#include "boost_atk.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __BOOST_ATK_H__
|
||||
#define __BOOST_ATK_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class boost_atk final: public potion {
|
||||
static const int BOOST_ATK = 5;
|
@ -1,7 +1,7 @@
|
||||
#include "boost_def.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
|
||||
boost_def::boost_def(const position &pos):
|
@ -1,7 +1,7 @@
|
||||
#ifndef __BOOST_DEF_H__
|
||||
#define __BOOST_DEF_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class boost_def final: public potion {
|
||||
static const int BOOST_DEF = 5;
|
@ -1,7 +1,7 @@
|
||||
#include "borrow_life.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
borrow_life::borrow_life(const position &pos):
|
||||
potion{potion_type::BORROW_LIFE, DURATION, pos} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __BORROW_LIFE_H__
|
||||
#define __BORROW_LIFE_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class borrow_life final: public potion {
|
||||
static const int GIVE_HP = 50;
|
@ -1,6 +1,6 @@
|
||||
#include "brawler.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
brawler::brawler(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, race::BRAWLER} {};
|
@ -1,7 +1,7 @@
|
||||
#ifndef __BRAWLER_H__
|
||||
#define __BRAWLER_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
|
||||
class brawler final: public player_base {
|
||||
public:
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <utility>
|
||||
#include <string>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
console_input::console_input(std::istream &cin):
|
||||
in{cin} {}
|
@ -2,7 +2,7 @@
|
||||
#define __CONSOLE_INPUT_H__
|
||||
|
||||
#include <iostream>
|
||||
#include "../input.h"
|
||||
#include "input.h"
|
||||
|
||||
class console_input final : public input {
|
||||
private:
|
@ -4,7 +4,7 @@
|
||||
#include <utility>
|
||||
#include <ncurses.h>
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
console_output::console_output(std::ostream &cout): out{cout} {}
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define __CONSOLE_OUTPUT_H__
|
||||
|
||||
#include <iostream>
|
||||
#include "../output.h"
|
||||
#include "output.h"
|
||||
|
||||
class console_output final : public output {
|
||||
private:
|
@ -96,7 +96,7 @@ enum potion_type : int {RESTORE_HEALTH = 0, BOOST_ATK, BOOST_DEF,
|
||||
POISON_HEALTH, WOUND_ATK, WOUND_DEF,
|
||||
CONTINUOUS_RESTORATION, SAVAGE_STRIKE,
|
||||
ECHOING_RESIL, TEMPEST_TANTRUM,
|
||||
BEZERK_BREW, BORROW_LIFE,
|
||||
BERZERK_BREW, BORROW_LIFE,
|
||||
FINE_BOOZE, IRONCLAD_WARD
|
||||
};
|
||||
|
||||
@ -162,8 +162,8 @@ static const int RETURN_PANICKED = 1;
|
||||
|
||||
static const int COLOR_BLACK_ON_WHITE = 8;
|
||||
|
||||
static const int GOLD_NORMAL = 1;
|
||||
static const int GOLD_SMALL = 2;
|
||||
static const int GOLD_NORMAL = 2;
|
||||
static const int GOLD_SMALL = 1;
|
||||
static const int GOLD_MERCHANT = 4;
|
||||
static const int GOLD_DRAGON = 6;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "continuous_restoration.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
continuous_restoration::continuous_restoration(const position &pos):
|
||||
potion{potion_type::CONTINUOUS_RESTORATION, DURATION, pos} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __CONTINUOUS_RESTORATION_H__
|
||||
#define __CONTINUOUS_RESTORATION_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class continuous_restoration final: public potion {
|
||||
static const int GAIN_HEALTH = 3;
|
@ -1,6 +1,6 @@
|
||||
#include "curses_input.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
curses_input::curses_input(cursor *new_curse):
|
||||
curse{new_curse} {}
|
@ -2,8 +2,8 @@
|
||||
#define __CURSES_INPUT_H__
|
||||
|
||||
#include <memory>
|
||||
#include "../input.h"
|
||||
#include "../cursor.h"
|
||||
#include "input.h"
|
||||
#include "cursor.h"
|
||||
|
||||
class curses_input final: public input {
|
||||
private:
|
@ -1,6 +1,6 @@
|
||||
#include "curses_output.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
curses_output::curses_output(cursor *new_curse):
|
||||
curse{new_curse} {}
|
@ -3,8 +3,8 @@
|
||||
|
||||
#include <utility>
|
||||
#include <memory>
|
||||
#include "../cursor.h"
|
||||
#include "../output.h"
|
||||
#include "cursor.h"
|
||||
#include "output.h"
|
||||
|
||||
class curses_output final : public output {
|
||||
private:
|
BIN
src/design.pdf
Normal file
BIN
src/design.pdf
Normal file
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
#include "dragon.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "../level.h"
|
||||
#include "constants.h"
|
||||
#include "level.h"
|
||||
|
||||
dragon::dragon(RNG *rng, const feature enabled_features, const position &pos,
|
||||
const int gen_room_num, const position &guards):
|
@ -1,7 +1,7 @@
|
||||
#ifndef __DRAGON_H__
|
||||
#define __DRAGON_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class dragon final: public enemy_base {
|
||||
const position guards;
|
@ -1,6 +1,6 @@
|
||||
#include "drow.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
drow::drow(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, race::DROW} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __DROW_H__
|
||||
#define __DROW_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
|
||||
class drow final: public player_base {
|
||||
public:
|
@ -1,6 +1,6 @@
|
||||
#include "dwarf.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
dwarf::dwarf(RNG *rng, const feature enabled_features, const position &pos,
|
||||
const int gen_room_num):
|
@ -1,7 +1,7 @@
|
||||
#ifndef __DWARF_H__
|
||||
#define __DWARF_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class dwarf final: public enemy_base {
|
||||
public:
|
@ -1,7 +1,7 @@
|
||||
#include "echoing_resilience.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
echoing_resilience::echoing_resilience(const position &pos):
|
||||
potion{potion_type::ECHOING_RESIL, DURATION, pos} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __ECHOING_RESILIENCE_H__
|
||||
#define __ECHOING_RESILIENCE_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class echoing_resilience final: public potion {
|
||||
static const int GAIN_HEALTH = 7;
|
@ -1,6 +1,6 @@
|
||||
#include "elf.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
elf::elf(RNG *rng, const feature enabled_features, const position &pos,
|
||||
const int gen_room_num):
|
@ -1,7 +1,7 @@
|
||||
#ifndef __ELF_H__
|
||||
#define __ELF_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class elf final: public enemy_base {
|
||||
public:
|
@ -1,19 +1,19 @@
|
||||
#include "enemies.h"
|
||||
|
||||
#include "constants.h"
|
||||
#include "enemies/dragon.h"
|
||||
#include "enemies/dwarf.h"
|
||||
#include "enemies/elf.h"
|
||||
#include "enemies/halfling.h"
|
||||
#include "enemies/human.h"
|
||||
#include "enemies/merchant.h"
|
||||
#include "enemies/orc.h"
|
||||
#include "enemies/viking.h"
|
||||
#include "enemies/swordsman.h"
|
||||
#include "enemies/leprechaun.h"
|
||||
#include "enemies/witch.h"
|
||||
#include "enemies/hacker.h"
|
||||
#include "enemies/baby_dragon.h"
|
||||
#include "dragon.h"
|
||||
#include "dwarf.h"
|
||||
#include "elf.h"
|
||||
#include "halfling.h"
|
||||
#include "human.h"
|
||||
#include "merchant.h"
|
||||
#include "orc.h"
|
||||
#include "viking.h"
|
||||
#include "swordsman.h"
|
||||
#include "leprechaun.h"
|
||||
#include "witch.h"
|
||||
#include "hacker.h"
|
||||
#include "baby_dragon.h"
|
||||
|
||||
std::unique_ptr<enemy_base> new_dragon(RNG *rng, const position &pos,
|
||||
const position &fallback,
|
||||
|
@ -34,7 +34,9 @@ long_result enemy_base::act(level *lvl, character *pc, bool hostile) {
|
||||
target = tmp;
|
||||
}
|
||||
|
||||
if (target.x != BIG_NUMBER)
|
||||
pos = target;
|
||||
|
||||
return {NOTHING, ""};
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <utility>
|
||||
#include <string>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
file_input::file_input(std::ifstream &&ifs):
|
||||
in{std::move(ifs)} {}
|
@ -2,7 +2,7 @@
|
||||
#define __FILE_INPUT_H__
|
||||
|
||||
#include <fstream>
|
||||
#include "../input.h"
|
||||
#include "input.h"
|
||||
|
||||
class file_input final : public input {
|
||||
private:
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
file_output::file_output(std::ofstream &&ofs):
|
||||
out{std::move(ofs)} {}
|
@ -2,7 +2,7 @@
|
||||
#define __FILE_OUTPUT_H__
|
||||
|
||||
#include <fstream>
|
||||
#include "../output.h"
|
||||
#include "output.h"
|
||||
|
||||
class file_output final : public output {
|
||||
private:
|
@ -1,7 +1,7 @@
|
||||
#include "fine_booze.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
fine_booze::fine_booze(const position &pos):
|
||||
potion{potion_type::FINE_BOOZE, DURATION, pos} {}
|
@ -1,8 +1,8 @@
|
||||
#ifndef __FINE_BOOZE_H__
|
||||
#define __FINE_BOOZE_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "../constants.h"
|
||||
#include "potion.h"
|
||||
#include "constants.h"
|
||||
|
||||
class fine_booze final: public potion {
|
||||
static const int GAIN_HP = 2;
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "constants.h"
|
||||
#include "pc.h"
|
||||
#include "enemies/dragon.h"
|
||||
#include "dragon.h"
|
||||
|
||||
game::game(const enum race starting_race,
|
||||
const feature enabled_features,
|
||||
@ -91,7 +91,11 @@ character *game::move_enemies() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (the_world && !(is_adjacent(ch->get_pos(), player->get_pos()) ||
|
||||
if (the_world && ch->get_race() == MERCHANT) {
|
||||
if (!hostile_merchants)
|
||||
continue;
|
||||
} else if (the_world &&
|
||||
!(is_adjacent(ch->get_pos(), player->get_pos()) ||
|
||||
(ch->get_race() == DRAGON &&
|
||||
is_adjacent(static_cast<dragon * >(ch)->get_guards(),
|
||||
player->get_pos()))))
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "goblin.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
goblin::goblin(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, race::GOBLIN} {};
|
@ -1,7 +1,7 @@
|
||||
#ifndef __GOBLIN_H__
|
||||
#define __GOBLIN_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
|
||||
class goblin final: public player_base {
|
||||
static const int GAIN_GOLD = 5;
|
@ -1,6 +1,6 @@
|
||||
#include "hacker.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
hacker::hacker(RNG *rng, const feature enabled_features, const position &pos,
|
||||
const int gen_room_num):
|
@ -1,7 +1,7 @@
|
||||
#ifndef __HACKER_H__
|
||||
#define __HACKER_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class hacker final: public enemy_base {
|
||||
static const int RAND_STR_LEN_MIN = 10;
|
@ -1,6 +1,6 @@
|
||||
#include "halfling.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
fraction halfling::HIT_RATE_MUL = {1, 2};
|
||||
|
||||
@ -35,5 +35,5 @@ long_result halfling::get_hit(character *ch, const int tATK,
|
||||
}
|
||||
|
||||
return {MISS, "PC tried to hit " + abbrev +
|
||||
" but missed. The halfling laughed. "};
|
||||
" but missed. The halfling laughs. "};
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __HALFLING_H__
|
||||
#define __HALFLING_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class halfling final: public enemy_base {
|
||||
static fraction HIT_RATE_MUL;
|
@ -1,7 +1,7 @@
|
||||
#include "human.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "../level.h"
|
||||
#include "constants.h"
|
||||
#include "level.h"
|
||||
|
||||
human::human(RNG *rng, const feature enabled_features, const position &pos,
|
||||
const int gen_room_num):
|
||||
@ -14,6 +14,10 @@ const char *human::get_race_name() const {
|
||||
int human::dies(level *lvl) {
|
||||
lvl->add_gold(gold{pos, GOLD_NORMAL});
|
||||
auto plist = lvl->get_available_around_all(pos);
|
||||
|
||||
if (plist.size())
|
||||
lvl->add_gold(gold{rng->get_rand_in_vector(plist), GOLD_NORMAL});
|
||||
else
|
||||
lvl->add_gold(gold{pos, GOLD_NORMAL});
|
||||
return 0;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __HUMAN_H__
|
||||
#define __HUMAN_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class human final: public enemy_base {
|
||||
public:
|
@ -1,7 +1,7 @@
|
||||
#include "ironclad_ward.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
ironclad_ward::ironclad_ward(const position &pos):
|
||||
potion{potion_type::IRONCLAD_WARD, DURATION, pos} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __IRONCLAD_WARD_H__
|
||||
#define __IRONCLAD_WARD_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class ironclad_ward final: public potion {
|
||||
inline static const float ATK_MUL = 0.5f;
|
@ -1,8 +1,8 @@
|
||||
#include "leprechaun.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "../player.h"
|
||||
#include "../level.h"
|
||||
#include "constants.h"
|
||||
#include "player.h"
|
||||
#include "level.h"
|
||||
|
||||
leprechaun::leprechaun(RNG *rng, const feature enabled_features,
|
||||
const position &pos,
|
@ -1,7 +1,7 @@
|
||||
#ifndef __LEPRECHAUN_H__
|
||||
#define __LEPRECHAUN_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class leprechaun final: public enemy_base {
|
||||
static const int STEAL_GOLD = 3;
|
10
src/level.cc
10
src/level.cc
@ -41,6 +41,12 @@ level::level(const level_data &lvl, character *player, RNG *rng,
|
||||
if (enabled_features & FEATURE_READ_MAP)
|
||||
fill(lvl, tiles, rng);
|
||||
|
||||
if (enabled_features & FEATURE_READ_MAP &&
|
||||
(lvl.enemies.size() ||
|
||||
lvl.potions.size() ||
|
||||
lvl.gold_piles.size()))
|
||||
return;
|
||||
|
||||
gen_potions(rng, tiles);
|
||||
gen_gold(rng, tiles);
|
||||
gen_enemies(lvl, rng, tiles);
|
||||
@ -109,9 +115,9 @@ bool level::is_in_glist(gold &g, const gold_list &gl) {
|
||||
void level::gen_enemies(const level_data &lvl, RNG *rng,
|
||||
std::vector<position_list> &tiles) {
|
||||
auto dhoard = dragon_hoard(lvl);
|
||||
int cnt = enabled_features & FEATURE_EXTRA_STUFF ?
|
||||
int cnt = (enabled_features & FEATURE_EXTRA_STUFF ?
|
||||
rng->rand_between(MIN_ENEMIE_CNT, MAX_ENEMIE_CNT + 1) :
|
||||
MIN_ENEMIE_CNT + dhoard.size();
|
||||
MIN_ENEMIE_CNT) + dhoard.size();
|
||||
|
||||
elist.reserve(cnt);
|
||||
pelist.reserve(cnt);
|
||||
|
@ -29,9 +29,13 @@ int main(int argc, char **argv) {
|
||||
|
||||
CC3K game_proc(enabled_features, in.get(), out.get(), rng.get(), data);
|
||||
|
||||
while (1)
|
||||
while (true) {
|
||||
if (game_proc.run() == game_status::TERMINATED)
|
||||
break;
|
||||
|
||||
if (enabled_features & FEATURE_IN_FILE)
|
||||
getchar();
|
||||
}
|
||||
|
||||
return RETURN_FINE;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "merchant.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "../gold.h"
|
||||
#include "../level.h"
|
||||
#include "constants.h"
|
||||
#include "gold.h"
|
||||
#include "level.h"
|
||||
|
||||
merchant::merchant(RNG *rng, const feature enabled_features,
|
||||
const position &pos, const int gen_room_num):
|
@ -1,7 +1,7 @@
|
||||
#ifndef __MERCHANT_H__
|
||||
#define __MERCHANT_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class merchant final: public enemy_base {
|
||||
public:
|
@ -1,6 +1,6 @@
|
||||
#include "monk.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
monk::monk(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, MONK} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __MONK_H__
|
||||
#define __MONK_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
|
||||
class monk final: public player_base {
|
||||
static const int GAIN_HP = 2;
|
@ -1,6 +1,6 @@
|
||||
#include "mr_goose.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
mr_goose::mr_goose(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, race::MR_GOOSE} {
|
@ -1,7 +1,7 @@
|
||||
#ifndef __MR_GOOSE_H__
|
||||
#define __MR_GOOSE_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
|
||||
class mr_goose final: public player_base {
|
||||
public:
|
@ -1,6 +1,6 @@
|
||||
#include "orc.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
orc::orc(RNG *rng, const feature enabled_features, const position &pos,
|
||||
const int gen_room_num):
|
@ -1,7 +1,7 @@
|
||||
#ifndef __ORC_H__
|
||||
#define __ORC_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class orc final: public enemy_base {
|
||||
public:
|
20
src/pc.cc
20
src/pc.cc
@ -1,16 +1,16 @@
|
||||
#include "pc.h"
|
||||
|
||||
#include "constants.h"
|
||||
#include "player/goblin.h"
|
||||
#include "player/drow.h"
|
||||
#include "player/shade.h"
|
||||
#include "player/troll.h"
|
||||
#include "player/vampire.h"
|
||||
#include "player/t_800.h"
|
||||
#include "player/assassin.h"
|
||||
#include "player/monk.h"
|
||||
#include "player/brawler.h"
|
||||
#include "player/mr_goose.h"
|
||||
#include "goblin.h"
|
||||
#include "drow.h"
|
||||
#include "shade.h"
|
||||
#include "troll.h"
|
||||
#include "vampire.h"
|
||||
#include "t_800.h"
|
||||
#include "assassin.h"
|
||||
#include "monk.h"
|
||||
#include "brawler.h"
|
||||
#include "mr_goose.h"
|
||||
|
||||
std::unique_ptr<player_base> init_player(RNG *rng,
|
||||
const feature enabled_features, const enum race &r) {
|
||||
|
@ -52,7 +52,7 @@ long_result player_base::apply(std::unique_ptr<potion> p) {
|
||||
"PC gets rusty joints (-50 HP). "};
|
||||
|
||||
return {result::APPLIED,
|
||||
"PC applied potion of " + name + ". "};
|
||||
"PC uses potion of " + name + ". "};
|
||||
}
|
||||
|
||||
long_result player_base::attack(character *ch) {
|
||||
@ -90,9 +90,9 @@ long_result player_base::move(level *lvl,
|
||||
}
|
||||
} else if (lvl->get_up_stairs() == p &&
|
||||
enabled_features & FEATURE_REVISIT) {
|
||||
return {result::GO_UP, "PC went up the stairs. "};
|
||||
return {result::GO_UP, "PC goes up the stairs. "};
|
||||
} else if (lvl->get_down_stairs() == p) {
|
||||
return {result::GO_DOWN, "PC went down the stairs. "};
|
||||
return {result::GO_DOWN, "PC goes down the stairs. "};
|
||||
} else if (lvl->is_available(p, true)) {
|
||||
pos = p;
|
||||
return {result::MOVED, ""};
|
||||
@ -109,7 +109,7 @@ void player_base::pickup_gold(level *lvl, std::string &msg) {
|
||||
gold_tmp += g.get_amount();
|
||||
|
||||
if (gold_tmp)
|
||||
msg += "PC picked up " + std::to_string(gold_tmp) +
|
||||
msg += "PC picks up " + std::to_string(gold_tmp) +
|
||||
" pieces of gold. ";
|
||||
|
||||
bool locked = false;
|
||||
@ -163,7 +163,7 @@ long_result player_base::throw_potion(level *lvl, std::unique_ptr<potion> p,
|
||||
size_t flag = lvl->what_is_at(tmp);
|
||||
|
||||
if (flag & WHAT_WALL)
|
||||
return {THROWN, "The potion shattered against a wall. "};
|
||||
return {THROWN, "The potion shatters against a wall. "};
|
||||
else if (flag & WHAT_ENEMY) {
|
||||
std::string name{p->get_name()};
|
||||
character *ch = lvl->get_elist()[flag ^ WHAT_ENEMY];
|
||||
@ -172,15 +172,15 @@ long_result player_base::throw_potion(level *lvl, std::unique_ptr<potion> p,
|
||||
|
||||
if (ch->get_race() != BABY_DRAGON)
|
||||
return {THROWN, "The potion of " + name +
|
||||
"'s contents spilled on " +
|
||||
"'s contents spills on " +
|
||||
ch->get_abbrev() + ". "};
|
||||
|
||||
return {THROWN, "The potion of " + name +
|
||||
" didn't seem to affect B. "};
|
||||
" doesn't seem to affect B. "};
|
||||
}
|
||||
}
|
||||
|
||||
return {THROWN, "The potion shattered against the floor. "};
|
||||
return {THROWN, "The potion shatters against the floor. "};
|
||||
}
|
||||
|
||||
long_result player_base::interpret_command(level *lvl, game_command cmd) {
|
||||
@ -222,7 +222,7 @@ long_result player_base::interpret_command(level *lvl, game_command cmd) {
|
||||
if (idx != lvl->get_plist().size() &&
|
||||
inv.owns.size() < INV_MAX_CNT) {
|
||||
inv.insert(lvl->detach_potion(idx));
|
||||
res.msg += "PC picked up a potion. ";
|
||||
res.msg += "PC picks up a potion. ";
|
||||
} else if (idx != lvl->get_plist().size()) {
|
||||
res.msg += "PC already has a full knapsack. ";
|
||||
}
|
||||
@ -262,21 +262,21 @@ long_result player_base::interpret_command(level *lvl, game_command cmd) {
|
||||
} else if (cmd == UP_STAIRS) {
|
||||
if (lvl->get_up_stairs() == pos &&
|
||||
enabled_features & FEATURE_REVISIT)
|
||||
return {GO_UP, "PC went up the stairs. "};
|
||||
return {GO_UP, "PC goes up the stairs. "};
|
||||
|
||||
return {result::NOTHING,
|
||||
"PC tried to fly through the ceiling. "};
|
||||
} else if (cmd == DOWN_STAIRS) {
|
||||
if (lvl->get_down_stairs() == pos)
|
||||
return {GO_DOWN, "PC went down the stairs. "};
|
||||
return {GO_DOWN, "PC goes down the stairs. "};
|
||||
|
||||
return {result::NOTHING,
|
||||
"PC tried to dig through the floor. "};
|
||||
} else if (cmd == THE_WORLD) {
|
||||
return {TOGGLE_THE_WORLD, "PC toggled Stand: The World! "};
|
||||
return {TOGGLE_THE_WORLD, "PC toggles Stand: The World! "};
|
||||
} else if (cmd == STAR_PLATINUM) {
|
||||
return {TOGGLE_STAR_PLATINUM,
|
||||
"PC toggled Stand: Star Platinum: The World! "};
|
||||
"PC toggles Stand: Star Platinum: The World! "};
|
||||
} else if (cmd == GAME_RESTART) {
|
||||
return {RESTART_GAME, ""};
|
||||
} else if (cmd == GAME_COMMAND_PASS) {
|
||||
|
125
src/playground.txt
Normal file
125
src/playground.txt
Normal file
@ -0,0 +1,125 @@
|
||||
|-----------------------------------------------------------------------------|
|
||||
| |
|
||||
| |--------------------------| |-----------------------| |
|
||||
| |.......@..................| |.......................| |
|
||||
| |..........................+########+..6789D.....678.9D.....| |
|
||||
| |..012345...012345.........| # |.......................+####### |
|
||||
| |..........................| # |.......................| # |
|
||||
| |----------+---------------| # |----+------------------| # |
|
||||
| # ############# # |
|
||||
| # # |-----+------| |--------+------| |
|
||||
| # # |............| |...............| |
|
||||
| ################### |....\.......+#########+.........M.....| |
|
||||
| # # |............| # |...............| |
|
||||
| # # |-----+------| # |--------+------| |
|
||||
| |---------+-----------| # # # # |
|
||||
| |..........H..........| # # # |----+------| |
|
||||
| |.....................+############################# |...........| |
|
||||
| |---------+-----------| # # |...........| |
|
||||
| # # |------+-| |---------| |...........| |
|
||||
| |---------+-----------| # |........| |...E.....|######|....O......| |
|
||||
| |........W............+##########+..H.....+#+.........+# #+...........| |
|
||||
| |.....................| |........| |.........| |...........| |
|
||||
| |---------------------| |--------| |---------| |-----------| |
|
||||
| |
|
||||
|-----------------------------------------------------------------------------|
|
||||
|-----------------------------------------------------------------------------|
|
||||
| |
|
||||
| |--------------------------| |-----------------------| |
|
||||
| |..........................| |.......................| |
|
||||
| |..........................+########+.......................| |
|
||||
| |..........................| # |......................@+####### |
|
||||
| |..........................| # |.......................| # |
|
||||
| |----------+---------------| # |----+------------------| # |
|
||||
| # ############# # |
|
||||
| # # |-----+------| |--------+------| |
|
||||
| # # |............| |...............| |
|
||||
| ########################+....\.......+#########+...............| |
|
||||
| # # |............| # |...............| |
|
||||
| # # |-----+------| # |--------+------| |
|
||||
| |---------+-----------| # # # # |
|
||||
| |.....................| # # # |----+------| |
|
||||
| |.....................+############################# |...........| |
|
||||
| |---------+-----------| # # |...........| |
|
||||
| # # |------+-| |---------| |...........| |
|
||||
| |---------+-----------| # |........| |.........|######|...........| |
|
||||
| |.....................+##########+........+#+.........+# #+...........| |
|
||||
| |.....................| |........| |.........| |...........| |
|
||||
| |---------------------| |--------| |---------| |-----------| |
|
||||
| |
|
||||
|-----------------------------------------------------------------------------|
|
||||
|-----------------------------------------------------------------------------|
|
||||
| |
|
||||
| |--------------------------| |-----------------------| |
|
||||
| |..........................| |.......................| |
|
||||
| |..........................+########+..6789D.....678.9D.....| |
|
||||
| |..012345...012345.........| # |......................@+####### |
|
||||
| |..........................| # |.......................| # |
|
||||
| |----------+---------------| # |----+------------------| # |
|
||||
| # ############# # |
|
||||
| # # |-----+------| |--------+------| |
|
||||
| # # |............| |...............| |
|
||||
| ########################+....\.......+#########+.........M.....| |
|
||||
| # # |............| # |...............| |
|
||||
| # # |-----+------| # |--------+------| |
|
||||
| |---------+-----------| # # # # |
|
||||
| |..........H..........| # # # |----+------| |
|
||||
| |.....................+############################# |...........| |
|
||||
| |---------+-----------| # # |...........| |
|
||||
| # # |------+-| |---------| |...........| |
|
||||
| |---------+-----------| # |........| |...E.....|######|....O......| |
|
||||
| |........W............+##########+..H.....+#+.........+# #+...........| |
|
||||
| |.....................| |........| |.........| |...........| |
|
||||
| |---------------------| |--------| |---------| |-----------| |
|
||||
| |
|
||||
|-----------------------------------------------------------------------------|
|
||||
|-----------------------------------------------------------------------------|
|
||||
| |
|
||||
| |--------------------------| |-----------------------| |
|
||||
| |..........................| |.......................| |
|
||||
| |..........................+########+..6789D.....678.9D.....| |
|
||||
| |..012345...012345.........| # |......................@+####### |
|
||||
| |..........................| # |.......................| # |
|
||||
| |----------+---------------| # |----+------------------| # |
|
||||
| # ############# # |
|
||||
| # # |-----+------| |--------+------| |
|
||||
| # # |............| |...............| |
|
||||
| ########################+....\.......+#########+.........M.....| |
|
||||
| # # |............| # |...............| |
|
||||
| # # |-----+------| # |--------+------| |
|
||||
| |---------+-----------| # # # # |
|
||||
| |..........H..........| # # # |----+------| |
|
||||
| |.....................+############################# |...........| |
|
||||
| |---------+-----------| # # |...........| |
|
||||
| # # |------+-| |---------| |...........| |
|
||||
| |---------+-----------| # |........| |...E.....|######|....O......| |
|
||||
| |........W............+##########+..H.....+#+.........+# #+...........| |
|
||||
| |.....................| |........| |.........| |...........| |
|
||||
| |---------------------| |--------| |---------| |-----------| |
|
||||
| |
|
||||
|-----------------------------------------------------------------------------|
|
||||
|-----------------------------------------------------------------------------|
|
||||
| |
|
||||
| |--------------------------| |-----------------------| |
|
||||
| |..........................| |.......................| |
|
||||
| |..........................+########+..6789D.....678.9D.....| |
|
||||
| |..012345...012345.........| # |......................@+####### |
|
||||
| |..........................| # |.......................| # |
|
||||
| |----------+---------------| # |----+------------------| # |
|
||||
| # ############# # |
|
||||
| # # |-----+------| |--------+------| |
|
||||
| # # |............| |...............| |
|
||||
| ########################+....\.......+#########+.........M.....| |
|
||||
| # # |............| # |...............| |
|
||||
| # # |-----+------| # |--------+------| |
|
||||
| |---------+-----------| # # # # |
|
||||
| |..........H..........| # # # |----+------| |
|
||||
| |.....................+############################# |...........| |
|
||||
| |---------+-----------| # # |...........| |
|
||||
| # # |------+-| |---------| |...........| |
|
||||
| |---------+-----------| # |........| |...E.....|######|....O......| |
|
||||
| |........W............+##########+..H.....+#+.........+# #+...........| |
|
||||
| |.....................| |........| |.........| |...........| |
|
||||
| |---------------------| |--------| |---------| |-----------| |
|
||||
| |
|
||||
|-----------------------------------------------------------------------------|
|
@ -1,7 +1,7 @@
|
||||
#include "poison_health.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
poison_health::poison_health(const position &pos):
|
||||
potion{potion_type::POISON_HEALTH, 1, pos} {}
|
||||
@ -14,7 +14,7 @@ void poison_health::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||
if (race == DROW)
|
||||
tmp *= DROW_POTION_MUL;
|
||||
|
||||
HP = std::max(HP - tmp, 1);
|
||||
HP = std::max(HP - tmp, 0);
|
||||
--remaining_duration;
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __POISON_HEALTH_H__
|
||||
#define __POISON_HEALTH_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class poison_health final: public potion {
|
||||
static const int LOSE_HEALTH = 10;
|
@ -1,20 +1,20 @@
|
||||
#include "potions.h"
|
||||
|
||||
#include "constants.h"
|
||||
#include "potions/restore_health.h"
|
||||
#include "potions/boost_atk.h"
|
||||
#include "potions/boost_def.h"
|
||||
#include "potions/poison_health.h"
|
||||
#include "potions/wound_atk.h"
|
||||
#include "potions/wound_def.h"
|
||||
#include "potions/continuous_restoration.h"
|
||||
#include "potions/savage_strike.h"
|
||||
#include "potions/echoing_resilience.h"
|
||||
#include "potions/tempest_tantrum.h"
|
||||
#include "potions/bezerk_brew.h"
|
||||
#include "potions/borrow_life.h"
|
||||
#include "potions/fine_booze.h"
|
||||
#include "potions/ironclad_ward.h"
|
||||
#include "restore_health.h"
|
||||
#include "boost_atk.h"
|
||||
#include "boost_def.h"
|
||||
#include "poison_health.h"
|
||||
#include "wound_atk.h"
|
||||
#include "wound_def.h"
|
||||
#include "continuous_restoration.h"
|
||||
#include "savage_strike.h"
|
||||
#include "echoing_resilience.h"
|
||||
#include "tempest_tantrum.h"
|
||||
#include "berzerk_brew.h"
|
||||
#include "borrow_life.h"
|
||||
#include "fine_booze.h"
|
||||
#include "ironclad_ward.h"
|
||||
|
||||
std::unique_ptr<potion> new_potion(potion_type type, const position &pos) {
|
||||
switch (type) {
|
||||
@ -48,8 +48,8 @@ std::unique_ptr<potion> new_potion(potion_type type, const position &pos) {
|
||||
case TEMPEST_TANTRUM:
|
||||
return std::make_unique<tempest_tantrum>(pos);
|
||||
|
||||
case BEZERK_BREW:
|
||||
return std::make_unique<bezerk_brew>(pos);
|
||||
case BERZERK_BREW:
|
||||
return std::make_unique<berzerk_brew>(pos);
|
||||
|
||||
case BORROW_LIFE:
|
||||
return std::make_unique<borrow_life>(pos);
|
||||
|
@ -1,24 +0,0 @@
|
||||
#include "bezerk_brew.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
|
||||
bezerk_brew::bezerk_brew(const position &pos):
|
||||
potion{potion_type::BEZERK_BREW, DURATION, pos} {}
|
||||
|
||||
void bezerk_brew::apply(const enum race &race, int &HP, int &ATK,
|
||||
int &DEF, fraction &base_hit_rate) {
|
||||
if (remaining_duration != 0) {
|
||||
ATK *= ATK_MUL * (race == DROW ? DROW_POTION_MUL : 1);
|
||||
DEF *= DEF_MUL * (race == DROW ? DROW_POTION_MUL : 1);
|
||||
--remaining_duration;
|
||||
}
|
||||
}
|
||||
|
||||
int bezerk_brew::get_priority() const {
|
||||
return CALC_MID;
|
||||
}
|
||||
|
||||
const char *bezerk_brew::get_name() const {
|
||||
return "BB";
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#include "restore_health.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
restore_health::restore_health(const position &pos):
|
||||
potion{potion_type::RESTORE_HEALTH, 1, pos} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __RESTORE_HEALTH_H__
|
||||
#define __RESTORE_HEALTH_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class restore_health final: public potion {
|
||||
static const int GAIN_HEALTH = 10;
|
@ -88,7 +88,7 @@ const char *LOSE_SCREEN =
|
||||
| | | \\. _|_. | . || |\
|
||||
| | || |\
|
||||
| * | * ** * ** |** ** |\
|
||||
| \\))...../.,(//,,..,,\\||(,,.,\\\\,.((// |\
|
||||
| \\))....,(//,,..,,\\||(,,.,\\\\,.((// |\
|
||||
| |\
|
||||
| Loser! |\
|
||||
| |\
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "savage_strike.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
savage_strike::savage_strike(const position &pos):
|
||||
potion{potion_type::SAVAGE_STRIKE, DURATION, pos} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __SAVAGE_STRIKE_H__
|
||||
#define __SAVAGE_STRIKE_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class savage_strike final: public potion {
|
||||
inline static const float ATK_MUL = 1.25f;
|
@ -1,6 +1,6 @@
|
||||
#include "shade.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
shade::shade(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, race::SHADE} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __SHADE_H__
|
||||
#define __SHADE_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
|
||||
class shade final: public player_base {
|
||||
public:
|
@ -1,6 +1,6 @@
|
||||
#include "swordsman.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
swordsman::swordsman(RNG *rng, const feature enabled_features,
|
||||
const position &pos,
|
@ -1,7 +1,7 @@
|
||||
#ifndef __SWORDSMAN_H__
|
||||
#define __SWORDSMAN_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class swordsman final: public enemy_base {
|
||||
public:
|
@ -1,6 +1,6 @@
|
||||
#include "t_800.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
t_800::t_800(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, race::RT_800} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __T_800_H__
|
||||
#define __T_800_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
class potion;
|
||||
|
||||
class t_800 final: public player_base {
|
@ -1,7 +1,7 @@
|
||||
#include "tempest_tantrum.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
tempest_tantrum::tempest_tantrum(const position &pos):
|
||||
potion{potion_type::TEMPEST_TANTRUM, DURATION, pos} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __TEMPEST_TANTRUM_H__
|
||||
#define __TEMPEST_TANTRUM_H__
|
||||
|
||||
#include "../potion.h"
|
||||
#include "potion.h"
|
||||
|
||||
class tempest_tantrum final: public potion {
|
||||
static const int ATK_MUL = 3;
|
@ -1,6 +1,6 @@
|
||||
#include "troll.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
troll::troll(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, TROLL} {}
|
@ -1,7 +1,7 @@
|
||||
#ifndef __TROLL_H__
|
||||
#define __TROLL_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
|
||||
class troll final: public player_base {
|
||||
static const int GAIN_HP = 5;
|
BIN
src/uml-final.pdf
Normal file
BIN
src/uml-final.pdf
Normal file
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
#include "vampire.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
vampire::vampire(RNG *rng, const feature enabled_features):
|
||||
player_base{rng, enabled_features, race::VAMPIRE} {};
|
@ -1,7 +1,7 @@
|
||||
#ifndef __VAMPIRE_H__
|
||||
#define __VAMPIRE_H__
|
||||
|
||||
#include "../player.h"
|
||||
#include "player.h"
|
||||
|
||||
class vampire final: public player_base {
|
||||
static const int GAIN_HP = 5;
|
@ -1,6 +1,6 @@
|
||||
#include "viking.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "constants.h"
|
||||
|
||||
viking::viking(RNG *rng, const feature enabled_features, const position &pos,
|
||||
const int gen_room_num):
|
@ -1,7 +1,7 @@
|
||||
#ifndef __VIKING_H__
|
||||
#define __VIKING_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class viking final: public enemy_base {
|
||||
public:
|
@ -1,30 +0,0 @@
|
||||
t ea ea se se se ne ea ea ea ea ea ea ea no no no no
|
||||
ea ea ea ea ea ea ea ea ea ea ea ea
|
||||
no no no so so no no
|
||||
a no a no a no a no a no a no a no a no
|
||||
so so so no no no no ea ea ea ea
|
||||
no no a se a se a se a se a se a se a se ea so
|
||||
so so so so ea u ne ea ea ea ea ea u ea
|
||||
ea ea ne
|
||||
a so a so a so a so a so a so a so a so a so a so a so a so a so a so a so a so
|
||||
se ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea se ea ea ea ea u ea
|
||||
ne ne sw ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea
|
||||
u sw we we we we we we we so we we we we we
|
||||
a we a we we we we we we
|
||||
a we a we a we a we a we a we a we a we a we ne
|
||||
we we we we we we we we we we we we we we we we we we
|
||||
no no no no no no we we we we we we we we we we we we we we we we
|
||||
so so so
|
||||
no no
|
||||
we u we
|
||||
ea so we we we we we we
|
||||
no no no no no
|
||||
ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea
|
||||
no no no
|
||||
so ea ea u ea ea a ea a ea a ea a ea a ea a ea a ea a ea a ea
|
||||
so ea no
|
||||
ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea
|
||||
no no no no
|
||||
ea ea ea ea ea ea ea ea ea ea ea ea
|
||||
no no no
|
||||
no so so no no we we
|
@ -1,7 +1,7 @@
|
||||
#include "witch.h"
|
||||
|
||||
#include "../constants.h"
|
||||
#include "../player.h"
|
||||
#include "constants.h"
|
||||
#include "player.h"
|
||||
|
||||
witch::witch(RNG *rng, const feature enabled_features, const position &pos,
|
||||
const int gen_room_num):
|
||||
@ -22,7 +22,7 @@ long_result witch::attack(character *ch) {
|
||||
DEFAULT_POTION_TYPE_CNT));
|
||||
auto npotion = new_potion(type, {0, 0});
|
||||
res.msg += std::string("Z's potion of ") +
|
||||
npotion->get_name() + " spilled onto PC. ";
|
||||
npotion->get_name() + " spills onto PC. ";
|
||||
static_cast<player_base *>(ch)->set_potion_known(
|
||||
npotion->get_type());
|
||||
ch->apply_effect(std::move(npotion));
|
@ -1,7 +1,7 @@
|
||||
#ifndef __WITCH_H__
|
||||
#define __WITCH_H__
|
||||
|
||||
#include "../enemy.h"
|
||||
#include "enemy.h"
|
||||
|
||||
class witch final: public enemy_base {
|
||||
inline static const fraction POTION_RATE = {1, 5};
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user