Skip to content

Commit

Permalink
Added vital striking, added dazzling display
Browse files Browse the repository at this point in the history
  • Loading branch information
biscuitWizard committed Jan 31, 2023
1 parent bfa763b commit 9e7d4b3
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 5 deletions.
2 changes: 2 additions & 0 deletions act.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ ACMD_DECL(do_dragonborn_breath_weapon);
ACMDCHECK(can_dragonborn_breath_weapon);
ACMD_DECL(do_tabaxi_claw_attack);
ACMDCHECK(can_tabaxi_claw_attack);
ACMDCHECK(do_dazzling_display);
ACMDCHECK(can_dazzling_display);
ACMD_DECL(do_blast);
ACMDCHECK(can_eldritch_blast);
ACMD_DECL(do_stones_endurance);
Expand Down
54 changes: 54 additions & 0 deletions act.offensive.c
Original file line number Diff line number Diff line change
Expand Up @@ -3647,6 +3647,60 @@ ACMD(do_blast)
}
}

ACMDCHECK(can_dazzling_display)
{
ACMDCHECK_PREREQ_HAS_FEAT(FEAT_DAZZLING_DISPLAY, "You have no idea how.\r\n");
return CAN_CMD;
}

ACMD(do_dazzling_display)
{
PREREQ_NOT_NPC();
PREREQ_CHECK(can_dazzling_display);

if (!FIGHTING(ch))
{
send_to_char(ch, "You can only use this ability in combat.\r\n");
return;
}

if (!is_action_available(ch, atSTANDARD, TRUE))
{
return;
}

act ("You make an intimidating display of force with your dazzling display of weapons.", false, ch, 0, ch, TO_CHAR);
struct char_data *tch = NULL, *next_tch = NULL;
const int skill_lvl = compute_ability(ch, ABILITY_INTIMIDATE);
const int challenge = 10 + skill_lvl;
for (tch = world[IN_ROOM(ch)].people; tch; tch = next_tch)
{
next_tch = tch->next_in_room;
if (AFF_FLAGGED(ch, AFF_DAZZLED))
continue;
if (!aoeOK(ch, tch, ABILITY_DAZZLING_DISPLAY))
continue;
if (is_immune_mind_affecting(ch, tch, 0))
continue;
int roll = savingthrow(tch, SAVING_WILL, 0) + d20(tch) + GET_LEVEL(tch);
if (roll > challenge)
continue;
struct affected_type af;
new_affect(&af);
af.spell = ABILITY_DAZZLING_DISPLAY;
af.location = APPLY_SPECIAL;
af.modifier = 0;
af.duration = 1 + ((challenge - roll) / 5);
SET_BIT_AR(af.bitvector, AFF_DAZZLED);
affect_to_char(ch, &af);
act("You are dazzled by $n's fearsome weapon display.", false, ch, 0, tch, TO_VICT);
act("$N is dazzled by your fearsome weapon display.", false, ch, 0, tch, TO_CHAR);
act("$N is dazzled by $n's fearsome weapon display.", false, ch, 0, tch, TO_NOTVICT);
}

USE_FULL_ROUND_ACTION(ch);
}

