games@tekred.TEK.COM (07/26/88)
Submitted by: "Laurence R. Brothers" <brothers@paul.rutgers.edu> Comp.sources.games: Volume 5, Issue 24 Archive-name: omega2/Part14 #! /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 19)." # Contents: oextern.h oguild1.c oitemf3.c ommove.c # Wrapped by billr@saab on Wed Jul 13 10:46:56 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'oextern.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'oextern.h'\" else echo shar: Extracting \"'oextern.h'\" \(15633 characters\) sed "s/^X//" >'oextern.h' <<'END_OF_FILE' 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(); Xvoid calc_melee(),gain_experience(),p_damage(),minute_check(); 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(); Xint expval(),player_hit(),statmod(),item_value(),true_item_value(); 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(); Xint calcmana(),fixnpc(),competence_check(); 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 */ Xint inbounds(),random_range(),hitp(),sign(),max(),min(),distance(); Xint unblocked(),los_p(),screenmod(),offscreen(),calc_points(); Xint bitp(),nighttime(),hour(),showhour(),day(),showminute(); Xint view_unblocked(),m_unblocked(),strmem(); Xint view_los_p(),confirmation(),gamestatusp(); 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(); Xvoid menuclear(),showcursor(),mnumprint(),menunumprint(),display_pack(); 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(); Xint parsenum(),getnumber(),litroom(),move_slot(),stillonblock(); Xchar getspot(),mgetc(),lgetc(),menugetc(),*msgscanstring(); Xchar mcigetc(),ynq(),ynq1(),ynq2(); 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(); Xint getitem(),badobject(),cursed(),get_money(),get_item_number(),find_item(); 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 15633 -ne `wc -c <'oextern.h'`; then echo shar: \"'oextern.h'\" unpacked with wrong size! fi # end of 'oextern.h' fi if test -f 'oguild1.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'oguild1.c'\" else echo shar: Extracting \"'oguild1.c'\" \(14561 characters\) sed "s/^X//" >'oguild1.c' <<'END_OF_FILE' X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */ X/* oguild1.c */ X/* L_ functions */ X X/* These functions implement the various guilds. */ X/* They are all l_ functions since they are basically activated*/ X/* at some site or other. */ X X#include "oglob.h" X X Xvoid l_merc_guild() X{ X pob newitem; X X print1("Legion of Destiny, Mercenary Guild, Inc."); X if (nighttime()) X print2("The barracks are under curfew right now."); X else { X print2("You enter Legion HQ, "); X if (Player.rank[LEGION] == COMMANDANT) { X nprint2("Your aide follows you to the staff room."); X morewait(); X clearmsg(); X } X if (Player.rank[LEGION] > 0) { X nprint2("and report to your commander."); X morewait(); X } X switch(Player.rank[LEGION]) { X case 0: X nprint2("and see the Recruiting Centurion."); X morewait(); X print2("Do you wish to join the Legion? [yn] "); X if (ynq2()=='y') { X clearmsg(); X if (Player.rank[ARENA]>0) { X print1("The Centurion checks your record, and gets angry:"); X print2("'The legion don't need any Arena Jocks. Git!'"); X } X else if (Player.rank[ORDER] > 0) { X print1("The Centurion checks your record, and is amused:"); X print2("'A paladin in the ranks? You must be joking.'"); X } X else if (Player.con < 12) { X print1("The Centurion looks you over, sadly."); X print2("You are too fragile to join the legion."); X } X else if (Player.str < 10) { X print1("The Centurion looks at you contemptuously."); X print2("Your strength is too low to pass the physical!"); X } X else { X print1("You are tested for strength and stamina..."); X morewait(); X nprint1(" and you pass!"); X print2("Commandant "); X nprint2(Commandant); X nprint2(" shakes your hand."); X morewait(); X print2("The Legion pays you a 500Au induction fee."); X morewait(); X print1("You are also issued a shortsword and leather."); X print2("You are now a Legionaire."); X morewait(); X clearmsg(); X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[WEAPONID+1]; /* shortsword */ X gain_item(newitem); X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[ARMORID+1]; /* leather */ X gain_item(newitem); X Player.cash += 500; X Player.rank[LEGION] = LEGIONAIRE; X Player.guildxp[LEGION] = 1; X Player.str++; Player.con++; X Player.maxstr++; Player.maxcon++; X } X } X break; X case COMMANDANT: X print1("You find the disposition of your forces satisfactory."); X break; X case COLONEL: X if ((Player.level > Commandantlevel) && X find_and_remove_item(CORPSEID+0,ML10+4)) { X print1("You liberated the Demon Emperor's Regalia!"); X morewait(); X clearmsg(); X print1("The Legion is assembled in salute to you!"); X print2("The Regalia is held high for all to see and admire."); X morewait(); X clearmsg(); X print1("Commandant "); X nprint1(Commandant); X nprint1(" promotes you to replace him,"); X print2("and announces his own overdue retirement."); X morewait(); X clearmsg(); X print1("You are the new Commandant of the Legion!"); X print2("The Emperor's Regalia is sold for a ridiculous sum."); X strcpy(Commandant,Player.name); X Commandantlevel = Player.level; X morewait(); X clearmsg(); X print1("You now know the Spell of Regeneration."); X Spells[S_REGENERATE].known = TRUE; X Player.rank[LEGION]=COMMANDANT; X Player.maxstr += 2; X Player.str += 2; X Player.maxcon += 2; X Player.con += 2; X print2("Your training is complete. You get top salary."); X Player.cash += 20000; X } X else if (Player.level <= Commandantlevel) { X clearmsg(); X print1("Your CO expresses satisfaction with your progress."); X print2("But your service record does not yet permit promotion."); X } X else { X clearmsg(); X print1("Why do you come empty handed?"); X print2("You must return with the Regalia of the Demon Emperor!"); X } X break; X case FORCE_LEADER: X clearmsg(); X print1("Your CO expresses satisfaction with your progress."); X if (Player.guildxp[LEGION] < 4000) X print2("But your service record does not yet permit promotion."); X else { X print2("You have been promoted to Legion Colonel!"); X morewait(); X print1("Your next promotion is contingent on the return of"); X print2("the Regalia of the Demon Emperor."); X morewait(); X print1("The Demon Emperor holds court at the base of a volcano"); X print2("to the far south, in the heart of a swamp."); X morewait(); X clearmsg(); X print1("You have been taught the spell of heroism!"); X Spells[S_HERO].known = TRUE; X Player.rank[LEGION]=COLONEL; X Player.maxstr++; X Player.str++; X Player.maxcon++; X Player.con++; X print2("You are given advanced training, and a raise."); X Player.cash += 10000; X } X break; X case CENTURION: X clearmsg(); X print1("Your CO expresses satisfaction with your progress."); X if (Player.guildxp[LEGION] < 1500) X print2("But your service record does not yet permit promotion."); X else { X print2("You are now a Legion Force-Leader!"); X Player.rank[LEGION]=FORCE_LEADER; X Player.maxstr++; X Player.str++; X morewait(); X clearmsg(); X print1("You receive more training, and bonus pay."); X Player.cash += 5000; X } X break; X case LEGIONAIRE: X clearmsg(); X print1("Your CO expresses satisfaction with your progress."); X if (Player.guildxp[LEGION] < 400) X print2("But your service record does not yet permit promotion."); X else { X print2("You are promoted to Legion Centurion!"); X morewait(); X clearmsg(); X print1("You get advanced training, and a higher salary."); X Player.rank[LEGION] = CENTURION; X Player.maxcon++; X Player.con++; X Player.cash += 2000; X } X break; X } X } X} X Xvoid l_castle() X{ X pob o; X if (Player.level < 3) { X print1("You can't possibly enter the castle, you nobody!"); X print2("Come back when you are famous."); X } X else { X print1("You are ushered into the castle."); X if (Player.rank[NOBILITY]<DUKE) { X print2("His Grace, "); X nprint2(Duke); X nprint2("-- Duke of Rampart! <fanfare>"); X morewait(); X clearmsg(); X } X if (Player.rank[NOBILITY]==0) { X print1("Well, sirrah, wouldst embark on a quest? [yn] "); X if (ynq1() == 'y') { X print2("Splendid. Bring me the head of the Goblin King."); X Player.rank[NOBILITY]=COMMONER; X } X else { X print1("You scoundrel! Guards! Take this blackguard away!"); X morewait(); X p_damage(25,UNSTOPPABLE,"castle guards for lese majeste"); X send_to_jail(); X } X } X else if (Player.rank[NOBILITY]==COMMONER) { X if (find_and_remove_item(CORPSEID,ML3+5)) { X print1("Good job, sirrah! I promote you to the rank of esquire."); X Player.rank[NOBILITY]=ESQUIRE; X gain_experience(100); X print2("Now that you have proved yourself true, another quest!"); X morewait(); X print1("Bring to me a Holy Defender!"); X print2("One is said to be in the possession of the Great Wyrm"); X morewait(); X clearmsg(); X print1("in the depths of the sewers below the city."); X } X else print2("Do not return until you achieve the quest, caitiff!"); X } X else if (Player.rank[NOBILITY]==ESQUIRE) { X if (find_and_remove_item(WEAPONID+34,-1)) { X print1("My thanks, squire. In return, I dub thee knight!"); X Player.rank[NOBILITY]=KNIGHT; X gain_experience(1000); X print2("If thou wouldst please me further..."); X morewait(); X print1("Bring me a suit of dragonscale armor."); X print2("You might have to kill a dragon to get one...."); X } X else print2("Greetings, squire. My sword? What, you don't have it?"); X } X else if (Player.rank[NOBILITY]==KNIGHT) { X if (find_and_remove_item(ARMORID+12,-1)) { X print1("Thanks, good sir knight."); X print2("Here are letters patent to a peerage!"); X Player.rank[NOBILITY]=LORD; X gain_experience(10000); X morewait(); X print1("If you would do me a final service..."); X print2("I require the Orb of Mastery. If you would be so kind..."); X morewait(); X print1("By the way, you might find the Orb in the possession"); X print2("Of the Elemental Master on the Astral Plane"); X } X else print2("Your quest is not yet complete, sir knight."); X } X else if (Player.rank[NOBILITY]==LORD) { X if (find_item(&o,ARTIFACTID+0,-1)) { X print1("My sincerest thanks, my lord."); X print2("You have proved yourself a true paragon of chivalry"); X morewait(); X print1("I abdicate the Duchy in your favor...."); X print2("Oh, you can keep the Orb, by the way...."); X Player.rank[NOBILITY]=DUKE; X gain_experience(10000); X strcpy(Duke,Player.name); X } X else print2("I didn't really think you were up to the task...."); X } X } X} X X Xvoid l_arena() X{ X char response; X pob newitem; X int i,prize,monsterlevel; X print1("Rampart Coliseum"); X if (Player.rank[ARENA] == 0) { X print2("Enter the games, or Register as a Gladiator? [e,r,ESCAPE] "); X do response = mcigetc(); X while ((response != 'e') && (response != 'r') && (response != ESCAPE)); X } X else { X print2("Enter the games? [yn] "); X response = ynq2(); X if (response == 'y') response = 'e'; X else response = ESCAPE; X } X if (response == 'r') { X if (Player.rank[ARENA]>0) X print2("You're already a gladiator...."); X else if (Player.rank[ORDER]>0) X print2("We don't let Paladins into our Guild."); X else if (Player.rank[LEGION]>0) X print2("We don't train no stinkin' mercs!"); X else if (Player.str < 13) X print2("Yer too weak to train!"); X else if (Player.agi < 12) X print2("Too clumsy to be a gladiator!"); X else { X print1("Ok, yer now an Arena Trainee."); X print2("Here's a wooden sword, and a shield"); X morewait(); X clearmsg(); X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[WEAPONID+17]; /* club */ X gain_item(newitem); X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[SHIELDID+2]; /* shield */ X gain_item(newitem); X Player.rank[ARENA] = TRAINEE; X Arena_Opponent = 3; X morewait(); X clearmsg(); X print1("You've got 5000Au credit at the Gym."); X Gymcredit+=5000; X } X } X else if (response == 'e') { X print1("OK, we're arranging a match...."); X morewait(); X Arena_Monster = ((pmt) malloc(sizeof(montype))); X switch(Arena_Opponent) { X case 0: X *Arena_Monster = Monsters[ML1+9]; X break; X case 1: X *Arena_Monster = Monsters[ML0+0]; X break; X case 2: X *Arena_Monster = Monsters[ML1+21]; X break; X case 3: X *Arena_Monster = Monsters[ML1+6]; X break; X case 4: X *Arena_Monster = Monsters[ML1+0]; X break; X case 5: X *Arena_Monster = Monsters[ML2+4]; X break; X case 6: X *Arena_Monster = Monsters[ML2+0]; X break; X case 7: X *Arena_Monster = Monsters[ML3+0]; X break; X case 8: X *Arena_Monster = Monsters[ML2+11]; X break; X case 9: X *Arena_Monster = Monsters[ML4+0]; X break; X case 10: X *Arena_Monster = Monsters[ML5+5]; X break; X case 11: X *Arena_Monster = Monsters[ML6+4]; X break; X case 12: X *Arena_Monster = Monsters[ML6+5]; X break; X case 13: X *Arena_Monster = Monsters[ML8+2]; X break; X case 14: X *Arena_Monster = Monsters[ML8+4]; X break; X case 15: X *Arena_Monster = Monsters[ML9+0]; X break; X default: X if ((Player.rank[ARENA] < 5) && (Player.rank[ARENA] > 0)) { X strcpy(Str1,Champion); X strcat(Str1,", the arena champion"); X *Arena_Monster = Monsters[ML0+8]; X Arena_Monster->monstring = salloc(Str1); X strcpy(Str2,"The corpse of "); X strcat(Str2,Str1); X Arena_Monster->corpsestr = salloc(Str2); X Arena_Monster->level = 20; X Arena_Monster->hp = Championlevel*Championlevel*5; X Arena_Monster->hit = Championlevel*4; X Arena_Monster->ac = Championlevel*3; X Arena_Monster->dmg = 100+Championlevel*2; X Arena_Monster->xpv = Championlevel*Championlevel*5; X Arena_Monster->speed = 3; X Arena_Monster->meleestr = calloc(30,sizeof(char)); X strcpy(Arena_Monster->meleestr,""); X for(i=0;i<Championlevel/5;i++) X strcat(Arena_Monster->meleestr,"L?R?"); X } X else { X do X *Arena_Monster = Monsters[random_range(ML9-ML0)+ML0]; X while ((Arena_Monster->uniqueness != COMMON) || X (Arena_Monster->dmg == 0)); X } X break; X } X X X X monsterlevel = Arena_Monster->level; X X if (Arena_Monster->level != 20) { X strcpy(Str1,nameprint()); X strcat(Str1," the "); X strcat(Str1,Arena_Monster->monstring); X Arena_Monster->monstring = salloc(Str1); X strcpy(Str2,"The corpse of "); X strcat(Str2,Str1); X Arena_Monster->corpsestr = salloc(Str2); X } X Arena_Monster->uniqueness = UNIQUE_MADE; X print1("You have a challenger: "); X print2(Arena_Monster->monstring); X Arena_Monster->attacked = TRUE; X m_status_set(Arena_Monster,HOSTILE); X morewait(); X clearmsg(); X print1("Let the battle begin...."); X change_environment(E_ARENA); X X time_clock(TRUE); X while (Current_Environment == E_ARENA) X time_clock(FALSE); X X if (! Arena_Victory) { X print1("The crowd boos your craven behavior!!!"); X print2("You are thrown out of the Gladiator's Guild!"); X morewait(); X clearmsg(); X if (Gymcredit > 0) print1("Your credit at the gym is cut off!"); X Gymcredit = 0; X Player.rank[ARENA] = -1; X } X else { X Arena_Opponent++; X if (monsterlevel == 20) { X print1("The crowd roars its approval!"); X if (Player.rank[ARENA]) { X print2("You are the new Arena Champion!"); X Championlevel = Player.level; X strcpy(Champion,Player.name); X Player.rank[ARENA] = 5; X morewait(); X print1("You are awarded the Champion's Spear: Victrix!"); X morewait(); X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[WEAPONID+35]; X gain_item(newitem); X X } X else { X print1("As you are not an official gladiator,"); X nprint1("you are not made Champion."); X morewait(); X } X } X morewait(); X clearmsg(); X print1("Good fight! "); X nprint1("Your prize is: "); X prize = max(25,monsterlevel * 50); X if (Player.rank[ARENA] > 0) prize *= 2; X mnumprint(prize); X nprint1("Au."); X Player.cash+=prize; X if ((Player.rank[ARENA]<4) && X (Arena_Opponent>5) && X (Arena_Opponent % 3 == 0)) { X if (Player.rank[ARENA]>0) { X Player.rank[ARENA]++; X morewait(); X print1("You've been promoted to a stronger class!"); X print2("You are also entitled to additional training."); X Gymcredit+=Arena_Opponent*1000; X } X } X } X xredraw(); X } X else clearmsg(); X} X END_OF_FILE if test 14561 -ne `wc -c <'oguild1.c'`; then echo shar: \"'oguild1.c'\" unpacked with wrong size! fi # end of 'oguild1.c' fi if test -f 'oitemf3.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'oitemf3.c'\" else echo shar: Extracting \"'oitemf3.c'\" \(15783 characters\) sed "s/^X//" >'oitemf3.c' <<'END_OF_FILE' X/* omega copyright (C) 1987,1988 by Laurence Raphael Brothers */ X/* oitemf3.c */ X X/* mostly artifact and stick functions */ X X#include "oglob.h" X X/* amulet of the planes */ Xvoid i_planes(o) Xpob o; X{ X if (Player.mana < 1) print1("The amulet spits some multicolored sparks."); X else { X print1("You focus mana into the amulet...."); X Player.mana = max(0,Player.mana-100); X dataprint(); X morewait(); X strategic_teleport(1); X } X} X X X/* the sceptre of high magic */ Xvoid i_sceptre(o) Xpob o; X{ X if (HiMagicUse == Date) X print1("The Sceptre makes a sort of dull 'thut' noise."); X else { X HiMagicUse = Date; X print1("With a shriek of tearing aether, a magic portal appears!"); X print2("Step through? [yn] "); X if (ynq()=='y') change_environment(E_COURT); X } X print1("The sceptre seems to subside. You hear a high whine, as of"); X print2("capacitors beginning to recharge."); X} X X X/* the star gem */ Xvoid i_stargem(o) Xpob o; X{ X if (StarGemUse == Date) { X print1("The Star Gem glints weakly as if to say:"); X print2("'You have used me overmuch.'"); X print3("and it vanishes a puff of regret."); X dispose_lost_objects(1,o); X } X else { X StarGemUse = Date; X if (o->blessing < 1) { X print1("The Star Gem shines brightly and emits a musical tone."); X print2("You see a dark cloud roil away from it."); X morewait(); X o->blessing = 10; X } X print1("The star gem flares with golden light!"); X morewait(); X if (Player.status[ILLUMINATION] < 1000) { X print1("Interesting, you seem to be permanently accompanied"); X print2("by a friendly lambent glow...."); X morewait(); X Player.status[ILLUMINATION] = 1500; X } X print1("You suddenly find yourself whisked away by some unknown force!"); X morewait(); X setgamestatus(COMPLETED_ASTRAL); X change_environment(E_COUNTRYSIDE); X Player.x = 61; X Player.y = 3; X screencheck(3); X drawvision(Player.x,Player.y); X locprint("Star Peak"); X print2("The Star Gem's brilliance seems to fade."); X } X} X X X/* wand of fear */ Xvoid i_fear(o) Xpob o; X{ X int x=Player.x,y=Player.y; X Objects[o->id].known = 1; X o->known = max(1,o->known); X setspot(&x,&y); X if (o->blessing < 0) { X x = Player.x; X y = Player.y; X } X inflict_fear(x,y); X} X X X Xvoid i_juggernaut(o) Xpob o; X{ X int d,x=Player.x,y=Player.y; X print1("You activate the Juggernaut of Karnak!"); X if (! o->known) { X print2("Uh, oh, it's coming this way!"); X p_death("The Juggernaut of Karnak"); X } X else { X d = getdir(); X if (d == ABORT) X print2("You deactivate the Juggernaut before it escapes."); X else { X print2("Vroom!"); X while (inbounds(x+Dirs[0][d],y+Dirs[1][d])) { X x+=Dirs[0][d]; X y+=Dirs[1][d]; X Level->site[x][y].locchar = FLOOR; X Level->site[x][y].p_locf = L_NO_OP; X if (Level->site[x][y].creature != NULL) { X mprint("You hear a distant scream...."); X m_death(Level->site[x][y].creature); X } X } X gain_experience(1000); X } X } X dispose_lost_objects(1,o); X} X X Xvoid i_symbol(o) Xpob o; X{ X int i; X if (! o->known) X print1("Nothing seems to happen."); X /* if o->charge != 17, then symbol was stolen from own high priest! */ X else if ((o->aux != Player.patron) || (o->charge != 17)){ X print1("You invoke the deity..."); X print2("...who for some reason seems rather annoyed at you..."); X print3("You are enveloped in Godsfire!"); X morewait(); X for(;Player.hp>1;Player.hp--) { X dataprint(); X morewait(); X for(i=0;i<MAXITEMS;i++) X if (Player.possessions[i] != NULL) X dispose_lost_objects(Player.possessions[i]->number, X Player.possessions[i]); X Player.mana = 0; X } X } X else if (SymbolUseHour == hour()) { X print1("Your deity frowns upon this profligate use of power..."); X print2("Shazam! A bolt of Godsfire! Your symbol shatters!"); X dispose_lost_objects(1,o); X Player.hp = 1; X dataprint(); X } X else { X print1("A mystic flow of theurgic energy courses through your body!"); X SymbolUseHour = hour(); X cleanse(1); X heal(10); X Player.mana = max(Player.mana,calcmana()); X } X} X X X Xvoid i_crystal(o) Xpob o; X{ X if (!o->known) print1("You can't figure out how to activate this orb."); X else { X print1("You gaze into your crystal ball."); X if (ViewHour == hour()) print2("All you get is Gilligan's Island reruns."); X else if ((o->blessing<0) || (Player.iq+Player.level < random_range(30))) { X ViewHour = hour(); X print2("Weird interference patterns from the crystal fog your mind...."); X amnesia(); X } X else { X ViewHour = hour(); X print2("You sense the presence of life..."); X mondet(1); X morewait(); X print2("You sense the presence of objects..."); X objdet(1); X morewait(); X print2("You begin to see visions of things beyond your ken...."); X hint(); X } X } X} X Xvoid i_antioch(o) Xpob o; X{ X int x=Player.x,y=Player.y; X int count; X if (!o->known){ X print1("Ka-Boom!"); X print2("You seem to have annihilated yourself."); X p_death("The Holy Hand-Grenade of Antioch"); X } X else { X print1("Bring out the Holy Hand-Grenade of Antioch!"); X setspot(&x,&y); X print2("Ok, you pull the pin....."); X morewait(); X print1("What do you count up to? "); X count = parsenum(); X if ((count < 3)&&(Level->site[x][y].creature!=NULL)) { X print1("`Three shall be the number of thy counting...."); X print2("And the number of thy counting shall be three.'"); X print3("Your target picks up the grenade and throws it back!"); X morewait(); X clearmsg(); X print1("Ka-Boom!"); X p_death("The Holy Hand-Grenade of Antioch"); X } X else if (count>3) { X print1("`Three shall be the number of thy counting."); X print2("And the number of thy counting shall be three.'"); X morewait(); X clearmsg(); X print1("Ka-Boom!"); X p_death("The Holy Hand-Grenade of Antioch"); X } X else { X print1("Ka-Boom!"); X gain_experience(1000); X Level->site[x][y].locchar = TRAP; X Level->site[x][y].p_locf = L_TRAP_DOOR; X if (Level->site[x][y].creature != NULL) { X m_death(Level->site[x][y].creature); X print2("You are covered with gore."); X } X Level->site[x][y].things = NULL; X } X } X dispose_lost_objects(1,o); X} X Xvoid i_kolwynia(o) Xpob o; X{ X int i; X if (! o->known) { X print1("You destroy youself with a mana storm. How sad."); X p_death("Kolwynia, The Key That Was Lost"); X } X else { X gain_experience(5000); X print1("You seem to have gained complete mastery of magic."); X Player.pow = Player.maxpow = 2*Player.maxpow; X for(i=0;i<NUMSPELLS;i++) X Spells[i].known = TRUE; X } X dispose_lost_objects(1,o); X} X Xvoid i_enchantment(o) Xpob o; X{ X char response; X if (ZapHour == hour()) X print1("The staff doesn't seem to have recharged yet."); X else if (! o->known) { X ZapHour = hour(); X print1("You blast the staff backwards...."); X dispel(-1); X } X else { X ZapHour = hour(); X print1("Zap with white or black end [wb] "); X do response = mcigetc(); while ((response != 'w') && (response != 'b')); X print2("The staff discharges!"); X if (response = 'w') enchant(o->blessing*2+1); X else dispel(o->blessing); X } X} X Xvoid i_helm(o) Xpob o; X{ X if (HelmHour == hour()) X print1("The helm doesn't seem to have recharged yet."); X else if (! o->known) { X HelmHour = hour(); X print1("You put the helm on backwards...."); X p_teleport(-1); X } X else { X HelmHour = hour(); X print1("Your environment fades.... and rematerializes."); X p_teleport(o->blessing); X } X} X X Xvoid i_death(o) Xpob o; X{ X clearmsg(); X print1("Bad move..."); X p_death("The Potion of Death"); X} X Xvoid i_life(o) Xpob o; X{ X clearmsg(); X print1("Good move."); X Player.hp = Player.maxhp = 2 * Player.maxhp; X dispose_lost_objects(1,o); X} X X X X/* f = fire, w = water, e = earth, a = air, m = mastery */ Xint orbcheck(element) Xchar element; X{ X char response; X print1("The orb begins to glow with increasing intensity!"); X print2("You have the feeling you need to do something more...."); X morewait(); X print1("Burn it in fire [f] "); X print2("Douse it with water [w] "); X morewait(); X print1("Smash it against the earth [e] "); X print2("Toss is through the air [a] "); X morewait(); X print1("Mix the above actions, doing them in sequence [m] "); X do { X print2("Which one [f,w,e,a,m] "); X response = mcigetc(); X } while ((response != 'f') && X (response != 'w') && X (response != 'e') && X (response != 'a') && X (response != 'm')); X return(response == element); X} X X/* orb functions */ Xvoid i_orbfire(o) Xpob o; X{ X if (! orbcheck('f')) { X print1("Bad choice!"); X print2("The Orb of Fire blasts you!"); X fball(Player.x,Player.y,Player.x,Player.y,250); X o->known = 1; X } X else { X print1("The Orb of Fire flares a brilliant red!"); X Spells[S_FIREBOLT].known = TRUE; X gain_experience(10000); X Player.immunity[FLAME]+=100; X print2("You feel fiery!"); X o->plus = 100; X o->blessing = 100; X i_firebolt(o); X } X *o = Objects[ARTIFACTID+5]; X} X X Xvoid i_orbwater(o) Xpob o; X{ X if (! orbcheck('w')) { X print1("A serious mistake!"); X print2("The Orb of Water blasts you!"); X heal(-250); X o->known = 1; X } X else { X print1("The Orb of Water pulses a deep green!"); X Spells[S_DISRUPT].known = TRUE; X Player.immunity[POISON]+=100; X gain_experience(10000); X print2("You feel wet!"); X o->plus = 100; X o->blessing = 100; X i_disrupt(o); X } X *o = Objects[ARTIFACTID+5]; X} X X X X X X Xvoid i_orbearth(o) Xpob o; X{ X int i; X if (! orbcheck('e')) { X print1("What a maroon!"); X print2("The Orb of Earth blasts you!"); X Player.con -= 10; X if (Player.con < 3) X p_death("congestive heart failure"); X else { X print3("Your possessions disintegrate!"); X for (i=0;i<MAXITEMS;i++) X if (Player.possessions[i] != NULL) X dispose_lost_objects(Player.possessions[i]->number, X Player.possessions[i]); X for (i=0;i<MAXPACK;i++) X if (Player.pack[i] != NULL) { X free((char *) Player.pack[i]); X Player.pack[i] = NULL; X } X Player.packptr = 0; X o->known = 1; X } X } X else { X print1("The Orb of Earth emanates a brownish aura!"); X Spells[S_DISINTEGRATE].known = TRUE; X gain_experience(10000); X Player.immunity[NEGENERGY]+=100; X print2("You feel earthy!"); X o->plus = 100; X o->blessing = 100; X i_disintegrate(o); X } X *o = Objects[ARTIFACTID+5]; X} X X Xvoid i_orbair(o) Xpob o; X{ X if (! orbcheck('a')) { X print1("You lose!"); X print2("The Orb of Air blasts you!"); X lball(Player.x,Player.y,Player.x,Player.y,100); X o->known = 1; X } X else { X print1("The Orb of Air flashes blue!"); X Spells[S_LBALL].known = TRUE; /* lball */ X gain_experience(10000); X print2("You feel airy!"); X Player.immunity[ELECTRICITY]+=100; X o->plus = 100; X o->blessing = 100; X i_invisible(o); X i_lbolt(o); X } X *o = Objects[ARTIFACTID+5]; X} X X Xvoid i_orbmastery(o) Xpob o; X{ X X if (! orbcheck('m')) { X print1("A fatal error!"); X print2("The Orb of Mastery blasts you to cinders!"); X p_death("playing with the Orb of Mastery"); X o->known = 1; X } X else if ((find_and_remove_item(ARTIFACTID+1,-1)) && X (find_and_remove_item(ARTIFACTID+2,-1)) && X (find_and_remove_item(ARTIFACTID+3,-1)) && X (find_and_remove_item(ARTIFACTID+4,-1))) { X print1("The Orb of Mastery radiates rainbow colors!"); X print2("You feel godlike."); X Player.iq = Player.maxiq = 2 * Player.maxiq; X Player.pow = Player.maxpow = 2 * Player.maxpow; X Player.str = Player.maxstr = 2 * Player.maxstr; X Player.dex = Player.maxdex = 2 * Player.maxdex; X Player.con = Player.maxcon = 2 * Player.maxcon; X Player.agi = Player.maxagi = 2 * Player.maxagi; X dataprint(); X morewait(); X print1("You have been imbued with a cosmic power...."); X morewait(); X wish(1); X morewait(); X clearmsg(); X print2("You feel much more experienced."); X gain_experience(20000); X *o = Objects[ARTIFACTID+5]; X } X else { X print1("The Orb of Mastery's power is unbalanced!"); X print2("The Orb of Mastery blasts you to cinders!"); X p_death("playing with the Orb of Mastery"); X } X} X X Xvoid i_orbdead(o) Xpob o; X{ X int i; X print1("The burnt-out orb drains all your energy!"); X for(i=0;i<NUMSPELLS;i++) X Spells[i].known = FALSE; X print2("You feel not at all like a mage."); X for(i=0;i<MAXITEMS;i++) { X if (Player.possessions[i] != NULL) { X Player.possessions[i]->plus = 0; X if (Player.possessions[i]->usef > 100) X Player.possessions[i]->usef = I_NOTHING; X } X } X print3("A storm of mundanity surounds you!"); X level_drain(Player.level-1,"a Burnt-out Orb"); X Player.mana = 0; X Player.pow -= 10; X} X X X Xvoid i_dispel(o) Xpob o; X{ X dispel((o->blessing > -1) ? o->blessing+random_range(3): o->blessing); X} X X X/* stick functions * / X X X/* wand of apportation */ Xvoid i_apport(o) Xpob o; X{ X o->known = max(1,o->known); X Objects[o->id].known = 1; X apport(o->blessing); X} X X/* staff of firebolts */ Xvoid i_firebolt(o) Xpob o; X{ X int x=Player.x,y=Player.y; X o->known = max(1,o->known); X Objects[o->id].known = 1; X setspot(&x,&y); X if (o->blessing < 0) { X x = Player.x; X y = Player.y; X } X fbolt(Player.x,Player.y,x,y,Player.dex*2+Player.level,75); X} X X Xvoid i_disintegrate(o) Xpob o; X{ X int x=Player.x,y=Player.y; X o->known = max(1,o->known); X Objects[o->id].known = 1; X setspot(&x,&y); X if (o->blessing < 0) { X x = Player.x; X y = Player.y; X } X disintegrate(x,y); X} X Xvoid i_disrupt(o) Xpob o; X{ X int x=Player.x,y=Player.y; X o->known = max(1,o->known); X Objects[o->id].known = 1; X setspot(&x,&y); X if (o->blessing < 0) { X x = Player.x; X y = Player.y; X } X disrupt(x,y,100); X} X X X/* staff of lightning bolts */ Xvoid i_lbolt(o) Xpob o; X{ X int x=Player.x,y=Player.y; X o->known = max(1,o->known); X Objects[o->id].known = 1; X setspot(&x,&y); X if (o->blessing < 0) { X x = Player.x; X y = Player.y; X } X lbolt(Player.x,Player.y,x,y,Player.dex*2+Player.level,75); X} X X/* wand of magic missiles */ Xvoid i_missile(o) Xpob o; X{ X int x=Player.x,y=Player.y; X o->known = max(1,o->known); X Objects[o->id].known = 1; X setspot(&x,&y); X if (o->blessing < 0) { X x = Player.x; X y = Player.y; X } X nbolt(Player.x,Player.y,x,y,Player.dex*2+Player.level,20); X} X X/* wand of fire balls */ Xvoid i_fireball(o) Xpob o; X{ X int x=Player.x,y=Player.y; X Objects[o->id].known = 1; X o->known = max(1,o->known); X setspot(&x,&y); X if (o->blessing < 0) { X x = Player.x; X y = Player.y; X } X fball(Player.x,Player.y,x,y,35); X} X X X/* wand of snowballs */ Xvoid i_snowball(o) Xpob o; X{ X int x=Player.x,y=Player.y; X Objects[o->id].known = 1; X o->known = max(1,o->known); X setspot(&x,&y); X if (o->blessing < 0) { X x = Player.x; X y = Player.y; X } X snowball(Player.x,Player.y,x,y,20); X} X X/* wand of lightning balls */ Xvoid i_lball(o) Xpob o; X{ X int x=Player.x,y=Player.y; X Objects[o->id].known = 1; X o->known = max(1,o->known); X setspot(&x,&y); X if (o->blessing < 0) { X x = Player.x; X y = Player.y; X } X lball(Player.x,Player.y,x,y,50); X} X X/* staff of sleep */ Xvoid i_sleep_other(o) Xpob o; X{ X Objects[o->id].known = 1; X o->known = max(1,o->known); X sleep_monster(o->blessing); X} X X/* rod of summoning */ X/* rod of summoning now always summons as if cursed */ Xvoid i_summon(o) Xpob o; X{ X Objects[o->id].known = 1; X o->known = max(1,o->known); X summon(-1,-1); X} X Xvoid i_hide(o) Xpob o; X{ X int x=Player.x,y=Player.y; X Objects[o->id].known = 1; X o->known = max(1,o->known); X setspot(&x,&y); X hide(x,y); X} X Xvoid i_polymorph(o) Xpob o; X{ X Objects[o->id].known = 1; X o->known = max(1,o->known); X polymorph(o->blessing); X} END_OF_FILE if test 15783 -ne `wc -c <'oitemf3.c'`; then echo shar: \"'oitemf3.c'\" unpacked with wrong size! fi # end of 'oitemf3.c' fi if test -f 'ommove.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'ommove.c'\" else echo shar: Extracting \"'ommove.c'\" \(5355 characters\) sed "s/^X//" >'ommove.c' <<'END_OF_FILE' X/* omega copyright (c) 1987,1988 by Laurence Raphael Brothers */ X/* ommove.c */ X/* monster move functions */ X X#include "oglob.h" X X X/* like m_normal_move, but can open doors */ Xvoid m_smart_move(m) Xstruct monster *m; X{ X m_simple_move(m); X} X X/* not very smart, but not altogether stupid movement */ Xvoid m_normal_move(m) Xstruct monster *m; X{ X m_simple_move(m); X} X X X/* used by both m_normal_move and m_smart_move */ Xvoid m_simple_move(m) Xstruct monster *m; X{ X int dx = sign(Player.x - m->x); X int dy = sign(Player.y - m->y); X erase_monster(m); X if (m->hp < Monsters[m->id].hp/4) { X dx = - dx; X dy = - dy; X m->movef = M_MOVE_SCAREDY; X if (m->uniqueness == COMMON) { X strcpy(Str2,"The "); X strcat(Str2,m->monstring); X } X else strcpy(Str2,m->monstring); X if (m->possessions != NULL) { X strcat(Str2," drops its treasure and flees!"); X m_dropstuff(m); X } X else strcat(Str2," flees!"); X mprint(Str2); X m->speed = min(2,m->speed-1); X } X if ((! m_statusp(m,HOSTILE)) || X (Player.status[INVISIBLE] > 0)) m_random_move(m); X else { X if (m_unblocked(m,m->x+dx,m->y+dy)) X movemonster(m,m->x+dx,m->y+dy); X else if (dx == 0) { X if (m_unblocked(m,m->x+1,m->y+dy)) X movemonster(m,m->x+1,m->y+dy); X else if (m_unblocked(m,m->x-1,m->y+dy)) X movemonster(m,m->x-1,m->y+dy); X } X X else if (dy == 0) { X if (m_unblocked(m,m->x+dx,m->y+1)) X movemonster(m,m->x+dx,m->y+1); X else if (m_unblocked(m,m->x+dx,m->y-1)) X movemonster(m,m->x+dx,m->y-1); X } X X else { X if (m_unblocked(m,m->x+dx,m->y)) X movemonster(m,m->x+dx,m->y); X else if (m_unblocked(m,m->x,m->y+dy)) X movemonster(m,m->x,m->y+dy); X } X } X} X X X X Xvoid m_move_animal(m) Xstruct monster *m; X{ X if (m_statusp(m,HOSTILE)) X m_normal_move(m); X else m_scaredy_move(m); X} X X X X X/* same as simple move except run in opposite direction */ Xvoid m_scaredy_move(m) Xstruct monster *m; X{ X int dx = -sign(Player.x - m->x); X int dy = -sign(Player.y - m->y); X erase_monster(m); X if (Player.status[INVISIBLE]) m_random_move(m); X else { X if (m_unblocked(m,m->x+dx,m->y+dy)) X movemonster(m,m->x+dx,m->y+dy); X else if (dx == 0) { X if (m_unblocked(m,m->x+1,m->y+dy)) X movemonster(m,m->x+1,m->y+dy); X else if (m_unblocked(m,m->x-1,m->y+dy)) X movemonster(m,m->x-1,m->y+dy); X } X X else if (dy == 0) { X if (m_unblocked(m,m->x+dx,m->y+1)) X movemonster(m,m->x+dx,m->y+1); X else if (m_unblocked(m,m->x+dx,m->y-1)) X movemonster(m,m->x+dx,m->y-1); X } X X else { X if (m_unblocked(m,m->x+dx,m->y)) X movemonster(m,m->x+dx,m->y); X else if (m_unblocked(m,m->x,m->y+dy)) X movemonster(m,m->x,m->y+dy); X } X } X} X X X X X X X/* for spirits (and earth creatures) who can ignore blockages because X either they are noncorporeal or they can move through stone */ Xvoid m_spirit_move(m) Xstruct monster *m; X{ X int dx = sign(Player.x - m->x); X int dy = sign(Player.y - m->y); X erase_monster(m); X if (m->hp < Monsters[m->id].hp/6) { X dx = -dx; X dy = -dy; X } X X if (Player.status[INVISIBLE] > 0) m_random_move(m); X else movemonster(m,m->x+dx,m->y+dy); X} X X X X/* fluttery dumb movement */ Xvoid m_flutter_move(m) Xstruct monster *m; X{ X int trange,range = distance(m->x,m->y,Player.x,Player.y); X int i,tx,ty,nx=m->x,ny=m->y; X erase_monster(m); X if (Player.status[INVISIBLE] > 0) m_random_move(m); X else { X for (i=0;i<8;i++) { X tx = m->x+Dirs[0][i]; X ty = m->y+Dirs[1][i]; X trange = distance(tx,ty,Player.x,Player.y); X if (m->hp < Monsters[m->id].hp/6) { X if ((trange > range) && m_unblocked(m,tx,ty)) { X range = trange; X nx = tx; X ny = ty; X } X } X else if ((trange <= range) && m_unblocked(m,tx,ty)) { X range = trange; X nx = tx; X ny = ty; X } X } X movemonster(m,nx,ny); X } X} X X Xvoid m_follow_move(m) Xstruct monster *m; X{ X if (! m_statusp(m,HOSTILE)) X m_normal_move(m); X else m_scaredy_move(m); X} X X X X/* allows monsters to fall into pools, revealed traps, etc */ Xvoid m_confused_move(m) Xstruct monster *m; X{ X int i,nx,ny,done=FALSE; X erase_monster(m); X for (i=0;((i<8)&&(! done));i++) { X nx = m->x+random_range(3)-1; X ny = m->y+random_range(3)-1; X if (unblocked(nx,ny) && X ((nx != Player.x) || X (ny != Player.y))) { X done = TRUE; X movemonster(m,nx,ny); X } X } X} X Xvoid m_random_move(m) Xstruct monster *m; X{ X int i,nx,ny,done=FALSE; X erase_monster(m); X for (i=0;((i<8)&&(! done));i++) { X nx = m->x+random_range(3)-1; X ny = m->y+random_range(3)-1; X if (m_unblocked(m,nx,ny) && X ((nx != Player.x) || X (ny != Player.y))) { X done = TRUE; X movemonster(m,nx,ny); X } X } X} X X X/* monster removed from play */ Xvoid m_vanish(m) Xstruct monster *m; X{ X if (m->uniqueness == COMMON) { X strcpy(Str2,"The "); X strcat(Str2,m->monstring); X } X else strcpy(Str2,m->monstring); X strcat(Str2," vanishes in the twinkling of an eye!"); X mprint(Str2); X Level->site[m->x][m->y].creature = NULL; X erase_monster(m); X m->hp = -1; /* signals "death" -- no credit to payer, though */ X} X X/* monster still in play */ Xvoid m_teleport(m) Xstruct monster *m; X{ X erase_monster(m); X if (m_statusp(m,AWAKE)) { X Level->site[m->x][m->y].creature = NULL; X putspot(m->x,m->y,getspot(m->x,m->y,FALSE)); X findspace(&(m->x),&(m->y),-1); X Level->site[m->x][m->y].creature = m; X } X} END_OF_FILE if test 5355 -ne `wc -c <'ommove.c'`; then echo shar: \"'ommove.c'\" unpacked with wrong size! fi # end of 'ommove.c' fi echo shar: End of archive 14 \(of 19\). 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 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 19 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