public void TurretShapeDataMountPlayer(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player) { if (turret.isObject() && turret.getDamageState() != "Destroyed") turret.call("setMountTurret", player); }
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; }
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" }); } }