Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
tmewett committed Oct 5, 2023
2 parents ed5dc21 + dfd321e commit e4a15c9
Show file tree
Hide file tree
Showing 40 changed files with 110 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
path: BrogueCE-linux-x86_64.tar.gz

macos:
runs-on: macos-latest
runs-on: macos-11
steps:
- name: "Checkout sources"
uses: actions/checkout@v3
Expand Down
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
1.13
====

Thanks to great work by flend and zenzombie, we now have support for multiple
game variants in CE, and have added Rapid Brogue! Select it in *Play > Change
Variant* in the main menu.

Thanks to other contributors andkem, brturn, nathanf, nstoddard, and omar-polo.

-
Rapid Brogue is now part of Brogue CE!
-
Re-designed the main menu.
-
Lumenstones are worth 500 gold on death, instead of 0.
-
The rapier lunge attack works against invisible enemies when you are
telepathic.
-
Levers are now indestructible via shattering and tunneling, which would leave
some vaults impossible to open.
-
Autoexplore no longer walks through dangerous gases when wearing unidentified
respiration armor.
-
Items falling from the previous level will now trigger any traps they land on.
-
Items and monsters falling from the previous level will no longer fall into
reward rooms.
-
Fixed an issue where unidentified rings could have higher bonuses than they
would have once identified.
-
Fixed an issue where unidentified positive rings would be 1 enchant lower than
they should.
-
Update rapier description to use 'triple damage' instead of 'treble damage'.
-
Added a `-vn` command-line option to play a replay headlessly.
-
Fix the default enchantment value being ignored in wizard mode.
-
Fixed the dungeon version number in the seed catalog.


1.12
====

Expand Down
1 change: 0 additions & 1 deletion changes/dungeon-version-1.11.md

This file was deleted.

2 changes: 0 additions & 2 deletions changes/issue-541.md

This file was deleted.

4 changes: 0 additions & 4 deletions changes/main-menu-rework.md

This file was deleted.

1 change: 0 additions & 1 deletion changes/respiration-autoexplore.md

This file was deleted.

1 change: 0 additions & 1 deletion changes/vn-non-interactive-playback.md

This file was deleted.

1 change: 0 additions & 1 deletion changes/wizard-mode-default-enchant.md

This file was deleted.

4 changes: 2 additions & 2 deletions macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
<string>1.12.0</string>
<string>1.13.0</string>
<key>CFBundleShortVersionString</key>
<string>1.12.0</string>
<string>1.13.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
Expand Down
8 changes: 4 additions & 4 deletions make/releases.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ define make_release_base
endef

# Flatten bin/ in the Windows archive
BrogueCE-windows: bin/brogue.exe
BrogueCE-windows:
$(make_release_base)
cp -r $(common_bin) bin/{brogue.exe,brogue-cmd.bat} $@

BrogueCE-macos: Brogue.app
BrogueCE-macos:
$(make_release_base)
cp -r Brogue.app $@/"Brogue CE.app"

BrogueCE-linux: bin/brogue
BrogueCE-linux:
$(make_release_base)
cp brogue $@
cp -r --parents $(common_bin) bin/brogue $@
Expand All @@ -42,5 +42,5 @@ Brogue.app: bin/brogue
cp -r macos/Brogue.icns bin/assets $@/Contents/Resources

macos/sdl2.rb:
curl -L 'https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/sdl2.rb' >$@
curl -L 'https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/s/sdl2.rb' >$@
patch $@ macos/sdl2-deployment-target.patch
40 changes: 24 additions & 16 deletions src/brogue/Architect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3501,7 +3501,7 @@ void restoreMonster(creature *monst, short **mapToStairs, short **mapToPit) {
pmap[*x][*y].flags &= ~HAS_MONSTER;
}
getQualifyingPathLocNear(x, y, *x, *y, true, T_DIVIDES_LEVEL & avoidedFlagsForMonster(&(monst->info)), 0,
avoidedFlagsForMonster(&(monst->info)), (HAS_MONSTER | HAS_PLAYER | HAS_STAIRS), true);
avoidedFlagsForMonster(&(monst->info)), (HAS_MONSTER | HAS_PLAYER | HAS_STAIRS | IS_IN_MACHINE), true);
}
pmap[*x][*y].flags |= HAS_MONSTER;
monst->bookkeepingFlags &= ~(MB_PREPLACED | MB_APPROACHING_DOWNSTAIRS | MB_APPROACHING_UPSTAIRS | MB_APPROACHING_PIT | MB_ABSORBING);
Expand Down Expand Up @@ -3529,21 +3529,32 @@ void restoreMonster(creature *monst, short **mapToStairs, short **mapToPit) {
}
}

