yangkun_branch
yk 2 years ago
parent ae47fc013e
commit 10a2674705

@ -230,60 +230,77 @@ kick_monster(struct monst *mon, coordxy x, coordxy y)
* [80%-90%) | 1/3 | 1/2 * [80%-90%) | 1/3 | 1/2
* [90%-100%) | 1/2 | 1 * [90%-100%) | 1/2 | 1
*/ */
if (i < (j * 3) / 10) { /* This is a C language code snippet that describes a player character's kicking action in a game. */
if (i < (j * 3) / 10) {
/* If the condition (i < (j * 3) / 10) is true, execute the following code block: */
if (!rn2((i < j / 10) ? 2 : (i < j / 5) ? 3 : 4)) { if (!rn2((i < j / 10) ? 2 : (i < j / 5) ? 3 : 4)) {
if (martial()) /* If the result of rn2((i < j / 10) ? 2 : (i < j / 5) ? 3 : 4) is false (0), do the following: */
if (martial()) {
goto doit; goto doit;
Your("clumsy kick does no damage."); } else {
(void) passive(mon, uarmf, FALSE, 1, AT_KICK, FALSE); /* Output "Your clumsy kick does no damage." and call passive() function, then return. */
pline("Your clumsy kick does no damage.");
passive();
return; return;
} }
if (i < j / 10) }
if (i < j / 10) {
clumsy = TRUE; clumsy = TRUE;
else if (!rn2((i < j / 5) ? 2 : 3)) } else if (!rn2((i < j / 5) ? 2 : 3)) {
clumsy = TRUE; clumsy = TRUE;
} }
}
if (Fumbling) if (Fumbling) {
clumsy = TRUE; clumsy = TRUE;
} else if (uarm && objects[uarm->otyp].oc_bulky && ACURR(A_DEX) < rnd(25)) {
else if (uarm && objects[uarm->otyp].oc_bulky && ACURR(A_DEX) < rnd(25))
clumsy = TRUE; clumsy = TRUE;
doit: }
You("kick %s.", mon_nam(mon));
if (!rn2(clumsy ? 3 : 4) && (clumsy || !bigmonst(mon->data)) doit:
&& mon->mcansee && !mon->mtrapped && !thick_skinned(mon->data) /* Output "You kick __." where __ is the name of the enemy. */
&& mon->data->mlet != S_EEL && haseyes(mon->data) && mon->mcanmove pline("You kick %s.", mon_nam(mon));
&& !mon->mstun && !mon->mconf && !mon->msleeping
&& mon->data->mmove >= 12) { if ((!rn2(clumsy ? 3 : 4) || (clumsy || mon->data->msize == MZ_SMALL)) &&
mon->mcansee && !mon->mtrapped && !thick_skinned(mon->data) &&
mon->data->mlet != S_EEL && haseyes(mon->data) &&
mon->mcanmove && !mon->mstun && !mon->mconf && !mon->msleeping &&
mon->data->mmove >= 12) {
if (!nohands(mon->data) && !rn2(martial() ? 5 : 3)) { if (!nohands(mon->data) && !rn2(martial() ? 5 : 3)) {
pline("%s blocks your %skick.", Monnam(mon), /* Output "%s blocks your %skick." where %s is the name of the enemy,
clumsy ? "clumsy " : ""); * %skick can be "clumsy ", and call passive() function, then return. */
(void) passive(mon, uarmf, FALSE, 1, AT_KICK, FALSE); pline("%s blocks your %skick.", Monnam(mon), clumsy ? "clumsy " : "");
passive();
return; return;
} else { } else {
maybe_mnexto(mon); maybe_mnexto(mon);
if (mon->mx != x || mon->my != y) { if (mon->mx != x || mon->my != y) {
(void) unmap_invisible(x, y); unmap_invisible(x, y);
/* Output "%s %s, %s evading your %skick." where %s is the name of the enemy,
* %s can be "teleports", "floats", "swoops", or "slides",
* %s can be "easily" or "nimbly", and %s can be "clumsy ".
* Then call passive() function, and return. */
pline("%s %s, %s evading your %skick.", Monnam(mon), pline("%s %s, %s evading your %skick.", Monnam(mon),
(can_teleport(mon->data) && !noteleport_level(mon)) teleport_control(mon) ? "teleports" :
? "teleports" is_floater(mon->data) ? "floats" :
: is_floater(mon->data) is_flyer(mon->data) ? "swoops" : "slides",
? "floats" (is_floater(mon->data) || mon->data->mmove >= 12) ? "easily" : "nimbly",
: is_flyer(mon->data) ? "swoops" clumsy ? "clumsy " : "");
: (nolimbs(mon->data) passive();
|| slithy(mon->data))
? "slides"
: "jumps",
clumsy ? "easily" : "nimbly", clumsy ? "clumsy " : "");
(void) passive(mon, uarmf, FALSE, 1, AT_KICK, FALSE);
return; return;
} }
} }
}
kickdmg(mon, clumsy);
} }
kickdmg(mon, clumsy);
/* /*
* Return TRUE if caught (the gold taken care of), FALSE otherwise. * Return TRUE if caught (the gold taken care of), FALSE otherwise.
* The gold object is *not* attached to the fobj chain! * The gold object is *not* attached to the fobj chain!

Loading…
Cancel
Save