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 reported bug around PHBE and illusionary dragons #182

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions kingdoms/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1062,17 +1062,13 @@ void ARegionList::SetFractalTerrain(ARegionArray *pArr)

void ARegionList::NameRegions(ARegionArray *pArr)
{
int seed = 0;
int grown = 0;
Copy link
Contributor Author

@jt-traub jt-traub May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the variables in this file being removed here are set and incremented but never actually used, so the MacOS X compiler (CLANG) complained about them since it's static analysis code is stronger than the standard GCC code.

Awrite("Naming Regions");
int unnamed = 1;
int toname = 0;
for (int x = 0; x < pArr->x; x++) {
for (int y = 0; y < pArr->y; y++) {
ARegion *r = pArr->GetRegion(x,y);
if (!r) continue;
r->wages = -1;
if (r->type != R_OCEAN) toname++;
// r->wages = AGetName(0, reg);
r->population = 1;
}
Expand Down Expand Up @@ -1115,7 +1111,6 @@ void ARegionList::NameRegions(ARegionArray *pArr)
if (r1->yloc > ymin)
tnamedy[TerrainDefs[r1->type].similar_type] = r1->yloc;
unnamed = 1;
seed++;
}
}
}
Expand Down Expand Up @@ -1157,15 +1152,13 @@ void ARegionList::NameRegions(ARegionArray *pArr)
if (npop > (nw1 / nc1)) npop = nw1 / nc1;
reg->population = (int) npop;
named_a_reg = 1;
grown++;
} else {
reg->wages = name2;
float npop = (nc2 * (nw2 + nc2) / (nc2 + 1 + nn))
+ nn + (nc2 - 1);
if (npop > (nw2 / nc2)) npop = nw2 / nc2;
reg->population = (int) npop;
named_a_reg = 1;
grown++;
}
}
}
Expand Down Expand Up @@ -1699,9 +1692,7 @@ void GeoMap::Generate(int spread, int smoothness)
}
}
int frac = 25;
int count = 0;
while (step > 1) {
count++;
int nextstep = step/2 + step%2;
for (int x = 0; x <= size; x += step) {
for (int y = 0; y <= size; y += step) {
Expand Down
14 changes: 7 additions & 7 deletions skillshows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ AString *ShowSkill::Report(Faction *f) const
"transportation. A mage may summon ";
if (ItemDefs[I_EAGLE].mOut > 0) {
*str += "an average of ";
*str += ItemDefs[I_SKELETON].mOut;
*str += ItemDefs[I_EAGLE].mOut;
*str += " percent times his skill level minus 2 eagles";
}
else
Expand Down Expand Up @@ -1071,9 +1071,9 @@ AString *ShowSkill::Report(Faction *f) const
} else if (level == 3) {
if (ITEM_DISABLED(I_IDRAGON)) break;
*str += "Create Phantasmal Beasts at level 3 allows the "
"mage to summon an illusionary dragon into his "
"inventory. To summon an illusionary dragon, the mage "
"should CAST Create_Phantasmal_Beasts DRAGON. The number of dragons that a "
"mage to summon illusionary dragons into his "
"inventory. To summon illusionary dragons, the mage "
"should CAST Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that a "
"mage may have in his inventory is equal to mage's skill level.";
}
break;
Expand Down Expand Up @@ -1112,9 +1112,9 @@ AString *ShowSkill::Report(Faction *f) const
} else if (level == 3) {
if (ITEM_DISABLED(I_ILICH)) break;
*str += "Create Phantasmal Undead at level 3 allows the mage "
"to summon an illusionary lich into his inventory. To "
"summon an illusionary lich, the mage should CAST "
"Create_Phantasmal_Undead LICH; The number of liches that a "
"to summon illusionary liches into his inventory. To "
"summon illusionary liches, the mage should CAST "
"Create_Phantasmal_Undead LICH <number>; The number of liches that a "
"mage may have in his inventory is equal to mage's skill level.";
}
break;
Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_0/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_1/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_10/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_11/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_12/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_13/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_2/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_3/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_4/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_5/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_6/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
10 changes: 5 additions & 5 deletions snapshot-tests/neworigins_turns/turn_7/report.1
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ bird lore [BIRD] 2: No skill report.

bird lore [BIRD] 3: A mage with Bird Lore 3 can summon eagles to join
him, who will aid him in combat, and provide for flying
transportation. A mage may summon an average of 200 percent times
transportation. A mage may summon an average of 100 percent times
his skill level minus 2 eagles per month, and may control a number
equal to his skill level minus 2, squared, times two. To summon an
eagle, issue the order CAST Bird_Lore EAGLE; the eagles will appear
Expand Down Expand Up @@ -1177,10 +1177,10 @@ create phantasmal beasts [PHBE] 2: Create Phantasmal Beasts at level 2
inventory is equal to mage's skill squared.

create phantasmal beasts [PHBE] 3: Create Phantasmal Beasts at level 3
allows the mage to summon an illusionary dragon into his inventory.
To summon an illusionary dragon, the mage should CAST
Create_Phantasmal_Beasts DRAGON. The number of dragons that a mage
may have in his inventory is equal to mage's skill level.
allows the mage to summon illusionary dragons into his inventory. To
summon illusionary dragons, the mage should CAST
Create_Phantasmal_Beasts DRAGON <number>. The number of dragons that
a mage may have in his inventory is equal to mage's skill level.

create phantasmal beasts [PHBE] 4: No skill report.

Expand Down
Loading
Loading