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 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; }
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" }); } }