#include "path.h" inherit "room/room"; /* This is the simulator arena * As I mentioned, I am ashamed of the code, its really old :) * (Especially the really horrible array stuff! :) */ /* * Platforms * --------- * * This code has been ported to the following drivers: (With a basic mudlib) * * 2.4.5, 3.1.2, 3.2 (amylaar), 3.12 -DR, 3.12 -CD * * Author * ------ * * This code was written by David Ljung as Jubal E. Harshaw (The LPJubal) * DaveSource.com/GetDave.com * * Copyright * --------- * * This code is Copyright 1991, David Ljung Madison * * It may not be rewritten without consent of the author, except for the sake * of fixing bugs or porting to new platforms. * * It may be freely redistributed, but it may not be sold in any form. */ object suits; int num_suits; reset(arg) { if (arg) return; set_light(5); suits=allocate(MAX_SUITS); short_desc = "SimArena"; no_castle_flag = 0; fix_long(); dest_dir = ({ "players/jubal/room/arenaent", "south" }); } init() { add_action("kill","kill"); add_action("register","register"); add_action("dereg","deregister"); ::init(); } kill(arg) { if(this_player()->suit()) return this_player()->suit()->kill(arg); return write("You need to suit up first\n"); } long() { fix_long(); write(long_desc); } fix_long() { long_desc = "Jubal's Simulated Gladiator Arena.\n" + "Use 'register' to register for a simulated, player-killing fight.\n" + "After the fight is over, you get your hit points back and are unharmed.\n" + "Use the 'deregister' command or leave the arena to deregister.\n" + "Spells do not currently work, and you get no experience for the fight.\n" + is_registered()+"\nThere is one obvious exit:\n-> south\n"; } is_registered() { int i; string tmp,tmp2; tmp=""; for (i=0;iowner())==this_object())) tmp+=suits[i]->realshort()+"\n"; else { if (suits[i]) write("Deregistered: "+suits[i]->realshort()+"\n"); deregister(suits[i]); } if (num_suits==0) return "No one is registered to fight"; tmp2=" "+num_suits+" Gladiator"; if (num_suits>1) tmp2+="s"; tmp2+=" in the arena:\n"; return tmp2+tmp; } exit() { if (this_player()->suit()) { this_player()->leaving(); deregister(this_player()->suit()); write("You take off your simulator suit.\n"); say(this_player()->query_name()+" takes off "+this_player()->query_possessive()+" simulator suit.\n"); fix_long(); } } register() { object ob; if (this_player()->suit()) { write("You are already suited up.\n"); return 1; } ob=clone_object(SUIT_FILE); ob->start(this_player()); write("You suit up in the simulated combat outfit.\n"); say(this_player()->query_name()+" registers for combat\n"); suits[num_suits]=ob; num_suits++; fix_long(); return 1; } defeat(winner,loser) { winner->stop_fight(); loser->stop_fight(); tell_room(this_object()," *** "+winner->query_name()+" defeats " +loser->query_name()+" in simulated combat! ***\n"); #ifdef LOG_FILE log_file(LOG_FILE,winner->query_name()+" defeats "+loser->query_name() +" in the simarena.\n"); #endif tell_object(winner,"You WIN!\n"); tell_object(loser,"You LOSE!\n"); winner->suit()->fix_exp(); loser->suit()->fix_exp(); deregister(winner->suit()); deregister(loser->suit()); } dereg() { object ob; ob=shadow(this_player(),0); if(ob) { write("You take off the simulator suit.\n"); say(this_player()->query_name()+" deregisters from the simulator arena.\n"); deregister(ob); } else write("You aren't registered.\n"); return 1; } deregister(arg) { int i; status found; if(arg) arg->leaving(); found=0; for(i=0;iowner()) tell_object(arg->owner(),"You have been deregistered from the simulator arena.\n"); } if (arg) destruct(arg); fix_long(); }