-+-+-+-+-+-+-+-+ START OF PART 23 -+-+-+-+-+-+-+-+ X END X END; X 1,9 : BEGIN X mm`5B1`5D := 6; X if (y < 0) then X BEGIN X mm`5B2`5D := 3; X mm`5B3`5D := 9; X mm`5B4`5D := 2; X mm`5B5`5D := 8 X END X else X BEGIN X mm`5B2`5D := 9; X mm`5B3`5D := 3; X mm`5B4`5D := 8; X mm`5B5`5D := 2 X END X END; X 2,6 : BEGIN X mm`5B1`5D := 8; X if (x < 0) then X BEGIN X mm`5B2`5D := 9; X mm`5B3`5D := 7; X mm`5B4`5D := 6; X mm`5B5`5D := 4 X END X else X BEGIN X mm`5B2`5D := 7; X mm`5B3`5D := 9; X mm`5B4`5D := 4; X mm`5B5`5D := 6 X END X END; X 4 : BEGIN X mm`5B1`5D := 7; X if (ay > ax) then X BEGIN X mm`5B2`5D := 8; X mm`5B3`5D := 4; X mm`5B4`5D := 9; X mm`5B5`5D := 1 X END X else X BEGIN X mm`5B2`5D := 4; X mm`5B3`5D := 8; X mm`5B4`5D := 1; X mm`5B5`5D := 9 X END X END; X 5,13 : BEGIN X mm`5B1`5D := 4; X if (y < 0) then X BEGIN X mm`5B2`5D := 1; X mm`5B3`5D := 7; X mm`5B4`5D := 8; X mm`5B5`5D := 2 X END X else X BEGIN X mm`5B2`5D := 7; X mm`5B3`5D := 1; X mm`5B4`5D := 2; X mm`5B5`5D := 8 X END X END; X 8 : BEGIN X mm`5B1`5D := 3; X if (ay > ax) then X BEGIN X mm`5B2`5D := 2; X mm`5B3`5D := 6; X mm`5B4`5D := 1; X mm`5B5`5D := 9 X END X else X BEGIN X mm`5B2`5D := 6; X mm`5B3`5D := 2; X mm`5B4`5D := 9; X mm`5B5`5D := 1 X END X END; X 10,14 : BEGIN X mm`5B1`5D := 2; X if (x < 0) then X BEGIN X mm`5B2`5D := 1; X mm`5B3`5D := 3; X mm`5B4`5D := 4; X mm`5B5`5D := 6 X END X else X BEGIN X mm`5B2`5D := 3; X mm`5B3`5D := 1; X mm`5B4`5D := 6; X mm`5B5`5D := 4 X END X END; X 12 : BEGIN X mm`5B1`5D := 1; X if (ay > ax) then X BEGIN X mm`5B2`5D := 2; X mm`5B3`5D := 4; X mm`5B4`5D := 3; X mm`5B5`5D := 7 X END X else X BEGIN X mm`5B2`5D := 4; X mm`5B3`5D := 2; X mm`5B4`5D := 7; X mm`5B5`5D := 3 X END X END X END X END; X`20 X`20 X`7B Make an attack on the player (chuckle...) `7D X PROCEDURE make_attack(monptr : integer); X VAR X xpos,atype,adesc,dam,i1,i2,i3,i4,i7 : integer; X attstr,attx,cdesc,mdesc,ddesc : vtype; X damstr : dtype; X flag : boolean; X BEGIN X with m_list`5Bmonptr`5D do X with c_list`5Bmptr`5D do X BEGIN X attstr := damage; X if ((uand(%X'10000',cmove) <> 0) and X (not(py.flags.see_inv)))then X cdesc := 'It ' X else if (py.flags.blind > 0) then X cdesc := 'It ' X else if (not(ml)) then X cdesc := 'It ' X else X cdesc := 'The ' + name + ' '; X`7B For 'DIED_FROM' string `7D X if (uand(%X'80000000',cmove) <> 0) then X ddesc := 'The ' + name X else X ddesc := '& ' + name; X temporary_slot.name := ddesc; X temporary_slot.number := 1; X objdes(ddesc,1,true,'t'); X`7B End DIED_FROM `7D X while (length(attstr) > 0) do X BEGIN X xpos := index(attstr,'`7C'); X if (xpos > 0) then X BEGIN X attx := substr(attstr,1,xpos-1); X attstr := substr(attstr,xpos+1,length(attstr)-xpos) X END X else X BEGIN X attx := attstr; X attstr := '' X END; X readv(attx,atype,adesc,damstr); X flag := false; X if (py.flags.protevil > 0) then X if (uand(cdefense,%X'0004') <> 0) then X if ((py.misc.lev+1) > level) then X BEGIN X atype := 99; X adesc := max_attack_desc; X END; X with py.misc do X CASE atype of `7B hit conditions for various attacks `7 VD X`7BNormal attack `7D 1 : if (test_hit(60+intel,level,0,pac+ptoac)) V then X flag := true; X`7BPoison Strength`7D 2 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BConfusion attack`7D 3 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BFear attack `7D 4 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BFire attack `7D 5 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BAcid attack `7D 6 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BCold attack `7D 7 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BLightning attack`7D 8 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BCorrosion attack`7D 9 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BBlindness attack`7D 10 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BParalysis attack`7D 11 : if (test_hit(4,level,0,pac+ptoac)) then X flag := true; X`7BSteal Money `7D 12 : if (test_hit(8,level,0,py.misc.lev)) then X if (py.misc.au > 0) then X flag := true; X`7BSteal Object `7D 13 : if (test_hit(5,level,0,py.misc.lev)) then X if (inven_ctr > 0) then X flag := true; X`7BPoison `7D 14 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BLose dexterity`7D 15 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BLose constitution`7D 16 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BLose intelligence`7D 17 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BLose wisdom`7D 18 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BLose experience`7D 19 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BAggravate monsters`7D 20 : flag := true; X`7BDisenchant `7D 21 : if (test_hit(7,level,0,pac+ptoac)) then X flag := true; X`7BEat food `7D 22 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BEat light `7D 23 : if (test_hit(0,level,0,pac+ptoac)) then X flag := true; X`7BEat charges `7D 24 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BVampire bite `7D 25 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BTurn to stone `7D 26 : if (test_hit(10,level,0,pac+ptoac)) then X flag := true; X`7BVargouillian bite `7D 29 : if (test_hit(3,level,0,pac+ptoac)) then`2 V0 X`09`09`09`09 flag := true; X`7BCause disease`7D`09 30 : if ((randint(124) > py.stat.ccon) or X`09`09`09`09 (randint(100) > 95)) then X`09`09`09 flag := true; X`7BLose charisma`7D`09 31 : if (test_hit(0,level,0,pac+ptoac)) then X`09`09`09 flag := true; X 99 : flag := true; X OTHERWISE X END; X if (flag) then X BEGIN `20 X`09`09 if (adesc <> 19) then X`09`09`09 msg_print(cdesc + attack_desc`5Badesc`5D) X`09`09`09else X`7BEddie attacks`7D Begin X if (py.flags.see_inv) then X i7 := 11 X else X i7 := 7; X`09`09`09 case randint(i7) of X`09`09`09 1: msg_print(cdesc+'insults you.'); X`09`09`09 2: msg_print(cdesc+'insults your mother.'); X`09`09`09 3: msg_print(cdesc+'wets on your leg.'); X`09`09`09 4: msg_print(cdesc+'defiles you.'); X`09`09`09 5: msg_print(cdesc+'humiliates you.'); X`09`09`09 6: msg_print(cdesc+'laughs at you.'); X`09`09`09 7: msg_print(cdesc+'curses you!'); X`09`09`09 8: msg_print(cdesc+'moons you!'); X`09`09`09 9: msg_print(cdesc+'gives you the finger.'); X`09`09`09 10: msg_print(cdesc+'makes obscene gestures.'); X`09`09`09 11: msg_print(cdesc+'dances around you.'); X end X`09`09`09 End; X CASE atype of X`7BNormal attack `7D 1 : BEGIN X dam := damroll(damstr); X with py.misc do X dam :=dam - round(((pac+ptoac)/300.0)*da Vm); X take_hit(dam,ddesc); X prt_chp X END; X`7BPoison Strength`7D 2 : BEGIN X take_hit(damroll(damstr),ddesc); X if (py.flags.sustain_str) then X msg_print('You feel weaker for a moment, then it passes.') X else if (randint(2) = 1) then X BEGIN X msg_print('You feel weaker.'); X py.stat.cstr := de_statp(py.stat.cst Vr); X prt_strength X END; X prt_chp X END; X`7BConfusion attack`7D 3 : with py.flags do X BEGIN X take_hit(damroll(damstr),ddesc); X if (randint(50) > py.stat.cint) then X BEGIN X if (confused < 1) then X BEGIN X msg_print('You feel confused.'); X confused:=confused+randint(intel V); X END; X confused := confused + 3; X END; X prt_chp; X END; X`7BFear attack `7D 4 : with py.flags do X BEGIN X take_hit(damroll(damstr),ddesc); X if (player_saves(wis_adj)) then X msg_print('You resist the effects!') X else if (afraid < 1) then X BEGIN X msg_print('You are suddenly afraid!' V); X afraid := afraid + 3 + randint(level V) +-+-+-+-+-+-+-+- END OF PART 23 +-+-+-+-+-+-+-+-