Skip to content

Commit

Permalink
Merge branch 'feature/bullet_brogue_11' into tracking/bullet-brogue-v110
Browse files Browse the repository at this point in the history
  • Loading branch information
flend committed Aug 30, 2024
2 parents 37afc05 + 37c4243 commit a246582
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/brogue/Architect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ boolean buildAMachine(enum machineTypes bp,
while ((theItem->flags & ITEM_CURSED)
|| ((feature->flags & MF_REQUIRE_GOOD_RUNIC) && (!(theItem->flags & ITEM_RUNIC))) // runic if requested
|| ((feature->flags & MF_NO_THROWING_WEAPONS) && theItem->category == WEAPON && theItem->quantity > 1) // no throwing weapons if prohibited
|| ((feature->flags & MF_REQUIRE_HEAVY_WEAPON) && !itemIsHeavyWeapon(theItem)) // must be a heavy weapon
|| ((feature->flags & MF_REQUIRE_HEAVY_WEAPON) && (!itemIsHeavyWeapon(theItem) || !itemIsPositivelyEnchanted(theItem))) // must be a positively enchanted heavy weapon
|| itemIsADuplicate(theItem, p->spawnedItems, itemCount)) { // don't want to duplicates of rings, staffs, etc.
deleteItem(theItem);
theItem = generateItem(feature->itemCategory, feature->itemKind);
Expand Down
6 changes: 5 additions & 1 deletion src/brogue/Items.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@ static boolean itemIsThrowingWeapon(const item *theItem) {

boolean itemIsHeavyWeapon(const item *theItem) {
if (theItem && theItem->category == WEAPON && !itemIsThrowingWeapon(theItem)
&& weaponTable[theItem->kind].strengthRequired >= 15) {
&& weaponTable[theItem->kind].strengthRequired > 15) {
return true;
}
return false;
}

boolean itemIsPositivelyEnchanted(const item *theItem) {
return theItem->enchant1 > 0;
}

// Sets an item to the given type and category (or chooses randomly if -1) with all other stats
item *makeItemInto(item *theItem, unsigned long itemCategory, short itemKind) {
const itemTable *theEntry = NULL;
Expand Down
1 change: 1 addition & 0 deletions src/brogue/Rogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -3316,6 +3316,7 @@ extern "C" {
short chooseKind(const itemTable *theTable, short numKinds);
item *makeItemInto(item *theItem, unsigned long itemCategory, short itemKind);
boolean itemIsHeavyWeapon(const item *theItem);
boolean itemIsPositivelyEnchanted(const item *theItem);
void updateEncumbrance(void);
short displayedArmorValue(void);
short armorValueIfUnenchanted(item *theItem);
Expand Down
Loading

0 comments on commit a246582

Please sign in to comment.