1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-28 16:32:27 +01:00

Merge branch 'devel-3.21.2' of https://github.com/Chris-plus-alphanumericgibberish/dNAO.git into devel-3.21.2

This commit is contained in:
ChrisANG 2021-12-25 22:06:45 -05:00
commit a6c3daeeba
4 changed files with 95 additions and 5 deletions

View file

@ -610,6 +610,16 @@ struct you {
int role_variant; /*Records what variant of your role you are.*/
int umystic; /*Monk mystic attacks active*/
#define monk_style_active(style) (u.umystic & (1 << (style-1)))
#define toggle_monk_style(style) (u.umystic = u.umystic ^ (1 << (style-1)))
#define DIVE_KICK 1
#define AURA_BOLT 2
#define BIRD_KICK 3
#define METODRIVE 4
#define PUMMEL 5
long wardsknown; /* known wards */
#define WARD_ELBERETH 0x0000001L
#define WARD_HEPTAGRAM 0x0000002L
@ -842,11 +852,6 @@ struct you {
(Role_if(PM_BARD) || Role_if(PM_HEALER) || Role_if(PM_TOURIST) || Role_if(PM_WIZARD) || Role_if(PM_MADMAN)) ? 0.50:\
.5) /* Failsafe */
#define DIVE_KICK 1
#define AURA_BOLT 2
#define BIRD_KICK 3
#define METODRIVE 4
#define PUMMEL 5
extern long sealKey[34]; /*Defined in u_init.c*/
extern boolean forcesight; /*Defined in u_init.c*/

View file

@ -124,6 +124,7 @@ STATIC_PTR int NDECL(doability);
STATIC_PTR int NDECL(domonability);
STATIC_PTR int FDECL(ability_menu, (boolean, boolean));
STATIC_PTR int NDECL(domountattk);
STATIC_PTR int NDECL(doMysticForm);
STATIC_PTR int NDECL(dofightingform);
STATIC_PTR int NDECL(dooverview_or_wiz_where);
STATIC_PTR int NDECL(doclearinvissyms);
@ -896,6 +897,83 @@ use_reach_attack()
pline("%s", nothing_happens);
return (1);
}
int
doMysticForm()
{
winid tmpwin;
int n, how;
char buf[BUFSZ];
char incntlet = 'a';
menu_item *selected;
anything any;
tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin);
any.a_void = 0; /* zero out all bits */
Sprintf(buf, "Known Moves");
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_BOLD, buf, MENU_UNSELECTED);
if(monk_style_active(DIVE_KICK)) {
Sprintf(buf, "Dive Kick (active)");
} else {
Sprintf(buf, "Dive Kick (disabled)");
}
any.a_int = DIVE_KICK; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any,
incntlet, 0, ATR_NONE, buf,
MENU_UNSELECTED);
incntlet = (incntlet != 'z') ? (incntlet+1) : 'A';
if(monk_style_active(AURA_BOLT)) {
Sprintf(buf, "Aura Bolt (active)");
} else {
Sprintf(buf, "Aura Bolt (disabled)");
}
any.a_int = AURA_BOLT; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any,
incntlet, 0, ATR_NONE, buf,
MENU_UNSELECTED);
incntlet = (incntlet != 'z') ? (incntlet+1) : 'A';
if(monk_style_active(BIRD_KICK)) {
Sprintf(buf, "Bird Kick (active)");
} else {
Sprintf(buf, "Bird Kick (disabled)");
}
any.a_int = BIRD_KICK; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any,
incntlet, 0, ATR_NONE, buf,
MENU_UNSELECTED);
incntlet = (incntlet != 'z') ? (incntlet+1) : 'A';
if(monk_style_active(METODRIVE)) {
Sprintf(buf, "Meteor Drive (active)");
} else {
Sprintf(buf, "Meteor Drive (disabled)");
}
any.a_int = METODRIVE; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any,
incntlet, 0, ATR_NONE, buf,
MENU_UNSELECTED);
incntlet = (incntlet != 'z') ? (incntlet+1) : 'A';
if(monk_style_active(PUMMEL)) {
Sprintf(buf, "Pummel (active)");
} else {
Sprintf(buf, "Pummel (disabled)");
}
any.a_int = PUMMEL; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any,
incntlet, 0, ATR_NONE, buf,
MENU_UNSELECTED);
incntlet = (incntlet != 'z') ? (incntlet+1) : 'A';
end_menu(tmpwin, "Choose fighting style:");
how = PICK_ONE;
n = select_menu(tmpwin, how, &selected);
destroy_nhwindow(tmpwin);
if(n <= 0){
return 0;
} else {
toggle_monk_style(selected[0].item.a_int);
return 0;
}
}
int
dofightingform()
@ -906,6 +984,10 @@ dofightingform()
char incntlet = 'a';
menu_item *selected;
anything any;
if(Role_if(PM_MONK) && !((uwep && is_lightsaber(uwep)) || (u.twoweap && uswapwep && is_lightsaber(uswapwep)))){
return doMysticForm();
}
if(!(uwep && is_lightsaber(uwep))){
pline("You don't know any special fighting styles for use in this situation.");

View file

@ -1550,6 +1550,8 @@ u_init()
(void) memset((genericptr_t)&u, 0, sizeof(u));
u.ustuck = (struct monst *)0;
u.umystic = 31; //By default, all monk style attacks are active
u.summonMonster = FALSE;
u.uleadamulet = FALSE;
artinstance[ART_TENSA_ZANGETSU].ZangetsuSafe = 1;

View file

@ -17215,6 +17215,7 @@ monk_moves()
static struct attack weaponhit = { AT_WEAP, AD_PHYS, 0, 0 };
if(!moveID)
return FALSE;
if(!monk_style_active(moveID)) return FALSE;
if(u.uen < 8)
return FALSE;
switch(moveID){