@create Parent: Refueling Terminal @link Parent: Refueling Terminal = #0 @set Parent: Refueling Terminal = WIZARD @set Parent: Refueling Terminal = SAFE @set Parent: Refueling Terminal = NO_COMMAND @ADROP Parent: Refueling Terminal=[ifelse(words(v(DB_Pad)),,set(%!,DB_Pad:[room(%!)]))] @set Parent: Refueling Terminal/ADROP=no_command prefixmatch &CMD_BURN Parent: Refueling Terminal=$+fuel/engine *=*:@pemit %#=[setq(0,ulocal(FN_Error,%0))][ifelse(isdbref(%q0),ulocal(FN_Burn,%q0,ulocal(FN_Val,secure(%1)),%#),%q0)] &CMD_REACT Parent: Refueling Terminal=$+fuel/reactor *=*:@pemit %#=[setq(0,ulocal(FN_Error,%0))][ifelse(isdbref(%q0),ulocal(FN_React,%q0,ulocal(FN_Val,secure(%1)),%#),%q0)] &CMD_REFUEL Parent: Refueling Terminal=$+fuel/refuel *:@pemit %#=[setq(0,ulocal(FN_Error,%0))][ifelse(isdbref(%q0),ulocal(FN_Refuel,%q0,%#),%q0)] &CMD_SHIPS Parent: Refueling Terminal=$+fuel/ships:@pemit %#=[ansi(b,.--\[)] [ansi(yh,Accessible Ships)] [ansi(b,\]--.[repeat(-,24)].[repeat(-,24)].)][setq(0,iter(map(FN_Lcon,v(DB_Pad)),ifelse(ulocal(FN_HasFuel,##),##,)))][iter(%q0,[ifelse(mod(sub(#@,1),3),,%r[ansi(b,|)])]%b[ljust(ansi(ifelse(lt(hs_get_attr(##,hull),0),r,wh),left(hs_get_attr(##,name),23)),23)][ansi(b,|)],,)][repeat([space(24)][ansi(b,|)],[sub(2,mod(add(-1,words(%q0)),3))])][ifelse(words(%q0),,%r[ansi(b,|)][center(ansi(rh,None),74)][ansi(b,|)])]%r[ansi(b,>--\[)] [ansi(yh,Refueling Pads)] [ansi(b,\]----+[repeat(-,24)]+[repeat(-,24)]<)][iter(v(DB_Pad),[ifelse(mod(sub(#@,1),3),,%r[ansi(b,|)])]%b[ljust(ansi(wh,left(name(##),23)),23)][ansi(b,|)],,)][repeat([space(24)][ansi(b,|)],[sub(2,mod(add(-1,words(v(DB_Pad))),3))])]%r[ansi(b,'[repeat(-,24)]'[repeat(-,24)]'[repeat(-,24)]')] &CMD_STATUS Parent: Refueling Terminal=$+fuel/status *:@pemit %#=[setq(0,ulocal(FN_Error,%0))][ifelse(isdbref(%q0),ulocal(FN_Status,%q0),%q0)] &DB_PAD Parent: Refueling Terminal=#-1 @DESCRIBE Parent: Refueling Terminal=[space(14)][ansi(b,.[repeat(-,43)].)]%r[space(14)][ansi(b,|)][center(ansi(yh,name(%!)),43)][ansi(b,|)]%r[ansi(b,.[repeat(-,13)]'[repeat(-,43)]'[repeat(-,13)].)]%r[ulocal(FN_HelpLine,+fuel/ships,Displays what ships may be refueled here)]%r[ulocal(FN_HelpLine,+fuel/status ,Displays ship's fuel status)]%r[ulocal(FN_HelpLine,+fuel/refuel ,Completely refuels the ship)]%r[ulocal(FN_HelpLine,+fuel/engine =,Buys a set amount of engine fuel)]%r[ulocal(FN_HelpLine,+fuel/reactor =,Buys a set amount of reactor fuel)]%r[ansi(b,>[repeat(-,35)].[repeat(-,35)]<%r|)] [ljust(ansi(yh,Engine Fuel:),17)][rjust([ansi(wh,[u(Price_Burn)]c/unit)],16)] [ansi(b,|)] [ljust(ansi(yh,Reactor Fuel:),17)][rjust([ansi(wh,[u(Price_React)]c/unit)],16)] [ansi(b,|%r'[repeat(-,35)]'[repeat(-,35)]')] @set Parent: Refueling Terminal/DESCRIBE=no_command visual prefixmatch @FAILURE Parent: Refueling Terminal=Your attempt to control the fuel reserves of the universe has met with dismal failure. @set Parent: Refueling Terminal/FAILURE=no_command prefixmatch &FN_BAR Parent: Refueling Terminal=[setq(0,floor(mul(100,%0)))][ljust(ansi(switch(%q0,>67,g,>33,y,r),repeat(=,div(%q0,2))),50)] &FN_BAR2 Parent: Refueling Terminal=[setq(0,floor(mul(100,ifelse(isnum(%0),%0,0))))][setq(1,[rjust([%q0]\%,27,=)][repeat(=,23)])][iter(lnum(50),[setq(2,mid(%q1,##,1))][ifelse(match(=,%q2),ifelse(gt(div(%q0,2),##),ansi(switch(mul(##,2),>66,Gg,>33,Yy,Rr),%q2),%b),ansi(ifelse(gt(div(%q0,2),##),Ywh,wh),%q2))],,)] &FN_BAR3 Parent: Refueling Terminal=[setq(0,floor(mul(100,ifelse(isnum(%0),%0,0))))][setq(1,[rjust([%q0]\%,27,=)][repeat(=,23)])][ljust(ansi(Rr,repeat(=,min(17,max(0,div(%q0,2))))),17)][ljust(ansi(Yy,repeat(=,min(16,max(0,sub(div(%q0,2),17))))),16)][ljust(ansi(Gg,repeat(=,min(16,max(0,sub(div(%q0,2),33))))),16)] &FN_BURN Parent: Refueling Terminal=[setq(0,ceil(mul(v(Price_Burn),%1)))][setq(1,hs_sys_attr(%0/fuel system,max burnable fuel,1))][setq(2,hs_sys_attr(%0/fuel system,burnable fuel,1))][ifelse(gt(getmoney(%2),%q0),ifelse(gt(%1,0),ifelse(lte(%1,sub(%q1,%q2)),[ansi(gh,-)] [name(%2)] has paid [%q0] c-Bills to load [%1] units of burnable fuel onto the [hs_get_attr(%0,name)].[null([hs_sysset(%0/fuel system,burnable fuel:[add(%q2,%1)])][addmoney(%!,%q0)][addmoney(%2,mul(-1,%q0))]AA)],[ansi(rh,-)] The [hs_get_attr(%0,name)] may only accept another [sub(%q1,%q2)] units of burnable fuel.),[ansi(rh,-)] You must purchase a positive amount of fuel.),[ansi(rh,-)] [name(%2)] lacks the [%q0] c-Bills to pay for that.)] &FN_ERROR Parent: Refueling Terminal=[ulocal(FN_Error2,ulocal(FN_FindTarget,squish(secure(%0))))] &FN_ERROR2 Parent: Refueling Terminal=[switch([isnum(hs_get_attr(%0,class))][ulocal(FN_HasFuel,%0)],0*,[ansi(rh,-)] No ship with that name could be found.,10,[ansi(rh,-)] [hs_get_attr(%0,name)] lacks a fuel system.,11,[%0],#-1 Critical Error)] &FN_FINDTARGET Parent: Refueling Terminal=[first(iter(map(FN_Lcon,v(DB_Pad)),ifelse(and(isnum(hs_get_attr(##,class)),match(hs_get_attr(##,name),*[%0]*,|)),##,)))] &FN_GAUGE Parent: Refueling Terminal=[ansi(b,>[repeat(-,56)]<%r|)] [ljust(ansi(yh,[%2] Fuel:),13)][rjust(ansi(wh,setr(0,hs_sys_attr([%0]/fuel system,[%1] fuel,1))),11)][ansi(y,/)][ljust(ansi(wh,setr(1,hs_sys_attr([%0]/fuel system,max [%1] fuel,1))),11)][ansi(yh,Needed:)][rjust(ansi(wh,sub(%q1,%q0)),11)]%b[ansi(b,|%r|)] [ansi(rh,E)] [ulocal(FN_Bar2,fdiv(%q0,%q1))] [ansi(gh,F)] [ansi(b,|)] &FN_HASFUEL Parent: Refueling Terminal=[t(match(hs_eng_sys(%0),Fuel System,\,))] &FN_HELPLINE Parent: Refueling Terminal=[ansi(b,|)] [ansi(wh,%0)][rjust(ansi(yh,%1),sub(69,strlen(stripansi(%0))),.)] [ansi(b,|)] &FN_LCON Parent: Refueling Terminal=lcon(%0) &FN_REACT Parent: Refueling Terminal=[setq(0,ceil(mul(v(Price_React),%1)))][setq(1,hs_sys_attr(%0/fuel system,max reactable fuel,1))][setq(2,hs_sys_attr(%0/fuel system,reactable fuel,1))][ifelse(gt(getmoney(%2),%q0),ifelse(gt(%1,0),ifelse(lte(%1,sub(%q1,%q2)),[ansi(gh,-)] [name(%2)] has paid [%q0] c-Bills to load [%1] units of reactable fuel onto the [hs_get_attr(%0,name)].[null([hs_sysset(%0/fuel system,reactable fuel:[add(%q2,%1)])][addmoney(%!,%q0)][addmoney(%2,mul(-1,%q0))]AA)],[ansi(rh,-)] The [hs_get_attr(%0,name)] may only accept another [sub(%q1,%q2)] units of reactable fuel.),[ansi(rh,-)] You must purchase a positive amount of fuel.),[ansi(rh,-)] [name(%2)] lacks the [%q0] c-Bills to pay for that.)] &FN_REFUEL Parent: Refueling Terminal=[setq(0,add(mul(v(Price_Burn),sub([hs_sys_attr(%0/fuel system,max burnable fuel,1)],[hs_sys_attr(%0/fuel system,burnable fuel,1)])),mul(v(Price_React),sub([hs_sys_attr(%0/fuel system,max reactable fuel,1)],[hs_sys_attr(%0/fuel system,reactable fuel,1)]))))][ifelse(gt(getmoney(%1),%q0),[ansi(gh,-)] [hs_get_attr(%0,name)] has been refueled at the cost of [%q0] c-Bills.[null([hs_sysset(%0/fuel system,burnable fuel:[hs_sys_attr(%0/fuel system,max burnable fuel,1)])][hs_sysset(%0/fuel system,reactable fuel:[hs_sys_attr(%0/fuel system,max reactable fuel,1)])][addmoney(%1,mul(%q0,-1))][addmoney(%!,%q0)])],[ansi(rh,-)] [name(%1)] lacks the [%q0] c-Bills to pay for that.)] &FN_STATUS Parent: Refueling Terminal=[ansi(b,.[repeat(-,56)].%r|)][center(ansi(yh,name(%!)),56)][ansi(b,|%r|)][center([ansi(yh,hs_get_attr(%0,name))] [ansi(wh,\()][ansi(yh,hs_get_attr(%0,ident))][ansi(wh,\))],56)][ansi(b,|)]%r[ulocal(FN_Gauge,%0,burnable,Engine)]%r[ulocal(FN_Gauge,%0,reactable,Reactor)]%r[ansi(b,>[repeat(-,56)]<%r|)] [ljust(ansi(yh,Engine Fuel:),13)][rjust([ansi(wh,[u(Price_Burn)]c/unit)],13)] [ljust(ansi(yh,Reactor Fuel:),14)][rjust([ansi(wh,[u(Price_React)]c/unit)],13)] [ansi(b,|%r'[repeat(-,56)]')] &FN_VAL Parent: Refueling Terminal=[round(ifelse(isnum(%0),%0,val(%0)),2)] &PRICE_BURN Parent: Refueling Terminal=10 &PRICE_REACT Parent: Refueling Terminal=10 &SOURCE Parent: Refueling Terminal=BTF