public void TeleporterTriggerTeleportPlayer(coSimDataBlock thisobj, coPlayer player, coSceneObject exit)
        {
            TransformF targetPosition;

            if (exit["reorientPlayer"].AsBool())
            {
                targetPosition = exit.getTransform();
            }
            else
            {
                targetPosition = exit.getTransform();
                TransformF playerrot = player.getTransform();
                targetPosition.MOrientation.x = playerrot.MOrientation.x;
                targetPosition.MOrientation.y = playerrot.MOrientation.y;
                targetPosition.MOrientation.z = playerrot.MOrientation.z;
                targetPosition.MAngle         = playerrot.MAngle;
            }
            player.setTransform(targetPosition);
            Point3F playervelocity = player.getVelocity();

            playervelocity = playervelocity.vectorScale(exit["exitVelocityScale"].AsFloat());
            player.setVelocity(playervelocity);
            // Prevent the object from doing an immediate second teleport
            // In the case of a bidirectional teleporter
            player["isTeleporting"] = true.AsString();
        }
示例#2
0
        public void AmmoOnPickup(string thisobj, string obj, coSceneObject shape, string amount, int nameSpaceDepth)
        {
            int nsd = nameSpaceDepth + 1;

            if (console.ParentExecute(thisobj, "onPickup", nsd, new string[] { thisobj, obj, shape, amount }).AsBool())
            {
                AudioServerPlay3D("AmmoPickupSound", shape.getTransform());
            }
        }
        public void DoManualDetonation(coSceneObject obj)
        {
            Torque_Class_Helper tch = new Torque_Class_Helper("Item", "");

            tch.Props.Add("dataBlock", "Detonade");
            coSceneObject nade = tch.Create();

            ((coSimSet)"MissionCleanUp").pushToBack(nade);
            nade.setTransform(obj.getTransform());
            nade["sourceObject"] = obj["SourceObject"];
            nade.schedule("50", "setDamageState", "Destroyed");
            obj.delete();
        }
示例#4
0
        public void ObserverObserverSetMode(coCamera camera, string mode, coSceneObject 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;
        }