Skip to content

Commit

Permalink
bug: do not use skills when attack misses
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Jul 16, 2023
1 parent b4ac898 commit cede058
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 19 deletions.
Binary file modified data/gfx.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion python/things/monsters/tentacleye.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def tp_init(name, text_long_name):
my.rarity(self, my.RARITY_COMMON) # how rare within this monster class
my.stamina(self, 100)
my.stat_con(self, 10)
my.stat_def(self, 18)
my.stat_def(self, 10)
my.stat_dex(self, 14)
my.stat_int(self, 14)
my.stat_luck(self, 10)
Expand Down
6 changes: 3 additions & 3 deletions src/game_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,16 @@ void Game::place_player(void)
auto w = level->thing_new("spell_dominate_monst1", point(x, y));
t->spell_add(w);
}
if (0) {
level->thing_new("tentacleye", point(x + 1, y + 1));
if (1) {
auto w = level->thing_new("skill_primal_rage1", point(x, y));
t->skill_add(w);
}
if (1) {
auto w = level->thing_new("skill_devoted_thrust1", point(x, y));
t->skill_add(w);
}
if (0) {
if (1) {
auto w = level->thing_new("skill_double_strike1", point(x, y));
t->skill_add(w);
}
Expand Down Expand Up @@ -361,7 +362,6 @@ void Game::place_player(void)
d->wake("");
}
if (0) {
level->thing_new("tentacleye", point(x + 1, y + 1));
level->thing_new("exit1", point(x - 3, y + 2));
level->thing_new("gnome_rock", point(x + 2, y + 1));
level->thing_new("tentacleye", point(x + 1, y + 1));
Expand Down
2 changes: 1 addition & 1 deletion src/thing_hit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ int Thing::ai_hit_actual(Thingp hitter, // an arrow / monst /.
auto iter = level->thing_find(oid);
if (iter && iter->is_activated) {
real_hitter->dmg_current_set(damage);
real_hitter->use(iter);
real_hitter->on_use_skill(iter, this);
damage = real_hitter->dmg_current();
}
}
Expand Down
1 change: 0 additions & 1 deletion src/thing_skillbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ bool Level::skill_chosen(Thingp what)
player->msg("You deactivate %s.", what->text_the().c_str());
}
sound_play("coin");
player->skill_use(what);

return true;
}
Expand Down
13 changes: 0 additions & 13 deletions src/thing_target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,19 +572,6 @@ bool Thing::victim_attack_found_best(int equip, Thingp item, Thingp best, point
if (item->collision_check_and_handle_at(best_hit_at, attack_options)) {
lunge(best_hit_at);
}

FOR_ALL_SKILLS_FOR(this, id)
{
auto iter = level->thing_find(id);
if (iter && iter->is_activated) {
if (best) {
on_use_skill(iter, best);
} else {
on_use_skill(iter);
}
}
}

} else {
dbg2("Target-attack-best: Try to attack with no item");
TRACE_AND_INDENT();
Expand Down

0 comments on commit cede058

Please sign in to comment.