Skip to content

Commit

Permalink
Another set of old PR cleanups. (#187)
Browse files Browse the repository at this point in the history
* Fix special effect descriptions for no damage case

* Non-damaging special effects were reporting 'doing 1
  damage' in descriptions which was wrong.  This fixes it.
  See PR #129.
* Updated snapshots to reflect the change.

* Show costs for study and maintenance payments.

* This merges the work done in PR #121 to display costs for studying
  and all cases where items or money is borrowed for maintenance.
* Found and fixed a bug where allies covering maintenance would end up
  paying 2x rather than the expected cost.
* Found and fixed all places where 'maintenance' was spelled as
  'maintainence'
* Updated all snapshots to reflect these changes.
  • Loading branch information
jt-traub authored May 6, 2024
1 parent 7571f0c commit 906f132
Show file tree
Hide file tree
Showing 72 changed files with 817 additions and 615 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG_4
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Changes from 4.0.10g -> 4.0.10h
prevented from further moves or attacks. Full healing should mean
no penalties.
-- Fixed a bug in output of rules when dealing with skill-based
maintainence.
maintenance.
-- Fixed a bug dealing with the cost of non-skilled units versus skilled
units when in a maintenance mode which requires skill based upkeep.
Units will now pay the maximum of the skill based upkeep or the normal
Expand Down
2 changes: 1 addition & 1 deletion basic/rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static GameDefs g = {
10, /* MAINTENANCE_COST */
20, /* LEADER_COST */

0, /* MAINTAINENCE_MULTIPLIER */
0, /* MAINTENANCE_MULTIPLIER */
GameDefs::MULT_NONE, /* MULTIPLIER_USE */

33, /* STARVE_PERCENT */
Expand Down
2 changes: 1 addition & 1 deletion fracas/rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static GameDefs g = {
10, /* MAINTENANCE_COST */
20, /* LEADER_COST */

0, /* MAINTAINENCE_MULTIPLIER */
0, /* MAINTENANCE_MULTIPLIER */
GameDefs::MULT_NONE, /* MULTIPLIER_USE */

33, /* STARVE_PERCENT */
Expand Down
138 changes: 69 additions & 69 deletions gamedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4787,10 +4787,10 @@ static SpecialType spd[] = {
{-1, -1, -1, -1},
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts something that is not a spell", "annoying ", ""},
// SPECIAL_FIREBALL
{"fireball", "a fireball",
Expand All @@ -4803,9 +4803,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_ENERGY,2,5,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_ENERGY,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"shoots a Fireball", "killing ", ""},
// SPECIAL_HELLFIRE
{"hellfire", "hellfire",
Expand All @@ -4818,9 +4818,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_ENERGY,2,25,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_ENERGY,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"blasts the enemy with Hellfire", "killing ", ""},
// SPECIAL_CAUSEFEAR
{"fear", "cause fear",
Expand All @@ -4832,7 +4832,7 @@ static SpecialType spd[] = {
{-1, -1, -1, -1},
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_SPIRIT,2,25,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_SPIRIT, "fear", 1},
{{ATTACK_SPIRIT,2,25,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_SPIRIT, "fear", 0},
{-1, 0, 0, 0, 0, NULL, 1},
{-1, 0, 0, 0, 0, NULL, 1},
{-1, 0, 0, 0, 0, NULL, 1}},
Expand All @@ -4849,8 +4849,8 @@ static SpecialType spd[] = {
"a non-shield spell",
{{ATTACK_WEATHER,2,25,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_WEATHER,0,1},
{ATTACK_ENERGY,2,25,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_ENERGY,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"unleashes a mighty lightning strike", "killing ", ""},
// SPECIAL_MINDBLAST
{"mindblast", "a mindblast",
Expand All @@ -4863,9 +4863,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_SPIRIT,2,125,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_SPIRIT,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"blasts the minds of the enemy", "killing ", " troops"},
// SPECIAL_EARTHQUAKE
{"earthquake", "an earthquake",
Expand All @@ -4878,9 +4878,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_WEATHER,2,30,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_WEATHER,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"invokes a mighty Earthquake", "killing ", ""},
// SPECIAL_FORCE_SHIELD
{"force_shield", "a force shield",
Expand All @@ -4892,10 +4892,10 @@ static SpecialType spd[] = {
{ATTACK_RANGED, -1, -1, -1},
{{ATTACK_COMBAT, 1}, {-1, 0}, {-1, 0}, {-1, 0}},
"Force Shield",
{{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts something that is not a spell", "annoying ", ""},
// SPECIAL_ENERGY_SHIELD
{"energy_shield", "an energy shield",
Expand All @@ -4907,10 +4907,10 @@ static SpecialType spd[] = {
{ATTACK_ENERGY, -1, -1, -1},
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"Energy Shield",
{{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts something that is not a spell", "annoying ", ""},
// SPECIAL_SPIRIT_SHIELD
{"shield_spirit", "a spirit shield",
Expand All @@ -4922,10 +4922,10 @@ static SpecialType spd[] = {
{ATTACK_SPIRIT, -1, -1, -1},
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"Spirit Shield",
{{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts something that is not a spell", "annoying ", ""},
// SPECIAL_DISPEL_ILLUSIONS
{"dispel_illusion", "dispel illusion",
Expand All @@ -4938,9 +4938,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{NUM_ATTACK_TYPES,2,50,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_ENERGY,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts Dispel Illusions", "dispelling ", " illusions"},
// SPECIAL_SUMMON_STORM
{"storm", "summon storm",
Expand All @@ -4952,7 +4952,7 @@ static SpecialType spd[] = {
{-1, -1, -1, -1},
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_WEATHER,2,50,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_WEATHER,"storm",1},
{{ATTACK_WEATHER,2,50,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_WEATHER,"storm",0},
{-1, 0, 0, 0, 0, NULL, 1},
{-1, 0, 0, 0, 0, NULL, 1},
{-1, 0, 0, 0, 0, NULL, 1}},
Expand All @@ -4968,9 +4968,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_WEATHER,2,25,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_WEATHER, 0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"summons a wild tornado", "killing ", ""},
// SPECIAL_CLEAR_SKIES
{"clear_skies", "clear skies",
Expand All @@ -4982,10 +4982,10 @@ static SpecialType spd[] = {
{ATTACK_WEATHER, -1, -1, -1},
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"Clear Skies",
{{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts something that is not a spell", "annoying ", ""},
// SPECIAL_BLACK_WIND,
{"black_wind", "a black wind",
Expand All @@ -4998,9 +4998,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_SPIRIT,2,65,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_SPIRIT,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"summons the black wind", "killing ", ""},
// SPECIAL_BANISH_UNDEAD,
{"banish_undead", "banish undead",
Expand All @@ -5013,9 +5013,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{NUM_ATTACK_TYPES,2,25,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_ENERGY,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts Banish Undead", "banishing ", " undead"},
// SPECIAL_BANISH_DEMONS,
{"banish_demon", "banish demons",
Expand All @@ -5028,9 +5028,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{NUM_ATTACK_TYPES,2,25,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_SPIRIT,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts Banish Demons", "banishing ", " demons"},
// SPECIAL_FIREBREATH,
{"firebreath", "fiery breath",
Expand All @@ -5043,9 +5043,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_ENERGY,2,5,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_ENERGY,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"breathes Fire", "killing ", ""},
// SPECIAL_ICEBREATH,
{"icebreath", "icy breath",
Expand All @@ -5058,9 +5058,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_SPIRIT,2,5,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_SPIRIT,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"breathes Ice", "killing ", ""},
// SPECIAL_CAMEL_FEAR
{"spook_horses", "terrify horses",
Expand All @@ -5072,7 +5072,7 @@ static SpecialType spd[] = {
{-1, -1, -1, -1},
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield spell",
{{ATTACK_RIDING,1,0,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_SPIRIT,"spook",1},
{{ATTACK_RIDING,1,0,WeaponType::ALWAYSREADY|WeaponType::RANGED,MAGIC_SPIRIT,"spook",0},
{-1, 0, 0, 0, 0, NULL, 1},
{-1, 0, 0, 0, 0, NULL, 1},
{-1, 0, 0, 0, 0, NULL, 1}},
Expand All @@ -5087,10 +5087,10 @@ static SpecialType spd[] = {
{NUM_ATTACK_TYPES, -1, -1, -1},
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"invulnerability",
{{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts something that is not a spell", "annoying ", ""},
// Actual physical shields
{"physical_shield", "a physical shield",
Expand All @@ -5102,10 +5102,10 @@ static SpecialType spd[] = {
{ATTACK_RANGED, -1, -1, -1},
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"Physical Shield",
{{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"casts something that is not a spell", "annoying ", ""},

// SPECIAL_CATAPULT_STRIKE,
Expand All @@ -5119,9 +5119,9 @@ static SpecialType spd[] = {
{{-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}},
"a non-shield attack",
{{ATTACK_RANGED,1,4,WeaponType::ALWAYSREADY|WeaponType::RANGED,ARMORPIERCING,0,1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1},
{-1, 0, 0, 0, 0, 0, 1}},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0},
{-1, 0, 0, 0, 0, 0, 0}},
"strikes", "killing ", ""},
};

Expand Down
2 changes: 1 addition & 1 deletion genrules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5209,7 +5209,7 @@ int Game::GenRules(const AString &rules, const AString &css, const AString &intr
f << enclose("p", true) << "After that, Stephen Baillie took over the code and maintained it until "
<< "the v5.2.3-v5.2.5 time frame.\n"
<< enclose("p", false);
f << enclose("p", true) << "Artem Trytiak took over the code maintainence at that point and has maintained it "
f << enclose("p", true) << "Artem Trytiak took over the code maintenance at that point and has maintained it "
<< "since along with a number of other contrubutors to the github project.\n"
<< enclose("p", false);
f << enclose("p", true) << "The Atlantis source code is now hosted on github at the "
Expand Down
2 changes: 1 addition & 1 deletion havilah/rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static GameDefs g = {
10, /* MAINTENANCE_COST */
20, /* LEADER_COST */

0, /* MAINTAINENCE_MULTIPLIER */
0, /* MAINTENANCE_MULTIPLIER */
GameDefs::MULT_NONE, /* MULTIPLIER_USE */

33, /* STARVE_PERCENT */
Expand Down
2 changes: 1 addition & 1 deletion kingdoms/rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static GameDefs g = {
10, /* MAINTENANCE_COST */
20, /* LEADER_COST */

0, /* MAINTAINENCE_MULTIPLIER */
0, /* MAINTENANCE_MULTIPLIER */
GameDefs::MULT_NONE, /* MULTIPLIER_USE */

33, /* STARVE_PERCENT */
Expand Down
4 changes: 2 additions & 2 deletions monthorders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ void Game::Run1BuildOrder(ARegion *r, Object *obj, Unit *u)
string job;
if (needed < 1) {
// This looks wrong, but isn't.
// If a building has a maxMaintainence of 75 and the road is at
// If a building has a maxMaintenance of 75 and the road is at
// -70 (ie, 5 from max) then we want the value of maintMax to be
// 5 here. Then we divide by maintFactor (some things are easier
// to refix than others) to get how many items we need to fix it.
Expand Down Expand Up @@ -1564,7 +1564,7 @@ void Game::Do1StudyOrder(Unit *u,Object *obj)
if (taughtdays) {
str += " and was taught for " + to_string(taughtdays) + " days";
}
str += ".";
str += " at a cost of " + ItemString(I_SILVER, cost) + ".";
u->event(str, "study");
// study to level order
if (o->level != -1) {
Expand Down
2 changes: 1 addition & 1 deletion neworigins/rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static GameDefs g = {
10, /* MAINTENANCE_COST */
50, /* LEADER_COST */

0, /* MAINTAINENCE_MULTIPLIER */
0, /* MAINTENANCE_MULTIPLIER */
GameDefs::MULT_NONE, /* MULTIPLIER_USE */

33, /* STARVE_PERCENT */
Expand Down
2 changes: 1 addition & 1 deletion object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void Object::build_json_report(json& j, Faction *fac, int obs, int truesight,
if (incomplete > (0 - ob.maxMonthlyDecay)) {
container["decaying"] = true;
} else if (incomplete > (0 - ob.maxMaintenance/2)) {
container["needs_maintainence"] = true;
container["needs_maintenance"] = true;
}
}
}
Expand Down
Loading

0 comments on commit 906f132

Please sign in to comment.