public void GameConnectionLoadMission(coGameConnection client)
            {
            // Send over the information that will display the server info
            // when we learn it got there, we'll send the data blocks

            client["currentPhase"] = "0";

            if (client.isAIControlled())
                GameConnectionOnClientEnterGame(client);
            else
                {
                if (client.isObject())
                    console.commandToClient(client, "MissionStartPhase1", new[] {sGlobal["$missionSequence"], sGlobal["$Server::MissionFile"], sGlobal["MissionGroup.musicTrack"]});
                console.print("*** Sending mission load to client: " + sGlobal["$Server::MissionFile"]);
                }
            }
 public void GameConnectiononDataBlocksDone(coGameConnection thisobj, string missionSequence)
     {
     // Make sure to ignore calls from a previous mission load
     if (missionSequence != sGlobal["$missionSequence"])
         return;
     if (thisobj["currentPhase"].AsInt() != 1)
         return;
     thisobj["currentPhase"] = "1.5";
     // On to the next phase
     if (thisobj.isObject())
         console.commandToClient(thisobj, "MissionStartPhase2", new[] {sGlobal["$missionSequence"], sGlobal["$Server::MissionFile"]});
     }
Beispiel #3
0
        public void GameConnectionOnDeath(coGameConnection client, coPlayer sourceobject, coGameConnection sourceclient, string damagetype, string damloc)
            {
            if (client.isObject())
                {
                if (client["ownedTurrets"] == "")
                    client["ownedTurrets"] = new Torque_Class_Helper("SimSet").Create().AsString();

                coSimSet simSet = client["ownedTurrets"];

                for (uint i = 0; i < simSet.getCount(); i++)
                    {
                    ((coSimObject)simSet.getObject(i)).schedule("10", "delete");
                    }
                }


            // clear the weaponHUD

            GameConnectionRefreshWeaponHud(client, 0, "", "", "", 0);

            coPlayer player = client["player"];

            // Clear out the name on the corpse
            player.setShapeName("");

            // Update the numerical Health HUD

            //PlayerUpdateHealth(player);


            // Switch the client over to the death cam and unhook the player object.
            coCamera camera = client["camera"];

            if (camera.isObject() && player.isObject())
                {
                camera.call("setMode", "Corpse", player, "", "");
                client.setControlObject(camera);
                }
            else
                {
                console.print("------------>Failed to Switch the client over to the death cam.");
                }

            client["player"] = "0";

            // Display damage appropriate kill message
            string sendMsgFunction = "sendMsgClientKilled_" + damagetype;
            if (!console.isFunction(sendMsgFunction))
                {
                sendMsgFunction = "sendMsgClientKilled_Default";
                }

            console.Call(sendMsgFunction, new string[] { "MsgClientKilled", client, sourceclient, damloc });
            // Dole out points and check for win
            if ((damagetype == "Suicide") || (sourceclient == client))
                {
                IncDeaths(client, "1", "1");
                IncScore(client, "-1", "0");
                }
            else
                {
                IncDeaths(client, "1", "0");
                IncScore(sourceclient, "1", "1");
                IncKills(sourceclient, "1", "0");
                }
            }
 public void ServerCmdPlayDeath(coGameConnection client, string anim)
     {
     if (client.isObject())
         PlayerPlayDeathAnimation(client["player"]);
     }
 public void ServerCmdTestAnimation(coGameConnection client, string anim)
     {
     if (client.isObject())
         ((coPlayer)client["player"]).call("playTestAnimation", anim);
     }
 public void ServerCmdSuicide(coGameConnection client)
     {
     if (client.isObject())
         PlayerKill(client["player"], "Suicide");
     }