示例#1
0
        private void TurretShapeData_damage(coTurretShapeData thisobj, coTurretShape turret, TransformF position, coShapeBase sourceobject, float damage, string datatype)
        {
            if (turret.getDamageState() == "Dead")
            {
                return;
            }

            turret.applyDamage(damage);

            // Update the numerical Health HUD
            coShapeBase mountedobject = turret.getObjectMount();

            //if (mountedobject != 0)
            //    console.Call(mountedobject, "updateHealth");
            if (turret.getState() != "Dead")
            {
                return;
            }

            for (int i = 0; i < thisobj["numMountPoints"].AsInt(); i++)
            {
                coShapeBase player = turret.getMountNodeObject(i);
                if (player != 0)
                {
                    console.Call(player, "killWithSource", new[] { "sourceobject", "InsideTurret" });
                }
            }
        }
示例#2
0
 public void TurretShapeDataMountPlayer(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player)
 {
     if (turret.isObject() && turret.getDamageState() != "Destroyed")
     {
         turret.call("setMountTurret", player);
     }
 }
示例#3
0
 public int TurrestshapeDataFindEmptySeat(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player)
 {
     for (int i = 0; i < thisobj["numMountPoints"].AsInt(); i++)
     {
         int node = turret.getMountNodeObject(i);
         if (node == 0)
         {
             return(i);
         }
     }
     return(-1);
 }
示例#4
0
        public void TurretShapeDataOnMountObject(coTurretShapeData thisobj, coTurretShape turret, coShapeBase 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, "");
        }
示例#5
0
        public string MissionGroupRespawnTurret(coSimSet thisobj, coTurretShapeData datablock, coTurretShape classname, TransformF transform, bool isstatic, bool respawn)
        {
            Torque_Class_Helper turret = new Torque_Class_Helper(classname, "");

            turret.Props.Add("datablock", datablock);
            turret.Props.Add("static", isstatic.AsString());
            turret.Props.Add("respawn", respawn.AsString());
            coTurretShape turretid = turret.Create();

            turretid.setTransform(transform);
            ((coSimSet)"MissioinGroup").pushToBack(turretid);
            return(turretid);
        }
示例#6
0
        public void TurretShapeDataOnUnmountObject(coTurretShapeData thisobj, coTurretShape turret, coShapeBase 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, "");
        }
示例#7
0
 public int TurrestShapeDataSwitchSeats(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player)
 {
     for (int i = 0; i < thisobj["numMountPoints"].AsInt(); i++)
     {
         int node = turret.getMountNodeObject(i);
         if (node == player || node != 0)
         {
             continue;
         }
         if (node == 0)
         {
             return(i);
         }
     }
     return(-1);
 }
示例#8
0
        public void TurretShapeDataSetMountTurret(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player)
        {
            if (!turret.isObject() || turret.getDamageState() == "Destroyed")
            {
                return;
            }
            int node = thisobj.call("findEmptySeat", turret, player).AsInt();

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

            player["mVehicle"] = turret;
        }
示例#9
0
        public void TurretShapeDataOnDestroy(coTurretShapeData thisobj, coTurretShape 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");

            if (obj.call("doRespawn") != "")
            {
                ((coSimSet)"MissionGroup").schedule(sGlobal["$TurretShape::RespawnTime"], "respawnTurret", thisobj, console.GetClassName(obj), obj.getTransform().AsString(), true.AsString(), true.AsString());
            }
        }
示例#10
0
 public void TurretShapeDataDamage(coTurretShape thisobj, coShapeBase sourceObject, TransformF position, float damage, string damagetype)
 {
     ((coTurretShapeData)(thisobj.getDataBlock())).call("damage", thisobj, position.AsString(), sourceObject, damage.AsString(), damagetype);
 }
示例#11
0
 public void TurretShapeDataOnUnmount(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player, int node)
 {
     player.call("RefreshVehicleHud", "0", "", "");
 }
示例#12
0
 public void TurretShapeDataOnMount(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player, int node)
 {
     ((coGameConnection)player["client"]).call("RefreshVehicleHud", turret, thisobj["reticle"], thisobj["zoomReticle"]);
 }
示例#13
0
 public void TurretShapeDataIsMountable(coTurretShapeData thisobj, coTurretShape obj, string val)
 {
     obj["mountable"] = val;
 }
示例#14
0
 public void TurrestShapeDataOnEnable(coTurretShapeData thisobj, coTurretShape obj, string laststate)
 {
     // This method is invoked by the ShapeBase code whenever the
     // object's damage state changes.
 }
示例#15
0
 private void TurretShapeData_onDamage(coTurretShapeData thisobj, coTurretShape obj, float delta)
 {
     // This method is invoked by the ShapeBase code whenever the
     // object's damage level changes.
 }