@@ @@ DarrienSpace Installer, Version 1 @@ This is part 1. There is another section after this that must be run. @@ No editing of this file should be necessary for PennMUSH @@ @@ I haven't tested this on Tiny, though. @@ @@ It also shouldn't be necessary to pre-create objects @@ @@ @@ Some testing... @pemit me=Remember, this version of space will only work if set(), tel(), and a couple of other 'side-effect' functions are enabled. It was created to for SW1 (starwars.gamenet.org:4402), coded under PennMUSH 1.7.2 patchlevel 17. Feel free to make whatever modifications you need to it in order for it to function on your MUSH. @pemit me=[switch(hasflag(me,Wizard),0,You're not a Wizard. This installation can still work%, but might have problems if other character objects own the ships.,1,I see you're a wizard.)] @swi [set(me,current_loc:%l)]=,,@Pemit me=It looks like set() works. Very good.,{@pemit me=Hmm. set() doesn't look like it's going to work. You're going to need to do quite a bit of editing to get this version of DarrienSpace to work. Sorry.;@set me=current_loc:%l;@set me=No_set:1} @swi [tel(me,v(current_loc))]=,,@pemit me=Had to make sure tel() works. It appears to!,{@pemit me=Uh oh. tel() doesn't appear to be working. The code is going to need some extensive re-writing to work under this condition.;@set me=No_tel:1} @swi [setr(0,dig(Test Room))]=#*,{@pemit me=Excellent! dig() appears to be working.;@set %q0=!safe;@nuke %q0;@nuke %q0},{@pemit me=Hmm. Without dig(), some functions will need to be re-written for the ship construction object (Ugnaughts). Also, this installation will be spammier.;@set me=no_dig:1} @pemit me=Okay, I'm going to go ahead and create some stuff. @@ @@ Item creation @set me=QUIET @create Master Nav-Comp @create Master Static Info @create DB for Ship Construction @create Master Space DB Item @create Master Ship DB Item @create Master Ugnaught @create Ship Pricing @create Weapon Database @create Master Ship Parent @parent Master Nav-Comp=Master Static Info @set Master Nav-Comp=NO_COMMAND @@ @@ Set up Master Nav-Comp @@ First, the Commands... &CMD_MISC Master Nav-Comp=$MISC*:@pemit %#=[switch(member(v(misc_commands),setr(0,ucstr(first(after(secure(%0),/))))),0, MISC/%q0 is not a valid command. Check MISC/HELP for details.,[setq(1,GO)])];@swi %q1=GO,{@tr me/do_MISC_%q0=[ucstr(after(secure(%0),/))],%#,%l,after(escape(%0),/)} &CMD_NAV Master Nav-Comp=$NAV*:@pemit %#=[switch(member(v(NAV_commands),setr(0,ucstr(first(after(secure(%0),/))))),0, NAV/%q0 is not a valid command. Check NAV/HELP for details.,[setq(1,GO)])];@swi %q1=GO,{@tr me/do_NAV_%q0=[ucstr(after(secure(%0),/))],%#,%l} &CMD_CBT Master Nav-Comp=$CBT*:@pemit %#=[switch(member(v(CBT_commands),setr(0,ucstr(first(after(secure(%0),/))))),0, CBT/%q0 is not a valid command. Check CBT/HELP for details.,[setq(1,GO)])];@swi %q1=GO,{@tr me/do_CBT_%q0=[ucstr(after(secure(%0),/))],%#,%l} &CMD_COM Master Nav-Comp=$COM*:@pemit %#=[switch(member(v(COM_commands),setr(0,ucstr(first(after(secure(%0),/))))),0, COM/%q0 is not a valid command. Check COM/HELP for details.,[setq(1,GO)])];@swi %q1=GO,{@tr me/do_COM_%q0=[ucstr(after(secure(%0),/))],%#,%l,after(escape(%0),/)} &CMD_MAN Master Nav-Comp=$MAN*:@pemit %#=[switch(member(v(MAN_commands),setr(0,ucstr(first(after(secure(%0),/))))),0, MAN/%q0 is not a valid command. Check MAN/HELP for details.,[setq(1,GO)])];@swi %q1=GO,{@tr me/do_MAN_%q0=[ucstr(after(secure(%0),/))],%#,%l} &CMD_JUMP Master Nav-Comp=$JUMP*:@pemit %#=[switch(isnum(secure(%0)),1,[u(fun_do_jump,edit(secure(%0),%b,),%#,%l)],switch(member(v(JUMP_commands),setr(0,ucstr(first(after(secure(%0),/))))),0, JUMP/%q0 is not a valid command. Check JUMP/HELP for details.,[setq(1,GO)]))];@swi %q1=GO,{@tr me/do_JUMP_%q0=[ucstr(after(secure(%0),/))],%#,%l} &CMD_SCAN Master Nav-Comp=$SCAN*:@pemit %#=[switch(secure(%0),,[u(fun_basic-scan)],switch(member(v(SCAN_commands),setr(0,ucstr(first(after(secure(%0),/))))),0, SCAN/%q0 is not a valid command. Check SCAN/HELP for details.,[setq(1,GO)]))];@swi %q1=GO,{@tr me/do_SCAN_%q0=[ucstr(after(secure(%0),/))],%#,%l} &MISC_COMMANDS Master Nav-Comp=HELP POSE EMIT PILOT STATUS RESCUE QUIET CODE &MAN_COMMANDS Master Nav-Comp=HELP TAKEOFF LAND DOCK UNDOCK &CBT_COMMANDS Master Nav-Comp=HELP HELP2 INIT ACCEPT INVITE LEAVE DISPLAY FIRE DEFEND SHIELDS STATUS LOG &COM_COMMANDS Master Nav-Comp=HELP CHAN RADIO &NAV_COMMANDS Master Nav-Comp=HELP LOCATION MOVETO AUTO &JUMP_COMMANDS Master Nav-Comp=HELP CALC DEL INFO UNJUMP ETA DEST &SCAN_COMMANDS Master Nav-Comp=HELP NORM PASSIVE FOCUS @@ Next is the next level of the commands. Like sub-commands, or options for the @@ commands that were just set up. This is big. &DO_MISC_RESCUE Master Nav-Comp=@pemit %1=[switch(first(rest(%0)),DOCK,u(fun_rescue-dock,%0),LOAD,u(fun_rescue-load,%0),<[ansi(c,CONSOLE)]> [ansi(r,Error:)] '[first(rest(%0))]' isn't a MISC/RESCUE option. Check MISC/HELP for details.)] &DO_CBT_STATUS Master Nav-Comp=@pemit %1=[switch(setr(5,extract(get(setr(1,v(ship))/combat_stats),1,1,|)),0,<[ansi(c,COMBAT)]> You are not currently in combat%, so there is nothing to report. Check CBT/HELP%, or perhaps try MISC/STATUS.,[u(fun_cbt-disp-status)])] &DO_CBT_DEFEND Master Nav-Comp=@remit %2=[switch(u(fun_cbt-candefend?,setr(0,first(rest(%0)))),0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You are not in a Combat Group.,10*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You are not currently under attack. CBT/DEFEND is used in response to an attack.,110,<[ansi(c,COMBAT)]> [ansi(r,Error:)] '%q0' is not a valid Defensive Manuever. The choices are None%, Flee%, Roll%, Turn%, Dive%, Climb%, Roll+Turn%, Roll+Dive%, and Roll+Climb%.,[u(fun_cbt-calc-defense,%1)])] &DO_CBT_INVITE Master Nav-Comp=@remit %1=[switch(u(fun_cancbtinvite?,setr(0,rest(%0)),%1),0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You must be in real space in order to engage in space combat.,1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You must already be in a Combat Grouping in order to use this command. Check CBT/HELP for details.,1|1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] "%q0" does not appear to be in the same system.,1|1|1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] %q0 has already been defeated.,1|1|1|1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You can not invite yourself into the Combat Group.,1|1|1|1|1|0,<[ansi(c,COMBAT)]> [ansi(r,Error:)] Only the pilot can initiate or accept combat invitations.,1|1|1|1|1|1,<[ansi(c,COMBAT)]> Request for combat has been sent to %q0.[set(%q2,combat_stats:[replace(get(%q2/combat_stats),2,extract(get(%q1/combat_stats),1,1,|),|)])][set(%q2,combat_stats:[replace(get(%q2/combat_stats),3,%q1,|)])][remit(%2,<[ansi(c,COMBAT)]> You have invited [get(%q2/trans)] into your combat group. Use CBT/DISPLAY to list other ships in your combat group.)][remit(get(%q2/cockpit),<[ansi(c,COMBAT)]> Request: [get(%q1/trans)] has invited you into combat grouping '[extract(get(%q1/combat_stats),1,1,|)]'. Type: CBT/ACCEPT to accept the invitation.)])] &DO_CBT_HELP2 Master Nav-Comp=@pemit %1=%r[u(help_header,CBT)][iter(1 2 [lnum(add(round(fdiv(words(v(cbt_commands)),2),0),2),words(v(cbt_commands)))],%r[u(help_cbt_[extract(v(cbt_commands),##,1)])])] &DO_CBT_FIRE Master Nav-Comp=@remit %2=[u(fun_setqueues)][switch(u(fun_can-fight?,first(rest(%0)),setr(3,after(%0,AT%b))),0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You can not fire on a ship without being in a Combat Group. Check CBT/HELP or CBT/HELP2 for details.,10*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You are currently not able to attack. Make sure you are in real space and in a Combat Grouping. For quick help%, check CBT/HELP.,110*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You do not have a weapon numbered '[first(rest(%0))]'. Check CBT/STATS or MISC/STATS for a list of available Weapons.,1110*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] Your [extract(get(%q1/weapon_[first(rest(%0))]),1,1,|)] can no longer fire. Out of ammunition.,11110*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] '%q3' is not in your Combat Grouping.,111110*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You can not attack yourself.,1111110,<[ansi(c,COMBAT)]> [ansi(r,Error:)] [get(%q2/trans)] still needs to resolve another attack before it can resolve this one. They have been prompted to select a defense.[remit(get(%q2/cockpit),<[ansi(c,COMBAT)]> Info: [get(%q1/trans)] tried to attack you%, but could not. You need to resolve another attack by use of CBT/DEFEND. Check CBT/HELP2 for details.)],1111111,[u(fun_cbt-calc-attack,first(rest(%0)),%1)]<[ansi(c,COMBAT)]> You fire your [extract(get(%q1/weapon_[first(rest(%0))]),1,1,|)] at %q3%, for an Attack Value of %q0. Waiting for Defense.[remit(get(%q2/cockpit),<[ansi(c,COMBAT)]> [get(%q1/trans)] has attacked you. You must now specify a Defense. See CBT/HELP2 for details.)])] &DO_MISC_EMIT Master Nav-Comp=@pemit %1=[switch(loc(setr(1,v(ship))),v(hyperspace),<[ansi(c,MISCELLANEOUS)]> Ship poses are not possible in hyperspace.,v(space),iter(get(v(data_systemdb)/system_[get(%q1/system)]),remit(get(##/cockpit), [edit(rest(%3),%/,)])),Outside the ship%, this is posed:%r [edit(rest(%3),%/,)][remit(loc(%q1), [edit(rest(%3),%/,)])])] &DO_MISC_HELP Master Nav-Comp=@pemit %1=%r[u(Help_Header,MISC)][iter(v(MISC_commands),%r[u(help_misc_##)])] &DO_MISC_POSE Master Nav-Comp=@pemit %1=[switch(loc(setr(1,v(ship))),v(hyperspace),<[ansi(c,MISCELLANEOUS)]> [ansi(r,Error:)] Ship poses are not possible in hyperspace. Sorry.,v(space),[setq(3,get(%q1/system))][iter(get(v(data_systemdb)/system_%q3),remit(get(##/cockpit),<[ansi(c,SENSORS)]> [get(%q1/trans)] [edit(rest(%3),%/,)]))],<[ansi(c,MISCELLANEOUS)]> [ansi(r,Error:)] That type of Ship pose is impossible unless in space. Use MISC/EMIT while the ship is in this location.)] &DO_CBT_LEAVE Master Nav-Comp=@remit %2=[switch(t(setr(5,extract(get(setr(1,v(ship))/combat_stats),1,1,|))),0,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You are not in a combat group.,1,<[ansi(c,COMBAT)]> You leave combat group "%q5".[set(%q1,combat_stats:[replace(get(%q1/combat_stats),1,0,|)])][wipe(%q1/cbt_log)][map(fun_cbt-leave-notify,setr(6,get(v(data_systemdb)/system_[get(%q1/system)])))][switch(words(setr(7,squish(map(fun_cbt-cleanup,%q6)))),1,set(%q7,combat_stats:[replace(get(%q7/combat_stats),1,0,|)]))])] &DO_CBT_ACCEPT Master Nav-Comp=@remit %2=[switch(u(fun_cancbtaccept?,%1),0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You must be in real space in order to enter combat.,1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You have not been invited to enter combat in this system.,1|1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] The ship that invited you into a combat group is no longer in that group.,1|1|1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] This ship is incapable of entering combat.,1|1|1|1|0,<[ansi(c,COMBAT)]> [ansi(r,Error:)] Only the pilot can initiate or accept combat invitations.,1|1|1|1|1,<[ansi(c,COMBAT)]> You join combat group "%q4". Use CBT/DISPLAY to list other ships in this combat group.[switch(t(setr(5,extract(get(%q1/combat_stats),1,1,|))),1,map(fun_cbt-leave-notify,setr(6,get(v(data_systemdb)/system_%q3))))][switch(words(setr(7,squish(map(fun_cbt-cleanup,%q6)))),1,set(%q7,combat_stats:[replace(get(%q7/combat_stats),1,0,|)]))][map(fun_cbt-enter-notify,get(v(data_systemdb)/system_%q3))][set(%q1,combat_stats:[replace(get(%q1/combat_stats),1,%q4,|)])][set(%q1,combat_stats:[replace(get(%q1/combat_stats),4,extract(get(%q1/stat_stats),1,1,|),|)])][set(%q1,combat_stats:[replace(get(%q1/combat_stats),7,1,|)])][set(%q1,combat_stats:[replace(get(%q1/combat_stats),3,0,|)])])] &DO_CBT_INIT Master Nav-Comp=@remit %2=[switch(u(fun_cancbtinit?,setr(0,first(after(%0,WITH%b))),%1),0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You must be in real space in order to engage in space combat.,1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] This ship is crippled%, and cannot engage in space combat.,1|1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] "%q0" does not appear to be in the same system.,1|1|1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] %q0 has already been defeated.,1|1|1|1|0*,<[ansi(c,COMBAT)]> [ansi(r,Error:)] You can not initiate combat with yourself.,1|1|1|1|1|0,<[ansi(c,COMBAT)]> [ansi(r,Error:)] Only the pilot can initiate or accept combat invitations.,1|1|1|1|1|1,<[ansi(c,COMBAT)]> Request for combat has been sent to %q0.[set(%q2,combat_stats:[replace(get(%q2/combat_stats),2,setr(4,add(last(sort(setunion(iter(get(v(data_systemdb)/system_[get(%q1/system)]),extract(get(##/combat_stats),1,1,|)),0))),1)),|)])][switch(t(setr(5,extract(get(%q1/combat_stats),1,1,|))),1,map(fun_cbt-leave-notify,get(v(data_systemdb)/system_%q3)))][set(%q1,combat_stats:[replace(get(%q1/combat_stats),1,%q4,|)])][set(%q1,combat_stats:[replace(get(%q1/combat_stats),4,extract(get(%q1/stat_stats),1,1,|),|)])][set(%q1,combat_stats:[replace(get(%q1/combat_stats),7,1,|)])][set(%q2,combat_stats:[replace(get(%q2/combat_stats),3,%q1,|)])][remit(%2,<[ansi(c,COMBAT)]> You have created and entered combat group "%q4". Use CBT/DISPLAY to list other ships in your combat group. Use CBT/INVITE to invite other ships into this combat group.)][remit(get(%q2/cockpit),<[ansi(c,COMBAT)]> Request: [get(%q1/trans)] has requested to initiate combat with you. Type: CBT/ACCEPT to accept the request.)])] &DO_SCAN_NORM Master Nav-Comp=@pemit %1=[u(fun_setqueues)][u(fun_setqueues2,setr(2,get(v(data_shipdb)/trans_[first(after(%0,NORM))])))][switch(u(fun_scancheck?,extract(get(%q1/comm_stats),3,1,|)),0|*,[u(fun_scan-not-space)],1|0*,<[ansi(c,SENSORS)]> [ansi(r,Error:)] You have entered "[after(%0,NORM%b)]" as the Transponder of the ship you'd like to scan. Currently%, that can not be seen at this time.,1|1|0,<[ansi(c,SENSORS)]> [ansi(r,Error:)] That ship %([get(%q2/trans)]%) is out of range for that type of scan.,1|1|1,[u(fun_disp-norm-scan)])] @@ @@ End of part 1. @set me=!Quiet @wait 5=@pemit me=First part completed. You may begin the next part. (Only do them in sequence.)