# SFVehicle.SFVehiclePassengerSpace

00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 |
    //=============================================================================
    // Spatial Fear
    // Name: SFVehiclePassengerSpace
    // Description: Defines a passenger space for a given vehicle
    //
    // Author: Gert Jen Peltenburg
    //=============================================================================
    class SFVehiclePassengerSpace expands SFVehicleControl;

    var (SpatialFear) name ControllerTag;
    var SFvehiclecontrol Controller;

    auto state Pickup {
     ignores Tick;

     function touch(actor other)
     {
      super(actor).touch(other);
     }

     function BeginPlay()
     {
     }

     Begin:

    }

    event float BotDesireability( pawn Bot )
    {
     local SFdriverslicense lic;

     lic=SFdriverslicense(Bot.FindInventoryType(class'SFDriversLicense'));

     if(lic!=None) // knows about controls, so using ratecontroller
      return -1;

     if(controller==None)
      return -1;

     if(Controller.owner==None)
      return -1;
     if(pawn(Controller.owner)==None)
      return -1;

     if(pawn(Controller.owner).playerreplicationinfo.team==Bot.playerreplicationinfo.Team)
      return MaxDesireability;

     return -1;
    }

    function BeginPlay()
    {
     local SFvehiclecontrol vc;

     bPlayersOnly=false;

     foreach allactors(class'SFVehicleControl',vc,ControllerTag) {
      Controller=vc;
     }
     GotoState('Pickup');
    }

    function float ratecontroller(pawn Bot)
    {
     if(controller.owner==Bot)              // prevent bot from moving away from the driver position just to get into the passenger's seat
      return 0;
     if(Controller.owner==None)
      return 0;
     if(pawn(Controller.owner)==None)
      return 0;
     if(pawn(Controller.owner).playerreplicationinfo.team==Bot.playerreplicationinfo.Team)
      return MaxDesireability;

     return 0;
    }

    defaultproperties
    {
         bManualPickup=False
         bAutoActivate=False
         bActivatable=False
         bDisplayableInv=False
         PickupMessage=""
         ItemName=""
         PickupViewScale=1.000000
         M_Activated=""
         M_Selected=""
         M_Deactivated=""
         bHidden=True
         Mesh=None
         DrawScale=1.000000
    }

class file time: 12/7/2003 3:58:26 PM - creation time: 12/7/2003 4:03:45 PM
Created with UnCodeX