From d8c2d31c37f8dd61291ff08389adbd78910150ba Mon Sep 17 00:00:00 2001 From: Michael Shulbaev Date: Thu, 4 Oct 2018 10:47:38 +0700 Subject: [PATCH 1/7] Fix "Bug Report: Rapier of Mutuality": signed-unsigned comparison --- src/brogue/Sqrt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/brogue/Sqrt.c b/src/brogue/Sqrt.c index 2e8f7f7..0f442fa 100755 --- a/src/brogue/Sqrt.c +++ b/src/brogue/Sqrt.c @@ -80,7 +80,7 @@ unsigned fp_sqrt(unsigned val) We use the identity 2^a * 2^a = 2^(2*a) or: sqrt(2^a) = 2^(a/2) */ - if(bitpos > 0u) /* val > 1 */ + if(bitpos > 0) /* val > 1 */ x = (1u<> 1u); else if(bitpos < 0) /* 0 < val < 1 */ x = (1u< Date: Thu, 4 Oct 2018 10:49:50 +0700 Subject: [PATCH 2/7] Add .o and .broguesave to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb80333 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +**/*.o +bin/*.broguesave From 85e9f3293def42a1bdf9c1a19ab396658424d4bd Mon Sep 17 00:00:00 2001 From: Michael Shulbaev Date: Thu, 4 Oct 2018 11:04:43 +0700 Subject: [PATCH 3/7] Monsters loose track of player 3% of time instead of 97% --- src/brogue/Monsters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/brogue/Monsters.c b/src/brogue/Monsters.c index 76dd324..62f2233 100644 --- a/src/brogue/Monsters.c +++ b/src/brogue/Monsters.c @@ -1580,7 +1580,7 @@ boolean awareOfTarget(creature *observer, creature *target) { } else if (observer->creatureState == MONSTER_TRACKING_SCENT) { // already aware of the target, lose track 3% of the time if outside of stealth range. if (perceivedDistance > awareness) { - retval = rand_percent(3); + retval = rand_percent(97); } else { retval = true; } From d5ed12078f322b19d56696e149564ea37c01ca41 Mon Sep 17 00:00:00 2001 From: Michael Shulbaev Date: Tue, 23 Oct 2018 17:42:43 +0700 Subject: [PATCH 4/7] Removing mistaken shift to enable force weapons to damage correctly Created by @flend in https://github.com/flend/web-brogue/commit/7d23012b26eb67bac83082e78ef4a222eb44d89b --- src/brogue/Combat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/brogue/Combat.c b/src/brogue/Combat.c index fbdfa7a..09ed986 100644 --- a/src/brogue/Combat.c +++ b/src/brogue/Combat.c @@ -504,7 +504,7 @@ boolean forceWeaponHit(creature *defender, item *theItem) { zap(oldLoc, newLoc, &theBolt, false); if (!(defender->bookkeepingFlags & MB_IS_DYING) && distanceBetween(oldLoc[0], oldLoc[1], defender->xLoc, defender->yLoc) > 0 - && distanceBetween(oldLoc[0], oldLoc[1], defender->xLoc, defender->yLoc) << FP_BASE < fp_weaponForceDistance(fp_netEnchant(theItem))) { + && distanceBetween(oldLoc[0], oldLoc[1], defender->xLoc, defender->yLoc) < fp_weaponForceDistance(fp_netEnchant(theItem))) { if (pmap[defender->xLoc + newLoc[0] - oldLoc[0]][defender->yLoc + newLoc[1] - oldLoc[1]].flags & (HAS_MONSTER | HAS_PLAYER)) { otherMonster = monsterAtLoc(defender->xLoc + newLoc[0] - oldLoc[0], defender->yLoc + newLoc[1] - oldLoc[1]); From de0eda09205c522df1efe7b72f713e4bbd0a37a5 Mon Sep 17 00:00:00 2001 From: Michael Shulbaev Date: Tue, 23 Oct 2018 17:44:06 +0700 Subject: [PATCH 5/7] Fixing ring of wisdom message by @flend at https://github.com/flend/web-brogue/commit/92cd29ed3d8785631f2766a855f128ba62c43eea --- src/brogue/Items.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/brogue/Items.c b/src/brogue/Items.c index 9213ade..15a4a6c 100644 --- a/src/brogue/Items.c +++ b/src/brogue/Items.c @@ -2462,8 +2462,8 @@ void itemDetails(char *buf, item *theItem) { break; case RING_WISDOM: sprintf(buf2, "\n\nWhen worn, your staffs will recharge at %i%% of their normal rate. (If the ring is enchanted, the rate will increase to %i%% of the normal rate.)", - (int) (100 * fp_ringWisdomMultiplier(enchant) >> FP_BASE), - (int) (100 * fp_ringWisdomMultiplier(enchant + FP_FACTOR) >> FP_BASE)); + (int) (10 * fp_ringWisdomMultiplier(enchant)), + (int) (10 * fp_ringWisdomMultiplier(enchant + FP_FACTOR))); strcat(buf, buf2); break; case RING_REAPING: From 305e900aa0d8b03414667bc0700bec82aeddd74a Mon Sep 17 00:00:00 2001 From: Michael Shulbaev Date: Tue, 23 Oct 2018 17:45:05 +0700 Subject: [PATCH 6/7] Fixing heal percentage on staves of healing by @flend at https://github.com/flend/web-brogue/commit/1fc6b3fe88eb9d46c70cced7330b69f3119b3d50 --- src/brogue/Items.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/brogue/Items.c b/src/brogue/Items.c index 15a4a6c..7f9eabe 100644 --- a/src/brogue/Items.c +++ b/src/brogue/Items.c @@ -2351,7 +2351,7 @@ void itemDetails(char *buf, item *theItem) { fp_staffEntrancementDuration(enchant + FP_FACTOR)); break; case STAFF_HEALING: - if (enchant < 10) { + if (enchant >> FP_BASE < 10) { sprintf(buf2, "This staff will heal its target by %i%% of its maximum health. (If the staff is enchanted, this will increase to %i%%.)", theItem->enchant1 * 10, (theItem->enchant1 + 1) * 10); From c75030099c32fe92432a128a8b92e69a71aa407c Mon Sep 17 00:00:00 2001 From: Michael Shulbaev Date: Fri, 26 Oct 2018 16:29:05 +0700 Subject: [PATCH 7/7] Fix for unidentified staffs in vaults --- src/brogue/Globals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/brogue/Globals.c b/src/brogue/Globals.c index c7a27f2..811e3e7 100644 --- a/src/brogue/Globals.c +++ b/src/brogue/Globals.c @@ -1143,7 +1143,7 @@ const blueprint blueprintCatalog[NUMBER_BLUEPRINTS] = { {{1, 12}, {30, 50}, 30, 6, 0, (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_IMPREGNABLE | BP_REWARD), { {0, CARPET, DUNGEON, {0,0}, 0, 0, -1, 0, 0, 0, 0, (MF_EVERYWHERE)}, {0, 0, 0, {1,1}, 1, 0, 0, 0, 2, 0, 0, (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)}, - {0, ALTAR_CAGE_OPEN,DUNGEON, {1,1}, 1, (WEAPON|ARMOR|WAND|STAFF|RING|CHARM),-1,0,2, 0, (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_PLAYER_AVOIDS), (MF_GENERATE_ITEM | MF_NO_THROWING_WEAPONS | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)}, + {0, ALTAR_CAGE_OPEN,DUNGEON, {1,1}, 1, (WEAPON|ARMOR|WAND|STAFF|RING|CHARM),-1,0,2, 0, (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_MAX_CHARGES_KNOWN | ITEM_PLAYER_AVOIDS), (MF_GENERATE_ITEM | MF_NO_THROWING_WEAPONS | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)}, {0, ALTAR_CAGE_OPEN,DUNGEON, {3,3}, 3, (WEAPON|ARMOR|WAND),-1, 0, 2, 0, (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_PLAYER_AVOIDS), (MF_GENERATE_ITEM | MF_NO_THROWING_WEAPONS | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)}, {0, ALTAR_CAGE_OPEN,DUNGEON, {2,3}, 2, (STAFF|RING|CHARM),-1, 0, 2, 0, (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_MAX_CHARGES_KNOWN | ITEM_PLAYER_AVOIDS), (MF_GENERATE_ITEM | MF_NO_THROWING_WEAPONS | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)}, {0, STATUE_INERT,DUNGEON, {2,3}, 0, 0, -1, 0, 2, 0, 0, (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE)}}},