-+-+-+-+-+-+-+-+ START OF PART 47 -+-+-+-+-+-+-+-+ X msg_print('The ' + c_list`5Bm_list`5Bcptr`5D.mptr`5D.n Vame + X ' is in your way!') X else if (tval = 104) then X msg_print('The door must be closed first.') X else X msg_print('That isn''t a door!') X else X msg_print('That isn''t a door!'); X END; X END; X`20 X`20 X`7B Refill the players lamp`7D X procedure refill_lamp; X var X i1,i2,i3: integer; X out_val : vtype; X BEGIN X i3 := inventory`5B33`5D.subval; X if ((i3 > 0) and (i3 < 10)) then X if (find_range(`5B77`5D,i1,i2)) then X BEGIN X msg_print('Your lamp is full.'); X with inventory`5B33`5D do X BEGIN X p1 := p1 + inventory`5Bi1`5D.p1; X if (p1 > obj$lamp_max) then p1 := obj$lamp_max; X END; X desc_remain(i1); X inven_destroy(i1); X END X else X msg_print('You have no oil.') X else X msg_print('But you are not using a lamp.'); X END; X`20 X`7B General spells and misc routines `7D X %INCLUDE 'MOR_INCLUDE:SPELLS.INC' X`7B Wizard and debug routines `7D X %INCLUDE 'MOR_INCLUDE:WIZARD.INC' X`7B Creature movement and attacks using objects `7D X %INCLUDE 'MOR_INCLUDE:CREATURE.INC' X %INCLUDE 'MOR_INCLUDE:SCROLLS.INC' X %INCLUDE 'MOR_INCLUDE:POTIONS.INC' X %INCLUDE 'MOR_INCLUDE:EAT.INC' X %INCLUDE 'MOR_INCLUDE:WANDS.INC' X %INCLUDE 'MOR_INCLUDE:STAVES.INC' X`7B Spell casting `7D X %INCLUDE 'MOR_INCLUDE:MAGIC.INC' X %INCLUDE 'MOR_INCLUDE:PRAYER.INC' `20 X`09%INCLUDE 'MOR_INCLUDE:EXTRA.INC' X X`7B Bomb routine - logs out the top process in the process tree for a user X if called.....-NBT with help from WLP `7D XProcedure Bomb; External; X X`7B Main procedure for dungeon. X Note: There is a lot of prelinimary magic going on here at first`7D X BEGIN X`7B Check light status for setup `7D X with inventory`5B33`5D do X if (p1 > 0) then X player_light := true X else `20 X player_light := false; X`7B Check for a maximum level `7D X with py.misc do X if (dun_level > max_lev) then max_lev := dun_level; X`7B Set up the character co-ords `7D X if ((char_row = -1) or (char_col = -1)) then X new_spot(char_row,char_col); X`7B Reset flags and initialize variables`7D X moria_flag := false; X cave_flag := false; X find_flag := false; X search_flag:= false; X teleport_flag := false; X mon_tot_mult := 0; X cave`5Bchar_row,char_col`5D.cptr := 1; X old_chp:= trunc(py.misc.chp); X old_cmana := trunc(py.misc.cmana); X`7B--NBT--`7D X scumuser := loseruser; X`7B Light up the area around character `7D X move_char(5); X`7B Light, but do not move critters `7D X creatures(false); X`7B Print the depth `7D X prt_depth; X`20 X`7B Loop until dead, or new level `7D X repeat X`20 X`7B Increment turn counter `7D X turn := turn + 1; X`7B Check for game hours `7D X if (not(wizard)) then X if ((turn mod 250) = 1) then X if (not(check_time)) then X if (closing_flag > 4) then X BEGIN X if (search_flag) then X search_off; X if (py.flags.rest > 0) then X rest_off; X find_flag := false; X msg_print('The gates to Moria are now closed.'); X msg_print(''); X repeat X save_char; X until(false); X END X else X BEGIN X if (search_flag) then X search_off; X if (py.flags.rest > 0) then X rest_off; X find_flag := false; X move_char(5); X closing_flag := closing_flag + 1; X msg_print('The gates to Moria are closing...'); X msg_print('Please finish up or save your game.'); X msg_print(''); X END; X`20 X`7B Check for creature generation `7D X if (randint(max_malloc_chance) = 1) then X alloc_monster(floor_set,1,max_sight,false); X`7B Screen may need updating, used mostly for stats`7D X if (print_stat > 0) then X BEGIN X if (uand(%X'0001',print_stat) <> 0) then X prt_strength; X if (uand(%X'0002',print_stat) <> 0) then X prt_dexterity; X if (uand(%X'0004',print_stat) <> 0) then X prt_constitution; X if (uand(%X'0008',print_stat) <> 0) then X prt_intelligence; X if (uand(%X'0010',print_stat) <> 0) then X prt_wisdom; X if (uand(%X'0020',print_stat) <> 0) then X prt_charisma; X if (uand(%X'0040',print_stat) <> 0) then X prt_pac; X if (uand(%X'0100',print_stat) <> 0) then X prt_mhp; X if (uand(%X'0200',print_stat) <> 0) then X prt_title; X if (uand(%X'0400',print_stat) <> 0) then X prt_level; X END; X`7B Check light status `7D X with inventory`5B33`5D do X if (player_light) then X if (p1 > 0) then X BEGIN X p1 := p1 - 1; X if (p1 = 0) then X BEGIN X msg_print('Your light has gone out!'); X player_light := false; X find_flag := false; X move_light(char_row,char_col,char_row,char_col); X END X else if (p1 < 40) then X if (randint(5) = 1) then X BEGIN X if (find_flag) then X BEGIN X find_flag := false; X move_light(char_row,char_col,char_row,char_col); X END; X msg_print('Your light is growing faint.'); X END; X END X else X BEGIN X player_light := false; X find_flag := false; X move_light(char_row,char_col,char_row,char_col); X END X else if (p1 > 0) then X BEGIN X p1 := p1 - 1; X player_light := true; X move_light(char_row,char_col,char_row,char_col); X END; X`20 X`7B Update counters and messages `7D X with py.flags do X BEGIN X`7B Check food status `7D X regen_amount := player$regen_normal; X if (food < player_food_alert) then X BEGIN X if (food < player_food_weak) then X BEGIN X if (food < 0) then X regen_amount := 0 X else if (food < player_food_faint) then X regen_amount := player$regen_faint X else if (food < player_food_weak) then X regen_amount := player$regen_weak; X if (uand(%X'00000002',status) = 0) then X BEGIN X status := uor(%X'00000003',status); X msg_print('You are getting weak from hunger.'); X if (find_flag) then X BEGIN X find_flag := false; X move_char(5); X END; X prt_hunger; X END; X if (food < player_food_faint) then X if (randint(8) = 1) then X BEGIN X paralysis := paralysis + randint(5); X msg_print('You faint from the lack of food.'); X if (find_flag) then X BEGIN X find_flag := false; X move_char(5); X END; X END; X END X else X BEGIN X if (uand(%X'00000001',status) = 0) then X BEGIN X status := uor(%X'00000001',status); X msg_print('You are getting hungry.'); X if (find_flag) then X BEGIN X find_flag := false; X move_char(5); X END; X prt_hunger; X END; X END; X END; X`7B Food consumtion X Note: Speeded up characters really burn up the food!`7D X if (speed < 0) then X food := food - (speed*speed) - food_digested X else X food := food - food_digested; X`7B Regenerate `7D X with py.misc do X BEGIN X if (regenerate) then regen_amount := regen_amount*2; X if (rest > 0) then regen_amount := regen_amount*2; X if (py.flags.poisoned < 1) then X if (chp < mhp) then X regenhp(regen_amount); X if (cmana < mana) then X regenmana(regen_amount); X END; X`7B Blindness `7D X if (blind > 0) then X BEGIN X if (uand(%X'00000004',status) = 0) then X BEGIN X status := uor(%X'00000004',status); X prt_map; X prt_blind; X if (search_flag) then X search_off; X END; X blind := blind - 1; X if (blind = 0) then X BEGIN X status := uand(%X'FFFFFFFB',status); X prt_blind; X prt_map; X msg_print('The veil of darkness lifts.'); X if (find_flag) then X BEGIN X find_flag := false; X move_char(5); X END; X END; X END; X`7B Confusion `7D X if (confused > 0) then X BEGIN X if (uand(%X'00000008',status) = 0) then X BEGIN X status := uor(%X'00000008',status); X prt_confused; X END; X confused := confused - 1; X if (confused = 0) then X BEGIN X status := uand(%X'FFFFFFF7',status); X prt_confused; X msg_print('You feel less confused now.'); X if (find_flag) then X BEGIN X find_flag := false; X move_char(5); X END; X END; X END; X`7B Afraid `7D X if (afraid > 0) then X BEGIN X if (uand(%X'00000010',status) = 0) then X BEGIN X if ((shero+hero) > 0) then X afraid := 0 X else X BEGIN X status := uor(%X'00000010',status); X prt_afraid; X END; X END X else if ((shero+hero) > 0) then X afraid := 1; X afraid := afraid - 1; X if (afraid = 0) then X BEGIN X status := uand(%X'FFFFFFEF',status); X prt_afraid; X msg_print('You feel bolder now.'); X if (find_flag) then X BEGIN X find_flag := false; X move_char(5); X END; X END; X END; X`7B Poisoned `7D X if (poisoned > 0) then X BEGIN X if (uand(%X'00000020',status) = 0) then X BEGIN X status := uor(%X'00000020',status); X prt_poisoned; X END; X poisoned := poisoned - 1; X if (poisoned = 0) then X BEGIN X status := uand(%X'FFFFFFDF',status); X prt_poisoned; X msg_print('You feel better.'); X if (find_flag) then X BEGIN X find_flag := false; X move_char(5); X END; X END X else X BEGIN X CASE con_adj of X -4: take_hit(4,'poison.'); X -3,-2: take_hit(3,'poison.'); X -1: take_hit(2,'poison.'); X 0 : take_hit(1,'poison.'); X 1,2,3: if ((turn mod 2) = 0) then X take_hit(1,'poison.'); X 4,5 : if ((turn mod 3) = 0) then X take_hit(1,'poison.'); X 6 : if ((turn mod 4) = 0) then X take_hit(1,'poison.'); X END; X END; X END; X`7B Fast `7D X if (fast > 0) then X BEGIN X if (uand(%X'00000040',status) = 0) then X BEGIN X status := uor(%X'00000040',status); X msg_print('You feel yourself moving faster.'); X change_speed(-1); X if (find_flag) then X BEGIN X find_flag := false; X move_char(5); X END; X END; X fast := fast - 1; X if (fast = 0) then X BEGIN +-+-+-+-+-+-+-+- END OF PART 47 +-+-+-+-+-+-+-+-