Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0
This commit is contained in:
@@ -354,6 +354,7 @@ wielding Trollsbane prevents trolls from reviving
|
|||||||
wielding Demonbane prevents demons summoning friends
|
wielding Demonbane prevents demons summoning friends
|
||||||
wielding Dragonbane confers reflection
|
wielding Dragonbane confers reflection
|
||||||
wielding Ogresmasher grants 25 constitution
|
wielding Ogresmasher grants 25 constitution
|
||||||
|
Cleaver can hit three monsters with one swing
|
||||||
Elbereth must now be on a square by itself to function
|
Elbereth must now be on a square by itself to function
|
||||||
Elbereth now erodes based on attacks by the player, not monsters scared
|
Elbereth now erodes based on attacks by the player, not monsters scared
|
||||||
novels are made of paper, not gold
|
novels are made of paper, not gold
|
||||||
|
|||||||
+62
@@ -8,6 +8,7 @@ STATIC_DCL boolean FDECL(known_hitum, (struct monst *, struct obj *, int *,
|
|||||||
int, int, struct attack *, int));
|
int, int, struct attack *, int));
|
||||||
STATIC_DCL boolean FDECL(theft_petrifies, (struct obj *));
|
STATIC_DCL boolean FDECL(theft_petrifies, (struct obj *));
|
||||||
STATIC_DCL void FDECL(steal_it, (struct monst *, struct attack *));
|
STATIC_DCL void FDECL(steal_it, (struct monst *, struct attack *));
|
||||||
|
STATIC_DCL boolean FDECL(hitum_cleave, (struct monst *, struct attack *));
|
||||||
STATIC_DCL boolean FDECL(hitum, (struct monst *, struct attack *));
|
STATIC_DCL boolean FDECL(hitum, (struct monst *, struct attack *));
|
||||||
STATIC_DCL boolean FDECL(hmon_hitmon, (struct monst *, struct obj *, int,
|
STATIC_DCL boolean FDECL(hmon_hitmon, (struct monst *, struct obj *, int,
|
||||||
int));
|
int));
|
||||||
@@ -489,6 +490,63 @@ int dieroll;
|
|||||||
return malive;
|
return malive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* hit the monster next to you and the monsters to the left and right of it */
|
||||||
|
STATIC_OVL boolean
|
||||||
|
hitum_cleave(mon, uattk)
|
||||||
|
struct monst *mon;
|
||||||
|
struct attack *uattk;
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
int x = u.ux;
|
||||||
|
int y = u.uy;
|
||||||
|
int count = 3;
|
||||||
|
boolean malive = TRUE;
|
||||||
|
struct monst *mtmp;
|
||||||
|
|
||||||
|
/* find the direction we're swinging */
|
||||||
|
while (i < 8) {
|
||||||
|
if (xdir[i] == u.dx && ydir[i] == u.dy)
|
||||||
|
break;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == 8) {
|
||||||
|
impossible("hitum_cleave: failed to find target monster?");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
i = (i + 2) % 8;
|
||||||
|
|
||||||
|
/* swing from right to left */
|
||||||
|
while (count-- && uwep) {
|
||||||
|
boolean result;
|
||||||
|
int tmp, dieroll, mhit, attknum, armorpenalty;
|
||||||
|
|
||||||
|
if (!i)
|
||||||
|
i = 7;
|
||||||
|
else
|
||||||
|
i--;
|
||||||
|
|
||||||
|
mtmp = NULL;
|
||||||
|
if (isok(x + xdir[i], y + ydir[i]))
|
||||||
|
mtmp = m_at(x + xdir[i], y + ydir[i]);
|
||||||
|
if (!mtmp)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
tmp = find_roll_to_hit(mtmp, uattk->aatyp, uwep,
|
||||||
|
&attknum, &armorpenalty);
|
||||||
|
dieroll = rnd(20);
|
||||||
|
mhit = (tmp > dieroll);
|
||||||
|
result = known_hitum(mtmp, uwep, &mhit, tmp, armorpenalty,
|
||||||
|
uattk, dieroll);
|
||||||
|
(void) passive(mtmp, mhit, DEADMONSTER(mtmp), AT_WEAP, !uwep);
|
||||||
|
if (mon == mtmp)
|
||||||
|
malive = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return malive;
|
||||||
|
}
|
||||||
|
|
||||||
/* hit target monster; returns TRUE if it still lives */
|
/* hit target monster; returns TRUE if it still lives */
|
||||||
STATIC_OVL boolean
|
STATIC_OVL boolean
|
||||||
hitum(mon, uattk)
|
hitum(mon, uattk)
|
||||||
@@ -503,6 +561,10 @@ struct attack *uattk;
|
|||||||
int dieroll = rnd(20);
|
int dieroll = rnd(20);
|
||||||
int mhit = (tmp > dieroll || u.uswallow);
|
int mhit = (tmp > dieroll || u.uswallow);
|
||||||
|
|
||||||
|
if (uwep && uwep->oartifact == ART_CLEAVER
|
||||||
|
&& !u.uswallow && !u.ustuck && !NODIAG(u.umonnum))
|
||||||
|
return hitum_cleave(mon, uattk);
|
||||||
|
|
||||||
if (tmp > dieroll)
|
if (tmp > dieroll)
|
||||||
exercise(A_DEX, TRUE);
|
exercise(A_DEX, TRUE);
|
||||||
malive = known_hitum(mon, uwep, &mhit, tmp, armorpenalty, uattk, dieroll);
|
malive = known_hitum(mon, uwep, &mhit, tmp, armorpenalty, uattk, dieroll);
|
||||||
|
|||||||
Reference in New Issue
Block a user