Skip to content

Commit 665caa0

Browse files
committed
add wand of light
1 parent 2452286 commit 665caa0

41 files changed

Lines changed: 347 additions & 168 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

TODO

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ bugs
33

44
todo
55
----
6+
chests need to contain items
67
staff of fire in water damage when fully submerged
78
wands
89

data/gfx.tgz

102 Bytes
Binary file not shown.

src/enum.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
#include "my_thing.hpp"
1212
#include "my_tp.hpp"
1313

14-
ENUM_DEF_C(THING_FLAG_ENUM, ThingFlag)
15-
ENUM_DEF_C(THING_ANIM_ENUM, ThingAnim)
16-
ENUM_DEF_C(THING_DIR_ENUM, ThingDir)
14+
ENUM_DEF_C(THING_FLAG_ENUM, ThingFlagType)
15+
ENUM_DEF_C(THING_ANIM_ENUM, ThingAnimType)
16+
ENUM_DEF_C(THING_DIR_ENUM, ThingDirType)
1717
ENUM_DEF_C(THING_EVENT_ENUM, ThingEventType)
18-
ENUM_DEF_C(THING_ENVIRON_ENUM, ThingEnviron)
19-
ENUM_DEF_C(THING_RARITY_ENUM, ThingRarity)
18+
ENUM_DEF_C(THING_ENVIRON_ENUM, ThingEnvironType)
19+
ENUM_DEF_C(THING_RARITY_ENUM, ThingRarityType)
2020
ENUM_DEF_C(MONST_GROUP_ENUM, ThingMonstGroup)
21-
ENUM_DEF_C(MAP_Z_DEPTH_ENUM, MapZDepth)
22-
ENUM_DEF_C(GAME_STATE_ENUM, GameState)
23-
ENUM_DEF_C(PLAYER_STATE_ENUM, PlayerState)
21+
ENUM_DEF_C(MAP_Z_DEPTH_ENUM, MapZDepthType)
22+
ENUM_DEF_C(GAME_STATE_ENUM, GameStateType)
23+
ENUM_DEF_C(PLAYER_STATE_ENUM, PlayerStateType)
2424
ENUM_DEF_C(MONST_STATE_ENUM, MonstState)
25-
ENUM_DEF_C(BIOME_ENUM, Biome)
25+
ENUM_DEF_C(BIOME_ENUM, BiomeType)
2626
ENUM_DEF_C(LEVEL_TYPE_ENUM, LevelType)

src/game.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class Game
263263
//
264264
// Temporary. Global states
265265
//
266-
GameState state {STATE_INIT};
266+
GameStateType state {STATE_INIT};
267267

268268
//
269269
// Temporary. Dampens mouse clicks
@@ -321,7 +321,7 @@ class Game
321321
void seed_set(const char *seed = nullptr);
322322
void seed_previous_set() const;
323323
void start_playing();
324-
void state_change(GameState state, const std::string &why);
324+
void state_change(GameStateType state, const std::string &why);
325325
void state_reset(const std::string &why);
326326
void tick();
327327

@@ -969,10 +969,10 @@ void Game::destroy_levels()
969969
}
970970
void game_destroy_levels(Gamep g) { g->destroy_levels(); }
971971

972-
static auto game_state_to_string(GameState state) -> std::string
972+
static auto game_state_to_string(GameStateType state) -> std::string
973973
{
974974
TRACE();
975-
return GameState_to_string(state);
975+
return GameStateType_to_string(state);
976976
}
977977

978978
//
@@ -1002,9 +1002,9 @@ void Game::state_reset(const std::string &why)
10021002
}
10031003
void game_state_reset(Gamep g, const char *why) { g->state_reset(why); }
10041004

1005-
auto game_state(Gamep g) -> GameState { return g->state; }
1005+
auto game_state(Gamep g) -> GameStateType { return g->state; }
10061006