ACMDCHECK(can_tabaxi_claw_attack)
{
ACMDCHECK_PREREQ_HASFEAT(FEAT_TABAXI_CATS_CLAWS, "You have no idea how.\r\n");
Expand Down
12 changes: 12 additions & 0 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -4388,6 +4388,10 @@ void load_class_list(void)
feat_assignment(CLASS_WARRIOR, FEAT_EXOTIC_WEAPON_PROFICIENCY, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_WARRIOR, FEAT_FAR_SHOT, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_WARRIOR, FEAT_GREAT_CLEAVE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_WARRIOR, FEAT_DAZZLING_DISPLAY, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_WARRIOR, FEAT_VITAL_STRIKE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_WARRIOR, FEAT_IMPROVED_VITAL_STRIKE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_WARRIOR, FEAT_GREATER_VITAL_STRIKE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_WARRIOR, FEAT_GREATER_TWO_WEAPON_FIGHTING, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_WARRIOR, FEAT_GREATER_WEAPON_FOCUS, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_WARRIOR, FEAT_GREATER_WEAPON_SPECIALIZATION, Y, NOASSIGN_FEAT, N);
Expand Down Expand Up @@ -6355,6 +6359,10 @@ void load_class_list(void)
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_EXOTIC_WEAPON_PROFICIENCY, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_FAR_SHOT, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_GREAT_CLEAVE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_DAZZLING_DISPLAY, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_VITAL_STRIKE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_IMPROVED_VITAL_STRIKE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_GREATER_VITAL_STRIKE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_GREATER_TWO_WEAPON_FIGHTING, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_GREATER_WEAPON_FOCUS, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_ELDRITCH_KNIGHT, FEAT_GREATER_WEAPON_SPECIALIZATION, Y, NOASSIGN_FEAT, N);
Expand Down Expand Up @@ -6493,6 +6501,10 @@ void load_class_list(void)
feat_assignment(CLASS_SPELLSWORD, FEAT_EXOTIC_WEAPON_PROFICIENCY, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_SPELLSWORD, FEAT_FAR_SHOT, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_SPELLSWORD, FEAT_GREAT_CLEAVE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_SPELLSWORD, FEAT_DAZZLING_DISPLAY, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_SPELLSWORD, FEAT_VITAL_STRIKE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_SPELLSWORD, FEAT_IMPROVED_VITAL_STRIKE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_SPELLSWORD, FEAT_GREATER_VITAL_STRIKE, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_SPELLSWORD, FEAT_GREATER_TWO_WEAPON_FIGHTING, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_SPELLSWORD, FEAT_GREATER_WEAPON_FOCUS, Y, NOASSIGN_FEAT, N);
feat_assignment(CLASS_SPELLSWORD, FEAT_GREATER_WEAPON_SPECIALIZATION, Y, NOASSIGN_FEAT, N);
Expand Down
2 changes: 2 additions & 0 deletions db.c
Original file line number Diff line number Diff line change
Expand Up @@ -5114,10 +5114,12 @@ void reset_char(struct char_data *ch)
ch->char_specials.carry_weight = 0;
ch->char_specials.carry_items = 0;
ch->char_specials.totalDefense = 0;
ch->char_specials.vital_strike = 0;
ch->char_specials.mounted_blocks_left = 0;
ch->char_specials.deflect_arrows_left = 0;
ch->char_specials.riding = NULL;
ch->char_specials.ridden_by = NULL;
cb->char_specials.blasting = 0;
for (i = 0; i < NUM_CASTERS; i++)
ch->char_specials.is_preparing[i] = 0;
ch->char_specials.crafting_type = 0;
Expand Down
48 changes: 48 additions & 0 deletions feats.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,8 +1241,33 @@ void assign_feats(void)
"shield bonus to AC");
feat_prereq_cfeat(FEAT_TWO_WEAPON_DEFENSE, FEAT_TWO_WEAPON_FIGHTING);

/* vital strike weapon feats */
feato(FEAT_VITAL_STRIKE, "vital strike", TRUE, TRUE, FALSE, FEAT_TYPE_COMBAT,
"Sacrifice all attacks to make one attack at full bab for double weapon dice damage.",
"Sacrifice all attacks to make one attack at full bab for double weapon dice damage. "
"Use 'vitalstrike' to toggle this mode on or off.");
feat_prereq_bab(FEAT_VITAL_STRIKE, 6);
feat_prereq_cfeat(FEAT_VITAL_STRIKE, FEAT_DAZZLING_DISPLAY);

feato(FEAT_IMPROVED_VITAL_STRIKE, "improved vital strike", TRUE, TRUE, FALSE, FEAT_TYPE_COMBAT,
"Improves vital strike to triple weapon dice damage.",
"Improves vital strike to triple weapon dice damage.");
feat_prereq_cfeat(FEAT_IMPROVED_VITAL_STRIKE, FEAT_VITAL_STRIKE);
feat_prereq_bab(FEAT_IMPROVED_VITAL_STRIKE, 11);

