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" }); } } }
public void TurretShapeDataMountPlayer(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player) { if (turret.isObject() && turret.getDamageState() != "Destroyed") { turret.call("setMountTurret", player); } }
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); }
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, ""); }
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); }
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, ""); }
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); }
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; }
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()); } }
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); }
public void TurretShapeDataOnUnmount(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player, int node) { player.call("RefreshVehicleHud", "0", "", ""); }
public void TurretShapeDataOnMount(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player, int node) { ((coGameConnection)player["client"]).call("RefreshVehicleHud", turret, thisobj["reticle"], thisobj["zoomReticle"]); }
public void TurretShapeDataIsMountable(coTurretShapeData thisobj, coTurretShape obj, string val) { obj["mountable"] = val; }
public void TurrestShapeDataOnEnable(coTurretShapeData thisobj, coTurretShape obj, string laststate) { // This method is invoked by the ShapeBase code whenever the // object's damage state changes. }
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. }