Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cheats "double up" and "biffer baker" #438

merged 1 commit into from Jul 11, 2019


Copy link

commented Jul 9, 2019

The cheats "double up" and "biffer baker" modify the damage percentages
suffered and inflicted by units of a human player.

They were implemented as distinct difficulty levels, together with the
campaign difficulty levels (Easy, Medium, Hard and Insane). Activating
them changed the game difficulty to DL_TOUGH (with "double up") or
DL_KILLER (with "biffer baker"). This caused several problems:

  • The campaign behavior with the cheats enabled was undefined.
    For example, when starting a new campaign mission setLimits() changed
    unit limits to whichever value they were initialized with because only
    the common campaign difficulty levels had been considered.

  • Setting the difficulty variable of the configuration file to 4 or 5
    could cause games to be started with the cheat applied. Preventing
    them from ending up in the config by accident required safeguards in
    saveConfig() and the dedicated function revertToNonCheatDifficulty().

  • DL_TOUGH and DL_KILLER were stored in savegames.

This PR

  • removes all references to the difficulties DL_TOUGH and DL_KILLER from
    the code and its documentation. The translatable strings "Tough" and
    "Killer" become obsolete.

  • re-implements "double up" and "biffer baker" with two new functions:

    • setDamageModifiers() to override the currently used damage modifiers
    • resetDamageModifiers() to reset them
Fix cheats "double up" and "biffer baker"
* remove difficulty levels DL_TOUGH and DL_KILLER
* fix cheats causing undefined behavior in campaign
* fix loading and saving of difficulty levels
* re-implement cheats so that they change nothing but damage modifiers

Refs ticket:4795
Fixes #438

@KJeff01 KJeff01 added this to the 3.3.0_beta2 milestone Jul 11, 2019

@KJeff01 KJeff01 merged commit 6f24a6c into Warzone2100:master Jul 11, 2019

6 of 8 checks passed

LGTM analysis: JavaScript No code changes detected
LGTM analysis: Python No code changes detected
LGTM analysis: C/C++ No new or fixed alerts
WIP Ready for review
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
freebsd_build FreeBSD:freebsd-11-2-release-amd64 Task Summary
freebsd_build FreeBSD:freebsd-12-0-release-amd64 Task Summary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.