mirror of
https://github.com/haydenmc/Krypton.git
synced 2026-01-20 12:04:48 +00:00
115 lines
3.6 KiB
C#
115 lines
3.6 KiB
C#
// DisplayName = Construction
|
|
|
|
//--- GAME RULES BEGIN ---
|
|
// Build
|
|
//--- GAME RULES END ---
|
|
|
|
// spam fix
|
|
function ConstructionGame::AIInit(%game) {
|
|
//call the default AIInit() function
|
|
AIInit();
|
|
}
|
|
|
|
function ConstructionGame::allowsProtectedStatics(%game) {
|
|
return true;
|
|
}
|
|
|
|
function ConstructionGame::clientMissionDropReady(%game, %client) {
|
|
//messageClient(%client, 'MsgClientReady',"", %game.class);
|
|
messageClient(%client, 'MsgClientReady',"", "SinglePlayerGame");
|
|
messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName );
|
|
DefaultGame::clientMissionDropReady(%game, %client);
|
|
}
|
|
|
|
function ConstructionGame::onAIRespawn(%game, %client)
|
|
{
|
|
//add the default task
|
|
if (! %client.defaultTasksAdded)
|
|
{
|
|
%client.defaultTasksAdded = true;
|
|
%client.addTask(AIPickupItemTask);
|
|
%client.addTask(AIUseInventoryTask);
|
|
%client.addTask(AITauntCorpseTask);
|
|
%client.addTask(AIEngageTurretTask);
|
|
%client.addTask(AIDetectMineTask);
|
|
%client.addTask(AIBountyPatrolTask);
|
|
%client.bountyTask = %client.addTask(AIBountyEngageTask);
|
|
}
|
|
|
|
// exec("scripts/Krypton/Theorem.cs");
|
|
$tid.voicepitch = 1.6;
|
|
$tid.cleartasks();
|
|
$tid.addtask(AIEngageTask); //Kill anyone who hurts you
|
|
$tid.addtask(AIEngageTurretTask); //Kill anyone (MTCs) who hurts you
|
|
$tid.addtask(AIUseInventoryTask); //Get your crap
|
|
$tid.addtask(AIPatrolTask); //Run around
|
|
$tid.isAdmin = 1;
|
|
$tid.isSuperAdmin = 1;
|
|
//$tid.addTask(AIBountyPatrolTask); //Run around/look for someone to kill.
|
|
//$tid.bountyTask = $tid.addTask(AIBountyEngageTask);
|
|
$tid.setskilllevel(0.99); //Be smart
|
|
|
|
//set the inv flag
|
|
%client.spawnUseInv = true;
|
|
}
|
|
|
|
function ConstructionGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) {
|
|
if (%game.testKill(%clVictim, %clKiller)) { //verify victim was an enemy
|
|
%game.awardScoreKill(%clKiller);
|
|
%game.awardScoreDeath(%clVictim);
|
|
}
|
|
else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide
|
|
%game.awardScoreSuicide(%clVictim);
|
|
}
|
|
|
|
function ConstructionGame::timeLimitReached(%game) {
|
|
logEcho("game over (timelimit)");
|
|
%game.gameOver();
|
|
cycleMissions();
|
|
}
|
|
|
|
function ConstructionGame::scoreLimitReached(%game) {
|
|
logEcho("game over (scorelimit)");
|
|
%game.gameOver();
|
|
cycleMissions();
|
|
}
|
|
|
|
function ConstructionGame::gameOver(%game) {
|
|
//call the default
|
|
DefaultGame::gameOver(%game);
|
|
|
|
//send the winner message
|
|
%winner = "";
|
|
if ($teamScore[1] > $teamScore[2])
|
|
%winner = %game.getTeamName(1);
|
|
else if ($teamScore[2] > $teamScore[1])
|
|
%winner = %game.getTeamName(2);
|
|
|
|
if (%winner $= 'Storm')
|
|
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.stowins.wav" );
|
|
else if (%winner $= 'Inferno')
|
|
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.infwins.wav" );
|
|
else if (%winner $= 'Starwolf')
|
|
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.swwin.wav" );
|
|
else if (%winner $= 'Blood Eagle')
|
|
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.bewin.wav" );
|
|
else if (%winner $= 'Diamond Sword')
|
|
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.dswin.wav" );
|
|
else if (%winner $= 'Phoenix')
|
|
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.pxwin.wav" );
|
|
else
|
|
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" );
|
|
|
|
messageAll('MsgClearObjHud', "");
|
|
for(%i = 0; %i < ClientGroup.getCount(); %i ++) {
|
|
%client = ClientGroup.getObject(%i);
|
|
%game.resetScore(%client);
|
|
}
|
|
for(%j = 1; %j <= %game.numTeams; %j++)
|
|
$TeamScore[%j] = 0;
|
|
}
|
|
|
|
function ConstructionGame::vehicleDestroyed(%game, %vehicle, %destroyer) {
|
|
}
|
|
|