feato(FEAT_GREATER_VITAL_STRIKE, "greater vital strike", TRUE, TRUE, FALSE, FEAT_TYPE_COMBAT,
"Improves vital strike to quadruple weapon dice damage.",
"Improves vital strike to quadruple weapon dice damage.");
feat_prereq_cfeat(FEAT_GREATER_VITAL_STRIKE, FEAT_IMPROVED_VITAL_STRIKE);
feat_prereq_bab(FEAT_IMPROVED_VITAL_STRIKE, 16);

/* feat-number | name | in game? | learnable? | stackable? | feat-type | short-descrip | long descrip */
/* uncategorized combat feats */
feato(FEAT_DAZZLING_DISPLAY, "dazzling display", TRUE, TRUE, FALSE, FEAT_TYPE_COMBAT,
"use a full round action to intimidate all foes in sight, dazzling them.",
"use a full round action to intimidate all foes in sight, dazzling them.");
feat_prereq_cfeat(FEAT_DAZZLING_DISPLAY, FEAT_WEAPON_FOCUS);

feato(FEAT_BLIND_FIGHT, "blind fighting", TRUE, TRUE, FALSE, FEAT_TYPE_COMBAT,
"when fighting blind, retain dex bonus to AC and deny enemy +4 attack bonus for invisibility.",
"when fighting blind, retain dex bonus to AC and deny enemy +4 attack bonus for invisibility.");
Expand Down Expand Up @@ -5400,6 +5425,29 @@ int feat_is_available(struct char_data *ch, int featnum, int iarg, char *sarg)
else
return FALSE;

case FEAT_DAZZLING_DISPLAY:
if (has_feat_requirement_check(ch, FEAT_WEAPON_FOCUS))
return TRUE;
return FALSE;

case FEAT_VITAL_STRIKE:
if (has_feat_requirement_check(ch, FEAT_DAZZLING_DISPLAY) &&
(BAB(ch) >= 6))
return TRUE;
return FALSE;

case FEAT_IMPROVED_VITAL_STRIKE:
if (has_feat_requirement_check(ch, FEAT_VITAL_STRIKE) &&
(BAB(ch) >= 11))
return TRUE;
return FALSE;

case FEAT_GREATER_VITAL_STRIKE:
if (has_feat_requirement_check(ch, FEAT_IMPROVED_VITAL_STRIKE) &&
(BAB(ch) >= 16))
return TRUE;
return FALSE;

case FEAT_SUNDER:
if (has_feat_requirement_check(ch, FEAT_POWER_ATTACK))
return TRUE;
Expand Down
19 changes: 16 additions & 3 deletions fight.c
Original file line number Diff line number Diff line change
Expand Up @@ -6077,6 +6077,16 @@ int compute_dam_dice(struct char_data *ch, struct char_data *victim,
return (diceOne * diceTwo) + diceOne; /* max damage! And more! */
}

if (VITAL_STRIKING(ch))
{
if (HAS_FEAT(ch, FEAT_GREATER_VITAL_STRIKE))
diceOne *= 4;
else if (HAS_FEAT(ch, FEAT_IMPROVED_VITAL_STRIKE))
diceOne *= 3;
else if (HAS_FEAT(ch, FEAT_VITAL_STRIKE))
diceOne *= 2;
}

return dice(diceOne, diceTwo);
}

Expand Down Expand Up @@ -10569,7 +10579,7 @@ int perform_attacks(struct char_data *ch, int mode, int phase)
/************************/
/* Process Melee Attacks -------------------------------------------------- */
// melee: now lets determine base attack(s) and resulting possible penalty
dual = is_dual_wielding(ch); // trelux or has off-hander equipped
dual = is_dual_wielding(ch) && !VITAL_STRIKING(ch); // trelux or has off-hander equipped

/* we are going to exit melee combat if we are somehow wielding a ranged
weapon here */
Expand Down Expand Up @@ -10655,8 +10665,8 @@ int perform_attacks(struct char_data *ch, int mode, int phase)
}

/* haste or equivalent? */
if (AFF_FLAGGED(ch, AFF_HASTE) ||
(!IS_NPC(ch) && HAS_FEAT(ch, FEAT_BLINDING_SPEED)))
if (!VITAL_STRIKING(ch) && (AFF_FLAGGED(ch, AFF_HASTE) ||
(!IS_NPC(ch) && HAS_FEAT(ch, FEAT_BLINDING_SPEED))))
{
numAttacks++;
if (mode == NORMAL_ATTACK_ROUTINE)
Expand All @@ -10677,6 +10687,9 @@ int perform_attacks(struct char_data *ch, int mode, int phase)
}

