void m_death(struct monster *m) { pob corpse; pml ml; int x; int y; int found = FALSE; m->hp = -1; if(los_p(Player.x, Player.y, m->x, m->y)) { putspot(m->x, m->y, getspot(m->x, m->y, FALSE)); gain_experience(m->xpv); calc_melee(); if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " is dead!"); mprint(Str1); } m_dropstuff(m); /* Death */ if(m->id == (ML10 + 0)) { mprint("Death lies sprawled out on the ground..."); mprint("Death laughs ironically and gets back to his feet."); mprint("He gestures and another scythe appears in his hands."); switch(random_range(10)) { case 0: mprint("Death performs a little bow and goes back on guard."); break; case 1: mprint("\'A hit! A palpable hit!\' Death goes back on the attack."); break; case 2: mprint("\'Ah, if only it could be so simple!\' snickers Death."); break; case 3: mprint("\'This fool things he can slay death! What a jest!\' says Death."); break; case 4: mprint("\'You point is well taken.\' says Death, attacking again."); break; case 5: mprint("\'Oh, come now, stop delaying the inevitable.\' says Death."); break; case 6: mprint("\'Your destiny ends here with me.\' says Death, scythe raised."); break; case 7: mprint("\'I almost felt that.\' says Death, smiling."); break; case 8: mprint("\'Timeo Mortis?\' asks Death quizzically, \'Not me!\'"); break; case 9: mprint("Death sighs theatrically. \'They never learn.\'"); break; } strengthen_death(m); } else { Level->site[m->x][m->y].creature = NULL; if(random_range(2) || (m->uniqueness != COMMON)) { corpse = (pob)malloc(sizeof(objtype)); make_corpse(corpse, m); drop_at(m->x, m->y, corpse); } plotspot(m->x, m->y, FALSE); switch(m->id) { case ML0 + 8: /* Hiscore NPC */ switch(m->aux2) { case 0: mprint("You hear a faroff dirge. You feel a sense of triumph."); break; case 1: case 2: case 3: case 4: case 5: case 6: mprint("You hear a faroff sound like angels crying..."); strcpy(Priest[1], nameprint()); Priestbehavior[1] = 2933; break; case 7: mprint("A furtive figure dashes out of the shadows, takes a look at"); mprint("the corpse, and runs away!"); strcpy(Shadowlord, nameprint()); Shadowlordbehavior = 2912; break; case 8: mprint("An aide-de-camp approaches, removes the corpse's insignia,"); mprint("and departs."); strcpy(Commandant, nameprint()); Commandantbehavior = 2912; break; case 9: mprint("An odd glow surrounds the corpse, and slowly fades."); strcpy(Archmage, nameprint()); Archmagebehavior = 2933; break; case 10: mprint("A demon materializes, takes a quick look at the corpse,"); mprint("and teleports away with a faint popping noise."); strcpy(Prime, nameprint()); Primebehavior = 2932; break; case 11: mprint("A sports columnist rushes forward and takes a quick photo"); mprint("of the corpse and rushes off muttering about a deadline."); strcpy(Champion, nameprint()); Championbehavior = 2913; break; case 12: mprint("You hear a fanfare in the distance, and feel dismayed."); strcpy(Duke, nameprint()); Dukebehavior = 2911; break; case 13: if(Player.alignment > 10) { mprint("You feel smug."); } else if(Player.alignment < 10) { mprint("You feel ashamed."); } strcpy(Chaoslord, nameprint()); Chaoslordbehavior = 2912; break; case 14: if(Player.alignment < 10) { mprint("You feel smug."); } else if(Player.alignment > 10) { mprint("You feel ashamed."); } strcpy(Lawlord, nameprint()); Lawlordbehavior = 2911; break; case 15: /* * Just a tad complicated. Promote a new justiciar if * an guards are left in the city, otherwise destroy * the Order! */ Player.alignment -= 100; if(!gamestatusp(DESTROYED_ORDER)) { mprint("In the distance you hear a trumpet. A Servent of Law"); mprint("materializes, sheds a tear, and leaves."); strcpy(Justiciar, nameprint()); Justiciarbehavior = 2911; /* Promote one of the city guards to be justiciar */ ml = City->mlist; while(!found && (ml != NULL)) { if((ml->m->id == (ML0 + 3)) && (ml->m->hp > 0)) { found = 1; } else { found = 0; } if(!found) { ml = ml->next; } } if(ml != NULL) { mprint("A new justiciar has been promoted!"); x = ml->m->x; y = ml->m->y; ml->m->x = x; ml->m->y = y; ml->m->click = (Tick + 1) % 60; m_status_reset(ml->m, AWAKE); m_status_reset(ml->m, HOSTILE); } /* * Will cause order to be destroyed if no guards or justiciar */ alert_guards(); } else { mprint("A Servant of Chaos materializes, grabs the corpse,"); mprint("snickers a bit, and vanishes."); } } break; case ML0 + 3: /* Guard */ Player.alignment -= 10; if((Current_Environment == E_CITY) || (Current_Environment == E_VILLAGE)) { alert_guards(); } break; case ML3 + 5: /* Goblin king */ if(!gamestatusp(ATTACKED_ORACLE)) { mprint("You seem to hear a woman's voice from far off:"); mprint("\'Well don! Come to me now...\'"); } setgamestatus(COMPLETED_CAVES); break; case ML7 + 5: /* Great worm */ if(!gamestatusp(ATTACKED_ORACLE)) { mprint("A female voice sounds from just behind your ear:"); mprint("\'Well fought! I have some new advice for you...\'"); } setgamestatus(COMPLETED_SEWERS); break; case ML10 + 1: setgamestatus(KILLED_EATER); break; case ML10 + 2: setgamestatus(KILLED_LAWBRINGER); break; case ML10 + 3: setgamestatus(KILLED_DRAGONLORD); break; case ML10 + 4: setgamestatus(COMPLETED_VOLCANO); if(!gamestatusp(ATTACKED_ORACLE)) { mprint("You feel a soft touch on your shoulder..."); mprint("You turn around but there is no one there!"); mprint("You turn back and see a not: \'See me soon.\'"); mprint("The note vanishes in a burst of blue fire!"); } break; case ML10 + 9: /* Elemental master */ if(!gamestatusp(ATTACKED_ORACLE)) { mprint("Words appear before you, traced in blue flame!"); mprint("\'Return to the Prime Plane via the Circle of Sorcerors..."); } break; } } dodrawspot(m->x, m->y); }
void l_arena(void) { char response; Object* newitem; int i,prize,monsterlevel; char *melee = NULL; print1("Rampart Coliseum"); if (Player.rank[ARENA] == 0) { print2("Enter the games, or Register as a Gladiator? [e,r,ESCAPE] "); do response = (char) mcigetc(); while ((response != 'e') && (response != 'r') && (response != ESCAPE)); } else { print2("Enter the games? [yn] "); response = ynq2(); if (response == 'y') response = 'e'; else response = ESCAPE; } if (response == 'r') { if (Player.rank[ARENA]>0) print2("You're already a gladiator...."); else if (Player.rank[ORDER]>0) print2("We don't let Paladins into our Guild."); else if (Player.rank[LEGION]>0) print2("We don't train no stinkin' mercs!"); else if (Player.str < 13) print2("Yer too weak to train!"); else if (Player.agi < 12) print2("Too clumsy to be a gladiator!"); else { print1("Ok, yer now an Arena Trainee."); print2("Here's a wooden sword, and a shield"); morewait(); clearmsg(); newitem = ((Object*) checkmalloc(sizeof(Object))); *newitem = Objects[OB_CLUB]; /* club */ gain_item(newitem); newitem = ((Object*) checkmalloc(sizeof(Object))); *newitem = Objects[OB_LRG_RND_SHIELD]; /* shield */ gain_item(newitem); Player.rank[ARENA] = TRAINEE; Arena_Opponent = 3; morewait(); clearmsg(); print1("You've got 5000Au credit at the Gym."); Gymcredit+=5000; } } else if (response == 'e') { print1("OK, we're arranging a match...."); morewait(); Arena_Monster = ((Monster*) checkmalloc(sizeof(Monster))); Arena_Victory = false; switch(Arena_Opponent) { case 0: *Arena_Monster = Monsters[GEEK]; break; case 1: *Arena_Monster = Monsters[HORNET]; break; case 2: *Arena_Monster = Monsters[HYENA]; break; case 3: *Arena_Monster = Monsters[GOBLIN]; break; case 4: *Arena_Monster = Monsters[GRUNT]; break; case 5: *Arena_Monster = Monsters[TOVE]; break; case 6: *Arena_Monster = Monsters[APPR_NINJA]; break; case 7: *Arena_Monster = Monsters[SALAMANDER]; break; case 8: *Arena_Monster = Monsters[ANT]; break; case 9: *Arena_Monster = Monsters[MANTICORE]; break; case 10: *Arena_Monster = Monsters[SPECTRE]; break; case 11: *Arena_Monster = Monsters[BANDERSNATCH]; break; case 12: *Arena_Monster = Monsters[LICHE]; break; case 13: *Arena_Monster = Monsters[AUTO_MAJOR]; break; case 14: *Arena_Monster = Monsters[JABBERWOCK]; break; case 15: *Arena_Monster = Monsters[JOTUN]; break; default: if ((Player.rank[ARENA] < 5) && (Player.rank[ARENA] > 0)) { strcpy(Str1,Champion); strcat(Str1,", the arena champion"); *Arena_Monster = Monsters[HISCORE_NPC]; Arena_Monster->name = salloc(Str1); strcpy(Str2,"The corpse of "); strcat(Str2,Str1); Arena_Monster->corpseString = salloc(Str2); m_status_set( Arena_Monster, ALLOC ); Arena_Monster->level = 20; Arena_Monster->hp = Championlevel*Championlevel*5; Arena_Monster->hit = Championlevel*4; Arena_Monster->ac = Championlevel*3; Arena_Monster->dmg = 100+Championlevel*2; Arena_Monster->xpv = Championlevel*Championlevel*5; Arena_Monster->speed = 3; melee = Arena_Monster->combatManeuvers = (char *) checkmalloc(30*sizeof(char)); strcpy(Arena_Monster->combatManeuvers,""); for(i=0; i<Championlevel/5; i++) strcat(Arena_Monster->combatManeuvers,"L?R?"); m_status_set(Arena_Monster, MOBILE); m_status_set(Arena_Monster, HOSTILE); } else { do i = random_range(ML9 - ML0) + ML0; while (i == NPC || i == HISCORE_NPC || i == ZERO_NPC || (Monsters[i].uniqueness != COMMON) || (Monsters[i].dmg == 0)); *Arena_Monster = Monsters[i]; } break; } monsterlevel = Arena_Monster->level; if (Arena_Monster->level != 20) { strcpy(Str1,nameprint()); strcat(Str1," the "); strcat(Str1,Arena_Monster->name); Arena_Monster->name = salloc(Str1); strcpy(Str2,"The corpse of "); strcat(Str2,Str1); Arena_Monster->corpseString = salloc(Str2); m_status_set( Arena_Monster, ALLOC ); } Arena_Monster->uniqueness = UNIQUE_MADE; print1("You have a challenger: "); print2(Arena_Monster->name); Arena_Monster->wasAttackedByPlayer = true; m_status_set(Arena_Monster,HOSTILE); /* DAG pump up the stats of the arena monster; from env.c */ /* DAG should we even do this for the champion? */ Arena_Monster->hp += Arena_Monster->level*10; Arena_Monster->hit += Arena_Monster->hit; Arena_Monster->dmg += Arena_Monster->dmg/2; morewait(); clearmsg(); change_environment(E_ARENA); print1("Let the battle begin...."); time_clock(true); while (Current_Environment == E_ARENA) time_clock(false); /* DAG all this nasty mess cleaned up... */ /* one process with m_status_set( Arena_Monster, ALLOC) */ /* free(name); */ /* free(corpse); */ if (melee) free(melee); if (! Arena_Victory) { print1("The crowd boos your craven behavior!!!"); if (Player.rank[ARENA] > 0) { print2("You are thrown out of the Gladiator's Guild!"); morewait(); clearmsg(); if (Gymcredit > 0) print1("Your credit at the gym is cut off!"); Gymcredit = 0; Player.rank[ARENA] = -1; } } else { Arena_Opponent++; if (monsterlevel == 20) { print1("The crowd roars its approval!"); if (Player.rank[ARENA]) { print2("You are the new Arena Champion!"); Championlevel = Player.level; strcpy(Champion,Player.name); Player.rank[ARENA] = 5; morewait(); Championbehavior = fixnpc(4); save_hiscore_npc(11); print1("You are awarded the Champion's Spear: Victrix!"); morewait(); newitem = ((Object*) checkmalloc(sizeof(Object))); *newitem = Objects[OB_VICTRIX]; gain_item(newitem); } else { print1("As you are not an official gladiator,"); nprint1("you are not made Champion."); morewait(); } } morewait(); clearmsg(); print1("Good fight! "); nprint1("Your prize is: "); prize = max(25,monsterlevel * 50); if (Player.rank[ARENA] > 0) prize *= 2; mnumprint(prize); nprint1("Au."); Player.cash+=prize; if ((Player.rank[ARENA]<4) && (Arena_Opponent>5) && (Arena_Opponent % 3 == 0)) { if (Player.rank[ARENA]>0) { Player.rank[ARENA]++; morewait(); print1("You've been promoted to a stronger class!"); print2("You are also entitled to additional training."); Gymcredit+=Arena_Opponent*1000; } } } xredraw(); } else clearmsg(); }