billr@saab.CNA.TEK.COM (Bill Randle) (07/14/89)
Submitted-by: "Laurence R. Brothers" <brothers@paul.rutgers.edu> Posting-number: Volume 7, Issue 33 Archive-name: omega3/Part14 Supersedes: omega2: Volume 5, Issue 12-29,38-40 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 14 (of 20)." # Contents: oeffect2.c oextern.h ospell.c oupdate.txt # Wrapped by billr@saab on Thu Jun 29 08:14:09 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'oeffect2.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'oeffect2.c'\" else echo shar: Extracting \"'oeffect2.c'\" \(16789 characters\) sed "s/^X//" >'oeffect2.c' <<'END_OF_FILE' X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */ X/* oeffect2.c */ X X#include "oglob.h" X X X Xvoid knowledge(blessing) Xint blessing; X{ X if (blessing < 0) X mprint("You feel ignorant."); X else { X mprint("You feel knowledgeable!"); X menuclear(); X menuprint("Current Point Total: "); X menunumprint(calc_points()); X menuprint("\nAlignment:"); X if (Player.alignment == 0) X menuprint("Neutral, embodying the Cosmic Balance"); X else if (abs(Player.alignment) < 10) X menuprint("Neutral, tending toward "); X else if (abs(Player.alignment) < 50) X menuprint("Neutral-"); X else if (abs(Player.alignment) < 100) ; X else if (abs(Player.alignment) < 200) X menuprint("Servant of "); X else if (abs(Player.alignment) < 400) X menuprint("Master of "); X else if (abs(Player.alignment) < 800) X menuprint("The Essence of "); X else menuprint("The Ultimate Avatar of "); X if (Player.alignment < 0) menuprint("Chaos\n"); X else if (Player.alignment > 0) menuprint("Law\n"); X morewait(); X menuclear(); X menuprint("Current stati:\n"); X if (Player.status[BLINDED]) X menuprint("Blinded\n"); X if (Player.status[SLOWED]) X menuprint("Slowed\n"); X if (Player.status[HASTED]) X menuprint("Hasted\n"); X if (Player.status[DISPLACED]) X menuprint("Displaced\n"); X if (Player.status[SLEPT]) X menuprint("Slept\n"); X if (Player.status[DISEASED]) X menuprint("Diseased\n"); X if (Player.status[POISONED]) X menuprint("Poisoned\n"); X if (Player.status[BREATHING]) X menuprint("Breathing\n"); X if (Player.status[INVISIBLE]) X menuprint("Invisible\n"); X if (Player.status[REGENERATING]) X menuprint("Regenerating\n"); X if (Player.status[VULNERABLE]) X menuprint("Vulnerable\n"); X if (Player.status[BERSERK]) X menuprint("Berserk\n"); X if (Player.status[IMMOBILE]) X menuprint("Immobile\n"); X if (Player.status[ALERT]) X menuprint("Alert\n"); X if (Player.status[AFRAID]) X menuprint("Afraid\n"); X if (Player.status[ACCURATE]) X menuprint("Accurate\n"); X if (Player.status[HERO]) X menuprint("Heroic\n"); X if (Player.status[LEVITATING]) X menuprint("Levitating\n"); X morewait(); X menuclear(); X menuprint("Immunities:\n"); X if (p_immune(NORMAL_DAMAGE)) X menuprint("Normal Damage\n"); X if (p_immune(FLAME)) X menuprint("Flame\n"); X if (p_immune(ELECTRICITY)) X menuprint("Electricity\n"); X if (p_immune(COLD)) X menuprint("Cold\n"); X if (p_immune(POISON)) X menuprint("Poison\n"); X if (p_immune(ACID)) X menuprint("Acid\n"); X if (p_immune(FEAR)) X menuprint("Fear\n"); X if (p_immune(SLEEP)) X menuprint("Sleep\n"); X if (p_immune(NEGENERGY)) X menuprint("Negative Energies\n"); X if (p_immune(THEFT)) X menuprint("Theft\n"); X if (p_immune(GAZE)) X menuprint("Gaze\n"); X if (p_immune(INFECTION)) X menuprint("Infection\n"); X morewait(); X menuclear(); X menuprint("Ranks:\n"); X switch(Player.rank[LEGION]) { X case COMMANDANT: X menuprint("Commandant of the Legion"); X break; X case COLONEL: X menuprint("Colonel of the Legion"); X break; X case FORCE_LEADER: X menuprint("Force Leader of the Legion"); X break; X case CENTURION: X menuprint("Centurion of the Legion"); X break; X case LEGIONAIRE: X menuprint("Legionaire"); X break; X } X if (Player.rank[LEGION] > 0) { X menuprint(" ("); X menunumprint(Player.guildxp[LEGION]); X menuprint(" XP).\n"); X } X switch(Player.rank[ARENA]) { X case -1: X menuprint("Ex-gladiator\n"); X break; X case CHAMPION: X menuprint("Gladiator Champion"); X break; X case GLADIATOR: X menuprint("Gladiator of the Arena"); X break; X case RETIARIUS: X menuprint("Retiarius of the Arena"); X break; X case BESTIARIUS: X menuprint("Bestiarius of the Arena"); X break; X case TRAINEE: X menuprint("Gladiator Trainee of the Arena"); X break; X } X if (Player.rank[ARENA] > 0) { X menuprint(" (Opponent "); X menunumprint(Arena_Opponent); X menuprint(")\n"); X } X switch(Player.rank[COLLEGE]) { X case ARCHMAGE: X menuprint("Archmage of the Collegium Magii"); X break; X case MAGE: X menuprint("Collegium Magii: Mage"); X break; X case PRECEPTOR: X menuprint("Collegium Magii: Preceptor"); X break; X case STUDENT: X menuprint("Collegium Magii: Student"); X break; X case NOVICE: X menuprint("Collegium Magii: Novice"); X break; X } X if (Player.rank[COLLEGE] > 0) { X menuprint(" ("); X menunumprint(Player.guildxp[COLLEGE]); X menuprint(" XP).\n"); X } X switch(Player.rank[NOBILITY]) { X case DUKE: X menuprint("Duke of Rampart"); X break; X case LORD: X menuprint("Peer of the Realm"); X break; X case KNIGHT: X menuprint("Order of the Knights of Rampart"); X break; X case ESQUIRE: X menuprint("Squire of Rampart"); X break; X case COMMONER: X menuprint("Commoner"); X break; X default: X menuprint("Lowly Commoner\n"); X break; X } X if (Player.rank[NOBILITY] > 0) { X menuprint(" ("); X menunumprint(Player.rank[NOBILITY]); X menuprint(ordinal(Player.rank[NOBILITY])); X menuprint(" Quest Completed)\n"); X } X switch(Player.rank[CIRCLE]) { X case -1: X menuprint("Former member of the Circle.\n"); X break; X case PRIME: X menuprint("Prime Sorceror of the Inner Circle"); X break; X case HIGHSORCEROR: X menuprint("High Sorceror of the Inner Circle"); X break; X case SORCEROR: X menuprint("Member of the Circle of Sorcerors"); X break; X case ENCHANTER: X menuprint("Member of the Circle of Enchanters"); X break; X case INITIATE: X menuprint("Member of the Circle of Initiates"); X break; X } X if (Player.rank[CIRCLE] > 0) { X menuprint(" ("); X menunumprint(Player.guildxp[CIRCLE]); X menuprint(" XP).\n"); X } X switch(Player.rank[ORDER]) { X case -1: X menuprint("Washout from the Order of Paladins\n"); X case JUSTICIAR: X menuprint("Justiciar of the Order of Paladins"); X break; X case PALADIN: X menuprint("Paladin of the Order"); X break; X case CHEVALIER: X menuprint("Chevalier of the Order"); X break; X case GUARDIAN: X menuprint("Guardian of the Order"); X break; X case GALLANT: X menuprint("Gallant of the Order"); X break; X } X if (Player.rank[ORDER] > 0) { X menuprint(" ("); X menunumprint(Player.guildxp[ORDER]); X menuprint(" XP).\n"); X } X switch(Player.rank[THIEVES]) { X case SHADOWLORD: X menuprint("Guild of Thieves: Shadowlord"); X break; X case TMASTER: X menuprint("Guild of Thieves: Master Thief"); X break; X case THIEF: X menuprint("Guild of Thieves: Thief"); X break; X case ATHIEF: X menuprint("Guild of Thieves: Apprentice Thief"); X break; X case TMEMBER: X menuprint("Guild of Thieves: Candidate Member"); X break; X } X if (Player.rank[THIEVES] > 0) { X menuprint(" ("); X menunumprint(Player.guildxp[THIEVES]); X menuprint(" XP).\n"); X } X switch(Player.rank[PRIESTHOOD]) { X case LAY: X menuprint("A lay devotee of "); X break; X case ACOLYTE: X menuprint("An Acolyte of "); X break; X case PRIEST: X menuprint("A Priest of "); X break; X case SPRIEST: X menuprint("A Senior Priest of "); X break; X case HIGHPRIEST: X menuprint("The High Priest of "); X break; X } X switch(Player.patron) { X case ODIN: X menuprint("Odin"); X break; X case SET: X menuprint("Set"); X break; X case ATHENA: X menuprint("Athena"); X break; X case HECATE: X menuprint("Hecate"); X break; X case DRUID: X menuprint("Druidism"); X break; X case DESTINY: X menuprint("the Lords of Destiny"); X break; X } X if (Player.rank[PRIESTHOOD] > 0) { X menuprint(" ("); X menunumprint(Player.guildxp[PRIESTHOOD]); X menuprint(" XP).\n"); X } X if (Player.rank[ADEPT] > 0) X menuprint("**************\n*Omegan Adept*\n**************\n"); X morewait(); X xredraw(); X } X} X X X/* Recreates the current level */ Xvoid flux(blessing) Xint blessing; X{ X mprint("The universe warps around you!"); X if (Current_Environment == E_CITY) { X mprint("Sensing dangerous high order magic, the Collegium Magii"); X mprint("and the Circle of Sorcerors join forces to negate the spell."); X mprint("You are zapped by an antimagic ray!!!"); X dispel(-1); X mprint("The universe unwarps itself...."); X } X else if (Current_Environment != Current_Dungeon) X mprint("Odd.... No effect!"); X else { X mprint("You stagger as the very nature of reality warps!"); X erase_level(); X Level->generated = FALSE; X mprint("The fabric of spacetime reknits...."); X change_level(Level->depth-1,Level->depth,TRUE); X } X} X X/*Turns on displacement status for the player */ Xvoid displace(blessing) Xint blessing; X{ X if (blessing > -1) { X mprint("You feel a sense of dislocation."); X Player.status[DISPLACED] = blessing + random_range(6); X } X else { X mprint("You feel vulnerable"); X Player.status[VULNERABLE] += random_range(6) - blessing; X } X} X X X Xvoid invisible(blessing) Xint blessing; X{ X if (blessing > -1) { X mprint("You feel transparent!"); X Player.status[INVISIBLE]+= 2+5*blessing; X } X else { X mprint("You feel dangerous!"); X Player.status[VULNERABLE] += X random_range(10)+1; X } X} X X Xvoid warp(blessing) Xint blessing; X{ X int newlevel; X if (Current_Environment != Current_Dungeon) X mprint("How strange! No effect...."); X else { X if (blessing > -1) { X mprint("Warp to which level? "); X newlevel = parsenum(); X } X if (newlevel >= MaxDungeonLevels) { X mprint("You have been deflected!"); X newlevel=random_range(MaxDungeonLevels); X } X mprint("You dematerialize..."); X change_level(Level->depth,newlevel,FALSE); X } X roomcheck(); X} X Xvoid alert(blessing) X int blessing; X{ X if (blessing > -1) { X mprint("You feel a sense of insomnia."); X Player.status[ALERT]+= 4+(5*blessing); X } X else sleep_player(abs(blessing)+3); X} X Xvoid regenerate(blessing) Xint blessing; X{ X if (blessing < 0) X heal(blessing * 10); X else { X mprint("You feel abnormally healthy."); X Player.status[REGENERATING] += (blessing+1)*50; X } X} X Xvoid haste(blessing) Xint blessing; X{ X if (blessing > -1) { X if (! Player.status[HASTED]) X mprint("The world slows down!"); X else mprint("Nothing much happens."); X if (Player.status[SLOWED]) X Player.status[SLOWED] = 0; X Player.status[HASTED] += (blessing*100)+random_range(250); X } X else { X mprint("You feel slower."); X if (Player.status[HASTED] > 0) mprint("...but the feeling quickly fades."); X else Player.status[SLOWED] += random_range(250)+250; X } X} X X Xvoid recover_stat(blessing) Xint blessing; X{ X if (blessing < 0) { X mprint("You feel a cold surge!"); X switch(random_range(6)) { X case 0: Player.str = min(Player.str-1,Player.maxstr-1); break; X case 1: Player.con = min(Player.con-1,Player.maxcon-1); break; X case 2: Player.dex = min(Player.dex-1,Player.maxdex-1); break; X case 3: Player.agi = min(Player.agi-1,Player.maxagi-1); break; X case 4: Player.iq = min(Player.iq-1,Player.maxiq-1); break; X case 5: Player.pow = min(Player.pow-1,Player.maxpow-1); break; X } X } X else { X mprint("You feel a warm tingle!"); X Player.str = max(Player.str,Player.maxstr); X Player.con = max(Player.con,Player.maxcon); X Player.dex = max(Player.dex,Player.maxdex); X Player.agi = max(Player.agi,Player.maxagi); X Player.iq = max(Player.iq,Player.maxiq); X Player.pow = max(Player.pow,Player.maxpow); X } X calc_melee(); X} X Xvoid augment(blessing) Xint blessing; X{ X if (blessing < 0) { X mprint("You feel a cold surge!"); X switch(random_range(6)) { X case 0: Player.str = min(Player.str-1,Player.maxstr-1); break; X case 1: Player.con = min(Player.con-1,Player.maxcon-1); break; X case 2: Player.dex = min(Player.dex-1,Player.maxdex-1); break; X case 3: Player.agi = min(Player.agi-1,Player.maxagi-1); break; X case 4: Player.iq = min(Player.iq-1,Player.maxiq-1); break; X case 5: Player.pow = min(Player.pow-1,Player.maxpow-1); break; X } X } X else if (blessing == 0) { X mprint("You feel a warm tingle!"); X switch(random_range(6)) { X case 0: Player.str = max(Player.str+1,Player.maxstr+1); break; X case 1: Player.con = max(Player.con+1,Player.maxcon+1); break; X case 2: Player.dex = max(Player.dex+1,Player.maxdex+1); break; X case 3: Player.agi = max(Player.agi+1,Player.maxagi+1); break; X case 4: Player.iq = max(Player.iq+1,Player.maxiq+1); break; X case 5: Player.pow = max(Player.pow+1,Player.maxpow+1); break; X } X } X else { X mprint("You feel a hot flash!"); X Player.str = max(Player.str+1,Player.maxstr+1); X Player.con = max(Player.con+1,Player.maxcon+1); X Player.dex = max(Player.dex+1,Player.maxdex+1); X Player.agi = max(Player.agi+1,Player.maxagi+1); X Player.iq = max(Player.iq+1,Player.maxiq+1); X Player.pow = max(Player.pow+1,Player.maxpow+1); X } X calc_melee(); X} X Xvoid breathe(blessing) Xint blessing; X{ X if (blessing > -1) { X mprint("Your breath is energized!"); X Player.status[BREATHING] += 6+blessing; X } X else { X mprint("You choke as your lungs fill with water!"); X p_damage(50,UNSTOPPABLE,"drowning"); X } X} X X Xvoid i_chaos(o) Xpob o; X{ X if (Player.alignment < 0) { X Player.alignment -= random_range(20); X mprint("You feel deliciously chaotic!"); X gain_experience(abs(Player.alignment)*10); X } X else { X mprint("You feel a sense of inner turmoil!"); X Player.alignment -= random_range(20); X } X} X Xvoid i_law(o) Xpob o; X{ X if (Player.alignment > 0) { X Player.alignment += random_range(20); X mprint("You feel wonderfully lawful!"); X gain_experience(Player.alignment*10); X } X else { X mprint("You feel a sense of inner constraint!"); X Player.alignment += random_range(20); X } X} X Xvoid sanctify(blessing) Xint blessing; X{ X if (blessing > -1) { X if (Level->environment == E_TEMPLE) X mprint("Odd, the spell has no effect. I wonder why."); X else if (Level->site[Player.x][Player.y].locchar == ALTAR) X mprint("This site can't get any holier!"); X else if (Player.patron == 0) { X mprint("The gods are angered!"); X Level->site[Player.x][Player.y].locchar = LAVA; X Level->site[Player.x][Player.y].p_locf = L_LAVA; X p_movefunction(L_LAVA); X } X else { X Level->site[Player.x][Player.y].locchar = ALTAR; X Level->site[Player.x][Player.y].aux = Player.patron; X Level->site[Player.x][Player.y].p_locf = L_ALTAR; X mprint("You are standing on sacred ground!"); X } X } X else { X if (Level->site[Player.x][Player.y].locchar == ALTAR) { X mprint("The altar crumbles before your unholy blast...."); X Level->site[Player.x][Player.y].locchar = FLOOR; X Level->site[Player.x][Player.y].p_locf = L_NO_OP; X if (Level->site[Player.x][Player.y].aux == Player.patron) { X mprint("Your deity is not amused...."); X p_damage(Player.hp-1,UNSTOPPABLE,"Divine Wrath"); X } X else if ((Player.patron == ATHENA) || (Player.patron == ODIN)) { X if ((Level->site[Player.x][Player.y].aux == SET) || X (Level->site[Player.x][Player.y].aux == HECATE)) { X mprint("Your deity applauds the eradication of Chaos' taint"); X gain_experience(1000); X } X else { X mprint("Your deity approves of your action."); X gain_experience(100); X } X } X if ((Player.patron == SET) || (Player.patron == HECATE)) { X if ((Level->site[Player.x][Player.y].aux == ODIN) || X (Level->site[Player.x][Player.y].aux == ATHENA)) { X mprint("Your deity applauds the obliteration of Law"); X gain_experience(1000); X } X else { X mprint("Your deity approves of your action."); X gain_experience(100); X } X } X else if (Player.patron == DRUID) { X mprint("Your attempt to maintain the Balance is applauded...."); X gain_experience(250); X } X else mprint("Nothing much happens"); X } X else mprint("You feel an aura of unholiness arising from this spot...."); X } X} X Xvoid accuracy(blessing) Xint blessing; X{ X if (blessing > -1) { X mprint("Everything seems covered in bullseyes!"); X Player.status[ACCURACY] += random_range(5)+1+blessing*5; X calc_melee(); X } X else { X Player.status[ACCURACY]=0; X calc_melee(); X mprint("Your vision blurs..."); X } X} END_OF_FILE if test 16789 -ne `wc -c <'oeffect2.c'`; then echo shar: \"'oeffect2.c'\" unpacked with wrong size! fi # end of 'oeffect2.c' fi if test -f 'oextern.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'oextern.h'\" else echo shar: Extracting \"'oextern.h'\" \(16657 characters\) sed "s/^X//" >'oextern.h' <<'END_OF_FILE' X/* omega copyright (c) 1987,1988,1989 by Laurence Raphael Brothers */ X/* oextern.h -- function declarations */ X X/* o.c functions */ Xvoid initrand(),inititem(),init_world(); Xint game_restore(),signalexit(),main(); X X X/* oabyss functions */ Xvoid load_abyss(); X X X/* oaux1 and oaux3 functions */ Xvoid pickup_at(),setspot(),foodcheck(),p_death(),hourly_check(); X#ifndef MSDOS Xvoid calc_melee(),gain_experience(),p_damage(),minute_check(); X#else Xvoid calc_melee(),p_damage(),minute_check(); Xvoid gain_lexperience(); X#endif Xvoid p_process(),p_teleport(),tacplayer(),roomcheck(),tunnelcheck(); Xvoid searchat(),showroom(),weapon_use(),damage_item(),tacmode(); Xvoid hand_wield(),optionset(),optionreset(),describe_player(); Xvoid lightroom(),surrender(),threaten(),darkenroom(),fight_monster(); Xvoid indoors_random_event(),outdoors_random_event(),tenminute_check(); Xchar getlocation(),*itemid(),*mstatus_string(),*trapid(),*levelname(); Xint p_moveable(),cursed(),getdir(),optionp(),goberserk(); Xint player_on_sanctuary(),maneuvers(); X X X/* oaux2 and oaux3 functions */ Xchar *actionlocstr(); Xvoid break_weapon(),drop_weapon(),moon_check(),toggle_item_use(); Xvoid p_fumble(),p_win(),p_hit(),player_miss(),addring(),torch_check(); Xvoid top_level(),printactions(),movecursor(),p_drown(),enter_site(); Xvoid tacexecute(),weapon_use(),minute_status_check(),tenminute_status_check(); Xvoid expandsiteabbrev(),gain_level(),terrain_check(); Xvoid countrysearch(),default_maneuvers(),alert_guards(); X#ifndef MSDOS Xint expval(),player_hit(),statmod(),item_value(),true_item_value(); X#else Xlong expval(),item_value(),true_item_value(); Xint player_hit(),statmod(); X#endif Xint parsecitysite(),expandsite(),hostilemonstersnear(),magic_resist(); Xchar *countryid(),*citysiteid(); X X/* ochar functions */ Xvoid initplayer(),initstats(),save_omegarc(),omegan_character_stats(); Xvoid user_character_stats(); X#ifndef MSDOS Xint calcmana(),fixnpc(),competence_check(); X#else Xlong calcmana(); Xint fixnpc(),competence_check(); X#endif XFILE *omegarc_check(); X X X/* ocity functions */ Xvoid load_city(),randommazesite(),assign_city_function(),make_justiciar(); Xvoid resurrect_guards(),mazesite(),make_minor_undead(),make_major_undead(); Xvoid repair_jail(); X X/* ocom1 functions */ Xvoid p_country_process(),p_process(); X X/* ocom3 and ocom2 functions */ Xvoid pickup(),drop(),magic(),disarm(),save(),restore(); Xvoid inventory(),opendoor(),closedoor(),fire(),fight(),city_move(); Xvoid eat(),version(),nap(),vault(),bash_item(),frobgamestatus(); Xvoid search(),peruse(),quaff(),talk(),bash_location(),wizard(); Xvoid give(),rest(),examine(),help(); Xvoid zapwand(),floor_inv(),callitem(), charid(); Xvoid moveplayer(),upstairs(),downstairs(),setoptions(),activate(); Xvoid pickpocket(),rename_player(),abortshadowform(),tunnel(); Xvoid change_environment(); Xvoid movepincountry(),tacoptions(),hunt(),dismount_steed(); Xint quit(); X X/* oeffect1 functions */ Xvoid bless(),identify(),bolt(),ball(),amnesia(),p_poison(); Xvoid heal(),mondet(),objdet(),enchant(),wish(),manastorm(); Xvoid acquire(),cleanse(),annihilate(),sleep_monster(),apport(); Xvoid sleep_player(),summon(),hide(),clairvoyance(),aggravate(); Xvoid fbolt(),lbolt(),lball(),fball(),nbolt(),learnspell(),level_drain(); Xvoid disintegrate(),disrupt(),snowball(),p_teleport(),acid_cloud(); Xvoid strategic_teleport(); Xint random_item(),itemlist(),monsterlist(); X X X/* oeffect2 functions */ Xvoid knowledge(),flux(),displace(),breathe(),invisible(),warp(),alert(); Xvoid haste(),regenerate(),recover_stat(),augment(),truesight(),disease(); Xvoid i_chaos(),i_law(),sanctify(),hero(),level_return(),cure(),dispel(); Xvoid polymorph(),hellfire(),illuminate(),drain_life(),drain(); Xvoid inflict_fear(),levitate(),accuracy(),sanctuary(),shadowform(); Xvoid invulnerable(),deflection(); X X/* oetc functions */ Xvoid hint(),learnclericalspells(),add_new_npc(); Xchar *slotstr(),*wordnum(),*nameprint(); X X X/* ofile functions */ Xvoid commandlist(),helpfile(),showfile(),showscores(),showmotd(); Xvoid extendlog(),filescanstring(),checkhigh(),user_intro(); Xvoid theologyfile(),cityguidefile(),combat_help(),inv_help(); Xvoid abyss_file(),wishfile(),adeptfile(),copyfile(),displayfile(); Xint filecheck(); XFILE *checkfopen(); X X X/* ogen functions */ Xint loc_statusp(),mazeok(); Xvoid lset(),lreset(),load_arena(),make_country_screen(),room_corridor(); Xvoid clear_level(),create_level(),build_square_room(),build_diamond_room(); Xvoid connect_room(),corridor_crawl(),build_room(),sewer_corridor(); Xvoid clear_dungeon(),init_dungeon(),install_traps(),straggle_corridor(); Xvoid room_connect_corridor(),sewer_level(),room_level(),make_prime(); Xvoid change_level(),cavern_level(),makedoor(),make_archmage(); Xvoid maze_level(),maze_corridor(); Xvoid install_specials(),make_stairs(); Xvoid make_plains(),make_road(),make_forest(),make_jungle(); Xvoid make_river(),make_swamp(),make_mountains(),load_circle(),load_court(); Xvoid find_stairs(); Xchar *roomname(); Xplv findlevel(); X X/* outil functions */ X#ifndef MSDOS Xint inbounds(),random_range(),hitp(),sign(),max(),min(),distance(); X#else Xint inbounds(),random_range(),hitp(),distance(); X#endif X#ifndef MSDOS Xint unblocked(),los_p(),screenmod(),offscreen(),calc_points(); X#else Xint unblocked(),los_p(),screenmod(),offscreen(); Xlong calc_points(); X#endif Xint bitp(),nighttime(),hour(),showhour(),day(),showminute(); Xint view_unblocked(),m_unblocked(),strmem(); X#ifndef MSDOS Xint view_los_p(),confirmation(),gamestatusp(); X#else Xint view_los_p(),confirmation(); Xlong gamestatusp(); X#endif Xchar inversedir(),*getarticle(),*ordinal(),*month(),*salloc(); Xvoid initdirs(),do_los(),do_object_los(),bitset(),bitreset(); Xvoid findspace(),setgamestatus(),resetgamestatus(),calc_weight(); X X X/* otime functions */ Xvoid time_clock(); X X X/* ospell functions */ Xvoid s_firebolt(),s_lball(),s_sleep(),s_objdet(),s_mondet(),s_identify(); Xvoid s_teleport(),s_disrupt(),s_disintegrate(),s_missile(); Xvoid s_heal(),s_dispel(),s_breathe(),s_invisible(),s_warp(),s_enchant(); Xvoid s_bless(),s_truesight(),s_hellfire(),s_knowledge(),s_hero(); Xvoid s_restore(),s_cure(),s_return(),s_desecrate(),s_summon(); Xvoid s_accuracy(),s_ritual(),s_apport(),s_shadowform(),s_alert(); Xvoid s_regenerate(),s_sanctify(),s_clairvoyance(),s_drain(),s_polymorph(); Xvoid s_invulnerable(),cast_spell(),s_fear(),s_wish(); Xvoid initspells(),expandspellabbrevs(); Xint getspell(),expandspell(); Xchar *spellid(); X X X/* osite functions */ Xvoid l_temple(),l_armorer(),l_club(),l_gym(),sign_print(),l_castle(); Xvoid l_healer(),statue_random(),l_statue_wake(),l_casino(),l_bank(); Xvoid l_sewer(),l_tavern(),l_alchemist(),l_vault(),l_oracle(),l_commandant(); Xvoid l_countryside(),l_dpw(),l_library(),l_pawn_shop(),l_diner(); Xvoid l_condo(),l_cemetary(),l_garden(),l_house(),l_hovel(),l_mansion(); Xvoid l_jail(),l_adept(),l_trifid(),l_warning(),l_brothel(),l_crap(); Xvoid l_safe(),l_cartographer(),l_charity(),l_mindstone(); Xvoid healforpay(),cureforpay(),gymtrain(),buyfromstock(),wake_statue(); Xvoid send_to_jail(); X X X/* oscr functions */ Xvoid redraw(),drawspot(),drawvision(),morewait(),drawmonsters(),locprint(); Xvoid mprint(),title(),sitclear(),initgraf(),xredraw(),erase_monster(); Xvoid plotchar(),show_screen(),blankoutspot(),show_license(),phaseprint(); X#ifndef MSDOS Xvoid menuclear(),showcursor(),mnumprint(),menunumprint(),display_pack(); X#else Xvoid menuclear(),showcursor(),display_pack(); Xvoid mlongprint(),menulongprint(); X#endif Xvoid clearmsg(),menuprint(),print3(),nprint3(),print1(),print2(),nprint1(); Xvoid clearmsg1(),clearmsg3(),commanderror(),nprint2(),deathprint(); Xvoid stdmorewait(),draw_explosion(),dataprint(),comwinprint(),timeprint(); Xvoid erase_level(),levelrefresh(),display_options(),display_option_slot(); Xvoid refreshmsg(),menuaddch(),drawscreen(),maddch(),putspot(),checkclear(); Xvoid display_quit(),showflags(),spreadroomdark(),display_win(); Xvoid drawplayer(),displaystats(),display_death(),plotmon(),display_bigwin(); Xvoid dobackspace(),drawandrefreshspot(),spreadroomlight(),bufferprint(); Xvoid drawomega(),screencheck(),blotspot(),plotspot(),dodrawspot(); Xvoid display_inventory_slot(),endgraf(),menuspellprint(),hide_line(); Xvoid display_possessions(),clear_if_necessary(),buffercycle(),lightspot(); X#ifndef MSDOS Xint parsenum(),getnumber(),litroom(),move_slot(),stillonblock(); X#else Xlong parsenum(); Xint getnumber(),litroom(),move_slot(),stillonblock(); X#endif Xchar getspot(),mgetc(),lgetc(),menugetc(),*msgscanstring(); X#ifndef MSDOS Xchar mcigetc(),ynq(),ynq1(),ynq2(); X#else Xint mcigetc(); Xchar ynq(),ynq1(),ynq2(); X#endif X X X/* omove functions */ Xvoid p_movefunction(); Xvoid l_water(),l_hedge(),l_lava(),l_lift(),l_magic_pool(),l_whirlwind(); Xvoid l_abyss(),l_no_op(),l_tactical_exit(),l_rubble(),l_raise_portcullis(); Xvoid l_portcullis(),l_portcullis_trap(),l_arena_exit(),l_house_exit(); Xvoid l_drop_every_portcullis(),l_earth_station(),l_water_station(); Xvoid l_fire_station(),l_air_station(),l_void(),stationcheck(),l_whirlwind(); Xvoid l_voice1(),l_voice2(),l_voice3(),l_whirlwind(),l_void_station(); Xvoid l_chaos(),l_tome1(),l_tome2(),l_enter_circle(),l_circle_library(); Xvoid l_temple_warning(),l_throne(),l_enter_court(),l_escalator(),l_fire(); Xvoid l_voidstone(),l_chaostone(),l_lawstone(),l_balancestone(); Xvoid l_sacrificestone(); X X/* otrap functions */ Xvoid l_trap_dart(),l_trap_pit(),l_trap_door(),l_trap_snare(),l_trap_siren(); Xvoid l_trap_blade(),l_trap_fire(),l_trap_disintegrate(),l_trap_teleport(); Xvoid l_trap_acid(),l_trap_manadrain(),l_trap_sleepgas(),l_trap_abyss(); X X X X/* ohouse functions */ Xvoid load_house(),make_dog(),make_automaton(),make_house_npc(); Xvoid make_mansion_npc(); X X/* omonf functions */ Xvoid m_normal_move(),m_no_op(); Xvoid m_smart_move(),m_simple_move(),m_spirit_move(),m_vanish(); Xvoid m_firebolt(),m_talk_guard(),m_random_move(),m_sp_morgon(); Xvoid m_flutter_move(),m_nbolt(),m_sp_surprise(),m_talk_druid(); Xvoid m_talk_stupid(),m_talk_hungry(),m_talk_silent(),m_talk_greedy(); Xvoid m_talk_mp(),m_follow_move(),m_sp_mp(),m_talk_evil(),m_talk_prime(); Xvoid m_lball(),m_fireball(),m_talk_titter(),m_talk_thief(); Xvoid m_sp_ng(),m_sp_poison_cloud(),m_huge_sounds(),m_talk_robot(); Xvoid m_blind_strike(),m_talk_im(),m_confused_move(),m_talk_beg(); Xvoid m_thief_f(),m_talk_man(),m_summon(),m_animal_talk(),m_move_animal(); Xvoid m_teleport(),m_illusion(),m_aggravate(),m_talk_hint(); Xvoid m_sp_explode(),m_sp_acid_cloud(),m_sp_bogthing(),m_talk_animal(); Xvoid m_sp_whirl(),m_sp_escape(),m_sp_ghost(),m_sp_demonlover(); Xvoid m_talk_mimsy(),m_talk_slithy(),m_talk_burble(),m_sp_spell(); Xvoid m_scaredy_move(),m_talk_gf(),m_talk_ef(),m_sp_demon(),m_sp_av(); Xvoid m_sp_seductor(),m_talk_demonlover(),m_talk_seductor(),m_sp_lw(); Xvoid m_sp_eater(),m_sp_dragonlord(),m_talk_ninja(),m_talk_assassin(); Xvoid m_sp_blackout(),m_sp_leash(),m_sp_were(),m_sp_angel(),m_sp_servant(); Xvoid m_sp_swarm(),m_talk_servant(),m_talk_horse(),m_snowball(),m_sp_prime(); Xvoid m_sp_mb(),m_sp_mirror(),m_sp_raise(),m_talk_scream(),m_strike_sonic(); Xvoid m_talk_parrot(),m_talk_hyena(),m_talk_archmage(),m_talk_merchant(); Xvoid m_sp_merchant(),m_sp_court(),m_sp_lair(),m_sp_whistleblower(); X Xchar *mantype(); X X/* omon functions */ Xint m_statusp(),m_immunityp(),tacticalp(); Xvoid m_pulse(),m_status_set(),m_damage(),monster_action(); Xvoid m_death(),m_hit(),m_miss(),m_pickup(),m_dropstuff(); Xvoid m_status_reset(),monster_strike(),tacmonster(),free_mlist(); Xvoid monster_talk(),monster_melee(),monster_move(),monster_special(); Xvoid movemonster(),make_log_npc(),m_abyss(),transcribe_monster_actions(); Xvoid m_movefunction(),trasnscribe_monster_actions(),determine_npc_behavior(); Xvoid m_water(),m_lava(),m_altar(),m_whirlwind(),m_fire(),make_hiscore_npc(); Xvoid m_trap_dart(),m_trap_pit(),m_trap_door(),m_trap_snare(); Xvoid m_trap_blade(),m_trap_fire(),m_trap_disintegrate(),m_trap_teleport(); Xvoid m_trap_manadrain(),m_trap_acid(),m_trap_sleepgas(),m_trap_abyss(); Xvoid strengthen_death(),fix_phantom(),destroy_order(); Xchar random_loc(); Xint corpsevalue(),monster_hit(); X X X/* olev functions */ Xvoid populate_level(),stock_level(),wandercheck(),make_site_monster(); Xvoid free_dungeon(),tactical_map(),make_country_monsters(); Xvoid make_site_treasure(),make_specific_treasure(); Xint difficulty(); Xpmt m_create(),make_creature(); X X/* osave functions */ Xint save_game(),restore_game(), signalsave(); Xvoid save_player(),save_player_items(),save_player_spells(); Xvoid save_player_item_knowledge(),save_monsters(),save_country(); Xvoid save_level(),save_item(),save_itemlist(); Xvoid restore_player(),restore_player_items(),restore_player_spells(); Xvoid restore_player_item_knowledge(),restore_monsters(); Xvoid restore_level(),restore_country(); Xpob restore_item(); Xpol restore_itemlist(); X X X X X/* oitemf functions (1 to 3)*/ Xvoid weapon_bare_hands(),weapon_normal_hit(),weapon_demonblade(); Xvoid weapon_lightsabre(),weapon_mace_disrupt(),weapon_tangle(); Xvoid weapon_vorpal(),weapon_desecrate(),weapon_firestar(),weapon_defend(); Xvoid weapon_victrix(),weapon_bolt(),weapon_arrow(),weapon_scythe(); Xvoid weapon_acidwhip(); Xvoid i_no_op(),i_nothing(),i_stargem(),i_sceptre(),i_deflect(); Xvoid i_spells(),i_bless(),i_enchant(),i_acquire(),i_jane_t(); Xvoid i_flux(),i_breathing(),i_invisible(),i_perm_invisible(); Xvoid i_teleport(),i_wish(),i_clairvoyance(),i_displace(),i_id(),i_augment(); Xvoid i_heal(),i_objdet(),i_mondet(),i_sleep_self(),i_neutralize_poison(); Xvoid i_speed(),i_restore(),i_azoth(),i_regenerate(),i_demonblade(); Xvoid i_firebolt(),i_lbolt(),i_missile(),i_fireball(),i_lball(),i_snowball(); Xvoid i_sleep_other(),i_summon(),i_hide(),i_disrupt(),i_disintegrate(); Xvoid i_perm_vision(),i_perm_burden(),i_perm_fire_resist(),i_charge(); Xvoid i_perm_poison_resist(),i_perm_strength(),i_perm_gaze_immune(); Xvoid i_perm_energy_resist(), i_perm_speed(),i_perm_breathing(); Xvoid i_perm_displace(),i_perm_negimmune(),i_mace_disrupt(),i_warp(); Xvoid i_food(),i_poison_food(),i_stim(),i_immune(),i_lembas(),i_pow(); Xvoid i_orbfire(),i_orbwater(),i_orbair(),i_orbearth(),i_orbdead(); Xvoid i_orbmastery(),i_lightsabre(),i_alert(),i_knowledge(),i_pick(); Xvoid i_perm_knowledge(),i_fear_resist(),i_perm_fear_resist(),i_key(); Xvoid i_defend(),i_victrix(),i_apport(),i_corpse(),i_accuracy(); Xvoid i_perm_accuracy(),i_hero(),i_perm_hero(),i_levitate(); Xvoid i_perm_regenerate(),i_perm_levitate(),i_perm_protection(); Xvoid i_perm_agility(),i_truesight(),i_perm_truesight(),i_cure(); Xvoid i_dispel(),i_pepper_food(),i_enchantment(),polymorph(); Xvoid i_crystal(),i_kolwynia(),i_death(),i_life(),i_helm(),i_antioch(); Xvoid i_illuminate(),i_perm_illuminate(),i_desecrate(); Xvoid i_trap(),i_juggernaut(),i_raise_portcullis(),i_planes(); Xvoid i_fear(),i_polymorph(),i_symbol(),i_perm_deflect(); Xvoid i_normal_armor(),i_normal_weapon(),i_normal_shield(); X X/* oitem functions */ Xvoid item_use(); Xpob create_object(); Xvoid make_shield(),make_armor(),make_weapon(); Xvoid make_scroll(),make_potion(),make_food(); Xvoid make_thing(),make_ring(),make_artifact(),make_corpse(); Xvoid make_boots(),make_cloak(),make_stick(),make_cash(); Xint itemplus(),itemcharge(),itemblessing(),twohandedp(); Xchar *scrollname(),*potionname(),*stickname(),*ringname(),*cloakname(); Xchar *bootname(),*grotname(); X X X/* oinv functions */ Xvoid pickup_at(),drop_at(),givemonster(),conform_lost_object(); Xvoid conform_unused_object(),gain_item(),drop_money(),add_to_pack(); Xvoid setplustr(),setchargestr(), setnumstr(),p_drop_at(),give_money(); Xvoid conform_lost_objects(),itemlist_inventory(),take_from_pack(); Xvoid merge_item(),take_from_slot(),inventory_control(),item_inventory(); Xvoid drop_from_slot(),put_to_pack(),switch_to_slot(),top_inventory_control(); Xvoid lose_all_items(),dispose_lost_objects(),pack_extra_items(),fixpack(); Xint get_inventory_slot(),getitem(); Xint objequal(),slottable(),item_useable(),find_and_remove_item(); X#ifndef MSDOS Xint getitem(),badobject(),cursed(),get_money(),get_item_number(),find_item(); X#else Xint getitem(),badobject(),cursed(),get_item_number(),find_item(); Xlong get_money(); X#endif Xpob detach_money(),split_item(); Xchar *itemid(),*cashstr(); X X/* oguild functions */ Xvoid l_druid(),l_thieves_guild(),l_college(),l_merc_guild(),l_sorcerors(); Xvoid l_altar(),l_arena(),l_order(); X X/* opriest functions */ Xvoid make_hp(),hp_req_test(),hp_req_print(),increase_priest_rank(); Xvoid answer_prayer(); Xint check_sacrilege(); X X/* ocountry functions */ Xvoid load_country(),load_dlair(),load_speak(),load_misle(),load_temple(); Xvoid make_high_priest(),random_temple_site(); X X/* ovillage functions */ Xvoid load_village(),make_horse(),make_sheep(); Xvoid make_guard(),make_sheep(),make_merchant(),make_food_bin(); Xvoid assign_village_function(),special_village_site(); X X END_OF_FILE if test 16657 -ne `wc -c <'oextern.h'`; then echo shar: \"'oextern.h'\" unpacked with wrong size! fi # end of 'oextern.h' fi if test -f 'ospell.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'ospell.c'\" else echo shar: Extracting \"'ospell.c'\" \(16536 characters\) sed "s/^X//" >'ospell.c' <<'END_OF_FILE' X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */ X/* ospell.c */ X/* functions having to do with spellcasting */ X X#include "oglob.h" X X Xvoid s_wish() X{ X if (random_range(100) > Player.iq+Player.pow+Player.level) { X mprint("Your concentration is flawed!"); X mprint("The spell energy backfires!"); X p_damage(random_range(Spells[S_WISH].powerdrain), X UNSTOPPABLE, X "a backfired wish spell"); X } X else { X wish(0); X mprint("The power of the spell is too much for you to withstand!"); X mprint("All memory of the spell is expunged from your brain."); X Spells[S_WISH].known = FALSE; X } X} X Xvoid s_firebolt() X{ X int x=Player.x,y=Player.y; X setspot(&x,&y); X fbolt(Player.x,Player.y,x,y,Player.dex*2+Player.level,Player.level*10+10); X} X Xvoid s_missile() X{ X int x=Player.x,y=Player.y; X setspot(&x,&y); X nbolt(Player.x,Player.y,x,y,Player.dex*2+Player.level,Player.level*3+3); X} X Xvoid s_teleport() X{ X p_teleport(0); X} X Xvoid s_disrupt() X{ X int x=Player.x,y=Player.y; X setspot(&x,&y); X disrupt(x,y,Player.level*10+25); X} X X Xvoid s_disintegrate() X{ X int x=Player.x,y=Player.y; X setspot(&x,&y); X disintegrate(x,y); X} X X Xvoid s_sleep() X{ X sleep_monster(0); X} X Xvoid s_heal() X{ X heal(3); X} X Xvoid s_dispel() X{ X dispel((Player.level+Player.maxpow)/10); X} X Xvoid s_breathe() X{ X breathe(0); X} X Xvoid s_invisible() X{ X invisible(0); X} X X Xvoid s_warp() X{ X warp(1); X} X Xvoid s_enchant() X{ X enchant(1); X} X X Xvoid s_bless() X{ X bless(0); X} X X Xvoid s_restore() X{ X recover_stat(0); X} X X Xvoid s_cure() X{ X cure(0); X} X X Xvoid s_truesight() X{ X truesight(0); X} X X Xvoid s_hellfire() X{ X int x=Player.x,y=Player.y; X setspot(&x,&y); X hellfire(x,y,0); X} X X Xvoid s_knowledge() X{ X knowledge(0); X} X X Xvoid s_hero() X{ X hero(0); X} X X/* spell takes longer and longer to work deeper into dungeon */ Xvoid s_return() X{ X mprint("You hear a whine as your spell begins to charge up."); X Player.status[RETURNING] = X ((Current_Environment == Current_Dungeon) ? difficulty() : 1); X} X Xvoid s_desecrate() X{ X sanctify(-1); X} X X Xvoid s_haste() X{ X haste(0); X} X X Xvoid s_summon() X{ X summon(0,-1); X} X X Xvoid s_sanctuary() X{ X sanctuary(); X} X Xvoid s_sanctify() X{ X sanctify(1); X} X X Xvoid s_accuracy() X{ X accuracy(0); X} X Xvoid s_fear() X{ X int x = Player.x,y=Player.y; X setspot(&x,&y); X inflict_fear(x,y); X} X X X/* Has all kinds of effects in different circumstances. X Eventually will be more interesting */ Xvoid s_ritual() X{ X pob symbol; X int i,roomno; X mprint("You begin your ritual...."); X mprint("You enter a deep trance. Time Passes..."); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X if (RitualHour == hour()) X mprint("Your mental fatigue prevents from completing the ritual!"); X else if (random_range(100) > Player.iq+Player.pow+Player.level) X mprint("Your concentration was broken -- the ritual fails!"); X else { X mprint("You charge the ritual with magical energy and focus your will."); X mprint("Time Passes..."); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X setgamestatus(SKIP_PLAYER); X time_clock(FALSE); X RitualHour = hour(); X /* set of random conditions for different ritual effects */ X if (Current_Environment == E_CITY) { X mprint("Flowing waves of mystical light congeal all around you."); X mprint("'Like wow, man! Colors!'"); X mprint("Appreciative citizens throw you spare change."); X Player.cash +=random_range(50); X } X else if ((roomno=Level->site[Player.x][Player.y].roomnumber) >= 0) { X if (RitualRoom == roomno) X mprint("For some reason the ritual doesn't work this time..."); X else { X RitualRoom = roomno; X switch (RitualRoom) { X case ROOMBASE+9: /* ransacked treasure chamber */ X mprint("Your spell sets off frenetic growth all around you!"); X for(i=0;i<8;i++){ X Level->site[Player.x+Dirs[0][i]][Player.y+Dirs[1][i]].locchar = X HEDGE; X Level->site[Player.x+Dirs[0][i]][Player.y+Dirs[1][i]].p_locf = X L_TRIFID; X } X break; X case ROOMBASE+22: /* boudoir */ X mprint("A secret panel opens next to the bed...."); X if (random_range(2)) X summon(0,ML4+6); /* succubus/incubus */ X else summon(0,ML4+7); /* satyr/nymph */ X break; X case ROOMBASE+26: /*shrine to high magic */ X mprint("A storm of mana coaelesces around you."); X mprint("You are buffeted by bursts of random magic."); X p_damage(random_range(Player.pow),UNSTOPPABLE,"high magic"); X mprint("Continue ritual? Could be dangerous.... [yn] "); X if (ynq()=='y') s_wish(); X else mprint("The mana fades away to nothingness."); X Level->site[Player.x][Player.y].roomnumber = RS_ZORCH; X break; X case ROOMBASE+27: /* magician's lab */ X mprint("Your magical activity sets off a latent spell in the lab!"); X cast_spell(random_range(NUMSPELLS)); X break; X case ROOMBASE+28: /* pentagram room */ X mprint("A smoky form begins to coalesce...."); X summon(-1,-1); X mprint("Fortunately, it seems confined to the pentagram."); X m_status_reset(Level->mlist->m,MOBILE); X break; X case ROOMBASE+29: /* blue omega room */ X mprint("The Lords of Destiny look upon you...."); X if (Player.level > 10) { X mprint("A curtain of blue flames leaps up from the omega."); X mprint("Enter it? [yn] "); X if (ynq()=='y') l_adept(); X } X else { X if (Player.patron == DESTINY) { X mprint("Your patrons take pity on you."); X if ((Player.rank[PRIESTHOOD]<SPRIEST) && X (! find_item(&symbol,ARTIFACTID+19,-1))) { X symbol = ((pob) malloc(sizeof(objtype))); X *symbol = Objects[ARTIFACTID+19]; X symbol->known = 2; X symbol->charge = 17; X gain_item(symbol); X mprint("You feel uplifted."); X } X else gain_experience(min(1000,Player.xp)); X } X else if (random_range(3)==1) { X mprint("You feel Fated."); X gain_experience(Player.level*Player.level*10); X Player.hp = Player.maxhp; X } X else if (random_range(2)) { X mprint("You feel Doomed."); X Player.hp = 1; X Player.mana = 0; X Player.xp = 0; X } X else mprint("The Lords of Destiny laugh at you!"); X } X break; X default: X mprint("Well, not much effect. Chalk it up to experience."); X gain_experience(Player.level*5); X break; X } X } X } X else { X if (RitualRoom == Level->site[Player.x][Player.y].roomnumber) X mprint("The ritual fails for some unexplainable reason."); X else { X mprint("The ritual seems to be generating some spell effect."); X RitualRoom = Level->site[Player.x][Player.y].roomnumber; X switch (RitualRoom) { X case RS_WALLSPACE: X shadowform(); X break; X case RS_CORRIDOR: X haste(0); X break; X case RS_PONDS: X breathe(0); X break; X case RS_ADEPT: X hero(1); X break; X default: X mprint("The ritual doesn't seem to produce any tangible results..."); X gain_experience(Player.level*6); X } X } X } X } X} X X X Xvoid s_apport() X{ X apport(0); X} X Xvoid s_shadowform() X{ X shadowform(); X} X Xvoid s_alert() X{ X alert(0); X} X Xvoid s_regenerate() X{ X regenerate(0); X} X Xvoid s_clairvoyance() X{ X clairvoyance(10); X} X Xvoid s_drain() X{ X drain(0); X} X Xvoid s_levitate() X{ X levitate(0); X} X Xvoid s_polymorph() X{ X polymorph(0); X} X X X/* lball spell */ Xvoid s_lball() X{ X int x=Player.x,y=Player.y; X setspot(&x,&y); X lball(Player.x,Player.y,x,y,Player.level*10+10); X} X Xvoid s_identify() X{ X identify(0); X} X Xvoid s_objdet() X{ X objdet(1); X} X Xvoid s_mondet() X{ X mondet(1); X} X X X/* select a spell to cast */ Xint getspell() X{ X int spell= -2; X do { X mprint("Cast Spell: [type spell abbrev, ?, or ESCAPE]: "); X spell = spellparse(); X } while (spell < ABORT); X return(spell); X} X X Xchar *spellid(id) Xint id; X{ X switch(id) { X case S_MON_DET:return("monster detection");break; X case S_OBJ_DET:return("object detection");break; X case S_IDENTIFY:return("identification");break; X case S_FIREBOLT:return("firebolt");break; X case S_LBALL:return("ball lightning");break; X case S_SLEEP:return("sleep");break; X case S_DISRUPT:return("disrupt");break; X case S_DISINTEGRATE:return("disintegrate");break; X case S_TELEPORT:return("teleport");break; X case S_MISSILE:return("magic missile"); break; X case S_HEAL:return("healing"); break; X case S_DISPEL:return("dispelling"); break; X case S_BREATHE:return("breathing"); break; X case S_INVISIBLE:return("invisibility"); break; X case S_WARP:return("the warp"); break; X case S_ENCHANT:return("enchantment"); break; X case S_BLESS:return("blessing"); break; X case S_RESTORE:return("restoration"); break; X case S_CURE:return("curing"); break; X case S_TRUESIGHT:return("true sight"); break; X case S_HELLFIRE:return("hellfire"); break; X case S_KNOWLEDGE:return("self knowledge"); break; X case S_HERO:return("heroism"); break; X case S_RETURN:return("return"); break; X case S_DESECRATE:return("desecration"); break; X case S_HASTE:return("haste"); break; X case S_SUMMON:return("summoning"); break; X case S_SANCTUARY:return("sanctuary"); break; X case S_ACCURACY:return("accuracy"); break; X case S_RITUAL:return("ritual magic"); break; X case S_APPORT:return("apportation"); break; X case S_SHADOWFORM:return("shadow form"); break; X case S_ALERT:return("alertness"); break; X case S_REGENERATE:return("regeneration"); break; X case S_SANCTIFY:return("sanctification"); break; X case S_CLAIRVOYANCE:return("clairvoyance"); break; X case S_DRAIN:return("energy drain"); break; X case S_LEVITATE:return("levitate"); break; X case S_POLYMORPH:return("polymorph"); break; X case S_FEAR:return("fear"); break; X case S_WISH:return("wishing"); break; X default:return("???"); break; X } X} X X X Xvoid initspells() X{ X int i; X X for (i=0; i<NUMSPELLS; i++) X Spells[i].known = FALSE; X X Spells[S_MON_DET].powerdrain = 3; X Spells[S_MON_DET].id = S_MON_DET; X X Spells[S_OBJ_DET].powerdrain = 3; X Spells[S_OBJ_DET].id = S_OBJ_DET; X X Spells[S_IDENTIFY].powerdrain = 10; X Spells[S_IDENTIFY].id = S_IDENTIFY; X X Spells[S_FIREBOLT].powerdrain = 20; X Spells[S_FIREBOLT].id = S_FIREBOLT; X X Spells[S_SLEEP].powerdrain = 15; X Spells[S_SLEEP].id = S_SLEEP; X X Spells[S_LBALL].powerdrain = 25; X Spells[S_LBALL].id = S_LBALL; X X Spells[S_TELEPORT].powerdrain = 20; X Spells[S_TELEPORT].id = S_TELEPORT; X X Spells[S_DISRUPT].powerdrain = 30; X Spells[S_DISRUPT].id = S_DISRUPT; X X Spells[S_DISINTEGRATE].powerdrain = 40; X Spells[S_DISINTEGRATE].id = S_DISINTEGRATE; X X Spells[S_MISSILE].powerdrain = 10; X Spells[S_MISSILE].id = S_MISSILE; X X Spells[S_HEAL].powerdrain = 15; X Spells[S_HEAL].id = S_HEAL; X X Spells[S_DISPEL].powerdrain = 40; X Spells[S_DISPEL].id = S_DISPEL; X X Spells[S_BREATHE].powerdrain = 20; X Spells[S_BREATHE].id = S_BREATHE; X X Spells[S_INVISIBLE].powerdrain = 15; X Spells[S_INVISIBLE].id = S_INVISIBLE; X X Spells[S_WARP].powerdrain = 50; X Spells[S_WARP].id = S_WARP; X X Spells[S_ENCHANT].powerdrain = 30; X Spells[S_ENCHANT].id = S_ENCHANT; X X Spells[S_BLESS].powerdrain = 30; X Spells[S_BLESS].id = S_BLESS; X X Spells[S_RESTORE].powerdrain = 20; X Spells[S_RESTORE].id = S_RESTORE; X X Spells[S_CURE].powerdrain = 20; X Spells[S_CURE].id = S_CURE; X X Spells[S_TRUESIGHT].powerdrain = 20; X Spells[S_TRUESIGHT].id = S_TRUESIGHT; X X Spells[S_HELLFIRE].powerdrain = 90; X Spells[S_HELLFIRE].id = S_HELLFIRE; X X Spells[S_KNOWLEDGE].powerdrain = 10; X Spells[S_KNOWLEDGE].id = S_KNOWLEDGE; X X Spells[S_HERO].powerdrain = 20; X Spells[S_HERO].id = S_HERO; X X Spells[S_RETURN].powerdrain = 10; X Spells[S_RETURN].id = S_RETURN; X X Spells[S_DESECRATE].powerdrain = 50; X Spells[S_DESECRATE].id = S_DESECRATE; X X Spells[S_HASTE].powerdrain = 15; X Spells[S_HASTE].id = S_HASTE; X X Spells[S_SUMMON].powerdrain = 20; X Spells[S_SUMMON].id = S_SUMMON; X X Spells[S_SANCTUARY].powerdrain = 75; X Spells[S_SANCTUARY].id = S_SANCTUARY; X X Spells[S_ACCURACY].powerdrain = 20; X Spells[S_ACCURACY].id = S_ACCURACY; X X Spells[S_RITUAL].powerdrain = 50; X Spells[S_RITUAL].id = S_RITUAL; X X Spells[S_APPORT].powerdrain = 15; X Spells[S_APPORT].id = S_APPORT; X X Spells[S_SHADOWFORM].powerdrain = 50; X Spells[S_SHADOWFORM].id = S_SHADOWFORM; X X Spells[S_ALERT].powerdrain = 15; X Spells[S_ALERT].id = S_ALERT; X X Spells[S_REGENERATE].powerdrain = 20; X Spells[S_REGENERATE].id = S_REGENERATE; X X Spells[S_SANCTIFY].powerdrain = 75; X Spells[S_SANCTIFY].id = S_SANCTIFY; X X Spells[S_CLAIRVOYANCE].powerdrain = 10; X Spells[S_CLAIRVOYANCE].id = S_CLAIRVOYANCE; X X Spells[S_DRAIN].powerdrain = 40; X Spells[S_DRAIN].id = S_DRAIN; X X Spells[S_LEVITATE].powerdrain = 25; X Spells[S_LEVITATE].id = S_LEVITATE; X X Spells[S_POLYMORPH].powerdrain = 30; X Spells[S_POLYMORPH].id = S_POLYMORPH; X X Spells[S_FEAR].powerdrain = 10; X Spells[S_FEAR].id = S_FEAR; X X Spells[S_WISH].powerdrain = 100; X Spells[S_WISH].id = S_WISH; X X} X X X X X X Xvoid cast_spell(spell) Xint spell; X{ X switch(spell) { X case S_MON_DET:s_mondet(); X break; X case S_OBJ_DET:s_objdet(); X break; X case S_IDENTIFY:s_identify(); X break; X case S_FIREBOLT:s_firebolt(); X break; X case S_SLEEP:s_sleep(); X break; X case S_LBALL:s_lball(); X break; X case S_TELEPORT:s_teleport(); X break; X case S_DISRUPT:s_disrupt(); X break; X case S_DISINTEGRATE:s_disintegrate(); X break; X case S_MISSILE:s_missile(); X break; X case S_HEAL:s_heal(); X break; X case S_DISPEL:s_dispel(); X break; X case S_BREATHE:s_breathe(); X break; X case S_INVISIBLE:s_invisible(); X break; X case S_WARP:s_warp(); X break; X case S_ENCHANT:s_enchant(); X break; X case S_BLESS:s_bless(); X break; X case S_RESTORE:s_restore(); X break; X case S_CURE:s_cure(); X break; X case S_TRUESIGHT:s_truesight(); X break; X case S_HELLFIRE:s_hellfire(); X break; X case S_KNOWLEDGE:s_knowledge(); X break; X case S_HERO:s_hero(); X break; X case S_RETURN:s_return(); X break; X case S_DESECRATE:s_desecrate(); X break; X case S_HASTE:s_haste(); X break; X case S_SUMMON:s_summon(); X break; X case S_SANCTUARY:s_sanctuary(); X break; X case S_ACCURACY:s_accuracy(); X break; X case S_RITUAL:s_ritual(); X break; X case S_APPORT:s_apport(); X break; X case S_SHADOWFORM:s_shadowform(); X break; X case S_ALERT:s_alert(); X break; X case S_REGENERATE:s_regenerate(); X break; X case S_SANCTIFY:s_sanctify(); X break; X case S_CLAIRVOYANCE:s_clairvoyance(); X break; X case S_DRAIN:s_drain(); X break; X case S_LEVITATE:s_levitate(); X break; X case S_FEAR:s_fear(); X break; X case S_POLYMORPH:s_polymorph(); X break; X case S_WISH:s_wish(); X break; X default: mprint("Your odd spell fizzles with a small 'sput'."); X break; X } X} X X X X X Xint spellparse() X{ X int spell= -3,place=0; X char byte,prefix[80]; X X prefix[0]=0; X X do { X byte = mgetc(); X if ((byte >= 'A') && (byte <= 'Z')) { X maddch(byte+'a'-'A'); X prefix[place] = byte+'a'-'A'; X prefix[place+1] = 0; X place++; X } X else if ((byte == ' ') || ((byte >= 'a') && (byte <= 'z'))) { X maddch(byte); X prefix[place] = byte; X prefix[place+1] = 0; X place++; X } X else if ((byte == 8) || (byte == 127)) { /* ^h or delete */ X prefix[place]=0; X if (place > 0) { X place--; X dobackspace(); X } X } X else if (byte == '?') { X maddch(byte); X expandspellabbrevs(prefix); X dobackspace(); X } X else if (byte == '\n') X spell = expandspell(prefix); X else if (byte == ESCAPE) X spell = ABORT; X } while (spell == -3); X xredraw(); X return(spell); X} X Xvoid expandspellabbrevs(prefix) Xchar prefix[80]; X{ X int i,printed=FALSE; X X menuclear(); X menuprint("\nPossible Spells:\n"); X for (i=0;i<NUMSPELLS;i++) X if (Spells[i].known && strprefix(prefix,spellid(i))) { X menuspellprint(i); X printed = TRUE; X } X if (! printed) X menuprint("\nNo spells match that prefix!"); X} X X Xint expandspell(prefix) Xchar prefix[80]; X{ X int i,spell,matched=0; X X for (i=0;i<NUMSPELLS;i++) X if (Spells[i].known && strprefix(prefix,spellid(i))) { X spell = i; X matched++; X } X if (matched==0) { X mprint("No spells match that prefix!"); X return(-2); X } X else if (matched > 1) { X mprint("That is an ambiguous abbreviation!"); X return(-2); X } X else return(spell); X} X END_OF_FILE if test 16536 -ne `wc -c <'ospell.c'`; then echo shar: \"'ospell.c'\" unpacked with wrong size! fi # end of 'ospell.c' fi if test -f 'oupdate.txt' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'oupdate.txt'\" else echo shar: Extracting \"'oupdate.txt'\" \(1377 characters\) sed "s/^X//" >'oupdate.txt' <<'END_OF_FILE' XVersion Changes X======= ======= X X0.57(alpha) First public release X X0.58(alpha) bugfixes, I forget what else X X0.59(alpha) bugfixes, better tactical combat mode ^c trapping X X0.60(alpha) bugfixes, filechecking, cuserid changed to getlogin, X brothel on city level, more foods. this file X started. new time mechanism, new module otime. X 12/5/87. X X0.70(alpha) architecture changed -- therefore most code X rewritten. Only large-scale changes detailed X here, otherwise too many to count. X X Countryside; multiple dungeons; "special levels"; X special screens for houses, the arena, and X countryside encounters; single combat mode X with different verbosity levels; no more X filechecking for saved games; many new X monsters; a few new items; new end game; X new inventory modes, effects of many commands X are different, some new commands added, X other old ones removed. Commands and X terrain characters have different meanings X in countryside. 3/22/88. X X0.70.5(alpha) First 0.70 version released via ftp. Many X bugs. Among other things, wouldn't work at all X on a vax. 3/22/88. X X0.71 (beta) Rather different version of 0.70 now about to X be released to usenet via comp.sources.games. X 7/11/88. X X0.75 Somewhat bugfixed version of 0.71, with MS-DOS X cpp code and makefile courtesy Nathan Glasser. X 5/4/89. END_OF_FILE if test 1377 -ne `wc -c <'oupdate.txt'`; then echo shar: \"'oupdate.txt'\" unpacked with wrong size! fi # end of 'oupdate.txt' fi echo shar: End of archive 14 \(of 20\). cp /dev/null ark14isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 20 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0