Skip to content

Commit

Permalink
Restore the new implementation of the backstab weapon special
Browse files Browse the repository at this point in the history
This reverts commit e0ac69c.
  • Loading branch information
CelticMinstrel committed Mar 6, 2016
1 parent d3d63b6 commit c761a80
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion data/core/macros/abilities.cfg
Expand Up @@ -402,8 +402,16 @@ Enemy units cannot see this unit while it is in deep water, except if they have
name= _ "backstab"
description= _ "When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
multiply=2
backstab=yes
active_on=offense
[filter_opponent]
[filter_adjacent]
adjacent=$other_unit.facing
is_enemy=yes
[not]
status=petrified
[/not]
[/filter_adjacent]
[/filter_opponent]
[/damage]
#enddef

Expand Down
4 changes: 4 additions & 0 deletions src/unit_abilities.cpp
Expand Up @@ -1006,6 +1006,10 @@ effect::effect(const unit_ability_list& list, int def, bool backstab) :
const config& cfg = *ability.first;
std::string const &effect_id = cfg[cfg["id"].empty() ? "name" : "id"];

if (!cfg["backstab"].blank()) {
lg::wml_error << "The backstab= key in weapon specials is deprecated; use [filter_adjacent] instead\n";
}

if (!backstab && cfg["backstab"].to_bool())
continue;
if (!filter_base_matches(cfg, def))
Expand Down

0 comments on commit c761a80

Please sign in to comment.