diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb80333 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +**/*.o +bin/*.broguesave 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]); 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)}}}, diff --git a/src/brogue/Items.c b/src/brogue/Items.c index 9213ade..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); @@ -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: 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; } 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<