Skip to content

Commit 8781017

Browse files
committed
sharedXP and removeCripplingEffects
1 parent ce494fc commit 8781017

4 files changed

Lines changed: 24 additions & 4 deletions

File tree

Source/monster.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ void MonsterAttackPlayer(Monster &monster, Player &player, int hit, int minDam,
11521152
}
11531153
return;
11541154
}
1155-
if (monster.type().type == MT_YZOMBIE && &player == MyPlayer) {
1155+
if (monster.type().type == MT_YZOMBIE && &player == MyPlayer && !*GetOptions().Gameplay.removeCripplingEffects) {
11561156
if (player._pMaxHP > 64) {
11571157
if (player._pMaxHPBase > 64) {
11581158
player._pMaxHP -= 64;
@@ -4792,6 +4792,13 @@ bool Monster::isPossibleToHit() const
47924792
void Monster::tag(const Player &tagger)
47934793
{
47944794
whoHit |= 1 << tagger.getId();
4795+
if (*GetOptions().Gameplay.sharedXP) {
4796+
for (const auto &player : Players) {
4797+
if (player.plractive && player.plrlevel == tagger.plrlevel) {
4798+
whoHit |= 1 << player.getId();
4799+
}
4800+
}
4801+
}
47954802
}
47964803

47974804
bool Monster::tryLiftGargoyle()

Source/objects.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3193,6 +3193,8 @@ int FindValidShrine()
31933193
continue;
31943194
if (!gbIsMultiplayer && shrineavail[rv] == ShrineTypeMulti)
31953195
continue;
3196+
if (rv == IsAnyOf(ShrineFascinating, ShrineOrnate, ShrineSacred, ShrineMurphys, ShrineTainted) && *GetOptions().Gameplay.removeCripplingEffects)
3197+
continue;
31963198
return rv;
31973199
}
31983200
}
@@ -3623,13 +3625,16 @@ bool Object::IsDisabled() const
36233625
if (!*GetOptions().Gameplay.disableCripplingShrines) {
36243626
return false;
36253627
}
3628+
// if gameplay option for Shrines
36263629
if (IsAnyOf(_otype, _object_id::OBJ_GOATSHRINE, _object_id::OBJ_CAULDRON)) {
36273630
return true;
36283631
}
36293632
if (!IsShrine()) {
36303633
return false;
36313634
}
3632-
return IsAnyOf(static_cast<shrine_type>(_oVar1), shrine_type::ShrineFascinating, shrine_type::ShrineOrnate, shrine_type::ShrineSacred, shrine_type::ShrineMurphys);
3635+
if (!*GetOptions().Gameplay.removeCripplingEffects) {
3636+
return IsAnyOf(static_cast<shrine_type>(_oVar1), shrine_type::ShrineFascinating, shrine_type::ShrineOrnate, shrine_type::ShrineSacred, shrine_type::ShrineMurphys);
3637+
}
36333638
}
36343639

36353640
Object *FindObjectAtPosition(Point position, bool considerLargeObjects)

Source/options.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,7 @@ GameplayOptions::GameplayOptions()
779779
, testBard("Test Bard", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::OnlyHellfire, N_("Test Bard"), N_("Force the Bard character type to appear in the hero selection menu."), false)
780780
, testBarbarian("Test Barbarian", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::OnlyHellfire, N_("Test Barbarian"), N_("Force the Barbarian character type to appear in the hero selection menu."), false)
781781
, experienceBar("Experience Bar", OptionEntryFlags::None, N_("Experience Bar"), N_("Experience Bar is added to the UI at the bottom of the screen."), false)
782+
, sharedXP("Shared Experience in Multiplayer", OptionEntryFlags::CantChangeInMultiPlayer, N_("Shared Experience in Multiplayer"), N_("Experience is always shared between all players active on the floor a monster is killed."), true)
782783
, showItemGraphicsInStores("Show Item Graphics in Stores", OptionEntryFlags::None, N_("Show Item Graphics in Stores"), N_("Show item graphics to the left of item descriptions in store menus."), false)
783784
, showHealthValues("Show health values", OptionEntryFlags::None, N_("Show health values"), N_("Displays current / max health value on health globe."), false)
784785
, showManaValues("Show mana values", OptionEntryFlags::None, N_("Show mana values"), N_("Displays current / max mana value on mana globe."), false)
@@ -795,9 +796,10 @@ GameplayOptions::GameplayOptions()
795796
, autoEquipJewelry("Auto Equip Jewelry", OptionEntryFlags::None, N_("Auto Equip Jewelry"), N_("Jewelry will be automatically equipped on pickup or purchase if enabled."), false)
796797
, randomizeQuests("Randomize Quests", OptionEntryFlags::CantChangeInGame, N_("Randomize Quests"), N_("Randomly selecting available quests for new games."), true)
797798
, showMonsterType("Show Monster Type", OptionEntryFlags::None, N_("Show Monster Type"), N_("Hovering over a monster will display the type of monster in the description box in the UI."), false)
798-
, showItemLabels("Show Item Labels", OptionEntryFlags::None, N_("Show Item Labels"), N_("Show labels for items on the ground when enabled."), false)
799-
, disableSearch("Disable Search Spell", OptionEntryFlags::CantChangeInMultiPlayer, N_("Disable Search Spell"), N_("Search spell will not appear on Scrolls, Books, or Staves generated by monsters you kill or objects and vendors you interact with. Set Monk class skill to Infravision. Search effect always enabled when using the map."), false)
799+
, showItemLabels("Show Item Labels", OptionEntryFlags::None, N_("Show Item Labels"), N_("Show labels for items on the ground when enabled."), true)
800+
, disableSearch("Disable Search Spell", OptionEntryFlags::CantChangeInMultiPlayer, N_("Disable Search Spell"), N_("Search spell will not appear on Scrolls, Books, or Staves generated by monsters you kill or objects and vendors you interact with. Set Monk class skill to Infravision. Search effect always enabled when using the map."), true)
800801
, autoRefillBelt("Auto Refill Belt", OptionEntryFlags::None, N_("Auto Refill Belt"), N_("Refill belt from inventory when belt item is consumed."), false)
802+
, removeCripplingEffects("Remove Crippling Effects", OptionEntryFlags::CantChangeInMultiPlayer, N_("Remove Crippling Effects"), N_("Fascinating, Ornate, Sacred, Murphy's and Tainted will not spawn and will not be selected for Cauldrons and Goat Shrines. Black Deaths will not reduce max life."), true)
801803
, disableCripplingShrines("Disable Crippling Shrines", OptionEntryFlags::None, N_("Disable Crippling Shrines"), N_("When enabled Cauldrons, Fascinating Shrines, Goat Shrines, Ornate Shrines, Sacred Shrines and Murphy's Shrines are not able to be clicked on and labeled as disabled."), false)
802804
, quickCast("Quick Cast", OptionEntryFlags::None, N_("Quick Cast"), N_("Spell hotkeys instantly cast the spell, rather than switching the readied spell."), false)
803805
, numHealPotionPickup("Heal Potion Pickup", OptionEntryFlags::None, N_("Heal Potion Pickup"), N_("Number of Healing potions to pick up automatically."), 0, { 0, 1, 2, 4, 8, 16 })
@@ -830,6 +832,7 @@ std::vector<OptionEntryBase *> GameplayOptions::GetEntries()
830832
&testBard,
831833
&testBarbarian,
832834
&experienceBar,
835+
&sharedXP,
833836
&showItemGraphicsInStores,
834837
&showHealthValues,
835838
&showManaValues,
@@ -854,6 +857,7 @@ std::vector<OptionEntryBase *> GameplayOptions::GetEntries()
854857
&numRejuPotionPickup,
855858
&numFullRejuPotionPickup,
856859
&autoPickupInTown,
860+
&removeCripplingEffects,
857861
&disableCripplingShrines,
858862
&adriaRefillsMana,
859863
&grabInput,

Source/options.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,12 @@ struct GameplayOptions : OptionCategoryBase {
610610
OptionEntryBoolean showItemLabels;
611611
/** @brief Search spell will not appear on Scrolls, Books, or Staves generated by monsters you kill or objects and vendors you interact with. Set Monk class skill to Infravision. */
612612
OptionEntryBoolean disableSearch;
613+
/** @brief Experience is always shared between all players active on the floor a monster is killed. */
614+
OptionEntryBoolean sharedXP;
613615
/** @brief Refill belt from inventory, or rather, use potions/scrolls from inventory first when belt item is consumed. */
614616
OptionEntryBoolean autoRefillBelt;
617+
/** @brief Fascinating, Ornate, Sacred, Murphy's and Tainted will not spawn and will not be selected for Cauldrons and Goat Shrines. Black Deaths will not reduce max life. */
618+
OptionEntryBoolean removeCripplingEffects;
615619
/** @brief Locally disable clicking on shrines which permanently cripple character. */
616620
OptionEntryBoolean disableCripplingShrines;
617621
/** @brief Spell hotkeys instantly cast the spell. */

0 commit comments

Comments
 (0)