-+-+-+-+-+-+-+-+ START OF PART 5 -+-+-+-+-+-+-+-+ X horsestat := (25,30,28,22,21,24,23,22,23,20,26,23,30,23,19,23,22,19,2 V7, X 25,23,28,24,26,22,25,21,22,26,24,28,27,29,29,28,26,26,1 V7, X 25,18,26,31,28,23,28,26,25,27,29,25,23,26,27,26,27); X X`20 Xprocedure change_money; X var X amount : integer; Xbegin X amount := abs(py.misc.money`5Btotal$`5D - gld)*gold$value; X if (gld > py.misc.money`5Btotal$`5D) then add_money(amount) X else subtract_money(amount,true); Xend; X`20 Xprocedure check_casino_kickout; X begin X if ((tics mod 2) = 1) then X if (check_kickout) then X`09begin X`09 msg_print('A new version of IMoria is being installed.'); X`09 msg_print('After your character is saved, wait a few minutes,'); X`09 msg_print('And then try to run the game.'); X`09 msg_print(''); X`09 change_money; X`09 repeat X`09 py.flags.dead := false; X`09 save_char(true); X`09 until(false); X`09end; X tics := tics + 1; X end; X`20 Xfunction get_response(comment : vtype; var num : integer) : boolean; X`20 Xvar X i1, clen : integer; X out_val : vtype; X flag : boolean; X`20 Xbegin X flag := true; X i1 := 0; X clen := length(comment) + 2; X repeat; X prt(comment,1,1); X msg_flag := false; X if (not(get_string(out_val,1,clen,40))) then X begin X flag := false; X erase_line(msg_line,msg_line); X end; X readv(out_val,i1,error:=continue); X until((i1 <> 0) or not(flag)); X if (flag) then num := i1; X get_response := flag Xend; X`20 X`20 Xprocedure display_gold; X var X out_val : vtype; X`20 Xbegin X writev(out_val, 'gold remaining : ',gld:1); X prt( out_val, 19, 22) Xend; X`20 X`20 Xprocedure display_casino; X var X shop_owner : vtype; Xbegin X clear(1,1); X shop_owner := 'Darkon (Master-Hacker) Casino'; X prt(shop_owner, 4, 10); X prt('Game: Max Bet',6,4); X prt('a) slots 10000', 7,1 V); X prt('b) blackjack 1000', 8,1 V); X prt('c) horse racing 1000', 9,1 V); X display_gold; X prt('You may:',21,1); X prt(' p) Play a game. h) Help on game rules.',22,2); X prt('`5EZ) Exit from building. `5ER) Redraw the screen.' ,23,2); Xend; X`20 X %INCLUDE 'bj.inc' X %INCLUDE 'slots.inc' X %INCLUDE 'horse.inc' X`20 Xprocedure play_game; X var X game : char; X com_val : integer; X exit_flag : boolean; Xbegin X exit_flag := false; X repeat X msg_print('Which game do you want to play? '); X if get_com('', game) then X begin X com_val := ord(game); X case com_val of X 97 : begin X game_slots; X exit_flag := true; X display_casino X end; X 98 : begin X game_blackjack; X exit_flag := true; X display_casino X end; X 99 : begin X game_horse; X exit_flag := true; X display_casino X end; X otherwise prt('That game does not exist, try again.',1,1); X end; X end X else exit_flag := true; X until(exit_flag) Xend; X`20 Xprocedure exit_messages; Xbegin X if (gld > 2*py.misc.money`5Btotal$`5D + 1000) then begin X case randint(3) of X 1 : msg_print('Quitting while you''re ahead, huh?'); X 2 : msg_print('Lady luck must be on you side.'); X 3 : msg_print('A pair of heavily armed thugs show you to the door.' V); X end X end X else if (gld < py.misc.money`5Btotal$`5D - 1000) then begin X case randint(4) of X 1 : msg_print('KC thanks you for your patronage.'); X 2 : msg_print('KC personally escorts you to the door.'); X 3 : msg_print('Better luck next time.'); X 4 : msg_print('You leave a sadder and wiser man.'); X end X end X else msg_print('Bye.'); X msg_print(' '); Xend; X`20 X`20 Xprocedure parse_command; X var X command : char; X com_val : integer; X exit_flag : boolean; Xbegin X exit_flag := false; X repeat X if get_com( '', command) then X begin X com_val := ord(command); X case com_val of X 112 : play_game; X 18 : display_casino; X otherwise prt('Invalid Command.',1,1) X end; X end X else exit_flag := true; X until (exit_flag) or (closed); Xend; X`20 Xbegin X closed := false; X tics := 1; X seed := get_seed; X gld := py.misc.money`5Btotal$`5D; X msg_line := 1; X display_casino; X parse_command; X exit_messages; X change_money; X clear(1,1); X draw_cave; Xend; X`20 Xend. $ CALL UNPACK CASINO.PAS;1 1764318408 $ create 'f' X`7B The money changer will change the person's money, taking 5% off the top V `7D X`7B and then giving change to the nearest integer value below the actual V `7D X`7B value. V `7D X X`5Bpsect(changer$code)`5D procedure enter_changer; X Xvar X X exit_flag : boolean; X shop_owner : vtype; X out_val : vtype; X tics : integer; X X X X procedure change_some_money; X`7B Changes money of one type to money of another type. -JPS- `7D X var`20 X change_flag : boolean; `7B Did they enter a valid entry? `7D X amount_from : integer; `7B Amount before changing. `7D X amount_to : integer; `7B Amount remaining after changing. `7 VD X`09key_in`09`09: char;`09 `7B input character `7D X typ_from,typ_to : integer; `7B Types of money `7D X prompt : string; `7B Prompt used.`7D X X begin X with py.misc do X begin X key_in := chr(get_money_type('Change what coin? ',change_flag,false)); X if change_flag then X`09begin X`09 coin_stuff(key_in,type_from); X`09 key_in := chr(get_money_type('Change to? ',change_flag,true)); X`09end; X if change_flag then X begin X`09 coin_stuff(key_in,type_to); X writev(prompt,'Number of coins to change? (1-', X`09`09money`5Btype_from`5D:1,'), `5EZ to exit : '); X change_flag := get_entry(prompt,amount_from); X end; X if (change_flag) then X`09 begin X amount_to := (amount_from * coin$value`5Btype_from`5D) div X`09`09`09coin$value`5Btype_to`5D; `7BNO surcharge`7D X`09 if (amount_to = 0) then X`09 msg_print('You don''t have enough to trade for that type of coin!') X`09 else if (amount_to > bank`5Btype_to`5D) then X`09 msg_print('The bank doesn''t have enough of that kind of coin!') X`09 else if (money`5Btype_from`5D < amount_from) then X`09 msg_print('You don''t have enough of that coin!') X else if (inven_weight + coin$weight*(amount_to-amount_from) X`09`09 > weight_limit*100) then X msg_print('You can''t carry that much weight.') X`09 else X`09 with py.misc do X`09 begin`09 `20 X`09`09money`5Btype_from`5D := money`5Btype_from`5D - amount_from; X`09`09bank`5Btype_from`5D := bank`5Btype_from`5D + amount_from; X`09`09money`5Btype_to`5D := money`5Btype_to`5D + amount_to; X`09`09bank`5Btype_to`5D := bank`5Btype_to`5D - amount_to; X`09`09inven_weight:=inven_weight+coin$weight*(amount_to-amount_from); X`09 msg_print('The money changer hands you your money.'); X end; X end; X end; X `20 X X $ CALL UNPACK CHANGER.INC;1 238903806 $ create 'f' X Xconst X`09`7BNote to the Wizard:`09`09`09`09`09`09`7D X`09`7B`09Tweaking these constants can *GREATLY* change the game. `7D X`09`7B`09Two years of constant tuning have generated these`09`7D X`09`7B`09values.`09 Minor adjustments are encouraged, but you must `7D X`09`7B`09be very careful not to unbalance the game. Moria was`09`7D X`09`7B`09meant to be challenging, not a give away. Many`09`09`7D X`09`7B`09adjustments can cause the game to act strangely, or even`7D X`09`7B`09cause errors.`09`09`09`09`09`09`7D X`20 X`09`7B Current version number of Moria`09`09`09`09`7D X`09cur_version = 4.85;`7BFUBAR`7D X`20 X`09`7B QIOW constants, see $IODEF in STARLET.MLB`09`09`09`7D X`09IO$MOR_OUTPUT = IO$_WRITEVBLK; X`09IO$MOR_INPUT = IO$_TTYREADALL + IO$M_NOECHO; X`09IO$MOR_DELAY = IO$MOR_INPUT + IO$M_NOWAIT; X`09IO$MOR_IPURGE = IO$MOR_DELAY + IO$M_PURGE; X `20 X`09`7B Wizard accounts (can use wizard/god modes)`09 -DCJ/KRC- X`09 Please document additions to this list. Current wizards are: X`09`09games/arcana`09: GAMES X`09`09Tom Bunch : 8630891 X`09`09Ken Case`09: 9EBB07D3, C8518 X Robert Christ : 8725262 X`09`09Mary Conner`09: 26F45030, 8221984 X`09`09Brad DeGrazia : 8830329 X`09`09Rob DeLoura`09: 8536399 X`09`09`09`09: DD7CB31C X`09`09Jimbo Harris : 8727288 X`09`09Jonathan Sari`09: 8728277 X`09`09Raoul St.Pierre : 8832780 X`09`09And Dean Yasuda as the MBI! X`09`7D X`09wizards = ':GAMES:9EBB07D3:C8518:26F45030:8727288:8536399:DD7CB31C:872827 V7:8221984:8725262:8832780:8830329:'; X`20 X`09`7B Encryption constants`09`09`09`09`09`09`7D X`09`7B Note: These numbers were pulled from the air, and can be`09`7D X`09`7B`09changed. If changed, characters produced from other`09`7D X`09`7B`09versions will fail to restore.`09`09`09`09`7D X`09encrypt_seed1 = 1175191; X`09encrypt_seed2 = 997551771; X`20 X`09`7B Screen size parameters`09`09`09`09`09`7D X`09screen_height = 22; X`09screen_width = 66; X`20 X`09`7B Screen placement parameters`09`09`09`09`09`7D X`09stat_column`09= 1 ; X`09race_row`09= 2 ; X`09class_row`09= race_row + 1 ; X`09title_row`09= class_row + 1 ; X`09str_row`09`09= title_row + 2 ; X`09int_row`09`09= str_row + 1 ; X`09wis_row`09`09= int_row + 1 ; X`09dex_row`09`09= wis_row + 1 ; X`09con_row`09`09= dex_row + 1 ; X`09cha_row`09`09= con_row + 1 ; X`09level_row`09= cha_row + 2 ; X`09exp_row`09`09= level_row + 1 ; X`09mana_row`09= exp_row + 1 ; X`09hp_row`09`09= mana_row + 1 ; X`09quest_row`09= hp_row + 1; X`09ac_row`09`09= quest_row + 1 ; X`09gold_row`09= ac_row + 1 ; X`09weight_row`09= gold_row + 1 ; X`09time_row`09= weight_row + 2; X`09winner_row`09= 23 ; X`09winner_column`09`09= 1 ; X`20 X`09status_row`09= 24 ; X`09`09hunger_column`09`09= 1 ; X`09`09blind_column`09`09= 9 ; X`09`09confused_column`09`09= 16 ; X`09`09afraid_column`09`09= 26 ; X`09`09poisoned_column`09`09= 34 ; X`09`09searching_column`09= 44 ; X`09`09resting_column`09`09= 44 ; X`09`09quested_column`09`09= 53 ;`7BFUBAR`7D X`09`09depth_column`09`09= 62 ; X`20 X`20 X`09sr = 0;`09iq = 1;`09ws = 2;`09dx = 3;`09cn = 4;`09ca = 5; X`09`7B Spell Effect Constants! `7D X`09c_null=0; X`09c_lightning=1; c_gas=2; c_acid=3; c_cold=4; c_fire=5; X`09c_good=6; c_evil=7; c_petrify=8; c_sunray=9; c_illusion=10; c_probe=11; X`09c_sleep=12; c_confuse=13; c_hp=14; c_drain=15; c_speed=16; c_hold=17; X`09c_turn=18; c_poly=19; c_joke=20; c_monster=21; c_invisible=22; X`09c_creature=23; c_object=24; c_treasure=25; c_hp_undead=26; X`09c_thunder=27; c_holy_word=28; X X`09c_sc_hold=1; c_sc_mental=2; X X`09`7B # of numbered objects for easy summoning (ie. create food) `7D X`09num_yum=17; X X`09`7B Dungeon size parameters`09`09`09`09`09`7D X`09max_height = 66;`09`7B Multiple of 11; >= 22 `7D X`09max_width = 198;`09`7B Multiple of 33; >= 66 `7D X`20 X`09`7B Output dungeon section sizes`09`09`09`09`09`7D X`09outpage_height= 44;`09`7B 44 lines of dungeon per section`09`7D X`09outpage_width = 99;`09`7B 100 columns of dungeon per section`09`7D X`20 X`09`7B Dungeon generation values`09`09`09`09`09`7D X`09`7B Note: The entire design of dungeon can be changed by only`09`7D X`09`7B`09slight adjustments here.`09`09`09`09`7D X`09day_length`09= 9600;`09`7B Turns in a day`09`09`09`7D X`09dun_tun_rnd`09= 36;`09`7B Random direction (4 is min)`09`09`7D X`09dun_tun_chg`09= 70;`09`7B Chance of changing direction (99 max) `7D X`09dun_tun_fnd`09= 12;`09`7B Distance for auto find to kick in`09`7D X`09dun_tun_con`09= 15;`09`7B Chance of extra tunneling`09`09`7D X`09dun_roo_mea`09= 32;`09`7B Mean of # of rooms, standard dev=2`09`7D X`09dun_tun_pen`09= 25;`09`7B % chance of room doors`09`09`7D X`09dun_tun_jct`09= 15;`09`7B % chance of doors at tunnel junctons`09`7D X`09dun_str_den`09= 5;`09`7B Density of streamers`09`09`09`7D X`09dun_str_rng`09= 2;`09`7B Width of streamers`09`09`09`7D X`09dun_str_mag`09= 3;`09`7B Number of magma streamers`09`09`7D X`09dun_str_qua`09= 2;`09`7B Number of quartz streamers`09`09`7D X`09dun_wtr_den`09= 5;`09`7B Density of water`09`09`09`7D X`09dun_wtr_width`09= 4;`09`7B Width of river`09`09`09`7D X`09dun_rivers`09= 3;`09`7B Number of rivers`09`09`09`7D X`09dun_riv_len`09= 35;`09`7B Maximum river length`09`09`09`7D X`09dun_pools`09= 3;`09`7B Number of pools`09`09`09`7D X`20 X`09`7B Store constants`09`09`09`09`09`09`7D X`09max_owner_kind`09= 4;`09`7B Number of different keepers for a shop`7D X`09max_stores`09= 11;`09`7B Number of different stores`09`09`7D X`09max_owners`09= max_stores * max_owner_kind; X`09`09`09`09`7B Number of owners to choose from`09`7D X`09max_unnamed`09= 6;`09`7B # of 'odd' shops (Post, etc)`09`7D X`09tot_stores`09= max_stores+max_unnamed; X`09max_fountains`09= 2;`09`7B # of fountains on town level`09`7D X`09max_house1`09= 4;`09`7B # of generic houses in town`09`7D X`09max_house2`09= 8;`09`7B # of small houses in town `7D X`09max_house3`09= 2;`09`7B # apartments `7D X`09max_house4`09= 2;`09`7B # small apartments `7D X`09day_mugging`09= 50;`09`7B 1/x chance that page gets mugged (day)`7D X`09night_mugging`09= 15;`09`7B 1/x chance that page gets mugged (night)`7D X`09bank_skim`09= 0.95;`09`7B Percent of money that really gets deposited`7D X`09store_inven_max = 24;`09`7B Max number of discrete objs in inven`09`7D X`09store$choices`09= 50;`09`7B Number of items to choice stock from`09`7D X`09store$max_inven = 20;`09`7B Max diff objs in stock before auto sell`7D X`09store$min_inven = 14;`09`7B Min diff objs in stock before auto buy`7D X`09store$turn_around= 3;`09`7B Amount of buying and selling normally `7D +-+-+-+-+-+-+-+- END OF PART 5 +-+-+-+-+-+-+-+-