-
Notifications
You must be signed in to change notification settings - Fork 3
/
naturalac.txt
93 lines (77 loc) · 3.27 KB
/
naturalac.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
HITTING NATURAL AC (Physical hit but no damage)
This snippet will add some spice to the generic smaug combat miss code.
In fight.c, smaug addresses all dicerolls that don't hit your AC as a miss,
and that's it. This little piece of code takes into account your natural AC
as well (armor class without any armor, but still including dex and racial
bonuses that reflect speed affecting AC) so it's possible to physically
strike an opponent but have armor prevent damage.
To me, it's a little silly to assume all attacks by a trained fighter
will end up just hitting or missing. Striking a target should be fairly easy
barring any dodge, parry, or tumble skills, but actually causing damage...
that's another story. A pure miss should be when an attack misses your
natural AC (missing your physical form completely). Attacks prevented by
armor being worn still reflect a physical hit but no damage is dealt. Once
again it's silly to assume that wearing armor improves your speed and
dexterity to the point where you can duck and sidestep more and more attacks.
All armor should do is prevent actual hits from doing damage...
A little math (note AC is multiplied by 10 in mud terms):
Bob has an AC of 5 (naturally 10 with no armor)
Joe has a thac0 of 15. (to hit armor class zero... needs to roll a 15 to hit AC 0)
So Joe needs to roll a 10 or better to hit bob.
Joe rolls an 8.
Joe makes an attack that would've hit AC 7 but misses AC 5
Joe still hit Bob (the attack would've hit the natural AC of 10) but armor
being worn prevented the strike from causing damage.
Anyay, simply put, this code adds an additional miss message that shows
a near miss.
In fight.c in function one_hit find:
/*
* The moment of excitement!
*/
while ( ( diceroll = number_bits( 5 ) ) >= 20 )
;
if ( diceroll == 0
|| ( diceroll != 19 && diceroll < thac0 - victim_ac ) )
{
/* Miss. */
if ( prof_gsn != -1 )
learn_from_failure( ch, prof_gsn );
damage( ch, victim, 0, dt );
tail_chain( );
return rNONE;
}
And replace it with:
/*
* The moment of excitement!
*/
while ( ( diceroll = number_bits( 5 ) ) >= 20 )
;
if ( diceroll == 0
|| ( diceroll != 19 && diceroll < thac0 - victim_ac ) )
{
/* Physical hit with no damage (hit natural AC) -Shade */
if ( diceroll < thac0 - victim_ac
&& diceroll >= thac0 - (10 + (dex_app[get_curr_dex(ch)].defensive / 10) + (race_table[victim->race]->ac_plus / 10))
&& diceroll != 19
&& diceroll != 0 )
{
if ( prof_gsn != -1 )
learn_from_failure( ch, prof_gsn );
act( AT_PLAIN, "Your attack is deflected by $N's armor.", ch, NULL, victim, TO_CHAR );
act( AT_PLAIN, "Your armor deflects $n's attack.", ch, NULL, victim, TO_VICT );
tail_chain( );
return rNONE;
}
else
{
/* Miss. */
if ( prof_gsn != -1 )
learn_from_failure( ch, prof_gsn );
damage( ch, victim, 0, dt );
tail_chain( );
return rNONE;
}
}
Recompile and you're done. You might want to add a random chance to
damage armor being worn. I'll look into this myself and may post an update
soon. Send any questions, comments, flames, etc to seven@nycap.rr.com