Fragmobile

A vehicle with various commands, including a horn and the ability to run over people.

Author: Mandrake@Paris
Category: Vehicles
Compatibility: CobraMUSH, PennMUSH, TinyBit, TinyMUSH, TinyMUX.

Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for Fragmobile

@create Fragmobile
@lock Fragmobile==me
@Ofail Fragmobile=strains and makes a fool of %pself trying to lift the [name(me)].
@Fail Fragmobile=You'd need a towing lorry to go anywhere with this vehicle.
@Desc Fragmobile=You see before you the sleek frame of a dark grey Citroen - not unlike the thousands of others in Paris. A second glance, however, reveals that this one has apparently seen a good deal of use in its day. The forward bumper beneath the hood is crumpled inwards from an old accident, and one headlight is missing. Rust spots stain the hood and sides, and a narrow crack mars the glass windshield. The vehicle appears in desperate need of a good tune-up, and the engine wheezes badly when in motion. [u(wind)]
@Listen Fragmobile=*
@Idesc Fragmobile=%tYou are seated inside the dark grey Citroen. If you thought the exterior was bad, the interior proves far worse: obviously the owner of this vehicle cares little for appearances. Refuse from various fastfood establishments litters the floorboards and seats in the back. Various tourist maps (most several years out of date) cover the front dashboard with a myriad of small gyro-compasses which swivel as the car takes a turn. Brown stains cover the passenger's seat, reminding of old coffee spills and the stuffing seems to be leaking out in several places. A evergreen shaped air freshener hangs from the rear-view mirror, sending a mockery of caustic fresh pine scent wafting through the interior.%R[center(* OOC: Type 'chelp' for commands. *,78)]%R
@Enter Fragmobile=%RYou duck your head, climbing inside the [name(me)].
@Oxenter Fragmobile=ducks %p head, climbing inside the [name(me)].
@Leave Fragmobile=You open the door, stepping out of the [name(me)]...%R
@Oleave Fragmobile=opens the door, and gets out.
@Oenter Fragmobile=ducks %p head, climbing inside.
@Oxleave Fragmobile=opens the door, stepping out of the [name(me)].
@Lalias Fragmobile=o;out;exit;back;leave;climb out
@Efail Fragmobile=The door seems to be securely locked.%R(OOC: Contact a staff member if you're trying to steal the [name(me)].)
@Oefail Fragmobile=tries the door of the [name(me)] but finds it locked.
@Inprefix Fragmobile=Outside,
@Prefix Fragmobile=From inside the [name(me)],
@Infilter Fragmobile={* has arrived.},{* has left.}
@Filter Fragmobile={* has arrived.},{* has left.},{Dropped.}
&CHELP Fragmobile=$chelp:@switch u(ck)=0,,{@pemit %#=[repeat(*,78)]%R[center(- - - [name(me)] Commands - - -,78)]%R[repeat(-,78)]%RLocation: [name(loc(me))]%RWindow Status: [v(winds)]%R[repeat(-,78)]%R%R[space(5)]Drive <exit>%t%tdrive the car about%R[space(5)]Corner <exit>%t%ttake the car around a sharp corner%R[space(5)]Faster%t%t%tstep on the accelerator%R[space(5)]Slower%t%t%tapply the brake gently%R[space(5)]Stop%t%t%tslam on the brakes%R%R[space(5)]Look/o%t%t%tlook at your surroundings%R[space(5)]Look/o <person/object>%tlook at someone/something outside the car%R[space(5)]Car <pose>%t%t%tscenery (try: 'car swerves violently!')%R[space(5)]Rundown <person>%t%ttry to hit someone deliberately%R[space(5)]Crash into <something>%thit something deliberately%R[space(5)]Windows%t%t%traise/lower the windows%R[space(5)]Horn%t%t%thonk the horn%R[space(5)]Gun%t%t%tgun the car's engine%R%R* Notes *%RCommands will react differently at different rates of speed.%RNo one can hear you outside the car with the windows up.%R(Owners may type: 'chelp2' for configuration information.)%R[repeat(*,78)]}
&STOP Fragmobile=$stop:@switch/first [u(ck)]:[v(moving)]=0:*,,*:0,{@pemit %#=OOC: The [name(me)] isn't moving currently.},*:1,{@pemit/c me=%N switches off the engine.;@emit The sound of the [name(me)]'s engine dies away as it is switched off.;&moving me=0},{@pemit/c me=%N slams on the brakes!!!;@emit [switch(v(moving),2,{The [name(me)] skids to a halt nearby with a screech of brakes.},3,{The [name(me)] skits to an abrupt halt nearby - fishtailing slightly.},{The driver of the [name(me)] throws on the emergency brake, sending the car spinning and slewing across the road - and with a earsplitting screech of brakes comes to an abrupt halt nearby.})];&moving me=1}
&DRIVE Fragmobile=$drive *:@switch u(ck)=0,,{@pemit/c me=[switch(v(moving),0,%N starts up the [name(me)].,1,%N shifts the vehicle into gear.,%N smoothly guides the vehicle along.)];@emit [switch(v(moving),0,{The engine of the [name(me)] rumbles to life, and it moves off down the street.},1,{The engine of the [name(me)] growls to life - shifting out of idle, and moves off down the street.},2,{The [name(me)] cruises off steadily down the street.},3,{The [name(me)] roars off down the street.},{The [name(me)] tears off down the street, tires screeching - heedless of the other traffic.})];@switch v(moving)=0,&moving me=2,1,&moving me=2;move %0}
&WIND Fragmobile=[switch(v(winds),up,{The darkened glass windows of the vehicle are currently up.},{The forward windows of the vehicle are currently down.})]
&INSTALL Fragmobile=$install:@switch owner(me)=%#,{@listen me=*;@set me=ENTER_OK;@set me=QUIET;@lock me=%#;@lalias me=o\;out\;exit\;back\;leave\;climb out},{}
&CORNER Fragmobile=$corner *:@switch u(ck)=0,,{@pemit/c me=[switch(v(moving),0,%N starts up the [name(me)].,1,%N shifts the vehicle into gear.,%N yanks the wheel sharply to take the corner.)];@emit [switch(v(moving),0,{The engine of the [name(me)] rumbles to life, and it moves off down the street - turning the corner to vanish from view.},1,{The engine of the [name(me)] growls to life - shifting out of idle.%RIt moves off down the street, turning the corner and vanishing from view.},2,{The [name(me)] takes the next corner at a sharp turn and vanishes from sight.},3,{The [name(me)] roars off down the street, taking the next corner much too fast!},{The [name(me)] tears off down the street, and - tires smoking - takes the next corner on two wheels!!})];@switch v(moving)=0,&moving me=2,1,&moving me=2;move %0}
&MOVING Fragmobile=2
&CK Fragmobile=[member(lcon(me),%#)]
&CRASH Fragmobile=$crash into *:@switch/first [u(ck)]:[v(moving)]=0:*,,*:0,{@pemit %#=OOC: You need to be moving first.},*:1,{@pemit %#=OOC: You need to be moving first.},{@pemit/c me=%N floors it, sending the vehicle shooting forwards.;@emit The [name(me)] plows headlong into %0 with a horrifying crunch!!!}
&GUN Fragmobile=$gun:@switch u(ck)=0,,{@pemit/c me=%N holds down the brake, jamming down on the accelerator.;@emit The [name(me)] guns its engine, reving loudly!!!}
&FASTER Fragmobile=$faster:@switch u(ck)=0,,{@pemit/c me=[switch(v(moving),0,%N starts up the [name(me)].,1,{%N shifts the vehicle into gear, stomping on the accelerator.},{%N steps on the accelerator.})];@emit [switch(v(moving),0,{The engine of the [name(me)] rumbles to life even as it moves off down the street.},1,{The engine of the [name(me)] growl becomes a throbbing purr as it shifts into gear and cruises off.},2,{The [name(me)] accelerates, moving faster and faster along the street.},3,{The [name(me)] roars off down the street, gaining steadily in speed.},{The [name(me)] tears off down the street - burning rubber!!!})];&moving me=[switch(v(moving),0,2,1,2,2,3,3,4,4)]}
&SLOWER Fragmobile=$slower:@switch/first [u(ck)]:[v(moving)]=0:*,,*:0,{@pemit %#=OOC: The [name(me)] is switched off and isn't moving currently.},*:1,{@pemit/c me=%N switches off the engine.;@emit The sound of the [name(me)]'s engine dies away as it is switched off.;&moving me=0},{@pemit/c me=%N gently applies the brakes.;@emit [switch(v(moving),2,{The [name(me)] slows, pulling over to the side of the street to idle nearby.},3,{The [name(me)] decreases to a more reasonable rate of speed as it cruises along the street.},4,{The [name(me)] decelerates slightly, still moving at a good clip down the street.})];&moving me=[switch(v(moving),1,0,2,1,3,2,4,3,3)]}
&SCENERY Fragmobile=$car *:@switch u(ck)=0,,@emit The [name(me)] %0
&RUNDOWN Fragmobile=$rundown *:@switch/first [u(ck)]:[v(moving)]=0:*,,*:0,{@pemit %#=OOC: The vehicle needs to be moving first.},*:1,{@pemit %#=OOC: The vehicle needs to be moving first.},{@pemit/c me=%N yanks the wheel - turning it sharply.;@emit The [name(me)] swerves suddenly out of the traffic - changing direction and heading right at %0!!!}
&HORN Fragmobile=$horn:@switch u(ck)=0,,{@pemit/c me=%N leans on the horn.;@emit The [name(me)] sounds a blast on its horn.;@pemit/c/list [iter(lexits(room(me)),loc(##))]=Somewhere nearby, a vehicle sounds a blast on its horn!}
&WINDOWS Fragmobile=$windows:@switch/first [u(ck)]:[v(winds)]=0:*,,*:up,{@set me=AUDIBLE;&winds me=down;@pemit/c me=%N flicks a switch and the front windows of the [name(me)] slide down.},{@pemit/c me=%N flicks a switch and the front windows of the [name(me)] slide up and lock into place.;&winds me=up;@set me=!AUDIBLE;}
&WINDS Fragmobile=up
&CHELP2 Fragmobile=$chelp2:@switch owner(me)=%#,{@pemit %#=[repeat(*,78)]%R[center(- - - [name(me)] Configuration - - -,78)]%R[repeat(-,78)]%ROnce you've created your car object, fill out the following commands to get everything set up correctly:%R%R@desc car=<the car's external description> \[u(wind)]%R@idesc car=<the car's internal description>%t(see below)%R@set car=TERSE%t%t%t%t%t(optional to avoid spam)%R@name car=<the car's name or type>%RInstall%R%R* Notes *%RThe car's internal description (@idesc) should probably always contain an OOC note to the effect that the car's commands can be accessed by typing the command: 'chelp'. You may also wish to enterlock your car (@lock/enterlock car=me) to prevent people from stealing it. Places code can also be used to simulate sections in larger vehicles.%R%RGeneral Car code is written by Mandrake @ Paris.%R[repeat(*,78)]}
&WRITTEN_BY Fragmobile=Mandrake @ Paris.
@set Fragmobile=ENTER_OK
@set Fragmobile=PARENT_OK
@set Fragmobile=QUIET
@set Fragmobile=COMMANDS