1007-
void Game::state_change(GameState new_state, const std::string &why)
1007+
void Game::state_change(GameStateType new_state, const std::string &why)
10081008
{
10091009
auto *g = this;
10101010
if (g->state == new_state) {
@@ -1166,7 +1166,7 @@ void Game::state_change(GameState new_state, const std::string &why)
11661166
//
11671167
state = new_state;
11681168
}
1169-
void game_state_change(Gamep g, GameState new_state, const char *why)
1169+
void game_state_change(Gamep g, GameStateType new_state, const char *why)
11701170
{
11711171
TRACE();
11721172

src/gfx.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,8 +2290,8 @@ static void gfx_init_tiles()
22902290
"staff_fire.1",
22912291
"wand_fire.0",
22922292
"wand_fire.1",
2293-
"",
2294-
"",
2293+
"wand_light.0",
2294+
"wand_light.1",
22952295
"",
22962296
"",
22972297
"",

src/level.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ auto level_get_thing_id_at(Gamep /*g*/, Levelsp /*v*/, Levelp l, const bpoint &p
344344
//
345345
// Additional level flag filters e.g. open doors are not obstacles
346346
//
347-
[[nodiscard]] static auto level_flag_filter(Gamep g, Levelsp v, Levelp l, ThingFlag f, Thingp me, Thingp it) -> bool
347+
[[nodiscard]] static auto level_flag_filter(Gamep g, Levelsp v, Levelp l, ThingFlagType f, Thingp me, Thingp it) -> bool
348348
{
349349
TRACE_DEBUG();
350350

@@ -411,14 +411,14 @@ auto level_get_thing_id_at(Gamep /*g*/, Levelsp /*v*/, Levelp l, const bpoint &p
411411
//
412412
// Additional level flag filters e.g. open doors are not obstacles
413413
//
414-
[[nodiscard]] static auto level_flag_filter_needed(Gamep g, Levelsp v, Levelp l, ThingFlag f, Thingp me) -> bool
414+
[[nodiscard]] static auto level_flag_filter_needed(Gamep g, Levelsp v, Levelp l, ThingFlagType f, Thingp me) -> bool
415415
{
416416
Thingp it = nullptr;
417417

418418
return level_flag_filter(g, v, l, f, me, it);
419419
}
420420

421-
auto level_find_all(Gamep g, Levelsp v, Levelp l, ThingFlag f) -> std::vector< Thingp >
421+
auto level_find_all(Gamep g, Levelsp v, Levelp l, ThingFlagType f) -> std::vector< Thingp >
422422
{
423423
TRACE();
424424

@@ -449,7 +449,7 @@ auto level_find_all(Gamep g, Levelsp v, Levelp l, ThingFlag f) -> std::vector< T
449449
return out;
450450
}
451451

452-
auto level_find_all(Gamep g, Levelsp v, Levelp l, ThingFlag f, bpoint p) -> std::vector< Thingp >
452+
auto level_find_all(Gamep g, Levelsp v, Levelp l, ThingFlagType f, bpoint p) -> std::vector< Thingp >
453453
{
454454
TRACE();
455455

@@ -497,14 +497,14 @@ void level_update_flags(Gamep g, Levelsp v, Levelp l)
497497
}
498498
}
499499

500-
auto level_flag_cached(Gamep /*g*/, Levelsp /*v*/, Levelp l, ThingFlag f, bpoint p) -> bool
500+
auto level_flag_cached(Gamep /*g*/, Levelsp /*v*/, Levelp l, ThingFlagType f, bpoint p) -> bool
501501
{
502502
TRACE_DEBUG();
503503

504504
return l->flag[ p.x ][ p.y ][ f ] != 0;
505505
}
506506

507-
auto level_flag(Gamep g, Levelsp v, Levelp l, ThingFlag f, bpoint p, Thingp me) -> Thingp
507+
auto level_flag(Gamep g, Levelsp v, Levelp l, ThingFlagType f, bpoint p, Thingp me) -> Thingp
508508
{
509509
TRACE_DEBUG();
510510

@@ -533,7 +533,7 @@ auto level_flag(Gamep g, Levelsp v, Levelp l, ThingFlag f, bpoint p, Thingp me)
533533
return nullptr;
534534
}
535535

536-
auto level_flag(Gamep g, Levelsp v, Levelp l, ThingFlag f, Thingp me) -> Thingp
536+
auto level_flag(Gamep g, Levelsp v, Levelp l, ThingFlagType f, Thingp me) -> Thingp
537537
{
538538
TRACE();
539539

@@ -548,7 +548,7 @@ auto level_flag(Gamep g, Levelsp v, Levelp l, ThingFlag f, Thingp me) -> Thingp
548548
//
549549
// Filter to only alive things
550550
//
551-
auto level_alive(Gamep g, Levelsp v, Levelp l, ThingFlag f, bpoint p, Thingp me) -> Thingp
551+
auto level_alive(Gamep g, Levelsp v, Levelp l, ThingFlagType f, bpoint p, Thingp me) -> Thingp
552552
{
553553
TRACE();
554554

@@ -584,7 +584,7 @@ auto level_alive(Gamep g, Levelsp v, Levelp l, ThingFlag f, bpoint p, Thingp me)
584584
return nullptr;
585585
}
586586

587-
auto level_alive(Gamep g, Levelsp v, Levelp l, ThingFlag f, Thingp me) -> Thingp
587+
auto level_alive(Gamep g, Levelsp v, Levelp l, ThingFlagType f, Thingp me) -> Thingp
588588
{
589589
TRACE();
590590

@@ -599,7 +599,7 @@ auto level_alive(Gamep g, Levelsp v, Levelp l, ThingFlag f, Thingp me) -> Thingp
599599
//
600600
// Flag + is open
601601
//
602-
auto level_open(Gamep g, Levelsp v, Levelp l, ThingFlag f, bpoint p, Thingp me) -> Thingp
602+
auto level_open(Gamep g, Levelsp v, Levelp l, ThingFlagType f, bpoint p, Thingp me) -> Thingp
603603
{
604604
TRACE();
605605

@@ -635,7 +635,7 @@ auto level_open(Gamep g, Levelsp v, Levelp l, ThingFlag f, bpoint p, Thingp me)
635635
return nullptr;
636636
}
637637

638-
auto level_open(Gamep g, Levelsp v, Levelp l, ThingFlag f, Thingp me) -> Thingp
638+
auto level_open(Gamep g, Levelsp v, Levelp l, ThingFlagType f, Thingp me) -> Thingp
639639
{
640640
TRACE();
641641

@@ -650,7 +650,7 @@ auto level_open(Gamep g, Levelsp v, Levelp l, ThingFlag f, Thingp me) -> Thingp
650650
//
651651
// Count things
652652
//
653-
auto level_count(Gamep g, Levelsp v, Levelp l, ThingFlag f, bpoint p) -> int
653+
auto level_count(Gamep g, Levelsp v, Levelp l, ThingFlagType f, bpoint p) -> int
654654
{
655655
TRACE();
656656

@@ -690,7 +690,7 @@ auto level_count(Gamep g, Levelsp v, Levelp l, ThingFlag f, bpoint p) -> int
690690
return count;
691691
}
692692

693-
auto level_count(Gamep g, Levelsp v, Levelp l, ThingFlag f, Thingp t) -> int
693+
auto level_count(Gamep g, Levelsp v, Levelp l, ThingFlagType f, Thingp t) -> int
694694
{
695695
TRACE();
696696

src/level_biome.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "my_tp.hpp"
88
#include "my_types.hpp"
99

10-
auto level_to_biome(Gamep /*g*/, Levelsp /*v*/, Levelp l) -> Biome
10+
auto level_to_biome(Gamep /*g*/, Levelsp /*v*/, Levelp l) -> BiomeType
1111
{
1212
TRACE();
1313

src/level_cursor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static auto level_cursor_path_draw_line_attempt(Gamep g, Levelsp v, Levelp l, Th
213213
// Here the cursor is over a hazard. Plot a course that allows travel via other hazards.
214214
//
215215
bool got_one = false;
216-
std::initializer_list< ThingFlag > const init = {is_lava, is_chasm, is_water};
216+
std::initializer_list< ThingFlagType > const init = {is_lava, is_chasm, is_water};
217217

218218
for (auto i : init) {
219219
if (level_flag(g, v, l, i, bpoint(v->cursor_at.x, v->cursor_at.y), player) != nullptr) {

src/level_display.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void level_display_cursor(Gamep g, Levelsp v, Levelp l, FboEnum fbo)
109109
}
110110
}
111111

112-
static void level_display_slot(Gamep g, Levelsp v, Levelp l, const bpoint &p, int slot, MapZDepth depth, FboEnum fbo)
112+
static void level_display_slot(Gamep g, Levelsp v, Levelp l, const bpoint &p, int slot, MapZDepthType depth, FboEnum fbo)
113113
{
114114
TRACE_DEBUG();
115115

src/level_populate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class LevelPopulate
5151
public:
5252
char c = {};
5353
bpoint at {};
54-
Biome biome = {BIOME_DUNGEON};
54+
BiomeType biome = {BIOME_DUNGEON};
5555
Tpp tp_wall = {};
5656
Tpp tp_vault = {};
5757
Tpp tp_border = {};

0 commit comments

Comments
 (0)