Skip to content

Commit

Permalink
feat: orbs of mayhem (nicolae)
Browse files Browse the repository at this point in the history
The mayhem ego for orbs causes monsters who see the wielder kill
something to go frenzy. It only hits one monster per kill with a
coinflip for now. This could be adjusted up or down based on power, but
we definitely don't want to give out free Discord casts for a single kill.
  • Loading branch information
ebering committed Dec 27, 2021
1 parent acce00e commit ecb9636
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crawl-ref/source/describe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,8 @@ static const char* _item_ego_desc(special_armour_type ego)
return "it lights the dungeon around the wearer.";
case SPARM_RAGE:
return "it berserks the wearer when making melee attacks (20% chance).";
case SPARM_MAYHEM:
return "it causes witnesses of the wearer's kills to go into a frenzy.";
default:
return "it makes the wearer crave the taste of eggplant.";
}
Expand Down
2 changes: 2 additions & 0 deletions crawl-ref/source/item-name.cc
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ const char* armour_ego_name(const item_def& item, bool terse)
case SPARM_INFUSION: return "infusion";
case SPARM_LIGHT: return "light";
case SPARM_RAGE: return "wrath";
case SPARM_MAYHEM: return "mayhem";
default: return "bugginess";
}
}
Expand Down Expand Up @@ -613,6 +614,7 @@ const char* armour_ego_name(const item_def& item, bool terse)
case SPARM_INFUSION: return "infuse";
case SPARM_LIGHT: return "light";
case SPARM_RAGE: return "*Rage";
case SPARM_MAYHEM: return "mayhem";
default: return "buggy";
}
}
Expand Down
2 changes: 2 additions & 0 deletions crawl-ref/source/item-prop-enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ enum special_armour_type
SPARM_RAMPAGING,
SPARM_INFUSION,
SPARM_LIGHT,
SPARM_RAGE,
SPARM_MAYHEM,
NUM_REAL_SPECIAL_ARMOURS,
NUM_SPECIAL_ARMOURS,
};
Expand Down
4 changes: 3 additions & 1 deletion crawl-ref/source/makeitem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ static special_armour_type _generate_armour_type_ego(armour_type type)
case ARM_ORB:
return random_choose_weighted(1, SPARM_PONDEROUSNESS,
1, SPARM_LIGHT,
1, SPARM_RAGE);
1, SPARM_RAGE,
1, SPARM_MAYHEM);

case ARM_SCARF:
return random_choose_weighted(1, SPARM_RESISTANCE,
Expand Down Expand Up @@ -984,6 +985,7 @@ bool is_armour_brand_ok(int type, int brand, bool strict)

case SPARM_LIGHT:
case SPARM_RAGE:
case SPARM_MAYHEM:
return type == ARM_ORB;

case NUM_SPECIAL_ARMOURS:
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/mapdef.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4948,6 +4948,7 @@ int str_to_ego(object_class_type item_type, string ego_str)
"infusion",
"light",
"wrath",
"mayhem",
nullptr
};
COMPILE_CHECK(ARRAYSZ(armour_egos) == NUM_REAL_SPECIAL_ARMOURS);
Expand Down
20 changes: 20 additions & 0 deletions crawl-ref/source/mon-death.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,17 @@ static void _druid_final_boon(const monster* mons)
}
}

static void _orb_of_mayhem(actor& maniac, const monster& victim)
{
vector<monster *> witnesses;
for (monster_near_iterator mi(&victim, LOS_NO_TRANS); mi; ++mi)
if (mi->can_see(maniac) && mi->can_go_frenzy())
witnesses.push_back(*mi);

if (coinflip() && !witnesses.empty())
(*random_iterator(witnesses))->go_frenzy(&maniac);
}

static bool _mons_reaped(actor &killer, monster& victim)
{
beh_type beh;
Expand Down Expand Up @@ -2005,6 +2016,13 @@ item_def* monster_die(monster& mons, killer_type killer,
{
bless_follower();
}

if (gives_player_xp
&& !mons_is_object(mons.type)
&& you.wearing_ego(EQ_ALL_ARMOUR, SPARM_MAYHEM))
{
_orb_of_mayhem(you, mons);
}
break;
}

Expand Down Expand Up @@ -2045,6 +2063,8 @@ item_def* monster_die(monster& mons, killer_type killer,
{
// Randomly bless the follower who killed.
bless_follower(killer_mon);
if (killer_mon->wearing_ego(EQ_ALL_ARMOUR, SPARM_MAYHEM))
_orb_of_mayhem(*killer_mon, mons);
}
break;
}
Expand Down
3 changes: 2 additions & 1 deletion crawl-ref/source/rltiles/dc-item.txt
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@ i-shadows BRAND_ARM_SHADOWS
i-lunging BRAND_ARM_LUNGING
i-infusion BRAND_ARM_INFUSION
i-light BRAND_ARM_LIGHT
i-rage BRAND_ARM_RAGE BRAND_ARM_LAST
i-rage BRAND_ARM_RAGE
i-mayhem BRAND_ARM_MAYHEM BRAND_ARM_LAST
%rim 1

###########OBJ_WANDS
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions crawl-ref/source/shopping.cc
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ unsigned int item_value(item_def item, bool ident)
case SPARM_SPIRIT_SHIELD:
case SPARM_HARM:
case SPARM_RAGE:
case SPARM_MAYHEM:
valued += 20;
break;

Expand Down

0 comments on commit ecb9636

Please sign in to comment.