@@ @@ DarrienSpace Installer, Version 1 @@ This is part 4. There is at least one other section after this one. @@ Please do the previous sections in order before executing this one. @@ 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 @@ @@ @set me=QUIET &FUN_HYPER-NOTIFY Master Nav-Comp=[u(fun_setqueues)][iter(get(v(data_systemdb)/system_%q3),[setq(7,extract(get(##/location),1,1,|))][setq(8,extract(get(##/location),2,1,|))][setq(9,extract(get(##/location),3,1,|))][switch(lte(round(dist3d(%q4,%q5,%q6,%q7,%q8,%q9),1),extract(get(##/comm_stats),3,1,|)),1,remit(get(##/cockpit),{<[ansi(c,SENSORS)]> [get(%q1/trans)] has just engaged its hyperdrive and entered hyperspace at %q4,%q5,%q6.}))])] &FUN_CANDOCK? Master Nav-Comp=[setq(1,v(ship))][setq(2,get(v(data_shipdb)/trans_[before(first(%0),/)]))][switch(t(member(%0,WITH)),0,setq(3,NORMAL),setq(3,after(%0,WITH%b)))][switch(first(%0),*/*,setq(4,after(first(%0),/)),setq(4,NORMAL))][setq(5,get(%q1/D_%q3))][setq(6,first(get(%q2/d_%q4)))][switch(first(rest(%0)),WITH,,setq(7,first(rest(%0))))][match(loc(%q1),v(space))]|[extract(get(%q1/dyn_stats),7,1,|)]|[and(t(%q2),match(get(%q2/system),get(%q1/system)))]|[match(get(%q1/location),get(%q2/location))]|[t(%q5)]|[t(%q6)]|[extract(get(%q2/dyn_stats),7,1,|)]|[switch(words(get(%q2/d_%q4)),1,1,3,0,2,not(isdbref(extract(get(%q2/d_%q4),2,1))),0)]|[match(extract(get(%q2/d_%q4),2,1),%q7)]|[not(strmatch(%q1,%q2))]|[not(extract(get(%q1/combat_stats),1,1,|))]|[switch(words(get(%q1/d_%q3)),1,1,3,0,2,not(isdbref(extract(get(%q1/d_%q3),2,1))),0)]|[match(get(%q1/pilot),%1)] &FUN_CANUNDOCK? Master Nav-Comp=[setq(1,v(ship))][switch(%0,,[setq(3,NORMAL)],[setq(3,%0)])][setq(2,switch(words(get(%q1/d_%q3)),1,,last(get(%q1/d_%q3))))][setq(5,first(get(%q1/d_%q3)))][setq(6,squish(iter(lexits(get(%q5/docked)),switch(get(##/docked),home(%q5),##))))][setq(4,squish(iter(lattr(%q2/d_*),switch(first(get(%q2/##)),%q6,after(##,D_)))))][extract(get(%q1/dyn_stats),10,1,|)]|[t(%q5)]|[hasattr(%q5,docked)]|[match(get(%q1/pilot),%1)] &FUN_CHAN_TRANSMIT Master Nav-Comp=switch([lte(setr(0,last(first(%0,=))),extract(get(setr(1,v(ship))/comm_stats),1,1,|))]|[t(setr(4,last(%0,=)))]|[t(setr(5,extract(get(%q1/com),%q0,1)))],0|*, [ansi(r,Error:)] "%q0" is not a valid channel number.,1|0*, [ansi(r,Error:)] Nothing to transmit.,1|1|0, [ansi(r,Error:)] Channel %q0 is not currently sent to a transmittable frequency.,1|1|1,[switch(hasattr(%q1,system),1,setq(3,get(v(data_systemdb)/system_[get(%q1/system)])),setq(3,lcon(loc(%q1))))][iter(%q3,switch(t(member(get(##/com),%q5)),1,remit(get(##/cockpit), From [get(%q1/trans)] over frequency %q5: "[edit(after(rest(%1),=),%/,)]")))]) &FUN_CHAN_LIST Master Nav-Comp=[repeat(_,76)]%r-- Channel List --%r[ljust(Channel,14)]Frequency%r[repeat(=,76)][iter(lnum(1,words(get(setr(1,v(ship))/com))),%r[ljust(%b##%b%b,14,.)][extract(get(%q1/com),##,1)])]%r[repeat(=,76)] &FUN_CHAN_SET Master Nav-Comp=switch([and(gt(setr(0,last(first(%0,=))),0),lte(%q0,extract(get(setr(1,v(ship))/comm_stats),1,1,|)))]|[and(gt(setr(4,round(first(last(%0,=)),2)),0),lte(%q4,9999.99))],0|*, [ansi(r,Error:)] "%q0" is not a valid channel number.,1|0, [ansi(r,Error:)] "%q4" is not a valid frequency. Frequencies need to be between 0000.01 and 9999.99., Channel %q0 set to %q4.[set(%q1,com:[replace(get(%q1/com),%q0,%q4)])]) &FUN_RADIOQUEUES Master Nav-Comp=[setq(1,v(ship))][switch(hasattr(%q1,system),0,setq(3,get(get(loc(%q1)/ship)/system)),setq(3,get(%q1/system)))][setq(4,extract(%q3,1,1,|))][setq(5,extract(%q3,2,1,|))][setq(6,extract(%q3,3,1,|))][setq(2,get(v(data_shipdb)/trans_%0))][switch(hasattr(%q2,system),1,setq(3,get(%q2/system)),setq(3,get(get(loc(%q2)/ship)/system)))][setq(7,extract(%q3,1,1,|))][setq(8,extract(%q3,2,1,|))][setq(9,extract(%q3,3,1,|))][switch(loc(%q2),v(hyperspace),setq(2,0))] &FUN_CBT-CLEANUP Master Nav-Comp=[switch(extract(get(%0/combat_stats),1,1,|),%q5,%0)] &FUN_CAN-FIGHT? Master Nav-Comp=[t(extract(get(%q1/combat_stats),1,1,|))][t(extract(get(%q1/combat_stats),7,1,|))][hasattr(%q1,weapon_%0)][t(extract(get(%q1/weapon_%0),7,1,|))][match(extract(get(%q1/combat_stats),1,1,|),extract(get(setr(2,get(v(data_shipdb)/trans_%q3))/combat_stats),1,1,|))][not(match(%q1,%q2))][not(t(extract(get(%q2/combat_stats),5,1,|)))] &FUN_CBT-DISPLAY Master Nav-Comp=[u(fun_setqueues2,%0)][switch(gte(extract(get(%q1/comm_stats),3,1,|),setr(3,dist3d(%q4,%q5,%q6,%q7,%q8,%q9))),1,switch(extract(get(%0/combat_stats),1,1,|),%q0,%r[ljust(%b%b[get(%0/trans)],20)][setq(2,get(%0/location))][rjust(extract(%q2,1,1,|),7)][rjust(extract(%q2,2,1,|),7)][rjust(extract(%q2,3,1,|),7)][rjust(round(%q3,0),10)]%b%b[ljust(extract(get(%0/dyn_stats),5,1,|),15)][extract(get(%0/combat_stats),1,1,|)]))] &FUN_CBT-DISPLAY-HEAD Master Nav-Comp=%r[ljust(----=< Combat Display =>,76,-)]%r[ljust(%b%bTransponder,20)][rjust(X,7)][rjust(Y,7)][rjust(Z,7)][rjust(Range,10)]%b%b[ljust(Status,10)]Combat Group%r[repeat(=,76)] &FUN_CBT-RESOLVE-HULL Master Nav-Comp=[switch(gt(setr(6,extract(get(%q1/dyn_stats),2,1,|)),%q3),1,[set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),2,setr(6,sub(%q6,%q3)),|)])][switch(lt(extract(get(%q1/dyn_stats),2,1,|),extract(get(%q1/stat_stats),2,1,|)),1,set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),5,Damaged,|)]))],0,[set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),2,setr(6,0),|)])][set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),5,Crippled)])])] &FUN_CBT-RESOLVE-SHIELD Master Nav-Comp=[switch(gte(setr(4,extract(get(%q1/dyn_stats),1,1,|)),%q3),1,[switch(t(%q4),1,set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),4,sub(%q4,%q3),|)]))][set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),1,setr(4,sub(%q4,%q3)),|)])][setq(3,0)],0,[switch(t(extract(get(%q1/dyn_stats),1,1,|)),1,set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),4,0,|)]))][set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),1,0,|)])][setq(3,sub(%q3,%q4))])][switch(t(%q9),1,setq(4,0))] &FUN_CBT-RESOLVE-INTERNAL Master Nav-Comp=[switch([t(%q9)][gte(rand(101),round(mul(fdiv(%q6,extract(get(%q1/stat_stats),2,1,|)),100),0))],01,[remit(get(%q1/cockpit),%r<[ansi(c,COMBAT)]> The ship has taken internal damage.)][switch(rand(15),1,%r<[ansi(c,COMBAT)]> The hyperdrive has taken a hit![set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),8,0,|)])],2,%r<[ansi(c,COMBAT)]> The Shield Generator has been hit![set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),1,0,|)])][set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),4,0,|)])],3,%r<[ansi(c,COMBAT)]> This ship is no longer going to be able to land%, if it was able to land before.[set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),9,0,|)])],4,%r<[ansi(c,COMBAT)]> Active ship scanners have been destroyed![set(me,cmd_scan:[edit(v(data_bad-scanner),,$)])],5,[switch(t(words(lattr(%q1/weapon_*))),1,%r<[ansi(c,COMBAT)]> [extract(get(%q1/[setr(8,weapon_[add(rand(words(lattr(%q1/weapon_*))),1)])]),1,1,|)] has been destroyed![wipe(%q1/%q8)],%r<[ansi(c,COMBAT)]> The internal damage is minor.)],6,%r<[ansi(c,COMBAT)]> Docking is no longer possible from this ship%, if it was before.[set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),10,0,|)])],7,%r<[ansi(c,COMBAT)]> Outgoing communication systems have been destroyed! [set(me,cmd_com:[edit(v(data_bad-com),,$)])],%r<[ansi(c,COMBAT)]> Internal damage affected only minor systems.)] &FUN_CBT-RESOLVE-RESULTS Master Nav-Comp=[switch([t(%q4)][lt(extract(get(%q1/dyn_stats),2,1,|),extract(get(%q1/stat_stats),2,1,|))][t(%q6)][t(%q9)],1*,u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q1/trans)]'s shields absorb the attack.),*1,u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q2/trans)] fires at [get(%q1/trans)] and misses completely.),??0?,[u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q2/trans)] fires at [get(%q1/trans)] and cripples it.)][set(%q1,dyn_stats:[replace(get(%q1/dyn_stats),5,Crippled,|)])][map(fun_cbt-leave-notify,get(v(data_systemdb)/system_[get(%q1/system)]))][set(%q1,combat_stats:[replace(get(%q1/combat_stats),1,0,|)])],0010,u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q2/trans)] blows through [get(%q1/trans)]'s shields%, but there is little noticeable effect.),0110,u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q2/trans)] attacks [get(%q1/trans)]%, doing damage to its hull.))] &FUN_DEFENSE_ROLL Master Nav-Comp=[round(mul(fdiv(extract(get(%q1/combat_stats),4,1,|),10),.5),0)][set(%q1,combat_stats:[replace(get(%q1/combat_stats),7,.75,|)])][u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q1/trans)] performs a rolling manuever in defense.)] &FUN_DEFENSE_TURN Master Nav-Comp=[round(mul(fdiv(extract(get(%q1/combat_stats),4,1,|),10),.75),0)][set(%q1,combat_stats:[replace(get(%q1/combat_stats),7,.625,|)])][u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q1/trans)] turns sharply in defense.)] &FUN_DEFENSE_DIVE Master Nav-Comp=[round(mul(fdiv(extract(get(%q1/combat_stats),4,1,|),10),.75),0)][set(%q1,combat_stats:[replace(get(%q1/combat_stats),7,.625,|)])][u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q1/trans)] dives sharply in defense.)] &FUN_DEFENSE_CLIMB Master Nav-Comp=[round(mul(fdiv(extract(get(%q1/combat_stats),4,1,|),10),.75),0)][set(%q1,combat_stats:[replace(get(%q1/combat_stats),7,.625,|)])][u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q1/trans)] climbs sharply in defense.)] &FUN_DEFENSE_ROLL+TURN Master Nav-Comp=[round(mul(fdiv(extract(get(%q1/combat_stats),4,1,|),10),.875),0)][set(%q1,combat_stats:[replace(get(%q1/combat_stats),7,.5,|)])][u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q1/trans)] turns sharply while performing a rolling manuever.)] &FUN_DEFENSE_ROLL+DIVE Master Nav-Comp=[round(mul(fdiv(extract(get(%q1/combat_stats),4,1,|),10),.875),0)][set(%q1,combat_stats:[replace(get(%q1/combat_stats),7,.5,|)])][u(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q1/trans)] dives sharply while performing a rolling manuever.)] &FUN_DEFENSE_ROLL+CLIMB Master Nav-Comp=[round(mul(fdiv(extract(get(%q1/combat_stats),4,1,|),10),.875),0)][set(%q1,combat_stats:[replace(get(%q1/combat_stats),7,.5,|)])][U(fun_notify-results,<[ansi(c,COMBAT)]> [get(%q1/trans)] climbs sharply while performing a rolling manuever.)] &FUN_CBT-STATUS-DISP-OTHER Master Nav-Comp=[switch(match(%q5,extract(get(%0/combat_stats),1,1,|)),1,%r%b%b%b[ljust(get(%0/trans),12)][ljust(Shields: [switch(t(extract(get(%0/dyn_stats),1,1,|)),1,UP,DOWN)],20)][ljust(Status: [extract(get(%0/dyn_stats),5,1,|)],20)]%t[switch(words(lattr(%0/weapon_*)),0,--Unarmed--,--Armed--)] &FUN_STATUS-DISP-WEAP Master Nav-Comp=%r[ljust(after(%0,_),4)][ljust(extract(get(%q1/%0),1,1,|),40)][ljust(switch(isnum(extract(get(%q1/%0),7,1,|)),1,extract(get(%q1/%0),7,1,|),Inf.),6)][ljust(extract(get(%q1/%0),5,1,|),6)][ljust(extract(get(%q1/%0),4,1,|),8)][ljust(extract(get(%q1/%0),3,1,|),9)][extract(get(%q1/%0),2,1,|)] &FUN_NOTIFY-RESULTS Master Nav-Comp=[iter(get(v(data_systemdb)/system_[get(%q1/system)]),remit(get(##/cockpit),%0))] &FUN_CAN-RESCUE-LOAD? Master Nav-Comp=[setq(1,v(ship))][isdbref(setr(2,get(v(data_shipdb)/trans_%0)))][match(get(%q1/system),get(%q2/system))][match(get(%q1/location),get(%q2/location))][hasattr(%q1,hangar_%q4)][not(extract(get(%q1/combat_stats),1,1,|))][match(extract(get(%q2/dyn_stats),5,1,|),Crippled)][lte(extract(get(%q2/stat_stats),10,1,|),extract(get(%q1/hangar_%q4),3,1))] &FUN_RESCUE-LOAD Master Nav-Comp=[switch(u(fun_can-rescue-load?,setr(0,first(after(%0,LOAD%b))),setr(4,first(after(%0,USING%b)))),0*,<[ansi(c,CONSOLE)]> [ansi(r,Error:)] '%q0' doesn't appear to be within this system.,10*,<[ansi(c,CONSOLE)]> [ansi(r,Error:)] '%q0' doesn't appear to be within this system.,110*,<[ansi(c,CONSOLE)]> [ansi(r,Error:)] '%q0' must be in the same location as this ship for rescuing manuevers.,1110*,<[ansi(c,CONSOLE)]> [ansi(r,Error:)] '%q4' is not a valid hangar on this ship.,11110*,<[ansi(c,CONSOLE)]> [ansi(r,Error:)] Rescue manuevers can not be engaged while in combat.,111110*,<[ansi(c,CONSOLE)]> [ansi(r,Error:)] Rescue manuevers can only be performed on Crippled ships.,1111110,<[ansi(c,CONSOLE)]> Hangar '%q4' does not have enough room for a ship of that size.,1111111,[u(fun_notify-results,<[ansi(c,SENSORS)]> [get(%q1/trans)] salvages [get(%q2/trans)] into one of its hangars.[set(v(data_systemdb),system_[setr(3,get(%q1/system))]:[setdiff(get(v(data_systemdb)/system_%q3),%q2)])][set(%q1,hangar_%q4:[replace(get(%q1/hangar_%q4),3,sub(extract(get(%q1/hangar_%q4),3,1),extract(get(%q2/stat_stats),10,1,|)))])][tel(%q2,extract(get(%q1/hangar_%q4),1,1))][wipe(%q2/location)][wipe(%q2/system)])] &FUN_CAN-BUILD? Master Nav-Comp=[or(hasattr(v(data_builddb),%0_stat),hasattr(me,%0_stat))][lte(extract(get(%q3/%0_stat),11,1,|),extract(get([get(v(data_home)/ship)]/hangar_[get(v(data_home)/hangar_name)]),3,1))] &FUN_BUILD-BODY Master Nav-Comp=[setq(1,create([extract(v(%0_stat),1,1,|)] -- %1)][set(%q1,trans:[setr(2,[switch(first(name(%q1)),CAPITAL:,CS-,SF-)][switch(hasattr(v(data_shipdb),trans_[after(%q1,#)]),0,after(%q1,#),u(fun_gettrans1))])])] &FUN_CREATE-ROOMS Master Nav-Comp=[tel(me,setr(2,dig(Cockpit - %1)))][switch(extract(v(%0_stat),12,1,|),0,setq(4,open(ut;out;o,)),[tel(me,setr(5,loc(open(ft;aft;a,dig(Aft - %1)))))][pemit(me,open(ore;fore;f,%q2))][setq(4,open(ut;out;o,))])] &FUN_WITHIN-SCAN Master Nav-Comp=[setq(7,extract(get(%0/location),1,1,|))][setq(8,extract(get(%0/location),2,1,|))][setq(9,extract(get(%0/location),3,1,|))][switch(lt(setr(0,round(dist3d(%q4,%q5,%q6,%q7,%q8,%q9),1)),extract(get(%q1/comm_stats),3,1,|)),1,%0)] @@ @@ Is you buffer full yet? Okay, this is the last bit of stuff that goes on the @@ Master Nav-Comp itself. It is the biggest piece, so if you've come this far, @@ you're well past half way. @@ &DATA_BAD-COM Master Nav-Comp=com*:@pemit %#=<[ansi(c,CONSOLE)]> [ansi(r,Error:)] Communications down. Transmitting emergency broadcast signal.[setq(1,v(ship))][u(fun_notify-results,<[ansi(c,SENSORS)]> ** EMERGENCY BROADCAST from [get(%q1/trans)] ** - Communications array destroyed.)] &DATA_BAD-SCANNER Master Nav-Comp=scan*:@pemit %#=<[ansi(c,CONSOLE)]> [ansi(r,Error:)] Scanners down. Transmitting emergency broadcast signal.[setq(1,v(ship))][u(fun_notify-results,<[ansi(c,SENSORS)]> ** EMERGENCY BROADCAST from [get(%q1/trans)] ** - Scanning equipment destroyed.)] &DESCRIBE Master Nav-Comp=It's your standard console for managing space related tasks. The layout of the controls is such that one person can handle most of the basic functions individually, or with some assistance if required.%r%r