// execute the calculated attacks from above
if (VITAL_STRIKING(ch))
bonus_mainhand_attacks = 0;

int j = 0;
for (i = 0; i < bonus_mainhand_attacks; i++)
{
Expand Down
1 change: 1 addition & 0 deletions interpreter.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ cpp_extern const struct command_info cmd_info[] = {
{"cast", "c", POS_SITTING, do_gen_cast, 1, SCMD_CAST_SPELL, FALSE, ACTION_MOVE, {0, 6}, NULL},
{"carriage", "car", POS_RECLINING, do_carriage, 0, 0, TRUE, ACTION_NONE, {0, 0}, NULL},
{"catsclaws", "catsclaws", POS_FIGHTING, do_tabaxi_claw_attack, 1, 0, FALSE, ACTION_NONE, {0, 0}, can_tabaxi_claw_attack},
{"dazzlingdisplay", "dazzlingdisplay", POS_FIGHTING, do_dazzling_display, 1, 0, FALSE, ACTION_NONE, {0, 0}, can_dazzling_display},
{"cedit", "cedit", POS_DEAD, do_oasis_cedit, LVL_IMPL, 0, TRUE, ACTION_NONE, {0, 0}, NULL},
{"chat", "chat", POS_SLEEPING, do_gen_comm, 0, SCMD_GOSSIP, TRUE, ACTION_NONE, {0, 0}, NULL},
{"changelog", "cha", POS_DEAD, do_changelog, LVL_IMMORT, 0, TRUE, ACTION_NONE, {0, 0}, NULL},
Expand Down
1 change: 1 addition & 0 deletions spells.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@
#define AFFECT_IMMUNITY_BANISHING_BLADE 1240
#define STATUS_AFFECT_STAGGERED 1241
#define AFFECT_PLANAR_SOUL_SURGE 1242
#define ABILITY_DAZZLING_DISPLAY 1243

/** we're going to start psionic powers at 1500.
* most psionic stuff is either in psionics.c or spell_parser.c
Expand Down
9 changes: 7 additions & 2 deletions structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2351,12 +2351,16 @@
#define FEAT_EPIC_ELDRITCH_BLAST 970
//more misc
#define FEAT_OVERSIZED_TWO_WEAPON_FIGHTING 971
#define FEAT_DAZZLING_DISPLAY 972
#define FEAT_VITAL_STRIKE 973
#define FEAT_IMPROVED_VITAL_STRIKE 974
#define FEAT_GREATER_VITAL_STRIKE 975

/**************/
/** reserved above feat# + 1**/
#define FEAT_LAST_FEAT 972
#define FEAT_LAST_FEAT 974
/** FEAT_LAST_FEAT + 1 ***/
#define NUM_FEATS 973
#define NUM_FEATS 975
/** absolute cap **/
#define MAX_FEATS 1500
/*****/
Expand Down Expand Up @@ -4069,6 +4073,7 @@ struct char_special_data
int mounted_blocks_left; /* how many mounted combat blocks left in the round */
int deflect_arrows_left; /* deflect arrows left */
struct condensed_combat_data *condensed_combat; /* condensed combat struct */
bool vital_strike; /* if we're using vital strike */


/* Mode Data */
Expand Down
1 change: 1 addition & 0 deletions utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ void char_from_furniture(struct char_data *ch);
// *** char_specials (there are others spread about utils.h file) *** //
#define GET_ELDRITCH_SHAPE(ch) ((ch)->char_specials.eldritch_shape)
#define GET_ELDRITCH_ESSENCE(ch) ((ch)->char_specials.eldritch_essence)
#define VITAL_STRIKING(ch) ((ch)->char_specials.vital_strike)
/** Current position (standing, sitting) of ch. */
#define GET_POS(ch) ((ch)->char_specials.position)
/** Timer */
Expand Down

0 comments on commit 9e7d4b3

Please sign in to comment.