-+-+-+-+-+-+-+-+ START OF PART 18 -+-+-+-+-+-+-+-+ X`09`09`09 mm`5B2`5D := 3; X`09`09`09 mm`5B3`5D := 1; X`09`09`09 mm`5B4`5D := 6; X`09`09`09 mm`5B5`5D := 4; X`09`09`09 end X`09`09`09end; X`09 12 : begin X`09`09`09 mm`5B1`5D := 1; X`09`09`09 if (ay > ax) then X`09`09`09 begin X`09`09`09 mm`5B2`5D := 2; X`09`09`09 mm`5B3`5D := 4; X`09`09`09 mm`5B4`5D := 3; X`09`09`09 mm`5B5`5D := 7; X`09`09`09 end X`09`09`09 else X`09`09`09 begin X`09`09`09 mm`5B2`5D := 4; X`09`09`09 mm`5B3`5D := 2; X`09`09`09 mm`5B4`5D := 7; X`09`09`09 mm`5B5`5D := 3; X`09`09`09 end X`09`09`09end X`09 end X`09 end; X X X`09`7B Make an attack on the player (chuckle...)`09`09-RAK-`09`7D X`09procedure make_attack(monptr : integer); X`09 var X`09`09xpos,atype,adesc,dam : integer; X`09`09i1,i2,i3,i4 : integer; X`09`09attstr,attx : vtype; X`09`09cdesc,mdesc,ddesc : vtype; X`09`09damstr : dtype; X`09`09flag : boolean; X`09 begin X`09 with m_list`5Bmonptr`5D do X`09 with c_list`5Bmptr`5D do X`09 begin X`09`09attstr := damage; X`09`09if ((uand(%X'10000',cmove) <> 0) and X`09`09 (not(py.flags.see_inv)))then X`09`09 cdesc := 'It ' X`09`09else if (py.flags.blind > 0) then X`09`09 cdesc := 'It ' X`09`09else if (not(ml)) then X`09`09 cdesc := 'It ' X`09`09else X`09`09 cdesc := 'The ' + name + ' '; X`09`09`7B For 'DIED_FROM' string `7D X`09`09if (uand(%X'80000000',cmove) <> 0) then X`09`09 ddesc := 'The ' + name X`09`09else X`09`09 ddesc := '& ' + name; X`09`09inventory`5Binven_max`5D.name := ddesc; X`09`09inventory`5Binven_max`5D.number := 1; X`09`09objdes(ddesc,inven_max,true); X`09`09`7B End DIED_FROM `7D X`09`09while (length(attstr) > 0) do X`09`09 begin X`09`09 xpos := index(attstr,'`7C'); X`09`09 if (xpos > 0) then X`09`09 begin X`09`09`09attx := substr(attstr,1,xpos-1); X`09`09`09attstr := substr(attstr,xpos+1,length(attstr)-xpos); X`09`09 end X`09`09 else X`09`09 begin X`09`09`09attx := attstr; X`09`09`09attstr := ''; X`09`09 end; X`09`09 readv(attx,atype,adesc,damstr); X`09`09 flag := false; X`09`09 if (py.flags.protevil > 0) then X`09`09 if (uand(cdefense,%X'0004') <> 0) then X`09`09`09if ((py.misc.lev+1) > level) then X`09`09`09 begin X`09`09`09 atype := 99; X`09`09`09 adesc := 99; X`09`09`09 end; X`09`09 with py.misc do X`09`09 case atype of X`7BNormal attack `7D 1 : if (test_hit(60,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BPoison Strength`7D 2 : if (test_hit(-3,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BConfusion attack`7D 3 : if (test_hit(10,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BFear attack `7D 4 : if (test_hit(10,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BFire attack `7D 5 : if (test_hit(10,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BAcid attack `7D 6 : if (test_hit(0,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BCold attack `7D 7 : if (test_hit(10,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BLightning attack`7D 8 : if (test_hit(10,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BCorrosion attack`7D 9 : if (test_hit(0,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BBlindness attack`7D 10 : if (test_hit(2,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BParalysis attack`7D 11 : if (test_hit(2,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BSteal Money `7D 12 : if (test_hit(5,level,0,py.misc.lev)) the Vn X`09`09`09`09 if (py.misc.au > 0) then X`09`09`09`09 flag := true; X`7BSteal Object `7D 13 : if (test_hit(2,level,0,py.misc.lev)) the Vn X`09`09`09`09 if (inven_ctr > 0) then X`09`09`09`09 flag := true; X`7BPoison `7D 14 : if (test_hit(5,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BLose dexterity`7D 15 : if (test_hit(0,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BLose constitution`7D 16 : if (test_hit(0,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BLose intelligence`7D 17 : if (test_hit(2,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BLose wisdom`7D 18 : if (test_hit(0,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BLose experience`7D 19 : if (test_hit(5,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BAggravate monsters`7D 20 : flag := true; X`7BDisenchant `7D 21 : if (test_hit(20,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BEat food `7D 22 : if (test_hit(5,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BEat light `7D 23 : if (test_hit(5,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`7BEat charges `7D 24 : if (test_hit(15,level,0,pac+ptoac)) then X`09`09`09`09 flag := true; X`09`09 99 : flag := true; X`09`09 otherwise ; X`09`09 end; X`09`09 if (flag) then X`09`09 begin X`09`09`09case adesc of X`09`09`09 1 : msg_print(cdesc + 'hits you.'); X`09`09`09 2 : msg_print(cdesc + 'bites you.'); X`09`09`09 3 : msg_print(cdesc + 'claws you.'); X`09`09`09 4 : msg_print(cdesc + 'stings you.'); X`09`09`09 5 : msg_print(cdesc + 'touches you.'); X`09`09`09 6 : msg_print(cdesc + 'kicks you.'); X`09`09`09 7 : msg_print(cdesc + 'gazes at you.'); X`09`09`09 8 : msg_print(cdesc + 'breathes on you.'); X`09`09`09 9 : msg_print(cdesc + 'spits on you.'); X`09`09`09 10 : msg_print(cdesc + 'makes a horrible wail.'); X`09`09`09 11 : msg_print(cdesc + 'embraces you.'); X`09`09`09 12 : msg_print(cdesc + 'crawls on you.'); X`09`09`09 13 : msg_print(cdesc + 'releases a cloud of spores.'); X`09`09`09 14 : msg_print(cdesc + 'begs you for money.'); X`09`09`09 15 : msg_print('You''ve been slimed!'); X`09`09`09 16 : msg_print(cdesc + 'crushes you.'); X`09`09`09 17 : msg_print(cdesc + 'tramples you.'); X`09`09`09 18 : msg_print(cdesc + 'drools on you.'); X`09`09`09 19 : case randint(9) of X`09`09`09`091 : msg_print(cdesc + 'insults you!'); X`09`09`09`092 : msg_print(cdesc + 'insults your mother!'); X`09`09`09`093 : msg_print(cdesc + 'gives you the finger!'); X`09`09`09`094 : msg_print(cdesc + 'humiliates you!'); X`09`09`09`095 : msg_print(cdesc + 'wets on your leg!'); X`09`09`09`096 : msg_print(cdesc + 'defiles you!'); X`09`09`09`097 : msg_print(cdesc + 'dances around you!'); X`09`09`09`098 : msg_print(cdesc + 'makes obscene gestures!'); X`09`09`09`099 : msg_print(cdesc + 'moons you!!!'); X`09`09`09 end; X`09`09`09 99 : msg_print(cdesc + 'is repelled.'); X`09`09`09 otherwise ; X`09`09`09end; X`09`09`09case atype of X`7BNormal attack `7D 1 : begin X`09`09`09`09 dam := damroll(damstr); X`09`09`09`09 with py.misc do X`09`09`09`09 dam :=dam - round(((pac+ptoac)/200.0)*dam); X`09`09`09`09 take_hit(dam,ddesc); X`09`09`09`09 prt_chp; X`09`09`09`09end; X`7BPoison Strength`7D 2 : begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 if (py.flags.sustain_str) then X`09`09msg_print('You feel weaker for a moment, then it passes.') X`09`09`09`09 else if (randint(2) = 1) then X`09`09`09`09 begin X`09`09`09`09`09msg_print('You feel weaker.'); X`09`09`09`09`09py.stat.cstr := de_statp(py.stat.cstr); X`09`09`09`09`09prt_strength; X`09`09`09`09 end; X`09`09`09`09 prt_chp; X`09`09`09`09end; X`7BConfusion attack`7D 3 : with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 if (randint(2) = 1) then X`09`09`09`09 begin X`09`09`09`09`09if (confused < 1) then X`09`09`09`09`09 begin X`09`09`09`09`09 msg_print('You feel confused.'); X`09`09`09`09`09 confused:=confused+randint(level); X`09`09`09`09`09 end; X`09`09`09`09`09confused := confused + 3; X`09`09`09`09 end; X`09`09`09`09 prt_chp; X`09`09`09`09 end; X`7BFear attack `7D 4 : with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 if (player_saves(wis_adj)) then X`09`09`09`09 msg_print('You resist the effects!') X`09`09`09`09 else if (afraid < 1) then X`09`09`09`09 begin X`09`09`09`09`09msg_print('You are suddenly afraid!'); X`09`09`09`09`09afraid := afraid + 3 + randint(level); X`09`09`09`09 end X`09`09`09`09 else X`09`09`09`09 afraid := afraid + 3; X`09`09`09`09 prt_chp; X`09`09`09`09 end; X`7BFire attack `7D 5 : begin X`09`09`09`09 msg_print('You are enveloped in flames!'); X`09`09`09`09 fire_dam(damroll(damstr),ddesc); X`09`09`09`09end; X`7BAcid attack `7D 6 : begin X`09`09`09`09 msg_print('You are covered in acid!'); X`09`09`09`09 acid_dam(damroll(damstr),ddesc); X`09`09`09`09end; X`7BCold attack `7D 7 : begin X`09`09`09`09 msg_print('You are covered with frost!'); X`09`09`09`09 cold_dam(damroll(damstr),ddesc); X`09`09`09`09end; X`7BLightning attack`7D 8 : begin X`09`09`09`09 msg_print('Lightning strikes you!'); X`09`09`09`09 light_dam(damroll(damstr),ddesc); X`09`09`09`09end; X`7BCorrosion attack`7D 9 : begin X`09`09`09msg_print('A stinging red gas swirls about you.'); X`09`09`09`09 corrode_gas(ddesc); X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 prt_chp; X`09`09`09`09end; X`7BBlindness attack`7D 10 : with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 if (blind < 1) then X`09`09`09`09 begin X`09`09`09`09`09blind := blind + 10 + randint(level); X`09`09`09`09`09msg_print('Your eyes begin to sting.'); X`09`09`09`09`09msg_print(' '); X`09`09`09`09 end; X`09`09`09`09 blind := blind + 5; X`09`09`09`09 prt_chp; X`09`09`09`09 end; X`7BParalysis attack`7D 11 : with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 if (player_saves(con_adj)) then X`09`09`09`09 msg_print('You resist the effects!') X`09`09`09`09 else if (paralysis < 1) then X`09`09`09`09 begin X`09`09`09`09`09if (free_act) then X`09`09`09`09`09 msg_print('You are unaffected.') X`09`09`09`09`09else X`09`09`09`09`09 begin X`09`09`09`09`09 paralysis:=randint(level) + 3; X`09`09`09`09`09 msg_print('You are paralyzed.'); X`09`09`09`09`09 end; X`09`09`09`09 end; X`09`09`09`09 prt_chp; X`09`09`09`09 end; X`7BSteal Money `7D 12 : with py.misc do X`09`09`09`09 begin X`09`09`09`09 if ((randint(124) < py.stat.cdex) and X`09`09`09`09`09(py.flags.paralysis < 1)) then X`09`09msg_print('You quickly protect your money pouch!') X`09`09`09`09 else X`09`09`09`09 begin X`09`09`09`09`09i1 := trunc(au/10) + randint(25); X`09`09`09`09`09if (i1 > au) then X`09`09`09`09`09 au := 0 X`09`09`09`09`09else X`09`09`09`09`09 au := au - i1; X`09`09`09`09`09msg_print('Your purse feels lighter.'); X`09`09`09`09`09prt_gold; X`09`09`09`09 end; X`09`09`09`09 if (randint(2) = 1) then X`09`09`09`09 begin X`09`09`09`09`09msg_print('There is a puff of smoke!'); X`09`09`09`09`09teleport_away(monptr,max_sight); X`09`09`09`09 end; X`09`09`09`09 end; X`7BSteal Object `7D 13 : with py.stat do X`09`09`09`09 begin X`09`09`09`09 if ((randint(124) < py.stat.cdex) and X`09`09`09`09`09(py.flags.paralysis < 1)) then X`09`09msg_print('You grab hold of your backpack!') X`09`09`09`09 else X`09`09`09`09 begin X`09`09`09`09`09i1 := randint(inven_ctr); X`09`09`09`09`09inven_destroy(i1); X`09`09`09`09msg_print('Your backpack feels lighter.'); X`09`09`09`09 end; X`09`09`09`09 if (randint(2) = 1) then X`09`09`09`09 begin X`09`09`09`09`09msg_print('There is a puff of smoke!'); X`09`09`09`09`09teleport_away(monptr,max_sight); X`09`09`09`09 end; X`09`09`09`09 end; X`7BPoison `7D 14 : with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 prt_chp; X`09`09`09`09 msg_print('You feel very sick.'); X`09`09`09`09 poisoned := poisoned+randint(level)+5; X`09`09`09`09 end; X`7BLose dexterity `7D 15 : with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 if (sustain_dex) then X`09`09msg_print('You feel clumsy for a moment, then it passes.') X`09`09`09`09 else X`09`09`09`09 begin X`09`09`09`09`09msg_print('You feel more clumsy.'); X`09`09`09`09`09py.stat.cdex := de_statp(py.stat.cdex); X`09`09`09`09`09prt_dexterity; X`09`09`09`09 end; X`09`09`09`09 prt_chp; X`09`09`09`09 end; X`7BLose constitution `7D 16 : with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 if (sustain_con) then X`09`09msg_print('Your body resists the effects of the disease.') X`09`09`09`09 else X`09`09`09`09 begin X`09`09`09`09`09msg_print('Your health is damaged!'); X`09`09`09`09`09py.stat.ccon := de_statp(py.stat.ccon); X`09`09`09`09`09prt_constitution; X`09`09`09`09 end; X`09`09`09`09 prt_chp; X`09`09`09`09 end; X`7BLose intelligence `7D 17 : with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 if (sustain_int) then X`09`09`09`09 begin X`09`09msg_print('You feel your memories fading...'); X`09`09msg_print('Your memories are suddenly restored!'); X`09`09`09`09 end X`09`09`09`09 else X`09`09`09`09 begin X`09`09msg_print('You feel your memories fading...'); X`09`09`09`09`09py.stat.cint:=de_statp(py.stat.cint); X`09`09`09`09`09prt_intelligence; X`09`09`09`09 end; X`09`09`09`09 prt_chp; X`09`09`09`09 end; X`7BLose wisdom `7D 18 : with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09`09`09 if (sustain_wis) then X`09`09`09`09 msg_print('Your wisdom is sustained.') X`09`09`09`09 else X`09`09`09`09 begin X`09`09`09`09`09msg_print('Your wisdom is drained.'); X`09`09`09`09`09py.stat.cwis := de_statp(py.stat.cwis); X`09`09`09`09`09prt_wisdom; X`09`09`09`09 end; X`09`09`09`09 prt_chp; X`09`09`09`09 end; X`7BLose experience `7D 19: begin X`09`09`09`09msg_print('You feel your life draining away!'); X`09`09`09`09 i1:=damroll(damstr)+ +-+-+-+-+-+-+-+- END OF PART 18 +-+-+-+-+-+-+-+-