yangkun_branch
yk 1 year ago
parent ae47fc013e
commit 10a2674705

@ -230,59 +230,76 @@ kick_monster(struct monst *mon, coordxy x, coordxy y)
* [80%-90%) | 1/3 | 1/2
* [90%-100%) | 1/2 | 1
*/
/* 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 (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;
Your("clumsy kick does no damage.");
(void) passive(mon, uarmf, FALSE, 1, AT_KICK, FALSE);
} else {
/* Output "Your clumsy kick does no damage." and call passive() function, then return. */
pline("Your clumsy kick does no damage.");
passive();
return;
}
if (i < j / 10)
}
if (i < j / 10) {
clumsy = TRUE;
else if (!rn2((i < j / 5) ? 2 : 3))
} else if (!rn2((i < j / 5) ? 2 : 3)) {
clumsy = TRUE;
}
}
if (Fumbling)
if (Fumbling) {
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;
}
doit:
You("kick %s.", mon_nam(mon));
if (!rn2(clumsy ? 3 : 4) && (clumsy || !bigmonst(mon->data))
&& 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) {
/* Output "You kick __." where __ is the name of the enemy. */
pline("You kick %s.", mon_nam(mon));
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)) {
pline("%s blocks your %skick.", Monnam(mon),
clumsy ? "clumsy " : "");
(void) passive(mon, uarmf, FALSE, 1, AT_KICK, FALSE);
/* Output "%s blocks your %skick." where %s is the name of the enemy,
* %skick can be "clumsy ", and call passive() function, then return. */
pline("%s blocks your %skick.", Monnam(mon), clumsy ? "clumsy " : "");
passive();
return;
} else {
maybe_mnexto(mon);
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),
(can_teleport(mon->data) && !noteleport_level(mon))
? "teleports"
: is_floater(mon->data)
? "floats"
: is_flyer(mon->data) ? "swoops"
: (nolimbs(mon->data)
|| slithy(mon->data))
? "slides"
: "jumps",
clumsy ? "easily" : "nimbly", clumsy ? "clumsy " : "");
(void) passive(mon, uarmf, FALSE, 1, AT_KICK, FALSE);
teleport_control(mon) ? "teleports" :
is_floater(mon->data) ? "floats" :
is_flyer(mon->data) ? "swoops" : "slides",
(is_floater(mon->data) || mon->data->mmove >= 12) ? "easily" : "nimbly",
clumsy ? "clumsy " : "");
passive();
return;
}
}
}
kickdmg(mon, clumsy);
}
/*
* Return TRUE if caught (the gold taken care of), FALSE otherwise.

Loading…
Cancel
Save