-+-+-+-+-+-+-+-+ START OF PART 10 -+-+-+-+-+-+-+-+ 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_hp; 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_hp; 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_spell_saves) 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 or (free_time>0)) 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_hp; 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(256) < py.stat.c`5Bdx`5D) 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 if (money`5Btotal$`5D > 0) then X`09`09`09`09`09begin X`09`09`09`09`09 subtract_money(randint(5) * (money`5Btotal$`5D * gold$value V) div 100,false); X`09`09`09`09`09 msg_print('Your purse feels lighter.'); X`09`09`09`09`09 prt_weight; X`09`09`09`09`09 prt_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(256) < py.stat.c`5Bdx`5D) 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`09item_ptr := inventory_list; X`09`09`09`09`09i1 := randint(inven_ctr) - 1; X`09`09`09`09`09while (item_ptr <> nil) and (i1 > 0) do X`09`09`09`09`09 begin X`09`09`09`09`09 item_ptr := item_ptr`5E.next; X`09`09`09`09`09 i1 := i1 - 1; X`09`09`09`09`09 end; X`09`09`09`09`09if (item_ptr`5E.is_in = false) then X`09`09`09`09`09 if (uand(item_ptr`5E.data.flags2, X`09`09`09`09`09`09 holding_bit) <> 0) then X`09`09`09`09`09 begin X`09`09`09`09`09 if (item_ptr`5E.insides = 0) then X`09`09`09`09`09 inven_destroy(item_ptr); X`09`09`09`09`09 end X`09`09`09`09`09 else X`09`09`09`09`09 inven_destroy(item_ptr) X`09`09`09`09`09else X`09`09`09`09`09 inven_destroy(item_ptr); X`09`09`09`09`09prt_weight; 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_hp; 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`09lose_stat(dx,'You feel more clumsy', X`09`09'You feel clumsy for a moment, then it passes.'); X`09`09`09 prt_hp; 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`09ident := lose_stat(cn,'Your health is damaged!', X`09`09'Your body resists the effects of the disease.'); X`09`09`09`09 prt_hp; 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`09lose_stat(iq,'You feel your memories fading.', X`09`09'You feel your memories fade, then they are restored!'); X`09`09`09`09 prt_hp; 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`09lose_stat(ws,'Your wisdom is drained.', X`09`09'Your wisdom is sustained.'); X`09`09`09`09 prt_hp; X`09`09`09`09 end; X`7BLose experience `7D 19: begin V `20 X`09`09`09`09msg_print('You feel your life draining away!'); X`09`09`09`09 i1:=damroll(damstr)+ X`09`09`09`09`09(py.misc.exp div 100)*mon$drain_life; X`09`09`09`09 lose_exp(i1); X`09`09`09`09end; X`7BAggravate monster`7D 20: aggravate_monster(5); X`7BDisenchant `7D 21: begin X`09`09`09`09 flag := false; X`09`09`09`09 case randint(8) of X`09`09`09`09 1 : i1 := Equipment_primary; X`09`09`09`09 2 : i1 := Equipment_armor; X`09`09`09`09 3 : i1 := Equipment_belt; X`09`09`09`09 4 : i1 := Equipment_shield; X`09`09`09`09 5 : i1 := Equipment_cloak; X`09`09`09`09 6 : i1 := Equipment_gloves; X`09`09`09`09 7 : i1 := Equipment_bracers; X`09`09`09`09 8 : i1 := Equipment_helm; X`09`09`09`09 end; X`09`09`09`09 with equipment`5Bi1`5D do X`09`09`09`09 begin X`09`09`09`09 if (tohit > 0) then X`09`09`09`09`09begin X`09`09`09`09`09 tohit := tohit - X`09`09`09`09`09 randint(2 - ord(tohit = 1)); X`09`09`09`09`09 flag := true; X`09`09`09`09`09end; X`09`09`09`09 if (todam > 0) then X`09`09`09`09`09begin X`09`09`09`09`09 todam := todam - X`09`09`09`09`09 randint(2 - ord(todam = 1)); X`09`09`09`09`09 flag := true; X`09`09`09`09`09end; X`09`09`09`09 if (toac > 0) then X`09`09`09`09`09begin X`09`09`09`09`09 toac := toac - X`09`09`09`09`09 randint(2 - ord(toac = 1)); X`09`09`09`09`09 flag := true; X`09`09`09`09`09end; X`09`09`09`09 end; X`09`09`09`09 if (flag) then X`09`09`09`09 begin X`09`09 msg_print('There is a static feeling in the air...'); X`09`09`09`09 py_bonuses(blank_treasure,1); X`09`09`09`09 end; X`09`09`09`09end; X`7BEat food `7D 22: begin X`09`09`09`09 if (find_range(`5Bfood`5D,false,item_ptr,i2)) then X`09`09`09`09 begin X`09`09`09`09 inven_destroy(item_ptr); X`09`09`09`09 prt_weight; X`09`09`09`09 end; X`09`09`09`09end; X`7BEat light `7D 23: begin X`09`09`09`09 with equipment`5BEquipment_light`5D do X`09`09`09`09 if (p1 > 0) then X`09`09`09`09 begin X`09`09`09`09`09p1 := p1 - 250 - randint(250); X`09`09`09`09`09if (p1 < 1) then p1 := 1; X`09`09`09`09`09msg_print('Your light dims...'); X`09`09`09`09 end; X`09`09`09`09end; X`7BEat charges `7D 24: if (inven_ctr > 0) then X`09`09`09`09 begin X`09`09`09`09 item_ptr := inventory_list; X`09`09`09`09 for i1 := 1 to randint(inven_ctr)-1 do X`09`09`09`09 item_ptr := item_ptr`5E.next; X`09`09`09`09 i4 := level; X`09`09`09`09 with item_ptr`5E.data do X`09`09`09`09 if (tval in `5Bstaff,rod,wand`5D) then X`09`09`09`09`09if (p1 > 0) then X`09`09`09`09`09 begin X`09`09`09`09`09 hp := hp + i4*p1; X`09`09`09`09`09 p1 := 0; X`09`09`09`09msg_print('Energy drains from your pack!'); X`09`09`09`09`09 end; X`09`09`09`09 end; X`7BLose charisma`09 `7D`09 25: with py.flags do X`09`09`09`09 begin X`09`09`09`09 take_hit(damroll(damstr),ddesc); X`09`09lose_stat(ca,'Your skin starts to itch.', X`09`09'Your skin starts to itch, but feels better now.'); X`09`09`09`09 prt_hp; X`09`09`09`09 end; X`7BPetrification `7D`09 26: with py.flags do X`09`09`09`09 begin X`09`09`09`09 petrify(hp); X`09`09`09`09 end; X`7BPOISON Poison`09`7D`09 27: with py.flags do X`09`09`09`09 begin X`09`09`09`09 poisoned := poisoned + damroll(damstr); X`09`09`09`09 msg_print('You feel very sick.'); X`09`09`09`09 end; X`09`09`09 99: ; X`09`09`09 otherwise ; X`09`09`09end X`09`09 end X`09`09 else X`09`09 case adesc of X`09`09`09 1,2,3,6 : msg_print(cdesc + 'misses you.'); X`09`09`09 otherwise ; X`09`09 end X`09`09 end X`09`09 end X`09 end X`09 end; X X X`09`7B Make the move if possible, five choices`09`09-RAK-`09`7D X`09function make_move(monptr : integer; mm : mm_type) : boolean; X`09 var X`09`09i1,i2,newy,newx : integer; X`09`09movebits : unsigned; X`09`09flag,tflag`09 : boolean; X`09`09squash,doesit`09`09: ctype; X X`09 begin X`09 i1 := 1; X`09 flag := false; X`09 make_move := false; X`09 movebits := c_list`5Bm_list`5Bmonptr`5D.mptr`5D.cmove; X`09 repeat X`09`09`7B Get new positon `7D X`09 newy := m_list`5Bmonptr`5D.fy; X`09 newx := m_list`5Bmonptr`5D.fx; X`09 move(mm`5Bi1`5D,newy,newx); X`09 with cave`5Bnewy,newx`5D do X`09`09if (fval <> 15) then X`09`09 begin X`09`09 tflag := false; X`09`09 if (cptr = 1) then X`09`09`09tflag := true X`09`09 else if (fopen) then X`09`09 begin X`09`09`09if (fval in floor_set) then X`09`09`09 if (uand(movebits,%X'00000040') = 0) then X`09`09`09`09tflag := true X`09`09`09 else if ((fval in earth_set) = X`09`09`09`09 (uand(movebits,%X'00000010') = 0)) then X`09`09`09`09tflag := true; X`09`09 end X`09`09`7B Creature moves through walls? `7D X`09`09 else if (uand(movebits,%X'40000') <> 0) then X`09`09 tflag := true X`09`09`7B Creature can open doors? `7D X`09`09 else if (tptr > 0) then X`09with t_list`5Btptr`5D do X`09 with m_list`5Bmonptr`5D do X`09 if (uand(movebits,%X'20000') <> 0) then X`09 begin `7B Creature can open doors... `7D X`09`09case tval of X`09`09 Closed_door : begin `7B Closed doors... `7D X`09`09`09 if (p1 = 0) then `7B Closed doors `7D X`09`09`09 begin X`09`09`09 tflag := true; X`09`09`09 if (fm) then X`09`09`09`09if (los(char_row,char_col,newy,newx)) then X`09`09`09`09 begin X`09`09`09`09 t_list`5Btptr`5D := door_list`5B1`5D; X`09`09`09`09 fopen := true; X`09`09`09`09 lite_spot(newy,newx); X`09`09`09`09 tflag := false; X`09`09`09`09 end; X`09`09`09 end X`09`09`09 else if (p1 > 0) then `7B Locked doors `7D X`09`09`09 begin X`09`09`09 if (randint(100-level) < 5) then X`09`09`09`09p1 := 0; X`09`09`09 end X`09`09`09 else if (p1 < 0) then `7B Stuck doors `7D X`09`09`09 begin X`09`09`09 if (randint(hp) > (10+abs(p1))) then X`09`09`09`09p1 := 0; X`09`09`09 end; X`09`09`09end; X`09`09 Secret_door : begin `7B Secret doors... `7D X`09`09`09 tflag := true; X`09`09`09 if (fm) then X`09`09`09 if (los(char_row,char_col,newy,newx)) then X`09`09`09 begin X`09`09`09`09t_list`5Btptr`5D := door_list`5B1`5D; X`09`09`09`09fopen := true; X`09`09`09`09lite_spot(newy,newx); X`09`09`09`09tflag := false; X`09`09`09 end; X`09`09`09end; X`09`09 otherwise ; X`09`09end; X`09 end X`09 else X`09 begin `7B Creature can not open doors, must bash them `7D X`09`09case tval of X`09`09 Closed_door : begin `7B Closed doors... `7D X`09`09`09 i2 := abs(p1) + 20; X`09`09`09 if (randint(hp) > i2) then X`09`09`09 begin X`09`09`09 tflag := true; X`09`09`09 if (fm) then X`09`09`09`09if (los(char_row,char_col,newy,newx)) then X`09`09`09`09 begin X`09`09`09`09 t_list`5Btptr`5D := door_list`5B1`5D; X`09`09`09`09 t_list`5Btptr`5D.p1 := randint(2) - 1; X`09`09`09`09 fopen := true; X`09`09`09`09 lite_spot(newy,newx); X`09`09`09`09 tflag := false; X`09`09`09`09 end; X`09`09`09 end X`09`09`09end; X`09`09 Secret_door : ; `7B Secret doors... `7D X`09`09 otherwise ; X`09`09end; X`09 end; X`09`09`7B Glyph of warding present? `7D X`09`09 if (tflag) then X`09`09 if (tptr > 0) then X`09`09`09if (t_list`5Btptr`5D.tval = Seen_Trap) then X`09`09`09 if (t_list`5Btptr`5D.subval = 99) then X`09`09`09 begin X`09`09`09 if (randint(obj$rune_prot) < c_list`5Bm_list`5Bmonptr`5D.mptr V`5D.level) then X`09`09`09`09begin X`09`09`09`09 if ((newy=char_row) and (newx=char_col)) then X`09`09`09`09 msg_print('The rune of protection is broken!'); X`09`09`09`09 delete_object(newy,newx); X`09`09`09`09end X`09`09`09 else X`09`09`09`09tflag := false; X`09`09`09 end; X`09`09`7B Creature has attempted to move on player? `7D X`09`09 if (tflag) then X`09`09 if (cptr = 1) then X`09`09`09begin X`09`09`09 if (not (m_list`5Bmonptr`5D.ml)) then X`09`09`09 update_mon(monptr); X`09`09`09 if (find_flag) then X`09`09`09 begin X`09`09`09 find_flag := false; X`09`09`09 move_char(5); X`09`09`09 end; X`09`09`09 make_attack(monptr); X`09`09`7B Player has read a Confuse Monster? `7D X`09`09`7B Monster gets a saving throw... `7D X`09`09`09 if (py.flags.confuse_monster) then X`09`09`09 with m_list`5Bmonptr`5D do X`09`09`09 with c_list`5Bmptr`5D do X`09`09`09 begin X`09`09`09`09msg_print('Your hands stop glowing.'); X`09`09`09`09py.flags.confuse_monster := false; X`09`09`09`09if mon_save(monptr,0,c_sc_mental) then X`09`09msg_print('The ' + name + ' is unaffected.') X`09`09`09`09else X`09`09`09`09 begin X`09`09msg_print('The ' + name + ' appears confused.'); X`09`09`09`09 confused := true; X`09`09`09`09 end; X`09`09`09 end; X`09`09`09 tflag := false; X`09`09`09 flag := true; X`09`09`09end X`09`09`7B Creature is attempting to move on other creature? `7D X`09`09 else`20 X`09`09`09if ((cptr > 1) and ((newy <> m_list`5Bmonptr`5D.fy) or X`09`09`09 (newx <> m_list`5Bmonptr`5D.fx))) then X`09`09`09begin X`09`09`7B Creature eats other creatures? `7D X`09`09`09 if (uand(movebits,%X'80000') <> 0) then X`09`09`09 begin X`09`09`09 if (m_list`5Bcptr`5D.ml = true) then X`09`09`09 begin X`09`09`09 squash := c_list`5Bm_list`5Bcptr`5D.mptr`5D.name; X`09`09`09 doesit := c_list`5Bm_list`5Bmonptr`5D.mptr`5D.name; +-+-+-+-+-+-+-+- END OF PART 10 +-+-+-+-+-+-+-+-