Skip to content

Commit

Permalink
feat: make rock summoning cause damage
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Jul 18, 2023
1 parent 2fedb5b commit 1668619
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 22 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- Bugs -->
<!-- ------ -->
<!-- when stuck in rock how to show? -->
<!-- ------ -->
<!-- -->
<!-- Performance -->
Expand Down
Binary file modified data/gfx.tgz
Binary file not shown.
40 changes: 20 additions & 20 deletions python/gfx.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,26 @@ def init_tiles_16x16_main():
"skill_super_health_activated",
############################################################
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
############################################################
"",
"spell_magic_missile",
"spell_magic_missile_activated",
"spell_summon_monst1",
Expand Down Expand Up @@ -858,26 +878,6 @@ def init_tiles_16x16_main():
"",
"",
############################################################
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
############################################################
"ring_is_immune_to_negation",
"ring_is_immune_to_negation_carry.1",
"ring_is_immune_to_negation_carry.2",
Expand Down
2 changes: 1 addition & 1 deletion python/things/dungeon/rock.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def tp_init(
my.text_description_short(self, "Rocky the rock.")
my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL)
my.z_depth(self, my.MAP_DEPTH_OBJ)
my.z_prio(self, my.MAP_Z_PRIO_ALWAYS_BEHIND)
my.z_prio(self, my.MAP_Z_PRIO_ALWAYS_BEHIND) # has to be behind for cloak of stone to show player
# end sort marker

for t in tiles:
Expand Down
5 changes: 5 additions & 0 deletions python/things/spells/spell_summon_rock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

def on_targeted(me, x, y):
my.place_at(me, "random_rock", x, y)
for it in my.level_get_all(me, x, y):
if my.thing_possible_to_attack(me, it):
my.thing_hit(0, me, it)


def tp_init(name, text_long_name, text_short_name):
Expand All @@ -14,6 +17,8 @@ def tp_init(name, text_long_name, text_short_name):
my.is_loggable(self, True)
my.is_spell(self, True)
my.is_target_select(self, True)
my.dmg_chance_d1000_crush(self, 0, 1000)
my.dmg_crush_dice(self, "4d6")
my.is_usable(self, True)
my.on_targeted_do(self, "me.on_targeted()")
my.range_max(self, 7)
Expand Down
4 changes: 4 additions & 0 deletions src/game_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ void Game::place_player(void)
level->thing_new("potion_health", point(x - 2, y));
}

if (0) {
auto w = level->thing_new("spell_summon_rock", point(x, y));
t->spell_add(w);
}
if (0) {
auto w = level->thing_new("spell_dominate_monst1", point(x, y));
t->spell_add(w);
Expand Down
3 changes: 2 additions & 1 deletion src/thing_stuck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ bool Thing::is_stuck_check(void)
}
}

if (level->is_barrel(curr_at.x, curr_at.y)) {
if (level->is_rock(curr_at.x, curr_at.y) || level->is_wall(curr_at.x, curr_at.y)
|| level->is_barrel(curr_at.x, curr_at.y)) {
if (is_flying()) {
//
// ok
Expand Down

0 comments on commit 1668619

Please sign in to comment.