Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*.o
bin/*.broguesave
2 changes: 1 addition & 1 deletion src/brogue/Combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion src/brogue/Globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)}}},
Expand Down
6 changes: 3 additions & 3 deletions src/brogue/Items.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/brogue/Monsters.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/brogue/Sqrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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<<FP_BASE)<<(bitpos >> 1u);
else if(bitpos < 0) /* 0 < val < 1 */
x = (1u<<FP_BASE)<<((unsigned)(-bitpos) << 1u);
Expand Down