public override void onObjectDetached(SceneObject obj) { // If no riders are left, return to the start position if (!this.hasHumanRider()) this.setMoveState(TypePathShapeState.Backward); base.onObjectDetached(obj); }
public override void onObjectAttached(SceneObject obj) { if (obj["client"].isObject()) { this.setMoveState(TypePathShapeState.Forward); this.checkWinner(obj["client"]); } base.onObjectAttached(obj); }
public override void onCollision(ShapeBase obj, SceneObject collObj, Point3F vec, float len) { if (!((collObj.GetType() == typeof (Player)) || (collObj.GetType() == typeof (AIPlayer)))) return; Player player = (Player) collObj; if (player.getDamageLevel() <= 0.00 || player.getState() == "Dead") return; player.applyRepair(this["repairAmount"].AsFloat()); player.setEnergyLevel(1); obj.schedule((100).AsString(), "startFade", "1000", "0", "true"); obj.schedule((1200).AsString(), "delete"); Audio.AudioServerPlay3D("HealthUseSound", player.getTransform()); }
public override void onObjectAttached(SceneObject obj) { if (!obj["client"].isObject()) return; bool driverAvailable = (ClientGroup.Count > 1); if (driverAvailable) { ShapeBase driver = ((WheeledVehicle) this["car"]).getMountNodeObject(0); if (driver.isObject()) message.MessageClient(obj["client"], "MsgItemPickup", "\\c1Hang On!"); else message.MessageAllExcept(obj["client"], "-1", "MsgItemPickup", "\\c2%1 is on the Cheetah and needs a driver...", obj["client.playerName"]); } else message.MessageClient(obj["client"], "MsgItemPickup", "\\c2Good luck finding a driver..."); }
public override void onObjectAttached(SceneObject obj) { // Start moving forward whenever we get a rider this.setMoveState(TypePathShapeState.Forward); if (obj["client"].isObject()) { if (!obj["client.gotInstructions"].AsBool()) { message.MessageClient(obj["client"], "MsgItemPickup", "\\c1Hop to the center grey platform to win."); obj["client.gotInstructions"] = "true"; } if (obj["client.miniStartTime"] == "") { // Record this as their start time and clear the tracking variables obj["client.miniStartTime"] = Util.getSimTime().AsString(); for (int i = 0; i < 4; i++) obj["client.touchedPlatform[" + i + "]"] = "false"; } } base.onObjectAttached(obj); }
public override void onUnmount(GameBase obj, SceneObject mountObj, int node) { //todo change to csharp mountObj.call("RefreshVehicleHud", "0", string.Empty, string.Empty); }
public override void onMount(GameBase obj, SceneObject mountObj, int node) { //todo change to csharp ((GameConnection) mountObj["client"]).call("RefreshVehicleHud", obj, this["reticle"], this["zoomReticle"]); }
public override void onTriggered(ProximityMine obj, SceneObject target) { }
public virtual void onUnmount(GameBase obj, SceneObject mountObj, int node){}
public virtual void onObjectDetached(SceneObject obj){}
public virtual void setMode(Camera camera, string mode, SceneObject arg1, string arg2, string arg3) { }
public virtual void onUnmountObject(TurretShape turret, SceneObject obj){}
public virtual void onImpact(ShapeBase obj, SceneObject collObj, Point3F vec, float len){}
public virtual void onMountObject(TurretShape turret, SceneObject obj, int node){}
public override void onCollision(ShapeBase obj, SceneObject collObj, Point3F vec, float len) { // Collision with other objects, including items }
public virtual void applyDamage(string hitPosition, string hitNormal, SceneObject hitObject){}
public virtual void onTriggered(ProximityMine obj, SceneObject target){}
public virtual void setMode(Camera camera, string mode, SceneObject arg1, string arg2, string arg3) { }
public virtual void onCollision(ShapeBase obj, SceneObject collObj, Point3F vec, float len){}
public override void onMount(GameBase obj, SceneObject mountObj, int node) { WheeledVehicle vehicle = obj._ID; vehicle.setImageAmmo(node, true); }
public override void setMode(Extendable.Camera camera, string mode, SceneObject arg1, string arg2, string arg3) { switch (mode) { case "Observer": camera.setFlyMode(); break; case "Corpse": camera.setOrbitMode(arg1, arg1.getTransform(), (float) 0.5, (float) 4.5, (float) 4.5, false, new Point3F(), false); camera["orbitObj"] = arg1; break; } camera["mode"] = mode; }
public override void onCollision(ShapeBase obj, SceneObject col, Point3F vec, float len) { Player player = obj.getId(); if (player.getState() == "Dead") { return; } // Try and pickup all items if (col.getClassName() == "Item") { player.pickup(col.ID, 1); return; } if (col.GetType() != typeof(WheeledVehicle)) { return; } WheeledVehicle vcol = (WheeledVehicle)col; //AI are not allowed to drive they are lousey drivers.... GameConnection client = player["client"]; if (!client.isObject()) { return; } //Mount Vehicle. if ((console.getTypeMask(col) & (UInt32)SceneObjectTypesAsUint.GameBaseObjectType) != (UInt32)SceneObjectTypesAsUint.GameBaseObjectType) { return; } VehicleData db = vcol.getDataBlock(); if (!(((db.getClassName() == "WheeledVehicleData") || player["mountVehicle"].AsBool() || player.getState() == "Move" || col["mountable"].AsBool()))) { return; } // Only mount drivers for now. // For this specific example, only one person can fit // into a vehicle int mount = vcol.getMountNodeObject(0); if (mount > 0) { try { Player p = mount; return; } catch (Exception err) { //Water particle emitters seem to take up the seat when the vehicle is in water. vcol.unmountObject(mount.AsString()); vcol.mountObject(player, 0, new TransformF()); ((GameConnection)player["client"]).setFirstPerson(false); console.commandToClient(client, "PushVehicleMap"); } } else { vcol.mountObject(player, 0, new TransformF()); ((GameConnection)player["client"]).setFirstPerson(false); console.commandToClient(client, "PushVehicleMap"); } //if (mount > 0) //return; // For this specific FPS Example, always mount the player to node 0 player["mVehicle"] = col; }