void restoreItem(item *theItem) {
if (theItem->flags & ITEM_PREPLACED) {
theItem->flags &= ~ITEM_PREPLACED;
void restoreItems() {
item *theItem, *nextItem;
pos loc;
item preplaced;
preplaced.nextItem = NULL;

// Remove preplaced items from the floor chain
for (theItem = floorItems->nextItem; theItem != NULL; theItem = nextItem) {
nextItem = theItem->nextItem;

if (theItem->flags & ITEM_PREPLACED) {
theItem->flags &= ~ITEM_PREPLACED;
removeItemFromChain(theItem, floorItems);
addItemToChain(theItem, &preplaced);
}
}

// Place items properly
for (theItem = preplaced.nextItem; theItem != NULL; theItem = nextItem) {
nextItem = theItem->nextItem;

pos loc;
// Items can fall into deep water, enclaved lakes, another chasm, even lava!
getQualifyingLocNear(&loc, theItem->loc, true, 0,
(T_OBSTRUCTS_ITEMS),
(HAS_MONSTER | HAS_ITEM | HAS_STAIRS), false, false);

theItem->loc = loc;
}
pmapAt(theItem->loc)->flags |= HAS_ITEM;
if (theItem->flags & ITEM_MAGIC_DETECTED && itemMagicPolarity(theItem)) {
pmapAt(theItem->loc)->flags |= ITEM_DETECTED;
(HAS_MONSTER | HAS_ITEM | HAS_STAIRS | IS_IN_MACHINE), false, false);
placeItemAt(theItem, loc);
}
}

Expand Down Expand Up @@ -3639,7 +3650,6 @@ void prepareForStairs(short x, short y, char grid[DCOLS][DROWS]) {
void initializeLevel() {
short i, j, dir;
short **mapToStairs, **mapToPit;
item *theItem;
char grid[DCOLS][DROWS];
short n = rogue.depthLevel - 1;

Expand Down Expand Up @@ -3727,9 +3737,7 @@ void initializeLevel() {
}

// Restore items that fell from the previous depth.
for (theItem = floorItems->nextItem; theItem != NULL; theItem = theItem->nextItem) {
restoreItem(theItem);
}
restoreItems();

// Restore creatures that fell from the previous depth or that have been pathing toward the stairs.
mapToStairs = allocGrid();
Expand Down
34 changes: 18 additions & 16 deletions src/brogue/Items.c
Original file line number Diff line number Diff line change
Expand Up @@ -1780,12 +1780,11 @@ short effectiveRingEnchant(item *theItem) {
if (theItem->category != RING) {
return 0;
}
if (!(theItem->flags & ITEM_IDENTIFIED)
&& theItem->enchant1 > 0) {

return theItem->timesEnchanted + 1; // Unidentified positive rings act as +1 until identified.
if (theItem->flags & ITEM_IDENTIFIED) {
return theItem->enchant1;
} else {
return min(theItem->enchant1, theItem->timesEnchanted + 1);
}
return theItem->enchant1;
}

short apparentRingBonus(const enum ringKind kind) {
Expand Down Expand Up @@ -6832,6 +6831,14 @@ void magicMapCell(short x, short y) {
}
}

boolean uncurse( item *theItem ) {
if (theItem->flags & ITEM_CURSED) {
theItem->flags &= ~ITEM_CURSED;
return true;
}
return false;
}

void readScroll(item *theItem) {
short i, j, x, y, numberOfMonsters = 0;
item *tempItem;
Expand Down Expand Up @@ -6876,10 +6883,7 @@ void readScroll(item *theItem) {
break;
case SCROLL_REMOVE_CURSE:
for (tempItem = packItems->nextItem; tempItem != NULL; tempItem = tempItem->nextItem) {
if (tempItem->flags & ITEM_CURSED) {
hadEffect = true;
tempItem->flags &= ~ITEM_CURSED;
}
hadEffect |= uncurse(tempItem);
}
if (hadEffect) {
message("your pack glows with a cleansing light, and a malevolent energy disperses.", 0);
Expand Down Expand Up @@ -6909,6 +6913,8 @@ void readScroll(item *theItem) {
} while (theItem == NULL || !(theItem->category & (WEAPON | ARMOR | RING | STAFF | WAND | CHARM)));
recordKeystroke(theItem->inventoryLetter, false, false);
confirmMessages();

theItem->timesEnchanted += enchantMagnitude();
switch (theItem->category) {
case WEAPON:
theItem->strengthRequired = max(0, theItem->strengthRequired - enchantMagnitude());
Expand Down Expand Up @@ -6948,7 +6954,6 @@ void readScroll(item *theItem) {
default:
break;
}
theItem->timesEnchanted += enchantMagnitude();
if ((theItem->category & (WEAPON | ARMOR | STAFF | RING | CHARM))
&& theItem->enchant1 >= 16) {

Expand All @@ -6960,10 +6965,9 @@ void readScroll(item *theItem) {
itemName(theItem, buf, false, false, NULL);
sprintf(buf2, "your %s gleam%s briefly in the darkness.", buf, (theItem->quantity == 1 ? "s" : ""));
messageWithColor(buf2, &itemMessageColor, 0);
if (theItem->flags & ITEM_CURSED) {
if (uncurse(theItem)) {
sprintf(buf2, "a malevolent force leaves your %s.", buf);
messageWithColor(buf2, &itemMessageColor, 0);
theItem->flags &= ~ITEM_CURSED;
}
createFlare(player.loc.x, player.loc.y, SCROLL_ENCHANTMENT_LIGHT);
break;
Expand All @@ -6977,10 +6981,9 @@ void readScroll(item *theItem) {
itemName(tempItem, buf2, false, false, NULL);
sprintf(buf, "a protective golden light covers your %s.", buf2);
messageWithColor(buf, &itemMessageColor, 0);
if (tempItem->flags & ITEM_CURSED) {
if (uncurse(tempItem)) {
sprintf(buf, "a malevolent force leaves your %s.", buf2);
messageWithColor(buf, &itemMessageColor, 0);
tempItem->flags &= ~ITEM_CURSED;
}
} else {
message("a protective golden light surrounds you, but it quickly disperses.", 0);
Expand All @@ -6994,10 +6997,9 @@ void readScroll(item *theItem) {
itemName(tempItem, buf2, false, false, NULL);
sprintf(buf, "a protective golden light covers your %s.", buf2);
messageWithColor(buf, &itemMessageColor, 0);
if (tempItem->flags & ITEM_CURSED) {
if (uncurse(tempItem)) {
sprintf(buf, "a malevolent force leaves your %s.", buf2);
messageWithColor(buf, &itemMessageColor, 0);
tempItem->flags &= ~ITEM_CURSED;
}
if (rogue.weapon->quiverNumber) {
rogue.weapon->quiverNumber = rand_range(1, 60000);
Expand Down
2 changes: 1 addition & 1 deletion src/brogue/Movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ boolean playerMoves(short direction) {
if (coordinatesAreInMap(newestX, newestY) && (pmap[newestX][newestY].flags & HAS_MONSTER)) {
tempMonst = monsterAtLoc((pos){ newestX, newestY });
if (tempMonst
&& canSeeMonster(tempMonst)
&& (canSeeMonster(tempMonst) || monsterRevealed(tempMonst))
&& monstersAreEnemies(&player, tempMonst)
&& tempMonst->creatureState != MONSTER_ALLY
&& !(tempMonst->bookkeepingFlags & MB_IS_DYING)
Expand Down
4 changes: 2 additions & 2 deletions src/brogue/Rogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

// Brogue version number (for main engine)
#define BROGUE_MAJOR 1
#define BROGUE_MINOR 12
#define BROGUE_MINOR 13
#define BROGUE_PATCH 0

// Expanding a macro as a string constant requires two levels of macros
Expand Down Expand Up @@ -2887,7 +2887,7 @@ extern "C" {
boolean superpriority);
boolean spawnDungeonFeature(short x, short y, dungeonFeature *feat, boolean refreshCell, boolean abortIfBlocking);
void restoreMonster(creature *monst, short **mapToStairs, short **mapToPit);
void restoreItem(item *theItem);
void restoreItems();
void refreshWaypoint(short wpIndex);
void setUpWaypoints();
void zeroOutGrid(char grid[DCOLS][DROWS]);
Expand Down
11 changes: 7 additions & 4 deletions src/brogue/RogueMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,7 @@ void startLevel(short oldLevelNumber, short stairDirection) {

levels[rogue.depthLevel-1].items = NULL;

for (theItem = floorItems->nextItem; theItem != NULL; theItem = theItem->nextItem) {
restoreItem(theItem);
}
restoreItems();

}

Expand Down Expand Up @@ -1089,13 +1087,18 @@ void gameOver(char *killedBy, boolean useCustomPhrasing) {
sprintf(buf, "Killed by a%s %s on depth %i", (isVowelish(killedBy) ? "n" : ""), killedBy,
rogue.depthLevel);
}

// Count gems as 500 gold each
short numGems = numberOfMatchingPackItems(GEM, 0, 0, false);
rogue.gold += 500 * numGems;
theEntry.score = rogue.gold;

if (rogue.easyMode) {
theEntry.score /= 10;
}
strcpy(highScoreText, buf);
if (theEntry.score > 0) {
sprintf(buf2, " with %li gold", theEntry.score);
sprintf(buf2, (numGems > 0) ? " with treasure worth %li gold" : " with %li gold", theEntry.score);
strcat(buf, buf2);
}
if (numberOfMatchingPackItems(AMULET, 0, 0, false) > 0) {
Expand Down
Loading

0 comments on commit e4a15c9

Please sign in to comment.