A new way to make units invulnerable for debugging
With debug features enabled (the --debug command line switch), select the unit and type ";unit invulnerable=yes". This method operates by reducing the opponent's hit chance to zero. As a result, it doesn't slow down damage calculation unlike the "increase HP to ridiculous levels" method.
This commit is contained in:
parent
8838486591
commit
dae453fe43
3 changed files with 14 additions and 0 deletions
|
@ -82,6 +82,10 @@ Version 1.13.5+dev:
|
|||
(extremely high HP, drain, slow, berserk, etc.) it's significantly faster than the
|
||||
default damage calculation method.
|
||||
* Miscellaneous and bug fixes:
|
||||
* A new way to make units invulnerable for debugging: select the unit and type
|
||||
";unit invulnerable=yes". This method operates by decreasing the opponent's hit
|
||||
chance to zero: as a result, it doesn't slow down damage prediction unlike the
|
||||
"increase HP to ridiculous levels" method.
|
||||
* Fixed a stray ; character appearing pre-entered in the command console.
|
||||
* Fixed bug in wesnothd that was causing server crashes if game with
|
||||
multiple network and local players was ran.
|
||||
|
|
|
@ -156,6 +156,11 @@ battle_context_unit_stats::battle_context_unit_stats(const unit &u,
|
|||
unit_abilities::effect cth_effects(cth_specials, chance_to_hit, backstab_pos);
|
||||
chance_to_hit = cth_effects.get_composite_value();
|
||||
|
||||
if (opp.get_state("invulnerable"))
|
||||
{
|
||||
chance_to_hit = 0;
|
||||
}
|
||||
|
||||
// Compute base damage done with the weapon.
|
||||
int base_damage = weapon->modified_damage(backstab_pos);
|
||||
|
||||
|
|
|
@ -564,6 +564,11 @@ unit::unit(const config &cfg, bool use_traits, const vconfig* vcfg)
|
|||
hit_points_ = max_hit_points_;
|
||||
}
|
||||
|
||||
if (cfg["invulnerable"].to_bool(false) == true)
|
||||
{
|
||||
set_state("invulnerable", true);
|
||||
}
|
||||
|
||||
goto_.x = cfg["goto_x"].to_int() - 1;
|
||||
goto_.y = cfg["goto_y"].to_int() - 1;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue