Example #1
0
        public virtual void mountPlayer(TurretShape turret, ShapeBase player)
        {
            if (turret.isObject() && turret.getDamageState() != "Destroyed")
            {
                //todo change to csharp

                turret.call("setMountTurret", player);
            }
        }
Example #2
0
 public virtual int findEmptySeat(TurretShape turret, ShapeBase player)
 {
     for (int i = 0; i < this["numMountPoints"].AsInt(); i++)
     {
         int node = turret.getMountNodeObject(i);
         if (node == 0)
         {
             return(i);
         }
     }
     return(-1);
 }
Example #3
0
        public virtual void onMountObject(TurretShape turret, ShapeBase player, int node)
        {
            if (turret["entranceThread"].AsInt() < 0)
            {
                return;
            }

            int et = turret["entranceThread"].AsInt();

            turret.setThreadDir(et, false);
            turret.setThreadPosition(et, 0);
            turret.playThread(et, string.Empty);
        }
Example #4
0
        public virtual void onUnmountObject(TurretShape turret, ShapeBase player)
        {
            if (turret["entranceThread"].AsInt() < 0)
            {
                return;
            }

            int et = turret["entranceThread"].AsInt();

            // Play the entrance thread backwards for an exit

            turret.setThreadDir(et, false);
            turret.setThreadPosition(et, (float)1.0);
            turret.playThread(et, string.Empty);
        }
Example #5
0
 public virtual int switchSeats(TurretShape turret, ShapeBase player)
 {
     for (int i = 0; i < this["numMountPoints"].AsInt(); i++)
     {
         int node = turret.getMountNodeObject(i);
         if (node == player || node != 0)
         {
             continue;
         }
         if (node == 0)
         {
             return(i);
         }
     }
     return(-1);
 }
Example #6
0
        public virtual void setMountTurret(TurretShape turret, ShapeBase player)
        {
            if (!turret.isObject() || turret.getDamageState() == "Destroyed")
            {
                return;
            }

            //todo convert to csharp
            int node = call("findEmptySeat", turret, player).AsInt();

            if (node < 0)
            {
                return;
            }
            turret.mountObject(player, node, new TransformF("0 0 0"));

            player["mVehicle"] = turret;
        }
Example #7
0
        public override void onDestroyed(ShapeBase obj, string lastState)
        {
            // This method is invoked by the ShapeBase code whenever the
            // object's damage state changes.

            // Fade out the destroyed object.  Then schedule a return.
            int destroydelay = iGlobal["$TurretShape::DestroyedFadeDelay"];

            obj.startFade(1000, destroydelay, true);

            obj.schedule((destroydelay + 1000).AsString(), "delete");

            TurretShape ts = obj.ID;

            if (ts.doRespawn())
            {
                ((SimSet)"MissionGroup").schedule(sGlobal["$TurretShape::RespawnTime"], "respawnTurret", this, console.GetClassName(obj), obj.getTransform().AsString(), true.AsString(), true.AsString());
            }
        }
public virtual  void onUnmountObject(TurretShape turret, SceneObject obj){}
public virtual  void onStickyCollision(TurretShape obj){}
        public virtual void onMountObject(TurretShape turret, ShapeBase player, int node)
        {
            if (turret["entranceThread"].AsInt() < 0)
                return;

            int et = turret["entranceThread"].AsInt();

            turret.setThreadDir(et, false);
            turret.setThreadPosition(et, 0);
            turret.playThread(et, string.Empty);
        }
public virtual  void onMountObject(TurretShape turret, SceneObject obj, int node){}
        public virtual void mountPlayer(TurretShape turret, ShapeBase player)
        {
            if (turret.isObject() && turret.getDamageState() != "Destroyed")
                //todo change to csharp

                turret.call("setMountTurret", player);
        }
        public virtual void onUnmountObject(TurretShape turret, ShapeBase player)
        {
            if (turret["entranceThread"].AsInt() < 0)
                return;

            int et = turret["entranceThread"].AsInt();

            // Play the entrance thread backwards for an exit

            turret.setThreadDir(et, false);
            turret.setThreadPosition(et, (float) 1.0);
            turret.playThread(et, string.Empty);
        }
        public virtual void setMountTurret(TurretShape turret, ShapeBase player)
        {
            if (!turret.isObject() || turret.getDamageState() == "Destroyed")
                return;

            //todo convert to csharp
            int node = call("findEmptySeat", turret, player).AsInt();
            if (node < 0)
                return;
            turret.mountObject(player, node, new TransformF("0 0 0"));

            player["mVehicle"] = turret;
        }
 public virtual int findEmptySeat(TurretShape turret, ShapeBase player)
 {
     for (int i = 0; i < this["numMountPoints"].AsInt(); i++)
         {
         int node = turret.getMountNodeObject(i);
         if (node == 0)
             return i;
         }
     return -1;
 }
 public virtual void isMountable(TurretShape obj, string val)
 {
     obj["mountable"] = val;
 }
Example #17
0
 public virtual void isMountable(TurretShape obj, string val)
 {
     obj["mountable"] = val;
 }
 public virtual int switchSeats(TurretShape turret, ShapeBase player)
 {
     for (int i = 0; i < this["numMountPoints"].AsInt(); i++)
         {
         int node = turret.getMountNodeObject(i);
         if (node == player || node != 0)
             continue;
         if (node == 0)
             return i;
         }
     return -1;
 }