public override void damage(ShapeBase obj, Point3F position, GameBase sourceobject, float damage, string damagetype) { Player pobj = obj._ID; if (!pobj.isObject() || pobj.getState() == "Dead" || !damage.AsBool()) { return; } obj.applyDamage(damage); GameConnection client = obj["client"]; if (!client.isObject()) { return; } if (damagetype != "Suicide") { pobj.setDamageDirection(sourceobject, new TransformF(position)); } if (pobj.getState() == "Dead") { client.onDeath(sourceobject, sourceobject["client"].isObject() ? sourceobject["client"] : "0", damagetype, "Body"); } }
public override void damage(ShapeBase obj, Point3F position, GameBase source, float damage, string damagetype) { if (obj.getDamageState() == "Dead") { return; } obj.applyDamage(damage); for (int i = 0; i < this["numMountPoints"].AsInt(); i++) { Player player = obj.getMountNodeObject(i); if (player != 0) { player.damage(source, position, 10000.0f, ""); } } }
public override void damage(ShapeBase obj, Point3F position, GameBase source, float damage, string damagetype) { if (obj.getDamageState() == "Dead") return; obj.applyDamage(damage); for (int i = 0; i < this["numMountPoints"].AsInt(); i++) { Player player = obj.getMountNodeObject(i); if (player != 0) player.damage(source, position, 10000.0f, ""); } }