mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-12 22:54:33 +00:00
Merge branch 'Dev' into Stable
This commit is contained in:
commit
428d4b341c
27 changed files with 2478 additions and 1229 deletions
|
|
@ -8,8 +8,8 @@ $Host::AllowAdminStopVote = 1;
|
||||||
$Host::AllowAdminStopVotes = 1;
|
$Host::AllowAdminStopVotes = 1;
|
||||||
$Host::AllowAdminVotes = 1;
|
$Host::AllowAdminVotes = 1;
|
||||||
$Host::AllowMapScript = "True";
|
$Host::AllowMapScript = "True";
|
||||||
$Host::AllowPlayerTournamentModeVotekick = 0;
|
|
||||||
$Host::AllowPlayerVoteChangeMission = 1;
|
$Host::AllowPlayerVoteChangeMission = 1;
|
||||||
|
$Host::AllowPlayerVoteNextMission = 1;
|
||||||
$Host::AllowPlayerVoteSkipMission = 1;
|
$Host::AllowPlayerVoteSkipMission = 1;
|
||||||
$Host::AllowPlayerVoteTeamDamage = 0;
|
$Host::AllowPlayerVoteTeamDamage = 0;
|
||||||
$Host::AllowPlayerVoteTimeLimit = 1;
|
$Host::AllowPlayerVoteTimeLimit = 1;
|
||||||
|
|
@ -149,6 +149,8 @@ $Host::MaxPlayers = 30;
|
||||||
$Host::MinBotDifficulty = 0;
|
$Host::MinBotDifficulty = 0;
|
||||||
$Host::MinFlagRecordPlayerCount = 6;
|
$Host::MinFlagRecordPlayerCount = 6;
|
||||||
$Host::MissionType = "LakRabbit";
|
$Host::MissionType = "LakRabbit";
|
||||||
|
$Host::MultipleMapRotation = 0;
|
||||||
|
$Host::MultipleMapRotationCount = 3;
|
||||||
$Host::NoBaseRapeEnabled = 1;
|
$Host::NoBaseRapeEnabled = 1;
|
||||||
$Host::NoBaseRapePlayerCount = 14;
|
$Host::NoBaseRapePlayerCount = 14;
|
||||||
$Host::NoSmurfs = 0;
|
$Host::NoSmurfs = 0;
|
||||||
|
|
|
||||||
|
|
@ -2093,39 +2093,39 @@ function CTFGame::startFlagCollisionSearch(%game, %flag)
|
||||||
// VOTING ///////////////////////////////////////////////////////////////////////////////
|
// VOTING ///////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
function CTFGame::sendGameVoteMenu(%game, %client, %key)
|
// function CTFGame::sendGameVoteMenu(%game, %client, %key)
|
||||||
{
|
// {
|
||||||
DefaultGame::sendGameVoteMenu(%game, %client, %key);
|
// DefaultGame::sendGameVoteMenu(%game, %client, %key);
|
||||||
if ( %game.scheduleVote $= "" )
|
// if ( %game.scheduleVote $= "" )
|
||||||
{
|
// {
|
||||||
//if(%client.isAdmin)
|
// if(%client.isAdmin)
|
||||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' );
|
||||||
//else
|
// else
|
||||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
function CTFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4)
|
// function CTFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||||
{
|
// {
|
||||||
DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
|
// DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
|
||||||
switch$ (%typeName)
|
// switch$ (%typeName)
|
||||||
{
|
// {
|
||||||
case "voteAntiTurtleTime":
|
// case "voteAntiTurtleTime":
|
||||||
%game.voteAntiTurtleTime(%admin, %arg1, %arg2, %arg3, %arg4);
|
// %game.voteAntiTurtleTime(%admin, %arg1, %arg2, %arg3, %arg4);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
function CTFGame::sendAntiTurtleTimeList( %game, %client, %key )
|
// function CTFGame::sendAntiTurtleTimeList( %game, %client, %key )
|
||||||
{
|
// {
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 6, "", '6 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 6, "", '6 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 8, "", '8 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 8, "", '8 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 10, "", '10 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 10, "", '10 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 12, "", '12 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 12, "", '12 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 14, "", '14 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 14, "", '14 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 16, "", '16 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 16, "", '16 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 18, "", '18 minutes' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 18, "", '18 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 200, "", 'Disable Anti Turtle' );
|
// messageClient( %client, 'MsgVoteItem', "", %key, 200, "", 'Disable Anti Turtle' );
|
||||||
}
|
// }
|
||||||
|
|
||||||
function CTFGame::voteAntiTurtleTime(%game, %admin, %newLimit)
|
function CTFGame::voteAntiTurtleTime(%game, %admin, %newLimit)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ function DMGame::setUpTeams(%game)
|
||||||
%group = nameToID("MissionGroup/Teams");
|
%group = nameToID("MissionGroup/Teams");
|
||||||
if(%group == -1)
|
if(%group == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// create a team0 if it does not exist
|
// create a team0 if it does not exist
|
||||||
%team = nameToID("MissionGroup/Teams/team0");
|
%team = nameToID("MissionGroup/Teams/team0");
|
||||||
if(%team == -1)
|
if(%team == -1)
|
||||||
|
|
@ -48,7 +48,7 @@ function DMGame::setUpTeams(%game)
|
||||||
%team = new SimGroup("team0");
|
%team = new SimGroup("team0");
|
||||||
%group.add(%team);
|
%group.add(%team);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'team0' is not counted as a team here
|
// 'team0' is not counted as a team here
|
||||||
%game.numTeams = 0;
|
%game.numTeams = 0;
|
||||||
while(%team != -1)
|
while(%team != -1)
|
||||||
|
|
@ -56,7 +56,7 @@ function DMGame::setUpTeams(%game)
|
||||||
// create drop set and add all spawnsphere objects into it
|
// create drop set and add all spawnsphere objects into it
|
||||||
%dropSet = new SimSet("TeamDrops" @ %game.numTeams);
|
%dropSet = new SimSet("TeamDrops" @ %game.numTeams);
|
||||||
MissionCleanup.add(%dropSet);
|
MissionCleanup.add(%dropSet);
|
||||||
|
|
||||||
%spawns = nameToID("MissionGroup/Teams/team" @ %game.numTeams @ "/SpawnSpheres");
|
%spawns = nameToID("MissionGroup/Teams/team" @ %game.numTeams @ "/SpawnSpheres");
|
||||||
if(%spawns != -1)
|
if(%spawns != -1)
|
||||||
{
|
{
|
||||||
|
|
@ -64,21 +64,21 @@ function DMGame::setUpTeams(%game)
|
||||||
for(%i = 0; %i < %count; %i++)
|
for(%i = 0; %i < %count; %i++)
|
||||||
%dropSet.add(%spawns.getObject(%i));
|
%dropSet.add(%spawns.getObject(%i));
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the 'team' field for all the objects in this team
|
// set the 'team' field for all the objects in this team
|
||||||
%team.setTeam(0);
|
%team.setTeam(0);
|
||||||
|
|
||||||
clearVehicleCount(%team+1);
|
clearVehicleCount(%team+1);
|
||||||
// get next group
|
// get next group
|
||||||
%team = nameToID("MissionGroup/Teams/team" @ %game.numTeams + 1);
|
%team = nameToID("MissionGroup/Teams/team" @ %game.numTeams + 1);
|
||||||
if (%team != -1)
|
if (%team != -1)
|
||||||
%game.numTeams++;
|
%game.numTeams++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the number of sensor groups (including team0) that are processed
|
// set the number of sensor groups (including team0) that are processed
|
||||||
setSensorGroupCount(%game.numTeams + 1);
|
setSensorGroupCount(%game.numTeams + 1);
|
||||||
%game.numTeams = 1;
|
%game.numTeams = 1;
|
||||||
|
|
||||||
// allow teams 1->31 to listen to each other (team 0 can only listen to self)
|
// allow teams 1->31 to listen to each other (team 0 can only listen to self)
|
||||||
for(%i = 1; %i < 32; %i++)
|
for(%i = 1; %i < 32; %i++)
|
||||||
setSensorGroupListenMask(%i, 0xfffffffe);
|
setSensorGroupListenMask(%i, 0xfffffffe);
|
||||||
|
|
@ -106,7 +106,7 @@ function DMGame::equip(%game, %player)
|
||||||
for(%i =0; %i<$InventoryHudCount; %i++)
|
for(%i =0; %i<$InventoryHudCount; %i++)
|
||||||
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
|
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
|
||||||
%player.client.clearBackpackIcon();
|
%player.client.clearBackpackIcon();
|
||||||
|
|
||||||
if( $Host::DMSLOnlyMode )
|
if( $Host::DMSLOnlyMode )
|
||||||
{
|
{
|
||||||
%player.clearInventory();
|
%player.clearInventory();
|
||||||
|
|
@ -122,7 +122,7 @@ function DMGame::equip(%game, %player)
|
||||||
buyFavorites(%player.client);
|
buyFavorites(%player.client);
|
||||||
%player.setEnergyLevel(%player.getDataBlock().maxEnergy);
|
%player.setEnergyLevel(%player.getDataBlock().maxEnergy);
|
||||||
%player.selectWeaponSlot( 0 );
|
%player.selectWeaponSlot( 0 );
|
||||||
|
|
||||||
// do we want to give players a disc launcher instead? GJL: Yes we do!
|
// do we want to give players a disc launcher instead? GJL: Yes we do!
|
||||||
%player.use("Disc");
|
%player.use("Disc");
|
||||||
}
|
}
|
||||||
|
|
@ -137,7 +137,7 @@ function DMGame::pickPlayerSpawn(%game, %client, %respawn)
|
||||||
function DMGame::clientJoinTeam( %game, %client, %team, %respawn )
|
function DMGame::clientJoinTeam( %game, %client, %team, %respawn )
|
||||||
{
|
{
|
||||||
%game.assignClientTeam( %client );
|
%game.assignClientTeam( %client );
|
||||||
|
|
||||||
// Spawn the player:
|
// Spawn the player:
|
||||||
%game.spawnPlayer( %client, %respawn );
|
%game.spawnPlayer( %client, %respawn );
|
||||||
}
|
}
|
||||||
|
|
@ -146,7 +146,7 @@ function DMGame::assignClientTeam(%game, %client)
|
||||||
{
|
{
|
||||||
for(%i = 1; %i < 32; %i++)
|
for(%i = 1; %i < 32; %i++)
|
||||||
$DMTeamArray[%i] = false;
|
$DMTeamArray[%i] = false;
|
||||||
|
|
||||||
%maxSensorGroup = 0;
|
%maxSensorGroup = 0;
|
||||||
%count = ClientGroup.getCount();
|
%count = ClientGroup.getCount();
|
||||||
for(%i = 0; %i < %count; %i++)
|
for(%i = 0; %i < %count; %i++)
|
||||||
|
|
@ -159,7 +159,7 @@ function DMGame::assignClientTeam(%game, %client)
|
||||||
%maxSensorGroup = %cl.team;
|
%maxSensorGroup = %cl.team;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//now loop through the team array, looking for an empty team
|
//now loop through the team array, looking for an empty team
|
||||||
for(%i = 1; %i < 32; %i++)
|
for(%i = 1; %i < 32; %i++)
|
||||||
{
|
{
|
||||||
|
|
@ -171,14 +171,14 @@ function DMGame::assignClientTeam(%game, %client)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set player's skin pref here
|
// set player's skin pref here
|
||||||
setTargetSkin(%client.target, %client.skin);
|
setTargetSkin(%client.target, %client.skin);
|
||||||
|
|
||||||
// Let everybody know you are no longer an observer:
|
// Let everybody know you are no longer an observer:
|
||||||
messageAll( 'MsgClientJoinTeam', '\c1%1 has joined the fray.', %client.name, "", %client, 1 );
|
messageAll( 'MsgClientJoinTeam', '\c1%1 has joined the fray.', %client.name, "", %client, 1 );
|
||||||
updateCanListenState( %client );
|
updateCanListenState( %client );
|
||||||
|
|
||||||
//now set the max number of sensor groups...
|
//now set the max number of sensor groups...
|
||||||
setSensorGroupCount(%maxSensorGroup + 1);
|
setSensorGroupCount(%maxSensorGroup + 1);
|
||||||
}
|
}
|
||||||
|
|
@ -190,9 +190,9 @@ function DMGame::clientMissionDropReady(%game, %client)
|
||||||
messageClient(%client, 'MsgDMPlayerDies', "", 0);
|
messageClient(%client, 'MsgDMPlayerDies', "", 0);
|
||||||
messageClient(%client, 'MsgDMKill', "", 0);
|
messageClient(%client, 'MsgDMKill', "", 0);
|
||||||
%game.resetScore(%client);
|
%game.resetScore(%client);
|
||||||
|
|
||||||
messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName );
|
messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName );
|
||||||
|
|
||||||
DefaultGame::clientMissionDropReady(%game, %client);
|
DefaultGame::clientMissionDropReady(%game, %client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,7 +205,7 @@ function DMGame::AIHasJoined(%game, %client)
|
||||||
function DMGame::checkScoreLimit(%game, %client)
|
function DMGame::checkScoreLimit(%game, %client)
|
||||||
{
|
{
|
||||||
%scoreLimit = MissionGroup.DM_scoreLimit;
|
%scoreLimit = MissionGroup.DM_scoreLimit;
|
||||||
|
|
||||||
if(%scoreLimit $= "")
|
if(%scoreLimit $= "")
|
||||||
%scoreLimit = 25;
|
%scoreLimit = 25;
|
||||||
if(%client.score >= %scoreLimit)
|
if(%client.score >= %scoreLimit)
|
||||||
|
|
@ -215,7 +215,7 @@ function DMGame::checkScoreLimit(%game, %client)
|
||||||
function DMGame::createPlayer(%game, %client, %spawnLoc, %respawn)
|
function DMGame::createPlayer(%game, %client, %spawnLoc, %respawn)
|
||||||
{
|
{
|
||||||
DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn);
|
DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn);
|
||||||
|
|
||||||
%client.setSensorGroup(%client.team);
|
%client.setSensorGroup(%client.team);
|
||||||
%client.isObserver = 0;
|
%client.isObserver = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -230,7 +230,7 @@ function DMGame::resetScore(%game, %client)
|
||||||
%client.MidAir = 0;
|
%client.MidAir = 0;
|
||||||
%client.Bonus = 0;
|
%client.Bonus = 0;
|
||||||
%client.KillStreakBonus = 0;
|
%client.KillStreakBonus = 0;
|
||||||
|
|
||||||
// not a score thing but needs to be reset
|
// not a score thing but needs to be reset
|
||||||
%client.killCounter = 0;
|
%client.killCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -244,35 +244,35 @@ function DMGame::forceObserver( %game, %client, %reason )
|
||||||
function DMGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc)
|
function DMGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc)
|
||||||
{
|
{
|
||||||
cancel(%clVictim.player.alertThread);
|
cancel(%clVictim.player.alertThread);
|
||||||
|
|
||||||
DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
|
DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
|
||||||
|
|
||||||
ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
|
ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc)
|
function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc)
|
||||||
{
|
{
|
||||||
if(%clVictim.isMarked && $DMGame::mode)
|
if(%clVictim.isMarked && $DMGame::mode)
|
||||||
{
|
{
|
||||||
if(%clKiller $= "" || %clVictim.killCounter < 3)
|
if(%clKiller $= "" || %clVictim.killCounter < 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(%clVictim == %clKiller || %damageType == $DamageType::Suicide || %damageType == $DamageType::Lava || %damageType == $DamageType::OutOfBounds || %damageType == $DamageType::Ground || %damageType == $DamageType::Lightning)
|
if(%clVictim == %clKiller || %damageType == $DamageType::Suicide || %damageType == $DamageType::Lava || %damageType == $DamageType::OutOfBounds || %damageType == $DamageType::Ground || %damageType == $DamageType::Lightning)
|
||||||
{
|
{
|
||||||
messageAll('Msgding', '\c2%1\'s Kill Streak has ended. No bonus rewarded.', %clVictim.name, %clVictim.killCounter);
|
messageAll('Msgding', '\c2%1\'s Kill Streak has ended. No bonus rewarded.', %clVictim.name, %clVictim.killCounter);
|
||||||
%game.lastGuy = 0;
|
%game.lastGuy = 0;
|
||||||
}
|
}
|
||||||
else if(%clVictim !$= %clKiller)
|
else if(%clVictim !$= %clKiller)
|
||||||
{
|
{
|
||||||
%temprampage = mfloor((%clVictim.killCounter - $DMGame::wpKillCount) * %game.SCORE_PER_KILLSTREAKBONUS);
|
%temprampage = mfloor((%clVictim.killCounter - $DMGame::wpKillCount) * %game.SCORE_PER_KILLSTREAKBONUS);
|
||||||
%s = "";
|
%s = "";
|
||||||
|
|
||||||
//single bonus
|
//single bonus
|
||||||
if(%clVictim.killCounter < $DMGame::wpKillCountDoubleBonus)
|
if(%clVictim.killCounter < $DMGame::wpKillCountDoubleBonus)
|
||||||
{
|
{
|
||||||
%clKiller.Bonus++; // stats rename to what ever
|
%clKiller.Bonus++; // stats rename to what ever
|
||||||
%clKiller.scoreBonus++;
|
%clKiller.scoreBonus++;
|
||||||
|
|
||||||
//messageAll('Msgding', '\c1%1 receives a bonus for ending %2\'s %3x kill streak.~wfx/misc/flag_lost.wav',%clKiller.name,%clVictim.name, %clVictim.killCounter);
|
//messageAll('Msgding', '\c1%1 receives a bonus for ending %2\'s %3x kill streak.~wfx/misc/flag_lost.wav',%clKiller.name,%clVictim.name, %clVictim.killCounter);
|
||||||
messageAllExcept(%clVictim, -1, 'Msgding', '\c4%1 is rewarded with a bonus for ending %5\'s %6X Kill Streak!~wfx/misc/flag_lost.wav', %clKiller.name, "", %clVictim, 1, %clVictim.name, %clVictim.killCounter );
|
messageAllExcept(%clVictim, -1, 'Msgding', '\c4%1 is rewarded with a bonus for ending %5\'s %6X Kill Streak!~wfx/misc/flag_lost.wav', %clKiller.name, "", %clVictim, 1, %clVictim.name, %clVictim.killCounter );
|
||||||
if(%temprampage > 0)
|
if(%temprampage > 0)
|
||||||
|
|
@ -284,11 +284,11 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
|
||||||
messageClient(%clVictim, 'Msgding', '\c2%1 has ended your %2X Kill Streak.~wfx/misc/flag_lost.wav', %clKiller.name, %clVictim.killCounter);
|
messageClient(%clVictim, 'Msgding', '\c2%1 has ended your %2X Kill Streak.~wfx/misc/flag_lost.wav', %clKiller.name, %clVictim.killCounter);
|
||||||
}
|
}
|
||||||
//double bonus
|
//double bonus
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%clKiller.Bonus++; %clKiller.Bonus++;
|
%clKiller.Bonus++; %clKiller.Bonus++;
|
||||||
%clKiller.scoreBonus++; %clKiller.scoreBonus++;
|
%clKiller.scoreBonus++; %clKiller.scoreBonus++;
|
||||||
|
|
||||||
//messageAll('Msgding', '\c1%1 receives a double bonus for ending %2\'s %3x kill streak.~wfx/misc/flag_lost.wav',%clKiller.name,%clVictim.name, %clVictim.killCounter);
|
//messageAll('Msgding', '\c1%1 receives a double bonus for ending %2\'s %3x kill streak.~wfx/misc/flag_lost.wav',%clKiller.name,%clVictim.name, %clVictim.killCounter);
|
||||||
messageAllExcept(%clVictim, -1, 'Msgding', '\c4%1 is rewarded with a double bonus for ending %5\'s %6X Kill Streak!~wfx/misc/flag_lost.wav', %clKiller.name, "", %clVictim, 1, %clVictim.name, %clVictim.killCounter );
|
messageAllExcept(%clVictim, -1, 'Msgding', '\c4%1 is rewarded with a double bonus for ending %5\'s %6X Kill Streak!~wfx/misc/flag_lost.wav', %clKiller.name, "", %clVictim, 1, %clVictim.name, %clVictim.killCounter );
|
||||||
if(%temprampage > 0)
|
if(%temprampage > 0)
|
||||||
|
|
@ -323,19 +323,19 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
|
||||||
}
|
}
|
||||||
%clKiller.killCounter++;
|
%clKiller.killCounter++;
|
||||||
%clVictim.killCounter = 0;
|
%clVictim.killCounter = 0;
|
||||||
|
|
||||||
switch$($DMGame::mode)
|
switch$($DMGame::mode)
|
||||||
{
|
{
|
||||||
case 1: // player with the highest kill streak if they are above $DMGame::wpKillCount
|
case 1: // player with the highest kill streak if they are above $DMGame::wpKillCount
|
||||||
%bonusClient = 0;
|
%bonusClient = 0;
|
||||||
for(%b = 0; %b < ClientGroup.getCount(); %b++)
|
for(%b = 0; %b < ClientGroup.getCount(); %b++)
|
||||||
{
|
{
|
||||||
%cl = ClientGroup.getObject(%b);
|
%cl = ClientGroup.getObject(%b);
|
||||||
if(%cl.killCounter >= $DMGame::wpKillCount && %cl.killCounter > %bonusClient.killCounter && !%cl.isObserver)
|
if(%cl.killCounter >= $DMGame::wpKillCount && %cl.killCounter > %bonusClient.killCounter && !%cl.isObserver)
|
||||||
{
|
{
|
||||||
%bonusClient = %cl;// we have a new
|
%bonusClient = %cl;// we have a new
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(%bonusClient !$= 0 && %clKiller == %bonusClient)
|
if(%bonusClient !$= 0 && %clKiller == %bonusClient)
|
||||||
{
|
{
|
||||||
if(%bonusClient !$= %game.lastGuy)
|
if(%bonusClient !$= %game.lastGuy)
|
||||||
|
|
@ -343,7 +343,7 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||||
{
|
{
|
||||||
%cl = ClientGroup.getObject(%i);
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
|
||||||
hideTargetWaypoint(%cl,%game.lastGuy);
|
hideTargetWaypoint(%cl,%game.lastGuy);
|
||||||
if(%cl !$= %bonusClient)
|
if(%cl !$= %bonusClient)
|
||||||
{
|
{
|
||||||
|
|
@ -352,13 +352,13 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
|
||||||
}
|
}
|
||||||
messageAllExcept(%bonusClient, -1, 'MsgPingWaypoint', '\c2%1 is on a Kill Streak. Kill them for a bonus!~wgui/vote_nopass.wav', %bonusClient.name, "", %bonusClient, 1 );
|
messageAllExcept(%bonusClient, -1, 'MsgPingWaypoint', '\c2%1 is on a Kill Streak. Kill them for a bonus!~wgui/vote_nopass.wav', %bonusClient.name, "", %bonusClient, 1 );
|
||||||
messageClient(%bonusClient, 'MsgPingWaypoint', '\c2You\'re on a Kill Streak. Get more kills for extra points!~wfx/misc/target_waypoint.wav', %bonusClient.killCounter);
|
messageClient(%bonusClient, 'MsgPingWaypoint', '\c2You\'re on a Kill Streak. Get more kills for extra points!~wfx/misc/target_waypoint.wav', %bonusClient.killCounter);
|
||||||
|
|
||||||
%game.lastGuy.isMarked = 0;
|
%game.lastGuy.isMarked = 0;
|
||||||
%bonusClient.isMarked = 1;
|
%bonusClient.isMarked = 1;
|
||||||
%game.lastGuy = %bonusClient;
|
%game.lastGuy = %bonusClient;
|
||||||
}
|
}
|
||||||
else if(%bonusClient == %game.lastGuy && %bonusClient.killCounter > 3)
|
else if(%bonusClient == %game.lastGuy && %bonusClient.killCounter > 3)
|
||||||
{
|
{
|
||||||
//give waypointed player a kill bonus
|
//give waypointed player a kill bonus
|
||||||
%bonusClient.KillStreakBonus++;
|
%bonusClient.KillStreakBonus++;
|
||||||
%bonusClient.scoreKillStreakBonus++;
|
%bonusClient.scoreKillStreakBonus++;
|
||||||
|
|
@ -375,7 +375,7 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
|
||||||
%bonusClient = %cl;
|
%bonusClient = %cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(%bonusClient != 0 && %game.lastGuy != %bonusClient)
|
if(%bonusClient != 0 && %game.lastGuy != %bonusClient)
|
||||||
{
|
{
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||||
|
|
@ -423,7 +423,7 @@ function hideTargetWaypoint(%client,%clTarget)
|
||||||
%visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup());
|
%visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup());
|
||||||
%visMask &= ~(1 << %client.getSensorGroup());
|
%visMask &= ~(1 << %client.getSensorGroup());
|
||||||
setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask);
|
setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask);
|
||||||
removeClientTargetType(%client, "AssignedTask");
|
removeClientTargetType(%client, "AssignedTask");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -437,7 +437,7 @@ function DMGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %imp
|
||||||
}
|
}
|
||||||
else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide
|
else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide
|
||||||
%game.awardScoreSuicide(%clVictim);
|
%game.awardScoreSuicide(%clVictim);
|
||||||
|
|
||||||
messageClient(%clVictim, 'MsgDMPlayerDies', "", %clVictim.deaths + %clVictim.suicides);
|
messageClient(%clVictim, 'MsgDMPlayerDies', "", %clVictim.deaths + %clVictim.suicides);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -449,12 +449,12 @@ function DMGame::recalcScore(%game, %client)
|
||||||
%BonusValue = %client.Bonus * %game.SCORE_PER_BONUS;
|
%BonusValue = %client.Bonus * %game.SCORE_PER_BONUS;
|
||||||
%MidAirValue = %client.MidAir * %game.SCORE_PER_MIDAIR;
|
%MidAirValue = %client.MidAir * %game.SCORE_PER_MIDAIR;
|
||||||
%KillStreakBonusValue = %client.KillStreakBonus * %game.SCORE_PER_KILLSTREAKBONUS;
|
%KillStreakBonusValue = %client.KillStreakBonus * %game.SCORE_PER_KILLSTREAKBONUS;
|
||||||
|
|
||||||
if (%killValue - %deathValue == 0)
|
if (%killValue - %deathValue == 0)
|
||||||
%client.efficiency = %suicideValue;
|
%client.efficiency = %suicideValue;
|
||||||
else
|
else
|
||||||
%client.efficiency = ((%killValue * %killValue) / (%killValue - (%deathValue + %suicideValue))) + (%BonusValue + %MidAirValue + %KillStreakBonusValue);
|
%client.efficiency = ((%killValue * %killValue) / (%killValue - (%deathValue + %suicideValue))) + (%BonusValue + %MidAirValue + %KillStreakBonusValue);
|
||||||
|
|
||||||
%client.score = mFloatLength(%client.efficiency, 1);
|
%client.score = mFloatLength(%client.efficiency, 1);
|
||||||
messageClient(%client, 'MsgYourScoreIs', "", %client.score);
|
messageClient(%client, 'MsgYourScoreIs', "", %client.score);
|
||||||
%game.recalcTeamRanks(%client);
|
%game.recalcTeamRanks(%client);
|
||||||
|
|
@ -479,12 +479,12 @@ function DMGame::gameOver(%game)
|
||||||
{
|
{
|
||||||
//call the default
|
//call the default
|
||||||
DefaultGame::gameOver(%game);
|
DefaultGame::gameOver(%game);
|
||||||
|
|
||||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" );
|
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" );
|
||||||
|
|
||||||
cancel(%game.timeThread);
|
cancel(%game.timeThread);
|
||||||
messageAll('MsgClearObjHud', "");
|
messageAll('MsgClearObjHud', "");
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i ++)
|
for(%i = 0; %i < ClientGroup.getCount(); %i ++)
|
||||||
{
|
{
|
||||||
%client = ClientGroup.getObject(%i);
|
%client = ClientGroup.getObject(%i);
|
||||||
%game.resetScore(%client);
|
%game.resetScore(%client);
|
||||||
|
|
@ -507,32 +507,32 @@ function plzBounceOffGrid(%obj, %bounceForce, %count)
|
||||||
%boundsNorth = getWord(%bounds, 1);
|
%boundsNorth = getWord(%bounds, 1);
|
||||||
%boundsEast = %boundsWest + getWord(%bounds, 2);
|
%boundsEast = %boundsWest + getWord(%bounds, 2);
|
||||||
%boundsSouth = %boundsNorth + getWord(%bounds, 3);
|
%boundsSouth = %boundsNorth + getWord(%bounds, 3);
|
||||||
|
|
||||||
%shapePos = %obj.getPosition();
|
%shapePos = %obj.getPosition();
|
||||||
%shapex = firstWord(%shapePos);
|
%shapex = firstWord(%shapePos);
|
||||||
%shapey = getWord(%shapePos, 1);
|
%shapey = getWord(%shapePos, 1);
|
||||||
|
|
||||||
if( %shapex >= %boundsWest && %shapex <= %boundsEast && %shapey >= %boundsNorth && %shapey <= %boundsSouth) {
|
if( %shapex >= %boundsWest && %shapex <= %boundsEast && %shapey >= %boundsNorth && %shapey <= %boundsSouth) {
|
||||||
// we don't need to bounce at all
|
// we don't need to bounce at all
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( %count == 8 ) {
|
if( %count == 8 ) {
|
||||||
// just kill this retard
|
// just kill this retard
|
||||||
%obj.scriptKill($DamageType::OutOfBounds);
|
%obj.scriptKill($DamageType::OutOfBounds);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (%bounceForce $= "")
|
if (%bounceForce $= "")
|
||||||
%bounceForce = 65;
|
%bounceForce = 65;
|
||||||
|
|
||||||
%oldVel = %obj.getVelocity();
|
%oldVel = %obj.getVelocity();
|
||||||
%obj.setVelocity("0 0 0");
|
%obj.setVelocity("0 0 0");
|
||||||
|
|
||||||
%vecx = firstWord(%oldVel);
|
%vecx = firstWord(%oldVel);
|
||||||
%vecy = getWord(%oldVel, 1);
|
%vecy = getWord(%oldVel, 1);
|
||||||
%vecz = getWord(%oldVel, 2);
|
%vecz = getWord(%oldVel, 2);
|
||||||
|
|
||||||
// four cases, not two cases you fucktard kineticpoet
|
// four cases, not two cases you fucktard kineticpoet
|
||||||
// no wonder the trives of vengrances failed
|
// no wonder the trives of vengrances failed
|
||||||
if(%shapex <= %boundsWest) {
|
if(%shapex <= %boundsWest) {
|
||||||
|
|
@ -541,16 +541,16 @@ function plzBounceOffGrid(%obj, %bounceForce, %count)
|
||||||
else if(%shapex >= %boundsEast) {
|
else if(%shapex >= %boundsEast) {
|
||||||
%vecx = -mAbs(%vecx);
|
%vecx = -mAbs(%vecx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%shapey <= %boundsNorth) {
|
if(%shapey <= %boundsNorth) {
|
||||||
%vecy = mAbs(%vecy);
|
%vecy = mAbs(%vecy);
|
||||||
}
|
}
|
||||||
else if(%shapey >= %boundsSouth) {
|
else if(%shapey >= %boundsSouth) {
|
||||||
%vecy = -mAbs(%vecy);
|
%vecy = -mAbs(%vecy);
|
||||||
}
|
}
|
||||||
|
|
||||||
%vec = %vecx SPC %vecy SPC %vecz;
|
%vec = %vecx SPC %vecy SPC %vecz;
|
||||||
|
|
||||||
// If the object's speed was pretty slow, give it a boost
|
// If the object's speed was pretty slow, give it a boost
|
||||||
%oldSpeed = VectorLen(%oldVel);
|
%oldSpeed = VectorLen(%oldVel);
|
||||||
if (%oldSpeed < 25)
|
if (%oldSpeed < 25)
|
||||||
|
|
@ -560,11 +560,11 @@ function plzBounceOffGrid(%obj, %bounceForce, %count)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
%vec = VectorScale(%vec, 1.15);
|
%vec = VectorScale(%vec, 1.15);
|
||||||
|
|
||||||
// apply the impulse to the object
|
// apply the impulse to the object
|
||||||
//%obj.applyImpulse(%obj.getWorldBoxCenter(), %vec);
|
//%obj.applyImpulse(%obj.getWorldBoxCenter(), %vec);
|
||||||
%obj.setVelocity(%vec);
|
%obj.setVelocity(%vec);
|
||||||
|
|
||||||
// repeat this bounce 4 times per second. if we're oob for 2 seconds, take action
|
// repeat this bounce 4 times per second. if we're oob for 2 seconds, take action
|
||||||
// don't do this with the flag because that has its own thread
|
// don't do this with the flag because that has its own thread
|
||||||
if( %obj.dataBlock !$= "Flag" ) {
|
if( %obj.dataBlock !$= "Flag" ) {
|
||||||
|
|
@ -582,7 +582,7 @@ function isOutOfBounds(%position)
|
||||||
%boundsNorth = getWord(%bounds, 1);
|
%boundsNorth = getWord(%bounds, 1);
|
||||||
%boundsEast = %boundsWest + getWord(%bounds, 2);
|
%boundsEast = %boundsWest + getWord(%bounds, 2);
|
||||||
%boundsSouth = %boundsNorth + getWord(%bounds, 3);
|
%boundsSouth = %boundsNorth + getWord(%bounds, 3);
|
||||||
|
|
||||||
return (%shapex < %boundsWest || %shapex > %boundsEast ||
|
return (%shapex < %boundsWest || %shapex > %boundsEast ||
|
||||||
%shapey < %boundsNorth || %shapey > %boundsSouth);
|
%shapey < %boundsNorth || %shapey > %boundsSouth);
|
||||||
}
|
}
|
||||||
|
|
@ -591,7 +591,7 @@ function DMGame::leaveMissionArea(%game, %playerData, %player)
|
||||||
{
|
{
|
||||||
if(%player.getState() $= "Dead")
|
if(%player.getState() $= "Dead")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
plzBounceOffGrid(%player, 65);
|
plzBounceOffGrid(%player, 65);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -607,7 +607,7 @@ function DMGame::DMAlertPlayer(%game, %count, %player)
|
||||||
|
|
||||||
function DMGame::MissionAreaDamage(%game, %player)
|
function DMGame::MissionAreaDamage(%game, %player)
|
||||||
{
|
{
|
||||||
if(%player.getState() !$= "Dead")
|
if(%player.getState() !$= "Dead")
|
||||||
{
|
{
|
||||||
%player.setDamageFlash(0.1);
|
%player.setDamageFlash(0.1);
|
||||||
%prevHurt = %player.getDamageLevel();
|
%prevHurt = %player.getDamageLevel();
|
||||||
|
|
@ -622,27 +622,27 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
{
|
{
|
||||||
// Clear the header:
|
// Clear the header:
|
||||||
messageClient( %client, 'SetScoreHudHeader', "", "" );
|
messageClient( %client, 'SetScoreHudHeader', "", "" );
|
||||||
|
|
||||||
// Send the subheader:
|
// Send the subheader:
|
||||||
messageClient(%client, 'SetScoreHudSubheader', "", '<tab:15,200,280,360,465>\tPLAYER\tRATING\tKILLS\tDEATHS\tBONUS');
|
messageClient(%client, 'SetScoreHudSubheader', "", '<tab:15,200,280,360,465>\tPLAYER\tRATING\tKILLS\tDEATHS\tBONUS');
|
||||||
|
|
||||||
for (%index = 0; %index < $TeamRank[0, count]; %index++)
|
for (%index = 0; %index < $TeamRank[0, count]; %index++)
|
||||||
{
|
{
|
||||||
//get the client info
|
//get the client info
|
||||||
%cl = $TeamRank[0, %index];
|
%cl = $TeamRank[0, %index];
|
||||||
|
|
||||||
//get the score
|
//get the score
|
||||||
%clScore = %cl.score;
|
%clScore = %cl.score;
|
||||||
|
|
||||||
%clKills = mFloatLength( %cl.kills, 0 );
|
%clKills = mFloatLength( %cl.kills, 0 );
|
||||||
%clDeaths = mFloatLength( %cl.deaths + %cl.suicides, 0 );
|
%clDeaths = mFloatLength( %cl.deaths + %cl.suicides, 0 );
|
||||||
%clBonus = mFloor((%cl.Bonus * %game.SCORE_PER_BONUS) + (%cl.MidAir * %game.SCORE_PER_MIDAIR) + (%cl.KillStreakBonus * %game.SCORE_PER_KILLSTREAKBONUS ));
|
%clBonus = mFloor((%cl.Bonus * %game.SCORE_PER_BONUS) + (%cl.MidAir * %game.SCORE_PER_MIDAIR) + (%cl.KillStreakBonus * %game.SCORE_PER_KILLSTREAKBONUS ));
|
||||||
%clStyle = %cl == %client ? "<color:dcdcdc>" : "";
|
%clStyle = %cl == %client ? "<color:dcdcdc>" : "";
|
||||||
|
|
||||||
//%BonusValue = %client.Bonus * %game.SCORE_PER_BONUS;
|
//%BonusValue = %client.Bonus * %game.SCORE_PER_BONUS;
|
||||||
//%MidAirValue = %client.MidAir * %game.SCORE_PER_MIDAIR;
|
//%MidAirValue = %client.MidAir * %game.SCORE_PER_MIDAIR;
|
||||||
//%KillStreakBonusValue = %client.KillStreakBonus * %game.SCORE_PER_KILLSTREAKBONUS;
|
//%KillStreakBonusValue = %client.KillStreakBonus * %game.SCORE_PER_KILLSTREAKBONUS;
|
||||||
|
|
||||||
//if the client is not an observer, send the message
|
//if the client is not an observer, send the message
|
||||||
if (%client.team != 0)
|
if (%client.team != 0)
|
||||||
{ // <tab:15,235,340,415,500>\%5\%1\%2\%3\tBG'
|
{ // <tab:15,235,340,415,500>\%5\%1\%2\%3\tBG'
|
||||||
|
|
@ -656,7 +656,7 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
%cl.name, %clScore, %clKills, %clDeaths, %clStyle, %cl, %clBonus);
|
%cl.name, %clScore, %clKills, %clDeaths, %clStyle, %cl, %clBonus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tack on the list of observers:
|
// Tack on the list of observers:
|
||||||
%observerCount = 0;
|
%observerCount = 0;
|
||||||
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||||
|
|
@ -665,7 +665,7 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
if (%cl.team == 0)
|
if (%cl.team == 0)
|
||||||
%observerCount++;
|
%observerCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (%observerCount > 0)
|
if (%observerCount > 0)
|
||||||
{
|
{
|
||||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
|
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
|
||||||
|
|
@ -686,7 +686,7 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//clear the rest of Hud so we don't get old lines hanging around...
|
//clear the rest of Hud so we don't get old lines hanging around...
|
||||||
messageClient( %client, 'ClearHud', "", %tag, %index );
|
messageClient( %client, 'ClearHud', "", %tag, %index );
|
||||||
}
|
}
|
||||||
|
|
@ -698,13 +698,13 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
|
|
||||||
package DMGame
|
package DMGame
|
||||||
{
|
{
|
||||||
|
|
||||||
function deployMineCheck(%mineObj, %player)
|
function deployMineCheck(%mineObj, %player)
|
||||||
{
|
{
|
||||||
// explode it vgc
|
// explode it vgc
|
||||||
schedule(2000, %mineObj, "explodeMine", %mineObj, true);
|
schedule(2000, %mineObj, "explodeMine", %mineObj, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Take out anything vehicle related
|
//Take out anything vehicle related
|
||||||
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
||||||
{
|
{
|
||||||
|
|
@ -714,19 +714,19 @@ package DMGame
|
||||||
{
|
{
|
||||||
%amount *= 1.3;
|
%amount *= 1.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%targetObject.client.armor $= "Heavy")
|
if(%targetObject.client.armor $= "Heavy")
|
||||||
{
|
{
|
||||||
%amount *= 1.43;
|
%amount *= 1.43;
|
||||||
}
|
}
|
||||||
|
|
||||||
//error("Armor::damageObject( "@%data@", "@%targetObject@", "@%sourceObject@", "@%position@", "@%amount@", "@%damageType@", "@%momVec@" )");
|
//error("Armor::damageObject( "@%data@", "@%targetObject@", "@%sourceObject@", "@%position@", "@%amount@", "@%damageType@", "@%momVec@" )");
|
||||||
if(%targetObject.invincible || %targetObject.getState() $= "Dead")
|
if(%targetObject.invincible || %targetObject.getState() $= "Dead")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
%targetClient = %targetObject.getOwnerClient();
|
%targetClient = %targetObject.getOwnerClient();
|
||||||
if(isObject(%mineSC))
|
if(isObject(%mineSC))
|
||||||
%sourceClient = %mineSC;
|
%sourceClient = %mineSC;
|
||||||
else
|
else
|
||||||
%sourceClient = isObject(%sourceObject) ? %sourceObject.getOwnerClient() : 0;
|
%sourceClient = isObject(%sourceObject) ? %sourceObject.getOwnerClient() : 0;
|
||||||
|
|
||||||
|
|
@ -740,8 +740,8 @@ package DMGame
|
||||||
//if (%sourceClient)
|
//if (%sourceClient)
|
||||||
// %sourceTeam = %sourceClient.getSensorGroup();
|
// %sourceTeam = %sourceClient.getSensorGroup();
|
||||||
//else if(%damageType == $DamageType::Suicide)
|
//else if(%damageType == $DamageType::Suicide)
|
||||||
// %sourceTeam = 0;
|
// %sourceTeam = 0;
|
||||||
|
|
||||||
// if teamdamage is off, and both parties are on the same team
|
// if teamdamage is off, and both parties are on the same team
|
||||||
// (but are not the same person), apply no damage
|
// (but are not the same person), apply no damage
|
||||||
//if(!$teamDamage && (%targetClient != %sourceClient) && (%targetTeam == %sourceTeam))
|
//if(!$teamDamage && (%targetClient != %sourceClient) && (%targetTeam == %sourceTeam))
|
||||||
|
|
@ -749,7 +749,7 @@ package DMGame
|
||||||
|
|
||||||
if(%targetObject.isShielded && %damageType != $DamageType::Blaster)
|
if(%targetObject.isShielded && %damageType != $DamageType::Blaster)
|
||||||
%amount = %data.checkShields(%targetObject, %position, %amount, %damageType);
|
%amount = %data.checkShields(%targetObject, %position, %amount, %damageType);
|
||||||
|
|
||||||
if(%amount == 0)
|
if(%amount == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -757,11 +757,11 @@ package DMGame
|
||||||
%damageScale = %data.damageScale[%damageType];
|
%damageScale = %data.damageScale[%damageType];
|
||||||
if(%damageScale !$= "")
|
if(%damageScale !$= "")
|
||||||
%amount *= %damageScale;
|
%amount *= %damageScale;
|
||||||
|
|
||||||
%flash = %targetObject.getDamageFlash() + (%amount * 2);
|
%flash = %targetObject.getDamageFlash() + (%amount * 2);
|
||||||
if (%flash > 0.75)
|
if (%flash > 0.75)
|
||||||
%flash = 0.75;
|
%flash = 0.75;
|
||||||
|
|
||||||
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
|
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
|
||||||
// No Schedules by DarkTiger Ver.2
|
// No Schedules by DarkTiger Ver.2
|
||||||
%targetClient.mineDisc = false;
|
%targetClient.mineDisc = false;
|
||||||
|
|
@ -770,17 +770,17 @@ package DMGame
|
||||||
case $DamageType::Disc:
|
case $DamageType::Disc:
|
||||||
if((getSimTime() - %targetClient.mdcTime1) < 256)
|
if((getSimTime() - %targetClient.mdcTime1) < 256)
|
||||||
%targetClient.mineDisc = true;
|
%targetClient.mineDisc = true;
|
||||||
|
|
||||||
%targetClient.mdcTime2 = getSimTime();
|
%targetClient.mdcTime2 = getSimTime();
|
||||||
|
|
||||||
case $DamageType::Mine:
|
case $DamageType::Mine:
|
||||||
if((getSimTime() - %targetClient.mdcTime2) < 256)
|
if((getSimTime() - %targetClient.mdcTime2) < 256)
|
||||||
%targetClient.mineDisc = true;
|
%targetClient.mineDisc = true;
|
||||||
|
|
||||||
%targetClient.mdcTime1 = getSimTime();
|
%targetClient.mdcTime1 = getSimTime();
|
||||||
}
|
}
|
||||||
// -- End Mine+Disc insert.
|
// -- End Mine+Disc insert.
|
||||||
|
|
||||||
%previousDamage = %targetObject.getDamagePercent();
|
%previousDamage = %targetObject.getDamagePercent();
|
||||||
%targetObject.setDamageFlash(%flash);
|
%targetObject.setDamageFlash(%flash);
|
||||||
%targetObject.applyDamage(%amount);
|
%targetObject.applyDamage(%amount);
|
||||||
|
|
@ -788,76 +788,69 @@ package DMGame
|
||||||
|
|
||||||
%targetClient.lastDamagedBy = %damagingClient;
|
%targetClient.lastDamagedBy = %damagingClient;
|
||||||
%targetClient.lastDamaged = getSimTime();
|
%targetClient.lastDamaged = getSimTime();
|
||||||
|
|
||||||
//now call the "onKilled" function if the client was... you know...
|
//now call the "onKilled" function if the client was... you know...
|
||||||
if(%targetObject.getState() $= "Dead")
|
if(%targetObject.getState() $= "Dead")
|
||||||
{
|
{
|
||||||
// where did this guy get it?
|
// where did this guy get it?
|
||||||
%damLoc = %targetObject.getDamageLocation(%position);
|
%damLoc = %targetObject.getDamageLocation(%position);
|
||||||
|
|
||||||
// should this guy be blown apart?
|
// should this guy be blown apart?
|
||||||
if( %damageType == $DamageType::Explosion ||
|
if( %damageType == $DamageType::Explosion ||
|
||||||
%damageType == $DamageType::Mortar ||
|
%damageType == $DamageType::Mortar ||
|
||||||
%damageType == $DamageType::SatchelCharge ||
|
%damageType == $DamageType::SatchelCharge ||
|
||||||
%damageType == $DamageType::Missile )
|
%damageType == $DamageType::Missile )
|
||||||
{
|
{
|
||||||
if( %previousDamage >= 0.35 ) // only if <= 35 percent damage remaining
|
if( %previousDamage >= 0.35 ) // only if <= 35 percent damage remaining
|
||||||
{
|
{
|
||||||
%targetObject.setMomentumVector(%momVec);
|
%targetObject.setMomentumVector(%momVec);
|
||||||
%targetObject.blowup();
|
%targetObject.blowup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we were killed, max out the flash
|
// If we were killed, max out the flash
|
||||||
%targetObject.setDamageFlash(0.75);
|
%targetObject.setDamageFlash(0.75);
|
||||||
|
|
||||||
%damLoc = %targetObject.getDamageLocation(%position);
|
%damLoc = %targetObject.getDamageLocation(%position);
|
||||||
Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc);
|
Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc);
|
||||||
}
|
}
|
||||||
else if ( %amount > 0.1 )
|
else if ( %amount > 0.1 )
|
||||||
{
|
{
|
||||||
if( %targetObject.station $= "" && %targetObject.isCloaked() )
|
if( %targetObject.station $= "" && %targetObject.isCloaked() )
|
||||||
{
|
{
|
||||||
%targetObject.setCloaked( false );
|
%targetObject.setCloaked( false );
|
||||||
%targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true );
|
%targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true );
|
||||||
}
|
}
|
||||||
|
|
||||||
playPain( %targetObject );
|
playPain( %targetObject );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function DMGame::sendGameVoteMenu(%game, %client, %key)
|
function DMGame::sendGameVoteMenu(%game, %client, %key)
|
||||||
{
|
{
|
||||||
parent::sendGameVoteMenu( %game, %client, %key );
|
parent::sendGameVoteMenu( %game, %client, %key );
|
||||||
|
|
||||||
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
||||||
|
|
||||||
if(!%client.canVote && !%isAdmin)
|
if(!%client.canVote && !%isAdmin)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( %game.scheduleVote $= "" )
|
if(%game.scheduleVote $= "")
|
||||||
{
|
{
|
||||||
if(!%client.isAdmin)
|
if(!%isAdmin || (%isAdmin && %client.ForceVote))
|
||||||
{
|
{
|
||||||
if(!$Host::DMSLOnlyMode)
|
if(!$Host::DMSLOnlyMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Vote to enable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable Shocklance Only Mode', 'Vote to enable Shocklance Only Mode' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Vote to disable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable Shocklance Only Mode', 'Vote to disable Shocklance Only Mode' );
|
||||||
}
|
|
||||||
else if (%client.ForceVote > 0)
|
|
||||||
{
|
|
||||||
if(!$Host::DMSLOnlyMode)
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Vote to enable Shocklance Only Mode' );
|
|
||||||
else
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Vote to disable Shocklance Only Mode' );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!$Host::DMSLOnlyMode)
|
if(!$Host::DMSLOnlyMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Enable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable Shocklance Only Mode', 'Enable Shocklance Only Mode' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Disable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable Shocklance Only Mode', 'Disable Shocklance Only Mode' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -869,7 +862,7 @@ function DMGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||||
case "DMSLOnlyMode":
|
case "DMSLOnlyMode":
|
||||||
%game.DMSLOnlyMode(%admin, %arg1, %arg2, %arg3, %arg4);
|
%game.DMSLOnlyMode(%admin, %arg1, %arg2, %arg3, %arg4);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
|
parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -884,17 +877,17 @@ function DMGame::DMSLOnlyMode(%game, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||||
if(%admin)
|
if(%admin)
|
||||||
{
|
{
|
||||||
killeveryone();
|
killeveryone();
|
||||||
|
|
||||||
if( $Host::DMSLOnlyMode )
|
if( $Host::DMSLOnlyMode )
|
||||||
{
|
{
|
||||||
messageAll('MsgAdminForce', '\c2The Admin has disabled Shocklance Only Mode.');
|
messageAll('MsgAdminForce', '\c2The Admin has disabled Shocklance Only Mode.');
|
||||||
|
|
||||||
$Host::DMSLOnlyMode = false;
|
$Host::DMSLOnlyMode = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
messageAll('MsgAdminForce', '\c2The Admin has enabled Shocklance Only Mode.');
|
messageAll('MsgAdminForce', '\c2The Admin has enabled Shocklance Only Mode.');
|
||||||
|
|
||||||
$Host::DMSLOnlyMode = true;
|
$Host::DMSLOnlyMode = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -904,17 +897,17 @@ function DMGame::DMSLOnlyMode(%game, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||||
if(%totalVotes > 0 && (%game.totalVotesFor / ClientGroup.getCount()) > ($Host::VotePasspercent / 100))
|
if(%totalVotes > 0 && (%game.totalVotesFor / ClientGroup.getCount()) > ($Host::VotePasspercent / 100))
|
||||||
{
|
{
|
||||||
killeveryone();
|
killeveryone();
|
||||||
|
|
||||||
if( $Host::DMSLOnlyMode )
|
if( $Host::DMSLOnlyMode )
|
||||||
{
|
{
|
||||||
messageAll('MsgVotePassed', '\c2Shocklance Only Mode Disabled.');
|
messageAll('MsgVotePassed', '\c2Shocklance Only Mode Disabled.');
|
||||||
|
|
||||||
$Host::DMSLOnlyMode = false;
|
$Host::DMSLOnlyMode = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
messageAll('MsgVotePassed', '\c2Shocklance Only Mode Enabled.');
|
messageAll('MsgVotePassed', '\c2Shocklance Only Mode Enabled.');
|
||||||
|
|
||||||
$Host::DMSLOnlyMode = true;
|
$Host::DMSLOnlyMode = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -932,13 +925,13 @@ function killEveryone(%ignore, %message)
|
||||||
else
|
else
|
||||||
messageAll('msgKillEveryone', %message);
|
messageAll('msgKillEveryone', %message);
|
||||||
|
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||||
{
|
{
|
||||||
%target = ClientGroup.getObject(%i);
|
%target = ClientGroup.getObject(%i);
|
||||||
|
|
||||||
if(!%target.player || %target.player == %ignore)
|
if(!%target.player || %target.player == %ignore)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
%target.player.blowup();
|
%target.player.blowup();
|
||||||
%target.player.scriptKill();
|
%target.player.scriptKill();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@
|
||||||
//
|
//
|
||||||
// v3.34 Febuary 2019
|
// v3.34 Febuary 2019
|
||||||
// Armor::damageObject rework
|
// Armor::damageObject rework
|
||||||
// Added SetNextMission support
|
|
||||||
// Indoor Spawning support
|
// Indoor Spawning support
|
||||||
//
|
//
|
||||||
// v3.33 January 2019
|
// v3.33 January 2019
|
||||||
|
|
@ -732,6 +731,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
}
|
}
|
||||||
else if(%points >= 100)
|
else if(%points >= 100)
|
||||||
{
|
{
|
||||||
|
blastFireworks();
|
||||||
messageAll('', '~wfx/Misc/Flair.wav');
|
messageAll('', '~wfx/Misc/Flair.wav');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1051,6 +1051,58 @@ function missileEveryone(%attacker)
|
||||||
if(Game.duelMode && %attacker.holdingFlag)
|
if(Game.duelMode && %attacker.holdingFlag)
|
||||||
%attacker.client.duelSeconds += 15;
|
%attacker.client.duelSeconds += 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function blastFireworks(%deezFireworks)
|
||||||
|
{
|
||||||
|
if(!ClientGroup.getCount())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// find a random client.
|
||||||
|
%client = ClientGroup.getObject(getRandom(ClientGroup.getCount() - 1));
|
||||||
|
|
||||||
|
if(isObject(%client.player) && isObject(Game))
|
||||||
|
{
|
||||||
|
%distance = Sky.visibleDistance;
|
||||||
|
if(!%distance || %distance > 250)
|
||||||
|
%distance = 250;
|
||||||
|
|
||||||
|
%position = %client.player.position;
|
||||||
|
// Vary by half of the visible distance.
|
||||||
|
%neg = getRandom(0, 1) - 1;
|
||||||
|
%x = getWord(%position, 0) + ((%distance - getRandom(%distance / 2)) * %neg);
|
||||||
|
%neg = getRandom(0, 1) - 1; // Randomize it again.
|
||||||
|
%y = getWord(%position, 1) + ((%distance - getRandom(%distance / 2)) * %neg);
|
||||||
|
%z = getWord(%position, 2) + (%distance - getRandom(%distance / 2));
|
||||||
|
|
||||||
|
%random = getRandom(1, $fireworkDatablockCount);
|
||||||
|
deezFireworksExplode(%x SPC %y SPC %z, %random);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(%deezFireworks <= 10)
|
||||||
|
{
|
||||||
|
%deezFireworks = %deezFireworks + 1;
|
||||||
|
$deezFireworksSchedule = schedule(getRandom(700), 0, "blastFireworks", %deezFireworks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function deezFireworksExplode(%position, %id)
|
||||||
|
{
|
||||||
|
%emitter = new ParticleEmissionDummy()
|
||||||
|
{
|
||||||
|
position = %position;
|
||||||
|
rotation = "1 0 0 0";
|
||||||
|
scale = "1 1 1";
|
||||||
|
datablock = "defaultEmissionDummy";
|
||||||
|
emitter = "FireworksEmitter" @ %id;
|
||||||
|
velocity = "1";
|
||||||
|
};
|
||||||
|
|
||||||
|
//echo(%emitter.position);
|
||||||
|
//serverPlay3d(dtFireworksSound, %emitter.position);
|
||||||
|
MissionCleanup.add(%emitter);
|
||||||
|
%emitter.schedule(1250, "delete");
|
||||||
|
}
|
||||||
|
|
||||||
function killEveryone(%ignore, %message)
|
function killEveryone(%ignore, %message)
|
||||||
{
|
{
|
||||||
if(!%message)
|
if(!%message)
|
||||||
|
|
@ -1119,42 +1171,20 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key )
|
||||||
|
|
||||||
if( %game.scheduleVote $= "" )
|
if( %game.scheduleVote $= "" )
|
||||||
{
|
{
|
||||||
if(!%isAdmin)
|
if(!%isAdmin || (%isAdmin && %client.ForceVote))
|
||||||
{
|
{
|
||||||
if(!Game.duelMode)
|
if(!Game.duelMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' );
|
||||||
|
|
||||||
if(!Game.noSplashDamage)
|
if(!Game.noSplashDamage)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' );
|
||||||
// DeVast - PubPro votes
|
if(!Game.PubPro) // DeVast - PubPro votes
|
||||||
if(!Game.PubPro)
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode (Disc, Blaster, Plasma Only)', 'Vote to enable Pro Mode (Disc, Blaster, Plasma Only)' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
|
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode (Disc, Blaster, Plasma Only)', 'Vote to disable Pro Mode (Disc, Blaster, Plasma Only)' );
|
||||||
}
|
|
||||||
//Added so lak vote items are properly displayed in evo adminvotemenu
|
|
||||||
//A lot of changes were added to admin.ovl in evo
|
|
||||||
//see footnotes below
|
|
||||||
else if (%client.ForceVote > 0)
|
|
||||||
{
|
|
||||||
if(!Game.duelMode)
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' );
|
|
||||||
else
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' );
|
|
||||||
|
|
||||||
if(!Game.noSplashDamage)
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' );
|
|
||||||
else
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' );
|
|
||||||
// DeVast - PubPro votes
|
|
||||||
if(!Game.PubPro)
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
|
|
||||||
else
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1162,16 +1192,14 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key )
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Enable Duel Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Enable Duel Mode' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Disable Duel Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Disable Duel Mode' );
|
||||||
|
|
||||||
if(!Game.noSplashDamage)
|
if(!Game.noSplashDamage)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Disable Splash Damage' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Disable Splash Damage' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Enable Splash Damage' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Enable Splash Damage' );
|
||||||
// DeVast - PubPro votes
|
if(!Game.PubPro) // DeVast - PubPro votes
|
||||||
if(!Game.PubPro)
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode (Disc, Blaster, Plasma Only)', 'Enable Pro Mode (Disc, Blaster, Plasma Only)' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Enable Pro Mode' );
|
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Disable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode (Disc, Blaster, Plasma Only)', 'Disable Pro Mode (Disc, Blaster, Plasma Only)' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2018,11 +2046,7 @@ function LakRabbitGame::gameOver(%game)
|
||||||
//call the default
|
//call the default
|
||||||
DefaultGame::gameOver(%game);
|
DefaultGame::gameOver(%game);
|
||||||
|
|
||||||
//send the message
|
|
||||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" );
|
|
||||||
|
|
||||||
cancel(%game.rabbitWaypointThread);
|
cancel(%game.rabbitWaypointThread);
|
||||||
messageAll('MsgClearObjHud', "");
|
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||||
{
|
{
|
||||||
%client = ClientGroup.getObject(%i);
|
%client = ClientGroup.getObject(%i);
|
||||||
|
|
@ -2039,6 +2063,18 @@ function LakRabbitGame::gameOver(%game)
|
||||||
|
|
||||||
%client.team = 0;
|
%client.team = 0;
|
||||||
%client.lastTeam = 0;
|
%client.lastTeam = 0;
|
||||||
|
|
||||||
|
if(!%client.isAIControlled())
|
||||||
|
{
|
||||||
|
//This is not a great way to do this...but...everything will be correct in all clients menus if its a change to ctf...
|
||||||
|
messageAll('MsgClientDrop', "", %client.name, %client);
|
||||||
|
messageAll('MsgClientJoin', "",%client.name, %client, %client.target,%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid);
|
||||||
|
messageClient(%client, 'MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team );
|
||||||
|
}
|
||||||
|
|
||||||
|
//send the message
|
||||||
|
messageClient(%client, 'MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" );
|
||||||
|
messageClient(%client, 'MsgClearObjHud', "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ilys -- cancel waypoint if not showing flag icon
|
// ilys -- cancel waypoint if not showing flag icon
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,7 @@ function SCtFGame::missionLoadDone(%game)
|
||||||
%game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 );
|
%game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 );
|
||||||
%game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 );
|
%game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 );
|
||||||
|
|
||||||
deleteNonSCtFObjectsFromMap();
|
deleteNonSCtFObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
function SCtFGame::clientMissionDropReady(%game, %client)
|
function SCtFGame::clientMissionDropReady(%game, %client)
|
||||||
|
|
@ -495,7 +495,7 @@ function SCtFGame::equip(%game, %player)
|
||||||
{
|
{
|
||||||
%player.clearInventory();
|
%player.clearInventory();
|
||||||
%player.setInventory(Disc,1);
|
%player.setInventory(Disc,1);
|
||||||
%player.setInventory(Blaster,1);
|
%player.setInventory(Shocklance,1);
|
||||||
%player.setInventory(GrenadeLauncher,1);
|
%player.setInventory(GrenadeLauncher,1);
|
||||||
%player.setInventory(DiscAmmo, %player.getDataBlock().max[DiscAmmo]);
|
%player.setInventory(DiscAmmo, %player.getDataBlock().max[DiscAmmo]);
|
||||||
%player.setInventory(GrenadeLauncherAmmo, %player.getDataBlock().max[GrenadeLauncherAmmo]);
|
%player.setInventory(GrenadeLauncherAmmo, %player.getDataBlock().max[GrenadeLauncherAmmo]);
|
||||||
|
|
@ -2214,33 +2214,26 @@ function SCtFGame::sendGameVoteMenu(%game, %client, %key)
|
||||||
if(!%client.canVote && !%isAdmin)
|
if(!%client.canVote && !%isAdmin)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( %game.scheduleVote $= "" )
|
if(%game.scheduleVote $= "")
|
||||||
{
|
{
|
||||||
if(!%client.isAdmin)
|
if(!%isAdmin || (%isAdmin && %client.ForceVote))
|
||||||
{
|
{
|
||||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Vote to change the Armor class' );
|
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Vote to change the Armor class' );
|
||||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' );
|
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' );
|
||||||
if(!$Host::SCtFProMode)
|
if(!$Host::SCtFProMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode (Disc, SL, GL Only)', 'Vote to enable Pro Mode (Disc, SL, GL Only)' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Vote to disable Pro Mode (Disc, SL, GL Only)' );
|
||||||
}
|
}
|
||||||
else if (%client.ForceVote > 0)
|
else
|
||||||
{
|
{
|
||||||
if(!$Host::SCtFProMode)
|
if(!$Host::SCtFProMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode (Disc, SL, GL Only)', 'Enable Pro Mode (Disc, SL, GL Only)' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Disable Pro Mode (Disc, SL, GL Only)' );
|
||||||
}
|
}
|
||||||
else
|
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Change the Armor class' );
|
||||||
{
|
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' );
|
||||||
if(!$Host::SCtFProMode)
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Enable Pro Mode' );
|
|
||||||
else
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Disable Pro Mode' );
|
|
||||||
}
|
|
||||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Change the Armor class' );
|
|
||||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2457,97 +2450,27 @@ function SCtFGame::SCtFProMode(%game, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||||
// playerStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4, %clientsVoting);
|
// playerStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4, %clientsVoting);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------DeleteObjects Code-------------------------------
|
|
||||||
//AutoRemove assets, sensors, and turrets from non-LT maps
|
//AutoRemove assets, sensors, and turrets from non-LT maps
|
||||||
//
|
function deleteNonSCtFObjects()
|
||||||
function getGroupObjectByName(%group, %name)
|
|
||||||
{
|
{
|
||||||
%numObjects = %group.getCount();
|
%c = 0;
|
||||||
|
InitContainerRadiusSearch("0 0 0", 9999, $TypeMasks::ItemObjectType |
|
||||||
|
$TypeMasks::TurretObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StaticShapeObjectType); //For FF: $TypeMasks::ForceFieldObjectType
|
||||||
|
while ((%obj = containerSearchNext()) != 0)
|
||||||
|
{
|
||||||
|
if(%obj.Datablock !$= "flag" && %obj.Datablock !$= "RepairKit" && %obj.Datablock !$= "RepairPatch") //Dont delete these...
|
||||||
|
{
|
||||||
|
%deleteList[%c] = %obj;
|
||||||
|
%c++;
|
||||||
|
}
|
||||||
|
|
||||||
for(%i = 0; %i < %numObjects; %i++)
|
}
|
||||||
{
|
for(%i = 0; %i < %c; %i++)
|
||||||
if (%group.getObject(%i).getClassName() $= %name)
|
{
|
||||||
return %group.getObject(%i);
|
%deleteList[%i].delete();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function deleteObjectsFromMapByType(%type)
|
|
||||||
{
|
|
||||||
%teamsGroup = getGroupObjectByName(MissionGroup, "Teams");
|
|
||||||
if (!isObject(%teamsGroup))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
%team1Group = getGroupObjectByName(%teamsGroup, "Team1");
|
|
||||||
if (!isObject(%team1Group))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
%team2Group = getGroupObjectByName(%teamsGroup, "Team2");
|
|
||||||
if (!isObject(%team2Group))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
%team1Base0Group = getGroupObjectByName(%team1Group, "Base0");
|
|
||||||
if (!isObject(%team1Base0Group))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
%team2Base0Group = getGroupObjectByName(%team2Group, "Base1");
|
|
||||||
if (!isObject(%team2Base0Group))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
deleteObjectsFromGroupByType(%team1Base0Group, %type);
|
|
||||||
deleteObjectsFromGroupByType(%team2Base0Group, %type);
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteObjectsFromGroupByType(%group, %type)
|
|
||||||
{
|
|
||||||
%noObjectsLeft = 0;
|
|
||||||
|
|
||||||
while (%noObjectsLeft == 0)
|
|
||||||
{
|
|
||||||
%i = 0;
|
|
||||||
%noObjectsLeft = 1;
|
|
||||||
%loop = 1;
|
|
||||||
%numObjects = %group.getCount();
|
|
||||||
|
|
||||||
while ((%loop == 1) && (%i < %numObjects))
|
|
||||||
{
|
|
||||||
%obj = %group.getObject(%i);
|
|
||||||
|
|
||||||
if (%obj.getClassName() $= "SimGroup")
|
|
||||||
deleteObjectsFromGroupByType(%obj, %type);
|
|
||||||
|
|
||||||
if (%obj.getClassName() $= %type)
|
|
||||||
{
|
|
||||||
%obj.delete();
|
|
||||||
%loop = 0;
|
|
||||||
%noObjectsLeft = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
%i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteNonSCtFObjectsFromMap()
|
|
||||||
{
|
|
||||||
deleteObjectsFromGroupByType(MissionGroup, "Turret");
|
|
||||||
deleteObjectsFromGroupByType(MissionGroup, "StaticShape");
|
|
||||||
deleteObjectsFromGroupByType(MissionGroup, "FlyingVehicle");
|
|
||||||
deleteObjectsFromGroupByType(MissionGroup, "WheeledVehicle");
|
|
||||||
deleteObjectsFromGroupByType(MissionGroup, "HoverVehicle");
|
|
||||||
deleteObjectsFromGroupByType(MissionGroup, "Waypoint");
|
|
||||||
//deleteObjectsFromGroupByType(MissionGroup, "ForceFieldBare");
|
|
||||||
//deleteObjectsFromGroupByType(MissionGroup, "Item");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//Delete all ForceField PhysicalZones (PZones)
|
||||||
|
// if(isObject(PZones))
|
||||||
|
// PZones.schedule(1500,"delete");
|
||||||
|
}
|
||||||
|
|
@ -52,3 +52,6 @@ function serverCmd(%client)
|
||||||
//Disable UE box on crash
|
//Disable UE box on crash
|
||||||
//Used if a clean crash is desired
|
//Used if a clean crash is desired
|
||||||
//memPatch("7dc7fc","90");
|
//memPatch("7dc7fc","90");
|
||||||
|
|
||||||
|
//Show Linux Icon in server list
|
||||||
|
//memPatch("5C9628","80CB05");
|
||||||
|
|
|
||||||
|
|
@ -28,47 +28,54 @@ function loadMissionStage2()
|
||||||
{
|
{
|
||||||
if($Host::TournamentMode && $Host::PUGautoPassword)
|
if($Host::TournamentMode && $Host::PUGautoPassword)
|
||||||
$Host::Password = $Host::PUGPassword;
|
$Host::Password = $Host::PUGPassword;
|
||||||
else if(!$Host::TournamentMode)
|
|
||||||
{
|
|
||||||
if($Host::Password)
|
|
||||||
$Host::Password = "";
|
|
||||||
if($LockedTeams)
|
|
||||||
$LockedTeams = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Set server mode to SPEED
|
//Set server mode to SPEED
|
||||||
$Host::HiVisibility = "0";
|
$Host::HiVisibility = 0;
|
||||||
}
|
}
|
||||||
else if($CurrentMissionType $= "LakRabbit")
|
else if($CurrentMissionType $= "LakRabbit")
|
||||||
{
|
{
|
||||||
if($Host::Password)
|
|
||||||
$Host::Password = "";
|
|
||||||
if($LockedTeams)
|
|
||||||
$LockedTeams = 0;
|
|
||||||
if($Host::TournamentMode)
|
if($Host::TournamentMode)
|
||||||
$Host::TournamentMode = 0;
|
$Host::TournamentMode = 0;
|
||||||
|
|
||||||
//Set server mode to DISTANCE
|
//Set server mode to DISTANCE
|
||||||
$Host::HiVisibility = "1";
|
$Host::HiVisibility = 1;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
$Host::Password = $Host::PUGPassword;
|
$Host::Password = $Host::PUGPassword;
|
||||||
$Host::HiVisibility = "0"; //always SPEED
|
$Host::HiVisibility = 0; //always SPEED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($Host::TournamentMode)
|
||||||
|
$Host::TimeLimit = 30; //TimeLimit Always 30 minutes in Tourney Mode
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Disable everything
|
||||||
|
if($Host::Password !$= "")
|
||||||
|
$Host::Password = "";
|
||||||
|
if($LockedTeams)
|
||||||
|
$LockedTeams = 0;
|
||||||
|
if($RestrictedVoting)
|
||||||
|
$RestrictedVoting = 0;
|
||||||
|
if($Host::AllowAdmin2Admin)
|
||||||
|
$Host::AllowAdmin2Admin = 0;
|
||||||
|
}
|
||||||
|
if(isActivePackage(LockedTeams) && !$LockedTeams)
|
||||||
|
deactivatePackage(LockedTeams);
|
||||||
|
|
||||||
//Siege NoBaseRape Fix
|
//Siege NoBaseRape Fix
|
||||||
if($CurrentMissionType $= "Siege")
|
if($CurrentMissionType $= "Siege")
|
||||||
$Host::NoBaseRapeEnabled = 0;
|
$Host::NoBaseRapeEnabled = 0;
|
||||||
else
|
else
|
||||||
$Host::NoBaseRapeEnabled = 1;
|
$Host::NoBaseRapeEnabled = 1;
|
||||||
|
|
||||||
if(isActivePackage(LockedTeams) && !$LockedTeams)
|
|
||||||
deactivatePackage(LockedTeams);
|
|
||||||
|
|
||||||
parent::loadMissionStage2();
|
parent::loadMissionStage2();
|
||||||
|
|
||||||
|
//Map Change Center Print. Used to advertise upcoming events
|
||||||
if($Host::MapChangeMSG)
|
if($Host::MapChangeMSG)
|
||||||
centerPrintAll($Host::MapChangeMSGContent, 12, 3);
|
centerPrintAll($Host::MapChangeMSGContent, 12, 3);
|
||||||
|
|
||||||
|
//Set random seed
|
||||||
|
setRandomSeed(getrandom(1,200000));
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ function Observer::onTrigger(%data, %obj, %trigger, %state)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// the flag isn't carried
|
// the flag isn't carried
|
||||||
if(%otherFlag.carrier $= "")
|
if(%otherFlag.carrier $= "")
|
||||||
observeFlag(%client, %otherFlag, 1, %otherFlagTeam);
|
observeFlag(%client, %otherFlag, 1, %otherFlagTeam);
|
||||||
|
|
@ -121,7 +121,15 @@ function Observer::setMode(%data, %obj, %mode, %targetObj)
|
||||||
default:
|
default:
|
||||||
Parent::setMode(%data, %obj, %mode, %targetObj);
|
Parent::setMode(%data, %obj, %mode, %targetObj);
|
||||||
}
|
}
|
||||||
%obj.mode = %mode;
|
%obj.mode = %mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
function serverCmdObserveClient(%client, %target)
|
||||||
|
{
|
||||||
|
%client.observeFlyClient = "";
|
||||||
|
%client.observingFlag = false;
|
||||||
|
|
||||||
|
parent::serverCmdObserveClient(%client, %target);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
@ -134,14 +142,14 @@ function serverCmdObserveFirstFlag(%client)
|
||||||
{
|
{
|
||||||
if(Game.class !$= CTFGame && Game.class !$= SCtFGame)
|
if(Game.class !$= CTFGame && Game.class !$= SCtFGame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// client must be an observer
|
// client must be an observer
|
||||||
if(%client.team > 0 || !$Observers) //$Observers added; Serverside var; Needs to have value to work correctly
|
if(%client.team > 0 || !$Observers) //$Observers added; Serverside var; Needs to have value to work correctly
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// check if the flag is carried by someone
|
// check if the flag is carried by someone
|
||||||
%player = $TeamFlag[1].carrier;
|
%player = $TeamFlag[1].carrier;
|
||||||
|
|
||||||
if($TeamFlag[1].isHome || %player $= "")
|
if($TeamFlag[1].isHome || %player $= "")
|
||||||
observeFlag(%client, $TeamFlag[1], 1, 1);
|
observeFlag(%client, $TeamFlag[1], 1, 1);
|
||||||
else
|
else
|
||||||
|
|
@ -152,14 +160,14 @@ function serverCmdObserveSecondFlag(%client)
|
||||||
{
|
{
|
||||||
if(Game.class !$= CTFGame && Game.class !$= SCtFGame)
|
if(Game.class !$= CTFGame && Game.class !$= SCtFGame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// client must be an observer
|
// client must be an observer
|
||||||
if(%client.team > 0 || !$Observers) //$Observers added; Serverside var; Needs to have value to work correctly
|
if(%client.team > 0 || !$Observers) //$Observers added; Serverside var; Needs to have value to work correctly
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// check if the flag is carried by someone
|
// check if the flag is carried by someone
|
||||||
%player = $TeamFlag[2].carrier;
|
%player = $TeamFlag[2].carrier;
|
||||||
|
|
||||||
if($TeamFlag[2].isHome || %player $= "")
|
if($TeamFlag[2].isHome || %player $= "")
|
||||||
observeFlag(%client, $TeamFlag[2], 1, 2);
|
observeFlag(%client, $TeamFlag[2], 1, 2);
|
||||||
else
|
else
|
||||||
|
|
@ -173,27 +181,27 @@ function observeFlag(%client, %target, %type, %flagTeam)
|
||||||
{
|
{
|
||||||
if(!isObject(%client) || !isObject(%target) || !isObject(%client.camera))
|
if(!isObject(%client) || !isObject(%target) || !isObject(%client.camera))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(Game.class !$= CTFGame && Game.class !$= SCtFGame)
|
if(Game.class !$= CTFGame && Game.class !$= SCtFGame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(%client.team > 0)
|
if(%client.team > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// cancel any scheduled update
|
// cancel any scheduled update
|
||||||
if(isEventPending(%client.obsHudSchedule))
|
if(isEventPending(%client.obsHudSchedule))
|
||||||
cancel(%client.obsHudSchedule);
|
cancel(%client.obsHudSchedule);
|
||||||
|
|
||||||
// must be an observer when observing other clients
|
// must be an observer when observing other clients
|
||||||
if(%client.getControlObject() != %client.camera)
|
if(%client.getControlObject() != %client.camera)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//can't observer yourself
|
//can't observer yourself
|
||||||
if(%client == %target)
|
if(%client == %target)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
%count = ClientGroup.getCount();
|
%count = ClientGroup.getCount();
|
||||||
|
|
||||||
//can't go into observer mode if you're the only client
|
//can't go into observer mode if you're the only client
|
||||||
if(%count <= 1 && %type != 1)
|
if(%count <= 1 && %type != 1)
|
||||||
return;
|
return;
|
||||||
|
|
@ -202,18 +210,18 @@ function observeFlag(%client, %target, %type, %flagTeam)
|
||||||
{
|
{
|
||||||
if(isObject(%client.player))
|
if(isObject(%client.player))
|
||||||
%client.player.scriptKill(0); // the player is still playing (this shouldn't be happen)
|
%client.player.scriptKill(0); // the player is still playing (this shouldn't be happen)
|
||||||
|
|
||||||
%client.camera.getDataBlock().setMode(%client.camera, "followFlag", $TeamFlag[%flagTeam]);
|
%client.camera.getDataBlock().setMode(%client.camera, "followFlag", $TeamFlag[%flagTeam]);
|
||||||
%client.setControlObject(%client.camera);
|
%client.setControlObject(%client.camera);
|
||||||
clearBottomPrint(%client);
|
clearBottomPrint(%client);
|
||||||
|
|
||||||
// was the client observing a player before?
|
// was the client observing a player before?
|
||||||
if(%client.observeClient != -1)
|
if(%client.observeClient != -1)
|
||||||
{
|
{
|
||||||
observerFollowUpdate(%client, -1, false);
|
observerFollowUpdate(%client, -1, false);
|
||||||
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
||||||
%client.observeClient = -1;
|
%client.observeClient = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Player
|
else // Player
|
||||||
{
|
{
|
||||||
|
|
@ -232,22 +240,23 @@ function observeFlag(%client, %target, %type, %flagTeam)
|
||||||
if(!%found)
|
if(!%found)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isObject(%client.player))
|
if(isObject(%client.player))
|
||||||
%client.player.scriptKill(0); // the player is still playing (this shouldn't be happen)
|
%client.player.scriptKill(0); // the player is still playing (this shouldn't be happen)
|
||||||
|
|
||||||
observerFollowUpdate(%client, %target, true);
|
observerFollowUpdate(%client, %target, true);
|
||||||
displayObserverHud(%client, %target);
|
displayObserverHud(%client, %target);
|
||||||
messageClient(%target, 'Observer', '\c1%1 is now observing you.', %client.name);
|
messageClient(%target, 'Observer', '\c1%1 is now observing you.', %client.name);
|
||||||
|
|
||||||
// was the client observing a player before?
|
// was the client observing a player before?
|
||||||
if(%client.observeClient != -1)
|
if(%client.observeClient != -1)
|
||||||
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
||||||
|
|
||||||
%client.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player);
|
%client.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player);
|
||||||
%client.setControlObject(%client.camera);
|
%client.setControlObject(%client.camera);
|
||||||
%client.observeClient = %target;
|
%client.observeClient = %target;
|
||||||
}
|
}
|
||||||
|
|
||||||
//clear the observer fly mode var...
|
//clear the observer fly mode var...
|
||||||
%client.observeFlyClient = -1;
|
%client.observeFlyClient = -1;
|
||||||
%client.observingFlag = true;
|
%client.observingFlag = true;
|
||||||
|
|
|
||||||
|
|
@ -7,25 +7,27 @@
|
||||||
package ObserverTimeout
|
package ObserverTimeout
|
||||||
{
|
{
|
||||||
|
|
||||||
function serverCmdClientMakeObserver( %client )
|
function serverCmdClientMakeObserver(%client)
|
||||||
{
|
{
|
||||||
//10 second cooldown on becoming an observer
|
//10 second cooldown on becoming an observer
|
||||||
%timeDif = getSimTime() - %client.observerTimeout;
|
%timeDif = getSimTime() - %client.observerTimeout;
|
||||||
%timeDif1 = getSimTime() - %client.observerMsg;
|
%timeDif1 = getSimTime() - %client.observerMsg;
|
||||||
if(%timeDif > 10000 || !%client.observerTimeout || %client.isAdmin)
|
if(%timeDif > 10000 || !%client.observerTimeout || %client.isAdmin)
|
||||||
{
|
{
|
||||||
if ( isObject( Game ) && Game.kickClient != %client )
|
|
||||||
Game.forceObserver( %client, "playerChoose" );
|
|
||||||
|
|
||||||
%client.observerProtectStart = getSimTime();
|
%client.observerProtectStart = getSimTime();
|
||||||
%client.observerTimeout = getSimTime();
|
%client.observerTimeout = getSimTime();
|
||||||
|
|
||||||
|
if (isObject(Game) && Game.kickClient != %client)
|
||||||
|
Game.forceObserver(%client, "playerChoose");
|
||||||
|
if($Host::TournamentMode) //Added to clear FIRE centerPrint
|
||||||
|
ClearCenterPrint(%client);
|
||||||
}
|
}
|
||||||
//1 second cooldown on message
|
//1 second cooldown on message
|
||||||
else if((%timeDif1 > 1000 || !%client.observerMsg))
|
else if((%timeDif1 > 1000 || !%client.observerMsg))
|
||||||
{
|
{
|
||||||
%wait = mFloor((10000 - (getSimTime() - %client.observerProtectStart)) / 1000);
|
%wait = mFloor((10000 - (getSimTime() - %client.observerProtectStart)) / 1000);
|
||||||
messageClient(%client, 'MsgObserverCooldown', '\c3Observer Cooldown:\cr Please wait another %1 seconds.', %wait );
|
messageClient(%client, 'MsgObserverCooldown', '\c3Observer Cooldown:\cr Please wait another %1 seconds.', %wait );
|
||||||
|
|
||||||
%client.observerMsg = getSimTime();
|
%client.observerMsg = getSimTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,17 +5,17 @@ package TKwarn
|
||||||
|
|
||||||
// From Evo
|
// From Evo
|
||||||
function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType)
|
function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType)
|
||||||
{
|
{
|
||||||
if(!$countdownStarted && !$MatchStarted)
|
if(!$countdownStarted && !$MatchStarted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
%tk = Parent::testTeamKill(%game, %victimID, %killerID);
|
%tk = Parent::testTeamKill(%game, %victimID, %killerID);
|
||||||
if(!%tk)
|
if(!%tk)
|
||||||
return false; // is not a tk
|
return false; // is not a tk
|
||||||
|
|
||||||
// No Bots
|
// No Bots
|
||||||
//if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled())
|
//if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled())
|
||||||
// return true;
|
//return true;
|
||||||
|
|
||||||
// Log TeamKill
|
// Log TeamKill
|
||||||
teamkillLog(%victimID, %killerID, %damageType);
|
teamkillLog(%victimID, %killerID, %damageType);
|
||||||
|
|
@ -23,7 +23,7 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType)
|
||||||
//No warnings in tournament mode
|
//No warnings in tournament mode
|
||||||
if($Host::TournamentMode)
|
if($Host::TournamentMode)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// No Admins
|
// No Admins
|
||||||
if(%killerID.isAdmin)
|
if(%killerID.isAdmin)
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -31,7 +31,7 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType)
|
||||||
// Ignore this map
|
// Ignore this map
|
||||||
if($CurrentMission $= "Mac_FlagArena" || $CurrentMission $= "Machineeggs")
|
if($CurrentMission $= "Mac_FlagArena" || $CurrentMission $= "Machineeggs")
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// warn the player of the imminent kick vote
|
// warn the player of the imminent kick vote
|
||||||
if((%killerID.teamkills == $Host::TKWarn1 - 1) && $Host::TKWarn1 != 0)
|
if((%killerID.teamkills == $Host::TKWarn1 - 1) && $Host::TKWarn1 != 0)
|
||||||
centerprint(%killerID, "You are receiving this warning for inappropriate teamkilling.\nBehave or a vote to kick will be started.", 10, 2);
|
centerprint(%killerID, "You are receiving this warning for inappropriate teamkilling.\nBehave or a vote to kick will be started.", 10, 2);
|
||||||
|
|
@ -61,7 +61,7 @@ if (!isActivePackage(TKwarn))
|
||||||
function TKkick( %client, %admin, %guid )
|
function TKkick( %client, %admin, %guid )
|
||||||
{
|
{
|
||||||
messageAll( 'MsgAdminForce', '\c2%1 has been autokicked for teamkilling.', %client.name ); // z0dd - ZOD, 7/13/03. Tell who kicked
|
messageAll( 'MsgAdminForce', '\c2%1 has been autokicked for teamkilling.', %client.name ); // z0dd - ZOD, 7/13/03. Tell who kicked
|
||||||
|
|
||||||
messageClient(%client, 'onClientKicked', "");
|
messageClient(%client, 'onClientKicked', "");
|
||||||
messageAllExcept( %client, -1, 'MsgClientDrop', "", Game.kickClientName, %client );
|
messageAllExcept( %client, -1, 'MsgClientDrop', "", Game.kickClientName, %client );
|
||||||
|
|
||||||
|
|
@ -87,12 +87,12 @@ function TKkick( %client, %admin, %guid )
|
||||||
%cl = ClientGroup.getObject( %i );
|
%cl = ClientGroup.getObject( %i );
|
||||||
if( %cl.guid == %guid )
|
if( %cl.guid == %guid )
|
||||||
{
|
{
|
||||||
%found = true;
|
%found = true;
|
||||||
|
|
||||||
// kill and delete this client, their done in this server.
|
// kill and delete this client, their done in this server.
|
||||||
if( isObject( %cl.player ) )
|
if( isObject( %cl.player ) )
|
||||||
%cl.player.scriptKill(0);
|
%cl.player.scriptKill(0);
|
||||||
|
|
||||||
if ( isObject( %cl ) )
|
if ( isObject( %cl ) )
|
||||||
{
|
{
|
||||||
%client.setDisconnectReason( "You have been kicked out of the game for teamkilling." ); // z0dd - ZOD, 7/13/03. Tell who kicked
|
%client.setDisconnectReason( "You have been kicked out of the game for teamkilling." ); // z0dd - ZOD, 7/13/03. Tell who kicked
|
||||||
|
|
@ -100,17 +100,17 @@ function TKkick( %client, %admin, %guid )
|
||||||
}
|
}
|
||||||
// ban by IP as well
|
// ban by IP as well
|
||||||
BanList::add( %guid, %client.getAddress(), $Host::KickBanTime );
|
BanList::add( %guid, %client.getAddress(), $Host::KickBanTime );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !%found )
|
if( !%found )
|
||||||
BanList::add( %guid, "0", $Host::KickBanTime ); // keep this guy out for a while since he left.
|
BanList::add( %guid, "0", $Host::KickBanTime ); // keep this guy out for a while since he left.
|
||||||
}
|
}
|
||||||
else // lan games
|
else // lan games
|
||||||
{
|
{
|
||||||
// kill and delete this client
|
// kill and delete this client
|
||||||
if( isObject( %client.player ) )
|
if( isObject( %client.player ) )
|
||||||
%client.player.scriptKill(0);
|
%client.player.scriptKill(0);
|
||||||
|
|
||||||
if ( isObject( %client ) )
|
if ( isObject( %client ) )
|
||||||
{
|
{
|
||||||
%client.setDisconnectReason( "You have been kicked out of the game for teamkilling." );
|
%client.setDisconnectReason( "You have been kicked out of the game for teamkilling." );
|
||||||
|
|
@ -124,7 +124,7 @@ function TKkick( %client, %admin, %guid )
|
||||||
// From Evo
|
// From Evo
|
||||||
// Info: Auto start a new vote
|
// Info: Auto start a new vote
|
||||||
function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4)
|
function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4)
|
||||||
{
|
{
|
||||||
// works only for kicking players
|
// works only for kicking players
|
||||||
if(%typeName !$= "VoteKickPlayer")
|
if(%typeName !$= "VoteKickPlayer")
|
||||||
return;
|
return;
|
||||||
|
|
@ -132,38 +132,78 @@ function TKvote(%typeName, %arg1, %arg2, %arg3, %arg4)
|
||||||
// only works for FFA mode
|
// only works for FFA mode
|
||||||
if($Host::TournamentMode)
|
if($Host::TournamentMode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// a vote is already running, cancel it
|
|
||||||
if(Game.scheduleVote !$= "")
|
|
||||||
stopCurrentVote();
|
|
||||||
|
|
||||||
%clientsVoting = 0;
|
|
||||||
|
|
||||||
// admins can't be kicked
|
// admins can't be kicked
|
||||||
if(%arg1.isAdmin)
|
if(%arg1.isAdmin)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//Stop current votes
|
||||||
|
if(Game.scheduleVote !$= "")
|
||||||
|
{
|
||||||
|
//Added for vote overtime
|
||||||
|
//Dont stop if under 90 secs left
|
||||||
|
%curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime();
|
||||||
|
if(%curTimeLeftMS <= 90000)
|
||||||
|
{
|
||||||
|
//log it
|
||||||
|
$tkvoteLog = formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC "[Autovote Cancelled]" SPC %arg1.nameBase @ "(" @ %arg1.guid @ ")" SPC "Teamkill Autovote cancelled due insufficient time. #P[" @ $HostGamePlayerCount @ "]" SPC "CM[" @ $CurrentMission @ "]";
|
||||||
|
if($Host::ClassicTeamKillLog)
|
||||||
|
{
|
||||||
|
%logpath = $Host::ClassicTeamKillLogPath;
|
||||||
|
export("$tkvoteLog", %logpath, true);
|
||||||
|
logEcho($tkvoteLog);
|
||||||
|
}
|
||||||
|
echo($tkvoteLog);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else //Stop any current votes
|
||||||
|
{
|
||||||
|
//Notify clients the vote is being cancelled
|
||||||
|
for(%i = 0; %i < %count; %i++)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
if(%cl !$= %arg1) //dont notify the team killer
|
||||||
|
messageClient(%cl, 'VoteStarted', '\c2Vote has been cancelled due to teamkill autovote.');
|
||||||
|
}
|
||||||
|
stopCurrentVote();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//notify any admins on the other team
|
||||||
|
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
if (%cl.isAdmin == true)
|
||||||
|
{
|
||||||
|
if(%cl.team !$= %arg1.team) //Not on admins team
|
||||||
|
messageClient(%cl, '', '\c5[A]\c1%1 \c0Teamkill Autovote started to kick %2 on the other team.~wgui/objective_notification.wav', "Vote in Progress:", %arg1.nameBase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo(formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC "Teamkill Autovote started for..." SPC %arg1.nameBase @ "(" @ %arg1.guid @ ")" SPC "#P[" @ $HostGamePlayerCount @ "]" SPC "CM[" @ $CurrentMission @ "]");
|
||||||
|
|
||||||
|
%clientsVoting = 0;
|
||||||
|
|
||||||
Game.kickClient = %arg1;
|
Game.kickClient = %arg1;
|
||||||
Game.kickClientName = %arg1.name;
|
Game.kickClientName = %arg1.name;
|
||||||
Game.kickGuid = %arg1.guid;
|
Game.kickGuid = %arg1.guid;
|
||||||
Game.kickTeam = %arg1.team;
|
Game.kickTeam = %arg1.team;
|
||||||
|
|
||||||
%count = ClientGroup.getCount();
|
%count = ClientGroup.getCount();
|
||||||
for(%i = 0; %i < %count; %i++)
|
for(%i = 0; %i < %count; %i++)
|
||||||
{
|
{
|
||||||
%cl = ClientGroup.getObject(%i);
|
%cl = ClientGroup.getObject(%i);
|
||||||
if(%cl.team == %arg1.team && !%cl.isAIControlled() && %cl !$= %arg1)
|
if(%cl.team == %arg1.team && !%cl.isAIControlled() && %cl !$= %arg1)
|
||||||
{
|
{
|
||||||
messageClient(%cl, 'VoteStarted', '\c2Vote initiated to kick the teamkiller %1 with %2 teamkills.', %arg1.name, $Host::TKWarn2);
|
messageClient(%cl, 'VoteStarted', '\c2Vote initiated to kick the teamkiller %1 with %2 teamkills.', %arg1.name, $Host::TKWarn2);
|
||||||
%clientsVoting++;
|
%clientsVoting++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(%i = 0; %i < %count; %i++)
|
for(%i = 0; %i < %count; %i++)
|
||||||
{
|
{
|
||||||
%cl = ClientGroup.getObject(%i);
|
%cl = ClientGroup.getObject(%i);
|
||||||
if(%cl.team == %arg1.team && !%cl.isAIControlled() && %cl !$= %arg1)
|
if(%cl.team == %arg1.team && !%cl.isAIControlled() && %cl !$= %arg1)
|
||||||
messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100));
|
messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
clearVotes();
|
clearVotes();
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ function stationTrigger::onEnterTrigger(%data, %obj, %colObj)
|
||||||
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
||||||
{
|
{
|
||||||
//Takes 11 blaster shots to kill a heavy, 13 normal.
|
//Takes 11 blaster shots to kill a heavy, 13 normal.
|
||||||
if(%targetObject.client.armor $= "Heavy" && %damageType $= $DamageType::Blaster)
|
if(%targetObject.client.armor $= "Heavy" && %damageType $= $DamageType::Blaster && !$Host::TournamentMode) //Free-for-all only
|
||||||
%amount *= 1.15;
|
%amount *= 1.15;
|
||||||
|
|
||||||
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||||
|
|
@ -298,6 +298,42 @@ function ConcussionGrenadeThrown::onThrow(%this, %gren)
|
||||||
%gren.detThread = schedule(1800, %gren, "detonateGrenade", %gren); // Was 2000
|
%gren.detThread = schedule(1800, %gren, "detonateGrenade", %gren); // Was 2000
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Attack LOS Sky Fix
|
||||||
|
function serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap)
|
||||||
|
{
|
||||||
|
%obj = getTargetObject(%client.getTargetId());
|
||||||
|
if(isObject(%obj))
|
||||||
|
{
|
||||||
|
if(%obj.getClassName() $= "Player" && !%client.player.ccActive)
|
||||||
|
{
|
||||||
|
%vec = %client.player.getMuzzleVector(0);
|
||||||
|
%vec2 = vectorNormalize(vectorSub(%obj.getWorldBoxCenter(), %client.player.getMuzzlePoint(%slot)));
|
||||||
|
%dot = vectorDot(%vec, %vec2);
|
||||||
|
if(%dot < 0.9)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
function serverCmdScopeCommanderMap(%client, %scope)
|
||||||
|
{
|
||||||
|
parent::serverCmdScopeCommanderMap(%client, %scope);
|
||||||
|
%client.player.ccActive = %scope;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Mortar Throw Reload Fix
|
||||||
|
function ShapeBase::throwWeapon(%this)
|
||||||
|
{
|
||||||
|
if((%this.getMountedImage($WeaponSlot).getName() $= "MortarImage" || %this.getMountedImage($WeaponSlot).getName() $= "MissileLauncherImage" || %this.getMountedImage($WeaponSlot).getName() $= "ShockLanceImage") &&
|
||||||
|
(%this.getImageState($WeaponSlot) $= "Reload" || %this.getImageState($WeaponSlot) $= "Fire")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::throwWeapon(%this);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Prevent package from being activated if it is already
|
// Prevent package from being activated if it is already
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ function CreateServer( %mission, %missionType )
|
||||||
//Call for a GetTeamCount update
|
//Call for a GetTeamCount update
|
||||||
GetTeamCounts(%game);
|
GetTeamCounts(%game);
|
||||||
|
|
||||||
// Prevent package from being activated if it is already
|
//Prevent package from being activated if it is already
|
||||||
if (!isActivePackage(TeamCountsTriggers))
|
if (!isActivePackage(TeamCountsTriggers))
|
||||||
activatePackage(TeamCountsTriggers);
|
activatePackage(TeamCountsTriggers);
|
||||||
}
|
}
|
||||||
|
|
@ -55,12 +55,15 @@ function GetTeamCounts(%game)
|
||||||
|
|
||||||
if( !$Host::TournamentMode )
|
if( !$Host::TournamentMode )
|
||||||
{
|
{
|
||||||
if( $CurrentMissionType $= "CTF" )
|
if($CurrentMissionType $= "CTF")
|
||||||
{
|
{
|
||||||
NBRStatusNotify(%game);
|
NBRStatusNotify(%game);
|
||||||
CheckAntiPack(%game);
|
CheckAntiPack(%game);
|
||||||
}
|
}
|
||||||
TeamBalanceNotify(%game);
|
else if($CurrentMissionType $= "DM")
|
||||||
|
CheckAntiPack(%game);
|
||||||
|
|
||||||
|
TeamBalanceNotify(%game); //Has check for # teams
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set so counter wont run when it doesnt need to.
|
//Set so counter wont run when it doesnt need to.
|
||||||
|
|
@ -172,6 +175,9 @@ function GameConnection::onDrop(%client, %reason)
|
||||||
// Called in GetTeamCounts
|
// Called in GetTeamCounts
|
||||||
function TeamBalanceNotify(%game)
|
function TeamBalanceNotify(%game)
|
||||||
{
|
{
|
||||||
|
if(!$Host::EnableTeamBalanceNotify && !$Host::EnableAutobalance)
|
||||||
|
return;
|
||||||
|
|
||||||
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 )
|
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 )
|
||||||
{
|
{
|
||||||
//Uneven
|
//Uneven
|
||||||
|
|
@ -225,6 +231,9 @@ function NotifyUnbalanced( %game )
|
||||||
if(isEventPending($NotifySchedule))
|
if(isEventPending($NotifySchedule))
|
||||||
cancel($NotifySchedule);
|
cancel($NotifySchedule);
|
||||||
|
|
||||||
|
if(!$Host::EnableTeamBalanceNotify && !$Host::EnableAutobalance)
|
||||||
|
return;
|
||||||
|
|
||||||
if( $TBNStatus !$= "NOTIFY" ) //If Status has changed to EVEN or anything else (GameOver reset).
|
if( $TBNStatus !$= "NOTIFY" ) //If Status has changed to EVEN or anything else (GameOver reset).
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -357,6 +366,9 @@ function Autobalance( %game )
|
||||||
if(isEventPending($AutoBalanceSchedule))
|
if(isEventPending($AutoBalanceSchedule))
|
||||||
cancel($AutoBalanceSchedule);
|
cancel($AutoBalanceSchedule);
|
||||||
|
|
||||||
|
if(!$Host::EnableAutobalance)
|
||||||
|
return;
|
||||||
|
|
||||||
if($TBNStatus !$= "NOTIFY") //If Status has changed to EVEN or anything else (GameOver reset).
|
if($TBNStatus !$= "NOTIFY") //If Status has changed to EVEN or anything else (GameOver reset).
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
200
Classic/scripts/autoexec/dtBanSystem.cs
Executable file → Normal file
200
Classic/scripts/autoexec/dtBanSystem.cs
Executable file → Normal file
|
|
@ -11,12 +11,12 @@
|
||||||
//$dtBanList::GUID3555379 = "4\t2021\t18\t31\t518400";
|
//$dtBanList::GUID3555379 = "4\t2021\t18\t31\t518400";
|
||||||
|
|
||||||
//TO UNBAN SOMEONE WITHOUT RESTARTING THE SERVER
|
//TO UNBAN SOMEONE WITHOUT RESTARTING THE SERVER
|
||||||
//unban(%guid,%ip); in console
|
//banList();in console
|
||||||
//Example: unban(555555,"22.222.222.222"); put ip in quotes
|
//unbanIndex(%index) %index is the number next to the players name from listBans();
|
||||||
|
//Example: unbanold(555555,"22.222.222.222"); put ip in quotes
|
||||||
|
|
||||||
package dtBan
|
package dtBan
|
||||||
{
|
{
|
||||||
|
|
||||||
function ClassicLoadBanlist()
|
function ClassicLoadBanlist()
|
||||||
{
|
{
|
||||||
$ClassicPermaBans = 0;
|
$ClassicPermaBans = 0;
|
||||||
|
|
@ -30,21 +30,43 @@ function BanList::add(%guid, %ipAddress, %time){
|
||||||
if(%time > 999999){
|
if(%time > 999999){
|
||||||
%time = "BAN";
|
%time = "BAN";
|
||||||
}
|
}
|
||||||
|
%name = getClientBanName(%guid, %ipAddress);
|
||||||
if (%guid > 0){
|
if (%guid > 0){
|
||||||
$dtBanList::GUID[%guid] = dtBanMark() TAB %time;
|
$dtBanList::GUID[%guid] = dtBanMark() TAB %time TAB %name;
|
||||||
}
|
}
|
||||||
if (getSubStr(%ipAddress, 0, 3) $= "IP:"){
|
if (getSubStr(%ipAddress, 0, 3) $= "IP:"){
|
||||||
// add IP ban
|
|
||||||
%bareIP = getSubStr(%ipAddress, 3, strLen(%ipAddress));
|
%bareIP = getSubStr(%ipAddress, 3, strLen(%ipAddress));
|
||||||
%bareIP = getSubStr(%bareIP, 0, strstr(%bareIP, ":"));
|
%bareIP = getSubStr(%bareIP, 0, strstr(%bareIP, ":"));
|
||||||
%bareIP = strReplace(%bareIP, ".", "_"); // variable access bug workaround
|
%bareIP = strReplace(%bareIP, ".", "_"); // variable access bug workaround
|
||||||
|
// add IP ban
|
||||||
$dtBanList::IP[%bareIP] = dtBanMark() TAB %time;
|
$dtBanList::IP[%bareIP] = dtBanMark() TAB %time TAB %name;
|
||||||
//error("ban" SPC %bareIP SPC $dtBanList::IP[%bareIP]);
|
|
||||||
}
|
}
|
||||||
|
%found = 0;
|
||||||
// write out the updated bans to the file
|
%eIndex = -1;
|
||||||
export("$dtBanList*", $Host::dtBanlist);
|
for (%i = 0; %i < 100; %i++){
|
||||||
|
if($dtBanList::NameList[%i] !$= ""){
|
||||||
|
if(getField($dtBanList::NameList[%i], 0) $= %name){
|
||||||
|
%found =1;
|
||||||
|
if(%guid > 0)
|
||||||
|
$dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 1, %guid);
|
||||||
|
if(getSubStr(%ipAddress, 0, 3) $= "IP:")
|
||||||
|
$dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 2, %bareIP);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(%eIndex == -1){
|
||||||
|
%eIndex = %i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!%found){
|
||||||
|
if($dtBanList::NameList[%eIndex] $= ""){
|
||||||
|
$dtBanList::NameList[%eIndex] = %name TAB %guid TAB %bareIP;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
error("Ban Index is not empty");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
saveBanList();
|
||||||
}
|
}
|
||||||
|
|
||||||
function banList_checkIP(%client){
|
function banList_checkIP(%client){
|
||||||
|
|
@ -56,14 +78,21 @@ function banList_checkIP(%client){
|
||||||
%time = $dtBanList::IP[%ip];
|
%time = $dtBanList::IP[%ip];
|
||||||
if(%time $= "BAN")
|
if(%time $= "BAN")
|
||||||
return 1;
|
return 1;
|
||||||
if (%time !$= "" && %time != 0){
|
if (getFieldCount(%time) > 0){
|
||||||
%delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3));
|
%delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3));
|
||||||
if (%delta < getField(%time,4))
|
if (%delta < getField(%time,4))
|
||||||
return 1;
|
return 1;
|
||||||
else{
|
else{
|
||||||
|
for (%i = 0; %i < 100; %i++){
|
||||||
|
if($dtBanList::NameList[%i] !$= ""){
|
||||||
|
if(getField($dtBanList::NameList[%i], 1) $= %guid){
|
||||||
|
unbanIndex(%i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$dtBanList::IP[%ip] = "";
|
$dtBanList::IP[%ip] = "";
|
||||||
schedule(1000,0,"export","$dtBanList*", $Host::dtBanlist);
|
saveBanList();
|
||||||
//export("$dtBanList*", "prefs/dtBanlist.cs");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -73,14 +102,21 @@ function banList_checkGUID(%guid){
|
||||||
%time = $dtBanList::GUID[%guid];
|
%time = $dtBanList::GUID[%guid];
|
||||||
if(%time $= "BAN")
|
if(%time $= "BAN")
|
||||||
return 1;
|
return 1;
|
||||||
if (%time !$= "" && %time != 0){
|
if (getFieldCount(%time) > 0){
|
||||||
%delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3));
|
%delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3));
|
||||||
if (%delta < getField(%time,4))
|
if (%delta < getField(%time,4))
|
||||||
return 1;
|
return 1;
|
||||||
else{
|
else{
|
||||||
$dtBanList::GUID[%guid] = "";
|
for (%i = 0; %i < 100; %i++){
|
||||||
schedule(500,0,"export","$dtBanList*", $Host::dtBanlist);
|
if($dtBanList::NameList[%i] !$= ""){
|
||||||
//export("$dtBanList*", "prefs/dtBanlist.cs");
|
if(getField($dtBanList::NameList[%i], 1) $= %guid){
|
||||||
|
unbanIndex(%i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$dtBanList::GUID[%guid] = "";
|
||||||
|
saveBanList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -88,31 +124,63 @@ function banList_checkGUID(%guid){
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!isActivePackage(dtBan))
|
if (!isActivePackage(dtBan)){
|
||||||
activatePackage(dtBan);
|
activatePackage(dtBan);
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveBanList(){
|
||||||
|
if(!isEventPending($banEvent))
|
||||||
|
$banEvent = schedule(1000,0,"export","$dtBanList*", $Host::dtBanlist);
|
||||||
|
}
|
||||||
|
function getClientBanName(%guid, %ip){
|
||||||
|
%found = 0;
|
||||||
|
for (%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||||
|
%client = ClientGroup.getObject(%i);
|
||||||
|
if(%guid > 0 && %client.guid $= %guid){
|
||||||
|
%found = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if(%client.getAddress() $= %ip){
|
||||||
|
%found = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(%found){
|
||||||
|
%authInfo = %client.getAuthInfo();
|
||||||
|
%realName = getField( %authInfo, 0 );
|
||||||
|
if(%realName !$= "")
|
||||||
|
%name = %realName;
|
||||||
|
else
|
||||||
|
%name = stripChars( detag( getTaggedString( %client.name ) ), "\cp\co\c6\c7\c8\c9\c0" );
|
||||||
|
return trim(%name);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
function getBanCount(%d, %year, %h, %n){
|
function getBanCount(%d, %year, %h, %n){
|
||||||
%dif = formattimestring("yy") - %year;
|
if(%d && %year && %h && %n){
|
||||||
%days += 365 * (%dif-1);
|
%dif = formattimestring("yy") - %year;
|
||||||
%days += 365 - %d;
|
%days += 365 * (%dif-1);
|
||||||
%days += dtBanDay();
|
%days += 365 - %d;
|
||||||
%ht = %nt = 0;
|
%days += dtBanDay();
|
||||||
if(formattimestring("H") > %h){
|
%ht = %nt = 0;
|
||||||
%ht = formattimestring("H") - %h;
|
if(formattimestring("H") > %h){
|
||||||
|
%ht = formattimestring("H") - %h;
|
||||||
|
}
|
||||||
|
else if(formattimestring("H") < %h){
|
||||||
|
%ht = 24 - %h;
|
||||||
|
%ht = formattimestring("H")+ %ht;
|
||||||
|
}
|
||||||
|
if(formattimestring("n") > %n){
|
||||||
|
%nt = formattimestring("n") - %n;
|
||||||
|
}
|
||||||
|
else if(formattimestring("n") < %n){
|
||||||
|
%nt = 60 - %n;
|
||||||
|
%nt = formattimestring("n") + %nt;
|
||||||
|
}
|
||||||
|
return mfloor((%days * 1440) + (%ht*60) + %nt);
|
||||||
}
|
}
|
||||||
else if(formattimestring("H") < %h){
|
return 0;
|
||||||
%ht = 24 - %h;
|
|
||||||
%ht = formattimestring("H")+ %ht;
|
|
||||||
}
|
|
||||||
if(formattimestring("n") > %n){
|
|
||||||
%nt = formattimestring("n") - %n;
|
|
||||||
}
|
|
||||||
else if(formattimestring("n") < %n){
|
|
||||||
%nt = 60 - %n;
|
|
||||||
%nt = formattimestring("n") + %nt;
|
|
||||||
}
|
|
||||||
return mfloor((%days * 1440) + (%ht*60) + %nt);
|
|
||||||
//return mfloor((%days * 1440) + (%ht*60) + %nt) TAB (%days * 1440) TAB (%ht*60) TAB %nt;
|
//return mfloor((%days * 1440) + (%ht*60) + %nt) TAB (%days * 1440) TAB (%ht*60) TAB %nt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,15 +214,63 @@ function dtBanMark(){
|
||||||
return %count + %d TAB formattimestring("yy") TAB formattimestring("H") TAB formattimestring("n");
|
return %count + %d TAB formattimestring("yy") TAB formattimestring("H") TAB formattimestring("n");
|
||||||
}
|
}
|
||||||
|
|
||||||
function unban(%guid,%ip){
|
function banList(){
|
||||||
|
%found = 0;
|
||||||
|
for (%i = 0; %i < 100; %i++){
|
||||||
|
%fieldList = $dtBanList::NameList[%i];
|
||||||
|
if($dtBanList::NameList[%i] !$= ""){
|
||||||
|
%found = 1;
|
||||||
|
error("index:" @ %i SPC "Name:" @ getField(%fieldList,0) SPC "GUID:" @ getField(%fieldList,1) SPC "IP:" @ getField(%fieldList,2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(%found){
|
||||||
|
error("Use unbanIndex(%index); to unban user from the list ");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
error("No bans, see" SPC $Host::dtBanlist SPC "for older entries");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function unbanIndex(%index){
|
||||||
|
if( $dtBanList::NameList[%index] !$= ""){
|
||||||
|
%fieldList = $dtBanList::NameList[%index];
|
||||||
|
%name = getField(%fieldList, 0);
|
||||||
|
$dtBanList::NameList[%index] = "";
|
||||||
|
error("Name" SPC getField(%fieldList,0) SPC "UNBANNED");
|
||||||
|
%guid = getField(%fieldList,1);
|
||||||
|
if($dtBanList::GUID[%guid] !$= ""){
|
||||||
|
$dtBanList::GUID[%guid] = "";
|
||||||
|
error("GUID" SPC %guid SPC "UNBANNED");
|
||||||
|
}
|
||||||
|
%ip = getField(%fieldList,2);
|
||||||
|
if($dtBanList::IP[%ip] !$= ""){
|
||||||
|
$dtBanList::IP[%ip] = "";
|
||||||
|
error("IP" SPC %ip SPC "UNBANNED");
|
||||||
|
}
|
||||||
|
saveBanList();
|
||||||
|
return %name;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//old method
|
||||||
|
function unbanold(%guid,%ip){
|
||||||
|
%ip = strReplace(%ip, ".", "_");
|
||||||
|
for (%i = 0; %i < 100; %i++){
|
||||||
|
if($dtBanList::NameList[%i] !$= ""){
|
||||||
|
if(getField($dtBanList::NameList[%i], 2) $= %ip || getField($dtBanList::NameList[%i], 1) $= %guid){
|
||||||
|
unbanIndex(%i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if($dtBanList::GUID[%guid] !$= ""){
|
if($dtBanList::GUID[%guid] !$= ""){
|
||||||
$dtBanList::GUID[%guid] = "";
|
$dtBanList::GUID[%guid] = "";
|
||||||
error("GUID" SPC %guid SPC "UNBANNED");
|
error("GUID" SPC %guid SPC "UNBANNED");
|
||||||
}
|
}
|
||||||
%ip = strReplace(%ip, ".", "_");
|
|
||||||
if($dtBanList::IP[%ip] !$= ""){
|
if($dtBanList::IP[%ip] !$= ""){
|
||||||
$dtBanList::IP[%ip] = "";
|
$dtBanList::IP[%ip] = "";
|
||||||
error("IP" SPC %ip SPC "UNBANNED");
|
error("IP" SPC %ip SPC "UNBANNED");
|
||||||
}
|
}
|
||||||
export("$dtBanList*", $Host::dtBanlist);
|
saveBanList();
|
||||||
}
|
}
|
||||||
104
Classic/scripts/autoexec/flagTunnelingFix.cs
Normal file
104
Classic/scripts/autoexec/flagTunnelingFix.cs
Normal file
|
|
@ -0,0 +1,104 @@
|
||||||
|
//Fixes for collision tunneling on flag objects note only in CTF type games
|
||||||
|
//Script By:DarkTiger
|
||||||
|
$ftEnable = 1;
|
||||||
|
$flagSimTime = 60;//note a higher the time, the larger the sweep scans will be
|
||||||
|
$flagCheckRadius = 50;
|
||||||
|
$playerBoxA = "-0.6 -0.6 0";
|
||||||
|
$playerBoxB = "0.6 0.6 2.3";
|
||||||
|
|
||||||
|
package flagFix{
|
||||||
|
function CTFGame::startFlagCollisionSearch(%game, %flag){
|
||||||
|
parent::startFlagCollisionSearch(%game, %flag);
|
||||||
|
if((getSimTime() - %game.fcs) >= $flagSimTime && $ftEnable){
|
||||||
|
%game.flagColTest(%flag);
|
||||||
|
%game.fcs = getSimTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function SCtFGame::startFlagCollisionSearch(%game, %flag){
|
||||||
|
parent::startFlagCollisionSearch(%game, %flag);
|
||||||
|
if((getSimTime() - %game.fcs) >= $flagSimTime && $ftEnable){
|
||||||
|
%game.flagColTest(%flag);
|
||||||
|
%game.fcs = getSimTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function PracticeCTFGame::startFlagCollisionSearch(%game, %flag){
|
||||||
|
parent::startFlagCollisionSearch(%game, %flag);
|
||||||
|
if((getSimTime() - %game.fcs) >= $flagSimTime && $ftEnable){
|
||||||
|
%game.flagColTest(%flag);
|
||||||
|
%game.fcs = getSimTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function CTFGame::startMatch(%game){
|
||||||
|
parent::startMatch(%game);
|
||||||
|
%game.setupFlagTrig();
|
||||||
|
if(!isEventPending(Game.flagLoop)){
|
||||||
|
%game.atHomeFlagLoop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function SCtFGame::startMatch(%game){
|
||||||
|
parent::startMatch(%game);
|
||||||
|
%game.setupFlagTrig();
|
||||||
|
if(!isEventPending(Game.flagLoop)){
|
||||||
|
%game.atHomeFlagLoop();
|
||||||
|
}
|
||||||
|
%game.fcs = getSimTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
function PracticeCTFGame::startMatch(%game){
|
||||||
|
parent::startMatch(%game);
|
||||||
|
%game.setupFlagTrig();
|
||||||
|
if(!isEventPending(Game.flagLoop)){
|
||||||
|
%game.atHomeFlagLoop();
|
||||||
|
}
|
||||||
|
%game.fcs = getSimTime();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
activatePackage(flagFix);
|
||||||
|
|
||||||
|
function DefaultGame::flagColTest(%game, %flag){
|
||||||
|
%Box2 = %flag.getWorldBox();
|
||||||
|
InitContainerRadiusSearch( %flag.getWorldBoxCenter(), $flagCheckRadius, $TypeMasks::PlayerObjectType);
|
||||||
|
while((%player = containerSearchNext()) != 0){
|
||||||
|
%playerPos = %player.getPosition();
|
||||||
|
if(%player.lastSim > 0 && (%player.getState() !$= "Dead")){// only check at speed
|
||||||
|
if((getSimTime() - %player.lastSim) <= 256){//make sure are last position is valid
|
||||||
|
%sweepCount = mFloor(vectorDist(%playerPos, %player.oldPos) + 1);
|
||||||
|
for(%i = 0; %i < %sweepCount; %i++){// sweep behind us to see if we should have hit something
|
||||||
|
%lerpPos = vectorLerp(%playerPos, %player.oldPos, (%i+1)/%sweepCount);//back sweep
|
||||||
|
%Box1 = vectorAdd($playerBoxA, %lerpPos) SPC vectorAdd($playerBoxB, %lerpPos);
|
||||||
|
if(boxIntersect(%Box1, %Box2)){
|
||||||
|
%flag.getDataBlock().onCollision(%flag, %player);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%player.oldPos = %playerPos;
|
||||||
|
%player.lastSim = getSimTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function vectorLerp(%point1, %point2, %t) {
|
||||||
|
return vectorAdd(%point1, vectorScale(vectorSub(%point2, %point1), %t));
|
||||||
|
}
|
||||||
|
|
||||||
|
function boxIntersect(%a, %b){
|
||||||
|
return (getWord(%a, 0) <= getWord(%b, 3) && getWord(%a, 3) >= getWord(%b, 0)) &&
|
||||||
|
(getWord(%a, 1) <= getWord(%b, 4) && getWord(%a, 4) >= getWord(%b, 1)) &&
|
||||||
|
(getWord(%a, 2) <= getWord(%b, 5) && getWord(%a, 5) >= getWord(%b, 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
function DefaultGame::atHomeFlagLoop(%game){
|
||||||
|
if($TeamFlag[1].isHome ){
|
||||||
|
%game.flagColTest($TeamFlag[1], 0);
|
||||||
|
}
|
||||||
|
if($TeamFlag[2].isHome){
|
||||||
|
%game.flagColTest($TeamFlag[2], 0);
|
||||||
|
}
|
||||||
|
%speed = ($HostGamePlayerCount - $HostGameBotCount > 0) ? $flagSimTime : 30000;
|
||||||
|
if(isObject(Game) && $missionRunning && $ftEnable)
|
||||||
|
%game.flagLoop = %game.schedule(%speed, "atHomeFlagLoop");
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
//$Host::ClassicRotationFile = "prefs/mapRotation1.cs";
|
//$Host::ClassicRotationFile = "prefs/mapRotation1.cs";
|
||||||
|
|
||||||
//Enable/Disable
|
//Enable/Disable
|
||||||
$EnableMultipleMapRotation = 0;
|
//$Host::MultipleMapRotation = 0;
|
||||||
|
|
||||||
//How any mapRotation Files
|
//How any mapRotation Files
|
||||||
//Naming scheme mapRotation1.cs, mapRotation2.cs, mapRotation3.cs, etc
|
//Naming scheme mapRotation1.cs, mapRotation2.cs, mapRotation3.cs, etc
|
||||||
$mapRotationFilesCount = 3;
|
//$Host::MultipleMapRotationCount = 3;
|
||||||
|
|
||||||
function multipleMapRotation()
|
function multipleMapRotation()
|
||||||
{
|
{
|
||||||
|
|
@ -15,7 +15,7 @@ function multipleMapRotation()
|
||||||
|
|
||||||
if(%var) //If number exists proceed
|
if(%var) //If number exists proceed
|
||||||
{
|
{
|
||||||
if(%var $= $mapRotationFilesCount)
|
if(%var $= $Host::MultipleMapRotationCount)
|
||||||
%var = 1;
|
%var = 1;
|
||||||
else
|
else
|
||||||
%var = %var + 1;
|
%var = %var + 1;
|
||||||
|
|
@ -34,5 +34,5 @@ function multipleMapRotationEcho()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Run
|
//Run
|
||||||
if($EnableMultipleMapRotation)
|
if($Host::MultipleMapRotation)
|
||||||
multipleMapRotation();
|
multipleMapRotation();
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,9 @@ $dtLoadingScreen::Delay = 0;
|
||||||
$dtLoadingScreen::ShowFullScreen = 0;
|
$dtLoadingScreen::ShowFullScreen = 0;
|
||||||
// Enable/Disable Images
|
// Enable/Disable Images
|
||||||
$dtLoadingScreen::ShowImages = 0;
|
$dtLoadingScreen::ShowImages = 0;
|
||||||
// Enable/Disable Server Logo
|
// Enable/Disable Server Logo
|
||||||
$dtLoadingScreen::ShowLogo = $Host::LoadScreenShowLogo; //$dtLoadingScreen::ShowLogo = 0;
|
//$Host::LoadScreenShowLogo = 0;
|
||||||
$dtLoadingScreen::LogoName = $Host::LoadScreenShowLogoName; //$dtLoadingScreen::LogoName = "dpub/DPUB_logo";
|
//$Host::LoadScreenShowLogoName = "dpub/DPUB_logo";
|
||||||
|
|
||||||
|
|
||||||
// Color safetynet
|
// Color safetynet
|
||||||
|
|
@ -234,11 +234,11 @@ function ALTsendModInfoToClient(%client)
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||||
}
|
}
|
||||||
else if($dtLoadingScreen::ShowLogo)
|
else if($Host::LoadScreenShowLogo)
|
||||||
{
|
{
|
||||||
if(%client.dmpVersion $=$DMP::Version)
|
if(%client.dmpVersion $=$DMP::Version)
|
||||||
{
|
{
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<bitmap:" @ $dtLoadingScreen::LogoName @ ">";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<bitmap:" @ $Host::LoadScreenShowLogoName @ ">";
|
||||||
|
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||||
|
|
|
||||||
|
|
@ -2,31 +2,30 @@
|
||||||
// Script BY: DarkTiger
|
// Script BY: DarkTiger
|
||||||
// Worked on: ChocoTaco
|
// Worked on: ChocoTaco
|
||||||
// If player is afk specific amount of time in minutes, force them into observer
|
// If player is afk specific amount of time in minutes, force them into observer
|
||||||
|
deleteVariables("$dtVar::AFKList*");
|
||||||
|
$AFKCount = 0;
|
||||||
|
|
||||||
// Enable/Disable entire script
|
// Enable/Disable entire script
|
||||||
$dtVar::AFKTimeout = 1;
|
$dtVar::AFKTimeout = 1;
|
||||||
// 60000 * 2 is 2 minutes
|
// 60000 * 2 is 2 minutes
|
||||||
// 0 minutes disables
|
// 0 minutes disables
|
||||||
$dtVar::AFKtime = 60000 * 2;
|
$dtVar::AFKtime = 60000 * 1;
|
||||||
// Run from List Only instead of All clients on the server. 1 is yes, 0 is no
|
// Run from List Only instead of All clients on the server. 1 is yes, 0 is no
|
||||||
$dtVar::ListOnly = 1;
|
$dtVar::ListOnly = 1;
|
||||||
// Add clients who are normally AFK
|
// Add clients who are normally AFK
|
||||||
$dtVar::AFKList[$AFKCount++] = "";
|
$dtVar::AFKList[$AFKCount++] = "";
|
||||||
$dtVar::AFKList[$AFKCount++] = "";
|
$dtVar::AFKList[$AFKCount++] = "";
|
||||||
|
|
||||||
// Loop Check Timer
|
// Loop Check Timer
|
||||||
// How often do you want a AFKLoop. 1000 * 30 is 30 seconds
|
// How often do you want a AFKLoop. 1000 * 30 is 30 seconds
|
||||||
$dtVar::AFKloop = 1000 * 30;
|
$dtVar::AFKloop = 1000 * 15;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Set Status Var
|
// Set Status Var
|
||||||
if($dtVar::ListOnly)
|
if($dtVar::ListOnly || !$dtVar::AFKtime)
|
||||||
$DT_AFKStatus = "IDLE";
|
$DT_AFKStatus = "IDLE";
|
||||||
else
|
else
|
||||||
$DT_AFKStatus = "ACTIVE";
|
$DT_AFKStatus = "ACTIVE";
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
package DT_AFKPackage
|
package DT_AFKPackage
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -67,21 +66,19 @@ function GameConnection::onDrop(%client, %reason)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
function DT_AFKStatusConnect(%client)
|
function DT_AFKStatusConnect(%client)
|
||||||
{
|
{
|
||||||
if($dtVar::AFKtime != 0 && !$Host::TournamentMode) //0 minutes disables
|
if(!$dtVar::AFKtime || $Host::TournamentMode)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for(%x = 1; %x <= $AFKCount; %x++)
|
||||||
{
|
{
|
||||||
for(%x = 1; %x <= $AFKCount; %x++)
|
%guid = $dtVar::AFKList[%x];
|
||||||
|
if(%client.guid $= %guid && %guid !$= "")
|
||||||
{
|
{
|
||||||
%guid = $dtVar::AFKList[%x];
|
$DT_AFKStatus = "ACTIVE";
|
||||||
if(%client.guid $= %guid && %guid !$= "")
|
$DT_AFKListCount++;
|
||||||
{
|
%client.dtAFK = 1;
|
||||||
$DT_AFKStatus = "ACTIVE";
|
|
||||||
$DT_AFKListCount++;
|
|
||||||
%client.dtAFK = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -89,87 +86,72 @@ function DT_AFKStatusConnect(%client)
|
||||||
function DT_AFKStatusDrop(%client)
|
function DT_AFKStatusDrop(%client)
|
||||||
{
|
{
|
||||||
if(%client.dtAFK)
|
if(%client.dtAFK)
|
||||||
$DT_AFKListCount = $DT_AFKListCount - 1;
|
$DT_AFKListCount--;
|
||||||
|
|
||||||
// for(%x = 1; %x <= $AFKCount; %x++)
|
//Reset
|
||||||
// {
|
if($DT_AFKListCount $= 0)
|
||||||
// %guid = $dtVar::AFKList[%x];
|
|
||||||
// if(%client.guid $= %guid && %guid !$= "")
|
|
||||||
// $DT_AFKListCount = $DT_AFKListCount - 1;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if($DT_AFKListCount $= 0) //Wont set IDLE until all List Clients are off the server
|
|
||||||
$DT_AFKStatus = "IDLE";
|
$DT_AFKStatus = "IDLE";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
function DT_AFKtimeoutLoop()
|
function DT_AFKtimeoutLoop()
|
||||||
{
|
{
|
||||||
//echo($DT_AFKStatus);
|
|
||||||
|
|
||||||
switch$($DT_AFKStatus)
|
|
||||||
{
|
|
||||||
case ACTIVE:
|
|
||||||
if($dtVar::AFKtime != 0 && !$Host::TournamentMode) //0 minutes disables
|
|
||||||
{
|
|
||||||
if($dtVar::ListOnly)
|
|
||||||
{
|
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i ++)
|
|
||||||
{
|
|
||||||
%client = ClientGroup.getObject(%i);
|
|
||||||
if(%client.dtAFK)
|
|
||||||
{
|
|
||||||
if(!%client.isAIControlled() && isObject(%client.player) && %client.player.getState() !$= "Dead")
|
|
||||||
AFKChk(%client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i ++)
|
|
||||||
{
|
|
||||||
%client = ClientGroup.getObject(%i);
|
|
||||||
if(!%client.isAIControlled() && isObject(%client.player) && %client.player.getState() !$= "Dead")
|
|
||||||
AFKChk(%client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case IDLE:
|
|
||||||
//Do Nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isEventPending($dtVar::AFKloopSchedule))
|
if(isEventPending($dtVar::AFKloopSchedule))
|
||||||
cancel($dtVar::AFKloopSchedule);
|
cancel($dtVar::AFKloopSchedule);
|
||||||
|
|
||||||
|
//echo($DT_AFKStatus);
|
||||||
|
if($DT_AFKStatus $= "ACTIVE" && !$Host::TournamentMode)
|
||||||
|
{
|
||||||
|
if($dtVar::ListOnly)
|
||||||
|
{
|
||||||
|
for(%i = 0; %i < ClientGroup.getCount(); %i ++)
|
||||||
|
{
|
||||||
|
%client = ClientGroup.getObject(%i);
|
||||||
|
if(%client.dtAFK)
|
||||||
|
{
|
||||||
|
if(!%client.isAIControlled() && isObject(%client.player) && %client.player.getState() !$= "Dead")
|
||||||
|
CheckAFK(%client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for(%i = 0; %i < ClientGroup.getCount(); %i ++)
|
||||||
|
{
|
||||||
|
%client = ClientGroup.getObject(%i);
|
||||||
|
if(!%client.isAIControlled() && isObject(%client.player) && %client.player.getState() !$= "Dead")
|
||||||
|
CheckAFK(%client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Have another go?
|
||||||
$dtVar::AFKloopSchedule = schedule($dtVar::AFKloop, 0, "DT_AFKtimeoutLoop");
|
$dtVar::AFKloopSchedule = schedule($dtVar::AFKloop, 0, "DT_AFKtimeoutLoop");
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
function CheckAFK(%client)
|
||||||
|
|
||||||
function AFKChk(%client)
|
|
||||||
{
|
{
|
||||||
if(%client.player.curTransform $= %client.player.getTransform())
|
//checks to see if there position and rotation are the same.
|
||||||
{//checks to see if there position and rotation are the same.
|
if(%client.player.curTransform $= %client.player.getTransform())
|
||||||
%client.player.afkTimer += $dtVar::AFKloop;
|
{
|
||||||
if(%client.player.afkTimer >= $dtVar::AFKtime)
|
%client.player.afkTimer += $dtVar::AFKloop;
|
||||||
{
|
if(%client.player.afkTimer >= $dtVar::AFKtime)
|
||||||
Game.AFKForceObserver(%client);
|
{
|
||||||
return;
|
Game.AFKForceObserver(%client);
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
%client.player.afkTimer = 0;//reset if moving
|
%client.player.afkTimer = 0; //reset if moving
|
||||||
}
|
|
||||||
|
|
||||||
%client.player.curTransform = %client.player.getTransform();//save current transform
|
//save current transform
|
||||||
|
%client.player.curTransform = %client.player.getTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
function DefaultGame::AFKForceObserver(%game, %client)
|
function DefaultGame::AFKForceObserver(%game, %client)
|
||||||
{
|
{
|
||||||
|
if($Host::TournamentMode)
|
||||||
|
return;
|
||||||
|
|
||||||
//make sure we have a valid client...
|
//make sure we have a valid client...
|
||||||
if (%client <= 0)
|
if (%client <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
@ -196,23 +178,6 @@ function DefaultGame::AFKForceObserver(%game, %client)
|
||||||
logEcho(%client.nameBase@" (cl "@%client@") was forced into observer mode due to inactivity");
|
logEcho(%client.nameBase@" (cl "@%client@") was forced into observer mode due to inactivity");
|
||||||
%client.lastTeam = %client.team;
|
%client.lastTeam = %client.team;
|
||||||
|
|
||||||
if($Host::TournamentMode)
|
|
||||||
{
|
|
||||||
if(!$matchStarted)
|
|
||||||
{
|
|
||||||
if(%client.camera.Mode $= "pickingTeam")
|
|
||||||
{
|
|
||||||
commandToClient( %client, 'processPickTeam');
|
|
||||||
clearBottomPrint( %client );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
clearCenterPrint(%client);
|
|
||||||
%client.notReady = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// switch client to team 0 (observer)
|
// switch client to team 0 (observer)
|
||||||
%client.team = 0;
|
%client.team = 0;
|
||||||
%client.player.team = 0;
|
%client.player.team = 0;
|
||||||
|
|
@ -233,4 +198,4 @@ function DefaultGame::AFKForceObserver(%game, %client)
|
||||||
|
|
||||||
// call the onEvent for this game type
|
// call the onEvent for this game type
|
||||||
%game.onClientEnterObserverMode(%client); //Bounty uses this to remove this client from others' hit lists
|
%game.onClientEnterObserverMode(%client); //Bounty uses this to remove this client from others' hit lists
|
||||||
}
|
}
|
||||||
|
|
@ -1733,7 +1733,7 @@ package dtStats{
|
||||||
if($dtStats::Enable){
|
if($dtStats::Enable){
|
||||||
dtSaveServerVars();
|
dtSaveServerVars();
|
||||||
dtScanForRepair();
|
dtScanForRepair();
|
||||||
$mapID::gameID = addNum($mapID::gameID,1);
|
$mapID::gameID = formattimestring("mddyHHnnss");
|
||||||
if($dtStats::debugEchos)
|
if($dtStats::debugEchos)
|
||||||
error("GAME ID" SPC $mapID::gameID SPC "//////////////////////////////");
|
error("GAME ID" SPC $mapID::gameID SPC "//////////////////////////////");
|
||||||
}
|
}
|
||||||
|
|
@ -2206,7 +2206,7 @@ package dtStatsGame{
|
||||||
}
|
}
|
||||||
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg){
|
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg){
|
||||||
parent::serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg);
|
parent::serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg);
|
||||||
if($dtStats::Enable){
|
if($dtStats::Enable && (!%client.isAdmin || (%client.isAdmin && %client.ForceVote))){
|
||||||
%client.dtStats.voteCount++;
|
%client.dtStats.voteCount++;
|
||||||
if(%typeName $= "VoteChangeMission"){
|
if(%typeName $= "VoteChangeMission"){
|
||||||
%mission = $HostMissionFile[%arg3];
|
%mission = $HostMissionFile[%arg3];
|
||||||
|
|
@ -4010,13 +4010,13 @@ function dtStatsMissionDropReady(%game, %client){ // called when client has fini
|
||||||
}
|
}
|
||||||
function dtStatsClientLeaveGame(%client){
|
function dtStatsClientLeaveGame(%client){
|
||||||
$dtServerVars::lastPlayerCount = $HostGamePlayerCount - $HostGameBotCount;
|
$dtServerVars::lastPlayerCount = $HostGamePlayerCount - $HostGameBotCount;
|
||||||
|
|
||||||
if(isGameRun()){// if they dc during game over dont count it
|
if(isGameRun()){// if they dc during game over dont count it
|
||||||
$dtServer::mapDisconnects[cleanMapName($CurrentMission),Game.class]++;
|
$dtServer::mapDisconnects[cleanMapName($CurrentMission),Game.class]++;
|
||||||
if(%client.score != 0)
|
if(%client.score != 0)
|
||||||
$dtServer::mapDisconnectsScore[cleanMapName($CurrentMission),Game.class]++;
|
$dtServer::mapDisconnectsScore[cleanMapName($CurrentMission),Game.class]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isObject(%client.dtStats)){
|
if(isObject(%client.dtStats)){
|
||||||
%client.dtStats.clientLeft = 1;
|
%client.dtStats.clientLeft = 1;
|
||||||
%client.dtStats.leftTime = getSimTime();
|
%client.dtStats.leftTime = getSimTime();
|
||||||
|
|
@ -12647,7 +12647,7 @@ function startMonitor(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function dtSaveServerVars(){
|
function dtSaveServerVars(){
|
||||||
$dtServerVars::lastSimTime = getSimTime();
|
$dtServerVars::lastSimTime = getSimTime();
|
||||||
$dtServerVars::lastDate = formattimestring("mm/dd/yy hh:nn:a");
|
$dtServerVars::lastDate = formattimestring("mm/dd/yy hh:nn:a");
|
||||||
$dtServerVars::lastMission = cleanMapName($CurrentMission);
|
$dtServerVars::lastMission = cleanMapName($CurrentMission);
|
||||||
|
|
@ -12995,4 +12995,4 @@ function testVarsRandomAll(%max){
|
||||||
// Server crash messsage fix
|
// Server crash messsage fix
|
||||||
//
|
//
|
||||||
// 9.3
|
// 9.3
|
||||||
// Stat format change for flag cap times, they now start at 0
|
// Stat format change for flag cap times, they now start at 0
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
//exec("scripts/autoexec/zzDiscordBot.cs");
|
//exec("scripts/autoexec/zzDiscordBot.cs");
|
||||||
|
|
||||||
//ip of the bot
|
//ip of the bot
|
||||||
$discordBot::IP = "";
|
$discordBot::IP = "127.0.0.1:28003";
|
||||||
$discordBot::reconnectTimeout = 3 * 60000;
|
$discordBot::reconnectTimeout = 3 * 60000;
|
||||||
//auto connect on start
|
//auto connect on start
|
||||||
$discordBot::autoStart = 0;
|
$discordBot::autoStart = 0;
|
||||||
|
|
@ -203,7 +203,6 @@ function discordBotProcess(%type, %var1, %var2, %var3, %var4, %var5, %var6)
|
||||||
sendToDiscordEmote(%msg, $discordBot::serverFeed);
|
sendToDiscordEmote(%msg, $discordBot::serverFeed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendToDiscord(%msg,%channel)
|
function sendToDiscord(%msg,%channel)
|
||||||
{
|
{
|
||||||
if(isObject(discord) && %msg !$= "")
|
if(isObject(discord) && %msg !$= "")
|
||||||
|
|
@ -286,15 +285,14 @@ function discord::onLine(%this, %line){
|
||||||
switch$(%cmd){
|
switch$(%cmd){
|
||||||
//case "Discord":
|
//case "Discord":
|
||||||
//messageAll( 'MsgDiscord', '\c3Discord: \c4%1 %2',getWord(%lineStrip,1),getWords(%lineStrip,2,getWordCount(%lineStrip) -1));
|
//messageAll( 'MsgDiscord', '\c3Discord: \c4%1 %2',getWord(%lineStrip,1),getWords(%lineStrip,2,getWordCount(%lineStrip) -1));
|
||||||
case "PLOTSTOP":
|
|
||||||
$pathMaps::running = 0;
|
|
||||||
case "PLOTPLAYER":
|
|
||||||
startPlayerPlot(getWord(%lineStrip,1));
|
|
||||||
case "GETSTAT":
|
case "GETSTAT":
|
||||||
%var = getWord(%lineStrip,1);
|
%mon = getWord(%lineStrip,1);
|
||||||
%mon = getWord(%lineStrip,2);
|
%year = getWord(%lineStrip,2);
|
||||||
%year = getWord(%lineStrip,3);
|
%var = getWord(%lineStrip,3);
|
||||||
%game = getWord(%lineStrip,4);
|
%game = getWord(%lineStrip,4);
|
||||||
|
if(%game $= ""){// default if not valid
|
||||||
|
%game = "CTFGame";
|
||||||
|
}
|
||||||
%returnIndex = getWord(%lineStrip,5);
|
%returnIndex = getWord(%lineStrip,5);
|
||||||
%nameList = $lData::name[%var,%game,"month",%mon,%year];
|
%nameList = $lData::name[%var,%game,"month",%mon,%year];
|
||||||
%dataList = $lData::data[%var,%game,"month",%mon,%year];
|
%dataList = $lData::data[%var,%game,"month",%mon,%year];
|
||||||
|
|
@ -307,8 +305,12 @@ function discord::onLine(%this, %line){
|
||||||
$genStatsLockout = 1;
|
$genStatsLockout = 1;
|
||||||
%month = getWord(%lineStrip,1);
|
%month = getWord(%lineStrip,1);
|
||||||
%year = getWord(%lineStrip,2);
|
%year = getWord(%lineStrip,2);
|
||||||
|
%game = getWord(%lineStrip,3);
|
||||||
|
if(%game $= ""){// default if not valid
|
||||||
|
%game = "CTFGame";
|
||||||
|
}
|
||||||
if(%month > 0 && %year > 0){
|
if(%month > 0 && %year > 0){
|
||||||
schedule(1000, 0, "sendLDATA", %month, %year, "CTFGame");
|
schedule(1000, 0, "sendLDATA", %month, %year, %game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
@ -317,9 +319,9 @@ function discord::onLine(%this, %line){
|
||||||
case "PING":
|
case "PING":
|
||||||
discord.send("PONG" @ $discordBot::cmdSplit @ "\r\n");
|
discord.send("PONG" @ $discordBot::cmdSplit @ "\r\n");
|
||||||
case "PINGAVG":
|
case "PINGAVG":
|
||||||
%min = 10000;
|
%min = 10000;
|
||||||
%max = -10000;
|
%max = -10000;
|
||||||
%lowCount = %lowPing = 0;
|
%lowCount = %lowPing = 0;
|
||||||
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||||
%cl = ClientGroup.getObject(%i);
|
%cl = ClientGroup.getObject(%i);
|
||||||
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
||||||
|
|
@ -353,6 +355,32 @@ function discord::onLine(%this, %line){
|
||||||
discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "msgList" @ "\r\n");
|
discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "msgList" @ "\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case "BANLIST":
|
||||||
|
%found = 0;
|
||||||
|
for (%i = 0; %i < 100; %i++){
|
||||||
|
if($dtBanList::NameList[%i] !$= ""){
|
||||||
|
%fieldList = $dtBanList::NameList[%i];
|
||||||
|
%msg = "Index:" @ %i SPC "Name:" @ getField(%fieldList,0) SPC "GUID:" @ getField(%fieldList,1);
|
||||||
|
%found++;
|
||||||
|
discord.schedule(%found*32,"send","MSGSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(%found > 0){
|
||||||
|
discord.schedule((%found+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "banList" @ "\r\n");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
sendToDiscord("No active bans, see ban file for manual/older entries", $discordBot::monitorChannel);
|
||||||
|
}
|
||||||
|
case "UNBANINDEX":
|
||||||
|
%var = getWord(%lineStrip,1);
|
||||||
|
if($dtBanList::NameList[%var] !$= ""){
|
||||||
|
%name = unbanIndex(%var);
|
||||||
|
sendToDiscord("User:" @ %name SPC "has been unbanned", $discordBot::monitorChannel);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
sendToDiscord("Invalid Index", $discordBot::monitorChannel);
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error("Discord Bad Command" SPC %line);
|
error("Discord Bad Command" SPC %line);
|
||||||
}
|
}
|
||||||
|
|
@ -361,7 +389,7 @@ if(!isObject(discord) && $discordBot::autoStart){
|
||||||
discordCon();
|
discordCon();
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendLDATA(%month, %year, %type){
|
function sendLDATA(%month, %year, %game){
|
||||||
%file = new FileObject();
|
%file = new FileObject();
|
||||||
RootGroup.add(%file);
|
RootGroup.add(%file);
|
||||||
%folderPath = "serverStats/LData/*.cs";
|
%folderPath = "serverStats/LData/*.cs";
|
||||||
|
|
@ -370,18 +398,16 @@ function sendLDATA(%month, %year, %type){
|
||||||
for (%i = 0; %i < %count; %i++){
|
for (%i = 0; %i < %count; %i++){
|
||||||
%filepath = findNextfile(%folderPath);
|
%filepath = findNextfile(%folderPath);
|
||||||
%fieldPath =strreplace(%filePath,"-","\t");
|
%fieldPath =strreplace(%filePath,"-","\t");
|
||||||
%game = getField(%fieldPath,1);
|
%g = getField(%fieldPath,1);
|
||||||
%m = getField(%fieldPath,2); // 0 path / 1 game / 2 mon / 3 year / 4 type / 5 .cs
|
%m = getField(%fieldPath,2); // 0 path / 1 game / 2 mon / 3 year / 4 type / 5 .cs
|
||||||
%y = getField(%fieldPath,3);
|
%y = getField(%fieldPath,3);
|
||||||
//%lType = getField(%fieldPath,4);
|
//%lType = getField(%fieldPath,4);
|
||||||
if(%month $= %m && %y $= %year && %game $= %type){
|
//error(%g SPC %game SPC %m SPC %month SPC %y SPC %year);
|
||||||
|
if(%month $= %m && %y $= %year && %g $= %game){
|
||||||
%found = 1;
|
%found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dtSendDataMon = %month;
|
|
||||||
$dtSendDataYear = %year;
|
|
||||||
$dtSendDataType = %type;
|
|
||||||
if(isFile(%filepath) && %found){
|
if(isFile(%filepath) && %found){
|
||||||
sendToDiscord("Building Big Stats", $discordBot::monitorChannel);
|
sendToDiscord("Building Big Stats", $discordBot::monitorChannel);
|
||||||
%file.OpenForRead(%filepath);
|
%file.OpenForRead(%filepath);
|
||||||
|
|
@ -389,11 +415,11 @@ function sendLDATA(%month, %year, %type){
|
||||||
while(!%file.isEOF()){
|
while(!%file.isEOF()){
|
||||||
%line = %file.readLine();
|
%line = %file.readLine();
|
||||||
if(strPos(%line,"%tguid") == -1){
|
if(strPos(%line,"%tguid") == -1){
|
||||||
discord.schedule((%i++)*32,"send","STATSDATA" @ "%c%" @ $dtSendDataMon @ "%c%" @ $dtSendDataType @ "%c%" @ %line @ "\r\n");
|
discord.schedule((%i++)*32,"send","STATSDATA" @ "%c%" @ %month @ "%c%" @ %game @ "%c%" @ %line @ "\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
error("Sent LData To Discord" SPC %month SPC %year SPC %type SPC %i);
|
//error("Sent LData To Discord" SPC %month SPC %year SPC %game SPC %i);
|
||||||
discord.schedule((%i++*32)+1000,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "buildStats" @ $discordBot::cmdSplit @ %month @ $discordBot::cmdSplit @ %year @ $discordBot::cmdSplit @ %type @ $discordBot::cmdSplit @ "\r\n");
|
discord.schedule((%i++*32)+1000,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "buildStats" @ $discordBot::cmdSplit @ %month @ $discordBot::cmdSplit @ %year @ $discordBot::cmdSplit @ %game @ $discordBot::cmdSplit @ "\r\n");
|
||||||
schedule((%i++*32)+1000, 0, "unlockStatGen");
|
schedule((%i++*32)+1000, 0, "unlockStatGen");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -406,80 +432,4 @@ function sendLDATA(%month, %year, %type){
|
||||||
}
|
}
|
||||||
function unlockStatGen(){
|
function unlockStatGen(){
|
||||||
$genStatsLockout = 0;
|
$genStatsLockout = 0;
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//Player Path Maps
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
$pathMaps::maxCount = 32000;// default point count
|
|
||||||
$pathMaps::speed = 500;
|
|
||||||
function sendPrx(%x){
|
|
||||||
for(%i = %x; %i < $prx::count && (%i - %x) < 50; %i++){
|
|
||||||
%line = $prx::data[%i];
|
|
||||||
%msg = "CDATA" @ "%c%" @ %i @ "%c%" @ %line @ "\r\n";
|
|
||||||
if(isObject(discord))
|
|
||||||
discord.send(%msg);
|
|
||||||
//discord.schedule(%i,"send",%msg);
|
|
||||||
}
|
|
||||||
if(%i < $prx::count)
|
|
||||||
schedule(128, 0, "sendPrx", %i);
|
|
||||||
else
|
|
||||||
discord.schedule(5000,"send","PROCSTACK" @ $discordBot::cmdSplit @ ($discordBot::monitorChannel) @ $discordBot::cmdSplit @ "buildprx" @ $discordBot::cmdSplit @ $prx::terFile @ $discordBot::cmdSplit @ $prx::misFile @ "\r\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
function startPlayerPlot(%count){
|
|
||||||
if(!$pathMaps::running && (($MatchStarted + $missionRunning) == 2)){
|
|
||||||
if(%count > 1000){
|
|
||||||
$pathMaps::maxCount = %count;
|
|
||||||
}
|
|
||||||
$prx::terFile = Terrain.terrainFile;
|
|
||||||
$prx::misFile = $missionName;
|
|
||||||
$prx::count = 0;
|
|
||||||
$pathMaps::running = 1;
|
|
||||||
pathMapData();
|
|
||||||
sendToDiscord("Player Plot Started" SPC $pathMaps::maxCount, $discordBot::monitorChannel);
|
|
||||||
error("Player Plot Started");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
sendToDiscord("Game Has Not Started Yet", $discordBot::monitorChannel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function floorVector(%vec){
|
|
||||||
return mFloor(getWord(%vec,0)) SPC mFloor(getWord(%vec,1)) SPC mFloor(getWord(%vec,2));
|
|
||||||
}
|
|
||||||
function pathDataPoint(%client){
|
|
||||||
%player = %client.player;
|
|
||||||
if(isObject(%player)){
|
|
||||||
%veh = (isObject(%client.vehicleMounted)) ? %client.vehicleMounted.getDataBlock().getName() : 0;
|
|
||||||
$prx::data[$prx::Count] = %client.nameBase @ "%c" @ %pos @ "%c" @ %client.team @ "%c" @ isObject(%player.holdingFlag) @ "%c" @ %veh @ "%c" @ getSimTime();
|
|
||||||
$prx::count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function pathMapData(){ //loop to collect player position data
|
|
||||||
for(%x = 0; %x < ClientGroup.getCount(); %x++){
|
|
||||||
%client = ClientGroup.getObject(%x);
|
|
||||||
%player = %client.player;
|
|
||||||
if(isObject(%player)){
|
|
||||||
%pos = %player.getPosition();
|
|
||||||
%fpos = floorVector(%pos);
|
|
||||||
if(%player.lpm !$= %fpos){
|
|
||||||
%veh = (isObject(%client.vehicleMounted)) ? %client.vehicleMounted.getDataBlock().getName() : 0;
|
|
||||||
$prx::data[$prx::Count] = %client.nameBase @ "%c" @ %pos @ "%c" @ %client.team @ "%c" @ isObject(%player.holdingFlag) @ "%c" @ %veh @ "%c" @ getSimTime();
|
|
||||||
$prx::count++;
|
|
||||||
}
|
|
||||||
%player.lpm = %fpos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!($prx::eCount++ % 10)){error("pathMapData" SPC $prx::Count);}
|
|
||||||
|
|
||||||
if($pathMaps::running && (($MatchStarted + $missionRunning) == 2) && $prx::Count < $pathMaps::maxCount){// note will stop at end of mission
|
|
||||||
schedule($pathMaps::speed, 0,"pathMapData");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$pathMaps::running = 0;
|
|
||||||
sendToDiscord("Player Plot Processing", $discordBot::monitorChannel);
|
|
||||||
error("Player Plot Tracking Has Ended");
|
|
||||||
sendPrx(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
736
Classic/scripts/camera.cs
Normal file
736
Classic/scripts/camera.cs
Normal file
|
|
@ -0,0 +1,736 @@
|
||||||
|
$Camera::movementSpeed = 40;
|
||||||
|
|
||||||
|
datablock CameraData(Observer)
|
||||||
|
{
|
||||||
|
mode = "observerStatic";
|
||||||
|
firstPersonOnly = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
datablock CameraData(CommanderCamera)
|
||||||
|
{
|
||||||
|
mode = "observerStatic";
|
||||||
|
firstPersonOnly = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
function CommanderCamera::onTrigger( %data, %obj, %trigger, %state )
|
||||||
|
{
|
||||||
|
// no need to do anything here.
|
||||||
|
}
|
||||||
|
|
||||||
|
function Observer::onTrigger(%data,%obj,%trigger,%state)
|
||||||
|
{
|
||||||
|
// state = 0 means that a trigger key was released
|
||||||
|
if (%state == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//first, give the game the opportunity to prevent the observer action
|
||||||
|
if (!Game.ObserverOnTrigger(%data, %obj, %trigger, %state))
|
||||||
|
return;
|
||||||
|
|
||||||
|
//now observer functions if you press the "throw"
|
||||||
|
if (%trigger >= 4)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//trigger types: 0:fire 1:altTrigger 2:jump 3:jet 4:throw
|
||||||
|
%client = %obj.getControllingClient();
|
||||||
|
if (%client == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch$ (%obj.mode)
|
||||||
|
{
|
||||||
|
case "justJoined":
|
||||||
|
// z0dd - ZOD, 7/15/03. Don't need to waste CPU on a demo check
|
||||||
|
//if (isDemo())
|
||||||
|
// clearCenterPrint(%client);
|
||||||
|
if (%trigger == 0) //press FIRE
|
||||||
|
{
|
||||||
|
// clear intro message
|
||||||
|
clearBottomPrint( %client );
|
||||||
|
|
||||||
|
//spawn the player
|
||||||
|
commandToClient(%client, 'setHudMode', 'Standard');
|
||||||
|
Game.assignClientTeam(%client);
|
||||||
|
Game.spawnPlayer( %client, $MatchStarted );
|
||||||
|
|
||||||
|
if( $MatchStarted )
|
||||||
|
{
|
||||||
|
%client.camera.setFlyMode();
|
||||||
|
%client.setControlObject( %client.player );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player );
|
||||||
|
%client.setControlObject( %client.camera );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (%trigger == 3) //press JET
|
||||||
|
{
|
||||||
|
//cycle throw the static observer spawn points
|
||||||
|
%markerObj = Game.pickObserverSpawn(%client, true);
|
||||||
|
%transform = %markerObj.getTransform();
|
||||||
|
%obj.setTransform(%transform);
|
||||||
|
%obj.setFlyMode();
|
||||||
|
}
|
||||||
|
else if (%trigger == 2) //press JUMP
|
||||||
|
{
|
||||||
|
//switch the observer mode to observing clients
|
||||||
|
if (isObject(%client.observeFlyClient))
|
||||||
|
serverCmdObserveClient(%client, %client.observeFlyClient);
|
||||||
|
else
|
||||||
|
serverCmdObserveClient(%client, -1);
|
||||||
|
|
||||||
|
displayObserverHud(%client, %client.observeClient);
|
||||||
|
if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching.
|
||||||
|
messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
case "playerDeath":
|
||||||
|
// Attached to a dead player - spawn regardless of trigger type
|
||||||
|
if(!%client.waitRespawn && getSimTime() > %client.suicideRespawnTime)
|
||||||
|
{
|
||||||
|
commandToClient(%client, 'setHudMode', 'Standard');
|
||||||
|
Game.spawnPlayer( %client, true );
|
||||||
|
%client.camera.setFlyMode();
|
||||||
|
%client.setControlObject(%client.player);
|
||||||
|
}
|
||||||
|
|
||||||
|
case "PreviewMode":
|
||||||
|
if (%trigger == 0)
|
||||||
|
{
|
||||||
|
commandToClient(%client, 'setHudMode', 'Standard');
|
||||||
|
if( %client.lastTeam )
|
||||||
|
Game.clientJoinTeam( %client, %client.lastTeam );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Game.assignClientTeam( %client, true );
|
||||||
|
|
||||||
|
// Spawn the player:
|
||||||
|
Game.spawnPlayer( %client, false );
|
||||||
|
}
|
||||||
|
%client.camera.setFlyMode();
|
||||||
|
%client.setControlObject( %client.player );
|
||||||
|
}
|
||||||
|
|
||||||
|
case "toggleCameraFly":
|
||||||
|
// this is the default camera mode
|
||||||
|
|
||||||
|
case "observerFly":
|
||||||
|
// Free-flying observer camera
|
||||||
|
if (%trigger == 0)
|
||||||
|
{
|
||||||
|
if( !$Host::TournamentMode && $MatchStarted )
|
||||||
|
{
|
||||||
|
// reset observer params
|
||||||
|
clearBottomPrint(%client);
|
||||||
|
commandToClient(%client, 'setHudMode', 'Standard');
|
||||||
|
|
||||||
|
if( %client.lastTeam !$= "" && %client.lastTeam != 0 && Game.numTeams > 1)
|
||||||
|
{
|
||||||
|
Game.clientJoinTeam( %client, %client.lastTeam, $MatchStarted );
|
||||||
|
%client.camera.setFlyMode();
|
||||||
|
%client.setControlObject( %client.player );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Game.assignClientTeam( %client );
|
||||||
|
|
||||||
|
// Spawn the player:
|
||||||
|
Game.spawnPlayer( %client, true );
|
||||||
|
%client.camera.setFlyMode();
|
||||||
|
%client.setControlObject( %client.player );
|
||||||
|
ClearBottomPrint( %client );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if( !$Host::TournamentMode )
|
||||||
|
{
|
||||||
|
clearBottomPrint(%client);
|
||||||
|
Game.assignClientTeam( %client );
|
||||||
|
|
||||||
|
// Spawn the player:
|
||||||
|
Game.spawnPlayer( %client, false );
|
||||||
|
%client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player );
|
||||||
|
%client.setControlObject( %client.camera );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (%trigger == 3) //press JET
|
||||||
|
{
|
||||||
|
%markerObj = Game.pickObserverSpawn(%client, true);
|
||||||
|
%transform = %markerObj.getTransform();
|
||||||
|
%obj.setTransform(%transform);
|
||||||
|
%obj.setFlyMode();
|
||||||
|
}
|
||||||
|
else if (%trigger == 2) //press JUMP
|
||||||
|
{
|
||||||
|
//switch the observer mode to observing clients
|
||||||
|
if (isObject(%client.observeFlyClient))
|
||||||
|
serverCmdObserveClient(%client, %client.observeFlyClient);
|
||||||
|
else
|
||||||
|
serverCmdObserveClient(%client, -1);
|
||||||
|
|
||||||
|
observerFollowUpdate( %client, %client.observeClient, false );
|
||||||
|
displayObserverHud(%client, %client.observeClient);
|
||||||
|
if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching.
|
||||||
|
messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
case "observerStatic":
|
||||||
|
// Non-moving observer camera
|
||||||
|
%next = (%trigger == 3 ? true : false);
|
||||||
|
%markerObj = Game.pickObserverSpawn(%client, %next);
|
||||||
|
%transform = %markerObj.getTransform();
|
||||||
|
%obj.setTransform(%transform);
|
||||||
|
%obj.setFlyMode();
|
||||||
|
|
||||||
|
case "observerStaticNoNext":
|
||||||
|
// Non-moving, non-cycling observer camera
|
||||||
|
|
||||||
|
case "observerTimeout":
|
||||||
|
// Player didn't respawn quickly enough
|
||||||
|
if (%trigger == 0)
|
||||||
|
{
|
||||||
|
clearBottomPrint(%client);
|
||||||
|
commandToClient(%client, 'setHudMode', 'Standard');
|
||||||
|
if( %client.lastTeam )
|
||||||
|
Game.clientJoinTeam( %client, %client.lastTeam, true );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Game.assignClientTeam( %client );
|
||||||
|
|
||||||
|
// Spawn the player:
|
||||||
|
Game.spawnPlayer( %client, true );
|
||||||
|
}
|
||||||
|
%client.camera.setFlyMode();
|
||||||
|
%client.setControlObject( %client.player );
|
||||||
|
}
|
||||||
|
else if (%trigger == 3) //press JET
|
||||||
|
{
|
||||||
|
%markerObj = Game.pickObserverSpawn(%client, true);
|
||||||
|
%transform = %markerObj.getTransform();
|
||||||
|
%obj.setTransform(%transform);
|
||||||
|
%obj.setFlyMode();
|
||||||
|
}
|
||||||
|
else if (%trigger == 2) //press JUMP
|
||||||
|
{
|
||||||
|
//switch the observer mode to observing clients
|
||||||
|
if (isObject(%client.observeFlyClient))
|
||||||
|
serverCmdObserveClient(%client, %client.observeFlyClient);
|
||||||
|
else
|
||||||
|
serverCmdObserveClient(%client, -1);
|
||||||
|
|
||||||
|
// update the observer list for this client
|
||||||
|
observerFollowUpdate( %client, %client.observeClient, false );
|
||||||
|
|
||||||
|
displayObserverHud(%client, %client.observeClient);
|
||||||
|
if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching.
|
||||||
|
messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
case "observerFollow":
|
||||||
|
// Observer attached to a moving object (assume player for now...)
|
||||||
|
//press FIRE - cycle to next client
|
||||||
|
if (%trigger == 0)
|
||||||
|
{
|
||||||
|
%nextClient = findNextObserveClient(%client);
|
||||||
|
%prevObsClient = %client.observeClient;
|
||||||
|
if (%nextClient > 0 && %nextClient != %client.observeClient)
|
||||||
|
{
|
||||||
|
// update the observer list for this client
|
||||||
|
observerFollowUpdate( %client, %nextClient, true );
|
||||||
|
|
||||||
|
//set the new object
|
||||||
|
%transform = %nextClient.player.getTransform();
|
||||||
|
//if( !%nextClient.isMounted() ) z0dd - ZOD, 7/15/03. DUH!
|
||||||
|
if( !%nextClient.player.isMounted() )
|
||||||
|
{
|
||||||
|
//z0dd - ZOD, 7/15/03. Use datablock of armor for observer params
|
||||||
|
%params = %nextClient.player.getDataBlock().observeParameters;
|
||||||
|
%obj.setOrbitMode(%nextClient.player, %transform, getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
||||||
|
//%obj.setOrbitMode(%nextClient.player, %transform, 0.5, 4.5, 4.5);
|
||||||
|
%client.observeClient = %nextClient;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%mount = %nextClient.player.getObjectMount();
|
||||||
|
if( %mount.getDataBlock().observeParameters $= "" )
|
||||||
|
%params = %transform;
|
||||||
|
else
|
||||||
|
%params = %mount.getDataBlock().observeParameters;
|
||||||
|
|
||||||
|
%obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
||||||
|
%client.observeClient = %nextClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
//send the message(s)
|
||||||
|
displayObserverHud(%client, %nextClient);
|
||||||
|
if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching.
|
||||||
|
{
|
||||||
|
messageClient(%nextClient, 'Observer', '\c1%1 is now observing you.', %client.name);
|
||||||
|
messageClient(%prevObsClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (%trigger == 3) //press JET - cycle to prev client
|
||||||
|
{
|
||||||
|
%prevClient = findPrevObserveClient(%client);
|
||||||
|
%prevObsClient = %client.observeClient;
|
||||||
|
if (%prevClient > 0 && %prevClient != %client.observeClient)
|
||||||
|
{
|
||||||
|
// update the observer list for this client
|
||||||
|
observerFollowUpdate( %client, %prevClient, true );
|
||||||
|
|
||||||
|
//set the new object
|
||||||
|
%transform = %prevClient.player.getTransform();
|
||||||
|
//if( !%prevClient.isMounted() ) z0dd - ZOD, 7/15/03. DUH!
|
||||||
|
if( !%prevClient.player.isMounted() )
|
||||||
|
{
|
||||||
|
//z0dd - ZOD, 7/15/03. Use datablock of armor for observer params
|
||||||
|
%params = %prevClient.player.getDataBlock().observeParameters;
|
||||||
|
%obj.setOrbitMode(%prevClient.player, %transform, getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
||||||
|
//%obj.setOrbitMode(%prevClient.player, %transform, 0.5, 4.5, 4.5);
|
||||||
|
%client.observeClient = %prevClient;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%mount = %prevClient.player.getObjectMount();
|
||||||
|
if( %mount.getDataBlock().observeParameters $= "" )
|
||||||
|
%params = %transform;
|
||||||
|
else
|
||||||
|
%params = %mount.getDataBlock().observeParameters;
|
||||||
|
|
||||||
|
%obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
||||||
|
%client.observeClient = %prevClient;
|
||||||
|
}
|
||||||
|
//send the message(s)
|
||||||
|
displayObserverHud(%client, %prevClient);
|
||||||
|
if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching.
|
||||||
|
{
|
||||||
|
messageClient(%prevClient, 'Observer', '\c1%1 is now observing you.', %client.name);
|
||||||
|
messageClient(%prevObsClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (%trigger == 2) //press JUMP
|
||||||
|
{
|
||||||
|
// update the observer list for this client
|
||||||
|
observerFollowUpdate( %client, -1, false );
|
||||||
|
|
||||||
|
//toggle back to observer fly mode
|
||||||
|
%obj.mode = "observerFly";
|
||||||
|
%obj.setFlyMode();
|
||||||
|
updateObserverFlyHud(%client);
|
||||||
|
if(!%client.isAdmin) // z0dd - ZOD, 7/15/03. Only warn them if it isn't an admin watching.
|
||||||
|
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
case "pre-game":
|
||||||
|
if(!$Host::TournamentMode || $CountdownStarted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
%readySpamDif = getSimTime() - %client.readySpam;
|
||||||
|
%readySpamDif1 = getSimTime() - %client.readySpamMsg;
|
||||||
|
if(%readySpamDif > 10000 || !%client.readySpam)
|
||||||
|
{
|
||||||
|
%client.readySpam = getSimTime();
|
||||||
|
if(%client.notReady)
|
||||||
|
{
|
||||||
|
%client.notReady = "";
|
||||||
|
MessageAll( 0, '\c1%1 is READY.', %client.name );
|
||||||
|
if(%client.notReadyCount < 3)
|
||||||
|
centerprint( %client, "\nWaiting for match start (FIRE if not ready)", 0, 3);
|
||||||
|
else
|
||||||
|
centerprint( %client, "\nWaiting for match start", 0, 3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%client.notReadyCount++;
|
||||||
|
if(%client.notReadyCount < 4)
|
||||||
|
{
|
||||||
|
%client.notReady = true;
|
||||||
|
MessageAll( 0, '\c1%1 is not READY.', %client.name );
|
||||||
|
centerprint( %client, "\nPress FIRE when ready.", 0, 3 );
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckTourneyMatchStart();
|
||||||
|
}
|
||||||
|
else if((%readySpamDif1 > 1000 || !%client.readySpamMsg) && %client.notReadyCount < 4)
|
||||||
|
{
|
||||||
|
%client.readySpamMsg = getSimTime();
|
||||||
|
%wait = mFloor((10000 - (getSimTime() - %client.readySpam)) / 1000);
|
||||||
|
messageClient(%client, 'MsgObserverCooldown', '\c3Ready Cooldown:\cr Please wait another %1 seconds.', %wait );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Observer::setMode(%data, %obj, %mode, %targetObj)
|
||||||
|
{
|
||||||
|
if(%mode $= "")
|
||||||
|
return;
|
||||||
|
%client = %obj.getControllingClient();
|
||||||
|
switch$ (%mode) {
|
||||||
|
case "justJoined":
|
||||||
|
commandToClient(%client, 'setHudMode', 'Observer');
|
||||||
|
%markerObj = Game.pickObserverSpawn(%client, true);
|
||||||
|
%transform = %markerObj.getTransform();
|
||||||
|
%obj.setTransform(%transform);
|
||||||
|
%obj.setFlyMode();
|
||||||
|
|
||||||
|
case "pre-game":
|
||||||
|
commandToClient(%client, 'setHudMode', 'Observer');
|
||||||
|
//z0dd - ZOD, 7/15/03. Use datablock of armor for observer params
|
||||||
|
%params = %targetObj.getDataBlock().observeParameters;
|
||||||
|
%obj.setOrbitMode(%targetObj, %targetObj.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
||||||
|
//%obj.setOrbitMode( %targetObj, %targetObj.getTransform(), 0.5, 4.5, 4.5);
|
||||||
|
|
||||||
|
case "observerFly":
|
||||||
|
// Free-flying observer camera
|
||||||
|
commandToClient(%client, 'setHudMode', 'Observer');
|
||||||
|
%markerObj = Game.pickObserverSpawn(%client, true);
|
||||||
|
%transform = %markerObj.getTransform();
|
||||||
|
%obj.setTransform(%transform);
|
||||||
|
%obj.setFlyMode();
|
||||||
|
|
||||||
|
case "observerStatic" or "observerStaticNoNext":
|
||||||
|
// Non-moving observer camera
|
||||||
|
%markerObj = Game.pickObserverSpawn(%client, true);
|
||||||
|
%transform = %markerObj.getTransform();
|
||||||
|
%obj.setTransform(%transform);
|
||||||
|
|
||||||
|
case "observerFollow":
|
||||||
|
// Observer attached to a moving object (assume player for now...)
|
||||||
|
%transform = %targetObj.getTransform();
|
||||||
|
|
||||||
|
if( !%targetObj.isMounted() )
|
||||||
|
{
|
||||||
|
//z0dd - ZOD, 7/15/03. Use datablock of armor for observer params
|
||||||
|
%params = %targetObj.getDataBlock().observeParameters;
|
||||||
|
%obj.setOrbitMode(%targetObj, %transform, getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
||||||
|
//%obj.setOrbitMode(%targetObj, %transform, 0.5, 4.5, 4.5);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%mount = %targetObj.getObjectMount();
|
||||||
|
if( %mount.getDataBlock().observeParameters $= "" )
|
||||||
|
%params = %transform;
|
||||||
|
else
|
||||||
|
%params = %mount.getDataBlock().observeParameters;
|
||||||
|
|
||||||
|
%obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
||||||
|
}
|
||||||
|
|
||||||
|
case "observerTimeout":
|
||||||
|
commandToClient(%client, 'setHudMode', 'Observer');
|
||||||
|
%markerObj = Game.pickObserverSpawn(%client, true);
|
||||||
|
%transform = %markerObj.getTransform();
|
||||||
|
%obj.setTransform(%transform);
|
||||||
|
%obj.setFlyMode();
|
||||||
|
}
|
||||||
|
%obj.mode = %mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
function findNextObserveClient(%client)
|
||||||
|
{
|
||||||
|
%index = -1;
|
||||||
|
%count = ClientGroup.getCount();
|
||||||
|
if (%count <= 1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (%i = 0; %i < %count; %i++)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
if (%cl == %client.observeClient)
|
||||||
|
{
|
||||||
|
%index = %i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//now find the next client (note, if not found, %index still == -1)
|
||||||
|
%index++;
|
||||||
|
if (%index >= %count)
|
||||||
|
%index = 0;
|
||||||
|
|
||||||
|
%newClient = -1;
|
||||||
|
for (%i = %index; %i < %count; %i++)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
if (%cl != %client && %cl.player > 0)
|
||||||
|
{
|
||||||
|
%newClient = %cl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//if we didn't find anyone, search from the beginning again
|
||||||
|
if (%newClient < 0)
|
||||||
|
{
|
||||||
|
for (%i = 0; %i < %count; %i++)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
if (%cl != %client && %cl.player > 0)
|
||||||
|
{
|
||||||
|
%newClient = %cl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//if we still haven't found anyone (new), give up..
|
||||||
|
if (%newClient < 0 || %newClient.player == %player)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function findPrevObserveClient(%client)
|
||||||
|
{
|
||||||
|
%index = -1;
|
||||||
|
%count = ClientGroup.getCount();
|
||||||
|
if (%count <= 1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (%i = 0; %i < %count; %i++)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
if (%cl == %client.observeClient)
|
||||||
|
{
|
||||||
|
%index = %i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//now find the prev client
|
||||||
|
%index--;
|
||||||
|
if (%index < 0)
|
||||||
|
%index = %count - 1;
|
||||||
|
|
||||||
|
%newClient = -1;
|
||||||
|
for (%i = %index; %i >= 0; %i--)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
if (%cl != %client && %cl.player > 0)
|
||||||
|
{
|
||||||
|
%newClient = %cl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//if we didn't find anyone, search from the end again
|
||||||
|
if (%newClient < 0)
|
||||||
|
{
|
||||||
|
for (%i = %count - 1; %i >= 0; %i--)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
if (%cl != %client && %cl.player > 0)
|
||||||
|
{
|
||||||
|
%newClient = %cl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//if we still haven't found anyone (new), give up..
|
||||||
|
if (%newClient < 0 || %newClient.player == %player)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function observeClient(%client)
|
||||||
|
{
|
||||||
|
if( $testcheats )
|
||||||
|
{
|
||||||
|
//pass in -1 to choose any client...
|
||||||
|
commandToServer('observeClient', %client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function serverCmdObserveClient(%client, %target)
|
||||||
|
{
|
||||||
|
//clear the observer fly mode var...
|
||||||
|
%client.observeFlyClient = -1;
|
||||||
|
|
||||||
|
//cancel any scheduled update
|
||||||
|
cancel(%client.obsHudSchedule);
|
||||||
|
|
||||||
|
// must be an observer when observing other clients
|
||||||
|
if( %client.getControlObject() != %client.camera)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//can't observer yourself
|
||||||
|
if (%client == %target)
|
||||||
|
return;
|
||||||
|
|
||||||
|
%count = ClientGroup.getCount();
|
||||||
|
|
||||||
|
//can't go into observer mode if you're the only client
|
||||||
|
if (%count <= 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//make sure the target actually exists
|
||||||
|
if (%target > 0)
|
||||||
|
{
|
||||||
|
%found = false;
|
||||||
|
for (%i = 0; %i < %count; %i++)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
if (%cl == %target)
|
||||||
|
{
|
||||||
|
%found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!%found)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%client.observeClient = -1;
|
||||||
|
%target = findNextObserveClient(%client);
|
||||||
|
if (%target <= 0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//send the message
|
||||||
|
if (%client.camera.mode !$= "observerFollow")
|
||||||
|
{
|
||||||
|
if (isObject(%client.player))
|
||||||
|
%client.player.scriptKill(0);
|
||||||
|
|
||||||
|
//messageAllExcept(%client, -1, 'ClientNowObserver', '\c1%1 is now an observer.', %client.name);
|
||||||
|
//messageClient(%client, 'YouNowObserver', '\c1You are now observing %1.', %target.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
%client.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player);
|
||||||
|
%client.setControlObject(%client.camera);
|
||||||
|
|
||||||
|
//tag is used if a client who is being observed dies...
|
||||||
|
%client.observeClient = %target;
|
||||||
|
}
|
||||||
|
|
||||||
|
function observerFollowUpdate( %client, %nextClient, %cycle )
|
||||||
|
{
|
||||||
|
%Oclient = %client.observeClient;
|
||||||
|
if( %Oclient $= "" )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// changed to observer fly...
|
||||||
|
if( %nextClient == -1 )
|
||||||
|
{
|
||||||
|
// find us in their observer list and remove, then reshuffle the list...
|
||||||
|
for( %i = 0; %i < %Oclient.observeCount; %i++ )
|
||||||
|
{
|
||||||
|
if( %Oclient.observers[%i] == %client )
|
||||||
|
{
|
||||||
|
%Oclient.observeCount--;
|
||||||
|
%Oclient.observers[%i] = %Oclient.observers[%Oclient.observeCount];
|
||||||
|
%Oclient.observers[%Oclient.observeCount] = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return; // were done..
|
||||||
|
}
|
||||||
|
|
||||||
|
// changed from observer fly to observer follow...
|
||||||
|
if( !%cycle && %nextClient != -1 )
|
||||||
|
{
|
||||||
|
// if nobody is observing this guy, initialize their observer count...
|
||||||
|
if( %nextClient.observeCount $= "" )
|
||||||
|
%nextClient.observeCount = 0;
|
||||||
|
|
||||||
|
// add us to their list of observers...
|
||||||
|
%nextClient.observers[%nextClient.observeCount] = %client;
|
||||||
|
%nextClient.observeCount++;
|
||||||
|
return; // were done.
|
||||||
|
}
|
||||||
|
|
||||||
|
if( %nextClient != -1 )
|
||||||
|
{
|
||||||
|
// cycling to the next client...
|
||||||
|
for( %i = 0; %i < %Oclient.observeCount; %i++ )
|
||||||
|
{
|
||||||
|
// first remove us from our prev client's list...
|
||||||
|
if( %Oclient.observers[%i] == %client )
|
||||||
|
{
|
||||||
|
%Oclient.observeCount--;
|
||||||
|
%Oclient.observers[%i] = %Oclient.observers[%Oclient.observeCount];
|
||||||
|
%Oclient.observers[%Oclient.observeCount] = "";
|
||||||
|
break; // screw you guys, i'm goin home!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if nobody is observing this guy, initialize their observer count...
|
||||||
|
if( %nextClient.observeCount $= "" )
|
||||||
|
%nextClient.observeCount = 0;
|
||||||
|
|
||||||
|
// now add us to the new clients list...
|
||||||
|
%nextClient.observeCount++;
|
||||||
|
%nextClient.observers[%nextClient.observeCount - 1] = %client;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateObserverFlyHud(%client)
|
||||||
|
{
|
||||||
|
//just in case there are two threads going...
|
||||||
|
cancel(%client.obsHudSchedule);
|
||||||
|
%client.observeFlyClient = -1;
|
||||||
|
|
||||||
|
//make sure the client is supposed to be in observer fly mode...
|
||||||
|
if (!isObject(%client) || %client.team != 0 || %client.getControlObject() != %client.camera || %client.camera.mode $= "observerFollow")
|
||||||
|
return;
|
||||||
|
|
||||||
|
//get various info about the player's eye
|
||||||
|
%srcEyeTransform = %client.camera.getTransform();
|
||||||
|
%srcEyePoint = firstWord(%srcEyeTransform) @ " " @ getWord(%srcEyeTransform, 1) @ " " @ getWord(%srcEyeTransform, 2);
|
||||||
|
|
||||||
|
%srcEyeVector = MatrixMulVector("0 0 0 " @ getWords(%srcEyeTransform, 3, 6), "0 1 0");
|
||||||
|
%srcEyeVector = VectorNormalize(%srcEyeVector);
|
||||||
|
|
||||||
|
//see if there's an enemy near our defense location...
|
||||||
|
%clientCount = 0;
|
||||||
|
%count = ClientGroup.getCount();
|
||||||
|
%viewedClient = -1;
|
||||||
|
%clientDot = -1;
|
||||||
|
for(%i = 0; %i < %count; %i++)
|
||||||
|
{
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
|
||||||
|
//make sure we find an AI who's alive and not the client
|
||||||
|
if (%cl != %client && isObject(%cl.player))
|
||||||
|
{
|
||||||
|
//make sure the player is within range
|
||||||
|
%clPos = %cl.player.getWorldBoxCenter();
|
||||||
|
%distance = VectorDist(%clPos, %srcEyePoint);
|
||||||
|
if (%distance <= 30)
|
||||||
|
{
|
||||||
|
//create the vector from the client to the client
|
||||||
|
%clVector = VectorNormalize(VectorSub(%clPos, %srcEyePoint));
|
||||||
|
|
||||||
|
//see if the dot product is greater than our current, and greater than 0.6
|
||||||
|
%dot = VectorDot(%clVector, %srcEyeVector);
|
||||||
|
|
||||||
|
if (%dot > 0.6 && %dot > %clientDot)
|
||||||
|
{
|
||||||
|
//make sure we're not looking through walls...
|
||||||
|
%mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType;
|
||||||
|
%losResult = containerRayCast(%srcEyePoint, %clPos, %mask);
|
||||||
|
%losObject = GetWord(%losResult, 0);
|
||||||
|
if (!isObject(%losObject))
|
||||||
|
{
|
||||||
|
%viewedClient = %cl;
|
||||||
|
%clientDot = %dot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isObject(%viewedClient))
|
||||||
|
displayObserverHud(%client, 0, %viewedClient);
|
||||||
|
else
|
||||||
|
displayObserverHud(%client, 0);
|
||||||
|
|
||||||
|
%client.observeFlyClient = %viewedClient;
|
||||||
|
|
||||||
|
//schedule the next...
|
||||||
|
%client.obsHudSchedule = schedule(500, %client, updateObserverFlyHud, %client);
|
||||||
|
}
|
||||||
|
|
@ -1802,7 +1802,7 @@ function DefaultGame::clientMissionDropReady(%game, %client)
|
||||||
%damMess = "DISABLED";
|
%damMess = "DISABLED";
|
||||||
|
|
||||||
if(%game.numTeams > 1)
|
if(%game.numTeams > 1)
|
||||||
BottomPrint(%client, "Server is Running in Tournament Mode.\nPick a Team\nTeam Damage is " @ %damMess, 0, 3 );
|
BottomPrint(%client, "Server is Running in Tournament Mode.\nGood luck and Have Fun!\nTeam Damage is " @ %damMess, 0, 3 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2973,13 +2973,13 @@ function DefaultGame::sendGameTeamList( %game, %client, %key )
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
function DefaultGame::sendTimeLimitList( %game, %client, %key )
|
function DefaultGame::sendTimeLimitList( %game, %client, %key )
|
||||||
{
|
{
|
||||||
|
messageClient( %client, 'MsgVoteItem', "", %key, 30, "", '30 minutes' );
|
||||||
|
messageClient( %client, 'MsgVoteItem', "", %key, 45, "", '45 minutes' );
|
||||||
|
messageClient( %client, 'MsgVoteItem', "", %key, 60, "", '60 minutes' );
|
||||||
|
messageClient( %client, 'MsgVoteItem', "", %key, 75, "", '75 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 90, "", '90 minutes' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 90, "", '90 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 120, "", '120 minutes' );
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 150, "", '150 minutes' );
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 180, "", '180 minutes' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 180, "", '180 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 240, "", '240 minutes' );
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 360, "", '360 minutes' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 360, "", '360 minutes' );
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 480, "", '480 minutes' );
|
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 999, "", 'No time limit' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 999, "", 'No time limit' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3385,9 +3385,10 @@ function DefaultGame::voteAdminPlayer(%game, %admin, %client)
|
||||||
|
|
||||||
if (%admin)
|
if (%admin)
|
||||||
{
|
{
|
||||||
messageAll('MsgAdminAdminPlayer', '\c2The Admin %3 made %2 an admin.', %client, %client.name, $AdminCl.name);
|
messageAll('MsgAdminAdminPlayer', '\c2The Admin %3 made %2 an admin.', %client, %client.name, %admin.nameBase);
|
||||||
%client.isAdmin = 1;
|
%client.isAdmin = 1;
|
||||||
%cause = "(admin)";
|
%cause = "(admin)";
|
||||||
|
adminLog(%admin, " has made" SPC %client.nameBase @ "(" @ %client.guid @ ") an admin.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -3402,6 +3403,7 @@ function DefaultGame::voteAdminPlayer(%game, %admin, %client)
|
||||||
else
|
else
|
||||||
messageAll('MsgVoteFailed', '\c2Vote to make %1 an admin did not pass.', %client.name);
|
messageAll('MsgVoteFailed', '\c2Vote to make %1 an admin did not pass.', %client.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%cause !$= "")
|
if(%cause !$= "")
|
||||||
logEcho($AdminCl.nameBase @ ": " @ %client.nameBase@" (cl "@%client@") made admin "@%cause, 1);
|
logEcho($AdminCl.nameBase @ ": " @ %client.nameBase@" (cl "@%client@") made admin "@%cause, 1);
|
||||||
}
|
}
|
||||||
|
|
@ -3847,10 +3849,9 @@ function notifyMatchEnd(%time)
|
||||||
{
|
{
|
||||||
%seconds = mFloor(%time / 1000);
|
%seconds = mFloor(%time / 1000);
|
||||||
|
|
||||||
if (%seconds > 1) {
|
if(%seconds > 1)
|
||||||
MessageAll('MsgMissionEnd', '\c2Match ends in %1 seconds.~wfx/misc/hunters_%1.wav', %seconds);
|
MessageAll('MsgMissionEnd', '\c2Match ends in %1 seconds.~wfx/misc/hunters_%1.wav', %seconds);
|
||||||
}
|
else if(%seconds == 1)
|
||||||
else if (%seconds == 1)
|
|
||||||
MessageAll('MsgMissionEnd', '\c2Match ends in 1 second.~wfx/misc/hunters_1.wav');
|
MessageAll('MsgMissionEnd', '\c2Match ends in 1 second.~wfx/misc/hunters_1.wav');
|
||||||
|
|
||||||
UpdateClientTimes(%time);
|
UpdateClientTimes(%time);
|
||||||
|
|
@ -3860,9 +3861,15 @@ function notifyMatchEndMinutes(%time)
|
||||||
{
|
{
|
||||||
%seconds = mFloor(%time / 1000);
|
%seconds = mFloor(%time / 1000);
|
||||||
|
|
||||||
if (%seconds == 180)
|
if(%seconds == 900 && $Host::TournamentMode)
|
||||||
|
MessageAll('MsgMissionEndMinutes', '\c2Match ends in 15 minutes.~wfx/misc/flagself.wav');
|
||||||
|
else if(%seconds == 600 && $Host::TournamentMode)
|
||||||
|
MessageAll('MsgMissionEndMinutes', '\c2Match ends in 10 minutes.~wfx/misc/flagself.wav');
|
||||||
|
else if(%seconds == 300 && $Host::TournamentMode)
|
||||||
|
MessageAll('MsgMissionEndMinutes', '\c2Match ends in 5 minutes.~wfx/misc/flagself.wav');
|
||||||
|
else if(%seconds == 180)
|
||||||
MessageAll('MsgMissionEndMinutes', '\c2Match ends in 3 minutes.~wfx/misc/flagself.wav');
|
MessageAll('MsgMissionEndMinutes', '\c2Match ends in 3 minutes.~wfx/misc/flagself.wav');
|
||||||
else if (%seconds == 120)
|
else if(%seconds == 120)
|
||||||
MessageAll('MsgMissionEndMinutes', '\c2Match ends in 2 minutes.~wfx/misc/flagself.wav');
|
MessageAll('MsgMissionEndMinutes', '\c2Match ends in 2 minutes.~wfx/misc/flagself.wav');
|
||||||
|
|
||||||
UpdateClientTimes(%time);
|
UpdateClientTimes(%time);
|
||||||
|
|
|
||||||
|
|
@ -955,7 +955,7 @@ function explodeFirework(%position, %id)
|
||||||
};
|
};
|
||||||
|
|
||||||
//echo(%emitter.position);
|
//echo(%emitter.position);
|
||||||
serverPlay3d(dtFireworksSound, %emitter.position);
|
//serverPlay3d(dtFireworksSound, %emitter.position);
|
||||||
MissionCleanup.add(%emitter);
|
MissionCleanup.add(%emitter);
|
||||||
%emitter.schedule(1250, "delete");
|
%emitter.schedule(1250, "delete");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ datablock AudioProfile(CorpseLootingSound)
|
||||||
preload = true;
|
preload = true;
|
||||||
effect = CorpseLootingEffect;
|
effect = CorpseLootingEffect;
|
||||||
};
|
};
|
||||||
|
|
||||||
datablock AudioProfile(ArmorMoveBubblesSound)
|
datablock AudioProfile(ArmorMoveBubblesSound)
|
||||||
{
|
{
|
||||||
filename = "fx/armor/bubbletrail2.wav";
|
filename = "fx/armor/bubbletrail2.wav";
|
||||||
|
|
@ -1085,8 +1085,8 @@ datablock ParticleData(LightPuff)
|
||||||
textureName = "particleTest";
|
textureName = "particleTest";
|
||||||
colors[0] = "0.46 0.36 0.26 0.4";
|
colors[0] = "0.46 0.36 0.26 0.4";
|
||||||
colors[1] = "0.46 0.46 0.36 0.0";
|
colors[1] = "0.46 0.46 0.36 0.0";
|
||||||
sizes[0] = 0.4;
|
sizes[0] = 0.8; //was 0.4
|
||||||
sizes[1] = 1.0;
|
sizes[1] = 1.4; //was 1.0
|
||||||
};
|
};
|
||||||
|
|
||||||
datablock ParticleEmitterData(LightPuffEmitter)
|
datablock ParticleEmitterData(LightPuffEmitter)
|
||||||
|
|
@ -1123,9 +1123,9 @@ datablock ParticleData(LiftoffDust)
|
||||||
colors[0] = "0.46 0.36 0.26 0.0";
|
colors[0] = "0.46 0.36 0.26 0.0";
|
||||||
colors[1] = "0.46 0.46 0.36 0.4";
|
colors[1] = "0.46 0.46 0.36 0.4";
|
||||||
colors[2] = "0.46 0.46 0.36 0.0";
|
colors[2] = "0.46 0.46 0.36 0.0";
|
||||||
sizes[0] = 0.2;
|
sizes[0] = 0.6; //was 0.2
|
||||||
sizes[1] = 0.6;
|
sizes[1] = 1.0; //was 0.6
|
||||||
sizes[2] = 1.0;
|
sizes[2] = 1.4; //was 1.0
|
||||||
times[0] = 0.0;
|
times[0] = 0.0;
|
||||||
times[1] = 0.5;
|
times[1] = 0.5;
|
||||||
times[2] = 1.0;
|
times[2] = 1.0;
|
||||||
|
|
@ -1193,11 +1193,11 @@ datablock DebrisData( PlayerDebris )
|
||||||
|
|
||||||
velocity = 18.0;
|
velocity = 18.0;
|
||||||
velocityVariance = 12.0;
|
velocityVariance = 12.0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// z0dd - ZOD, 4/21/02. Altered most of these properties
|
// z0dd - ZOD, 4/21/02. Altered most of these properties
|
||||||
datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
|
datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
|
||||||
{
|
{
|
||||||
emap = true;
|
emap = true;
|
||||||
|
|
||||||
className = Armor;
|
className = Armor;
|
||||||
|
|
@ -1316,8 +1316,8 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
|
||||||
splashEmitter[0] = PlayerFoamDropletsEmitter;
|
splashEmitter[0] = PlayerFoamDropletsEmitter;
|
||||||
splashEmitter[1] = PlayerFoamEmitter;
|
splashEmitter[1] = PlayerFoamEmitter;
|
||||||
splashEmitter[2] = PlayerBubbleEmitter;
|
splashEmitter[2] = PlayerBubbleEmitter;
|
||||||
mediumSplashSoundVelocity = 10.0;
|
mediumSplashSoundVelocity = 10.0;
|
||||||
hardSplashSoundVelocity = 20.0;
|
hardSplashSoundVelocity = 20.0;
|
||||||
exitSplashSoundVelocity = 5.0;
|
exitSplashSoundVelocity = 5.0;
|
||||||
|
|
||||||
// Controls over slope of runnable/jumpable surfaces
|
// Controls over slope of runnable/jumpable surfaces
|
||||||
|
|
@ -1436,7 +1436,7 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
|
||||||
|
|
||||||
observeParameters = "0.5 4.5 4.5";
|
observeParameters = "0.5 4.5 4.5";
|
||||||
shieldEffectScale = "0.7 0.7 1.0";
|
shieldEffectScale = "0.7 0.7 1.0";
|
||||||
|
|
||||||
//Kills autopoints
|
//Kills autopoints
|
||||||
detectsUsingLOSEnemy[1] = true;
|
detectsUsingLOSEnemy[1] = true;
|
||||||
detectsUsingLOSEnemy[2] = true;
|
detectsUsingLOSEnemy[2] = true;
|
||||||
|
|
@ -1453,7 +1453,7 @@ datablock DecalData(MediumMaleFootprint)
|
||||||
|
|
||||||
// z0dd - ZOD, 4/21/02. Altered most of these properties
|
// z0dd - ZOD, 4/21/02. Altered most of these properties
|
||||||
datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
|
datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
|
||||||
{
|
{
|
||||||
emap = true;
|
emap = true;
|
||||||
|
|
||||||
className = Armor;
|
className = Armor;
|
||||||
|
|
@ -1574,7 +1574,7 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
|
||||||
boxHeadRightPercentage = 1;
|
boxHeadRightPercentage = 1;
|
||||||
boxHeadBackPercentage = 0;
|
boxHeadBackPercentage = 0;
|
||||||
boxHeadFrontPercentage = 1;
|
boxHeadFrontPercentage = 1;
|
||||||
|
|
||||||
//Foot Prints
|
//Foot Prints
|
||||||
decalData = MediumMaleFootprint;
|
decalData = MediumMaleFootprint;
|
||||||
decalOffset = 0.35;
|
decalOffset = 0.35;
|
||||||
|
|
@ -1594,8 +1594,8 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
|
||||||
splashEmitter[0] = PlayerFoamDropletsEmitter;
|
splashEmitter[0] = PlayerFoamDropletsEmitter;
|
||||||
splashEmitter[1] = PlayerFoamEmitter;
|
splashEmitter[1] = PlayerFoamEmitter;
|
||||||
splashEmitter[2] = PlayerBubbleEmitter;
|
splashEmitter[2] = PlayerBubbleEmitter;
|
||||||
mediumSplashSoundVelocity = 10.0;
|
mediumSplashSoundVelocity = 10.0;
|
||||||
hardSplashSoundVelocity = 20.0;
|
hardSplashSoundVelocity = 20.0;
|
||||||
exitSplashSoundVelocity = 5.0;
|
exitSplashSoundVelocity = 5.0;
|
||||||
|
|
||||||
footstepSplashHeight = 0.35;
|
footstepSplashHeight = 0.35;
|
||||||
|
|
@ -1694,7 +1694,7 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
|
||||||
observeParameters = "0.5 4.5 4.5";
|
observeParameters = "0.5 4.5 4.5";
|
||||||
|
|
||||||
shieldEffectScale = "0.7 0.7 1.0";
|
shieldEffectScale = "0.7 0.7 1.0";
|
||||||
|
|
||||||
//Kills autopoints
|
//Kills autopoints
|
||||||
detectsUsingLOSEnemy[1] = true;
|
detectsUsingLOSEnemy[1] = true;
|
||||||
detectsUsingLOSEnemy[2] = true;
|
detectsUsingLOSEnemy[2] = true;
|
||||||
|
|
@ -1761,7 +1761,7 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
|
||||||
maxDamage = 1.32;
|
maxDamage = 1.32;
|
||||||
maxEnergy = 110;
|
maxEnergy = 110;
|
||||||
repairRate = 0.0033;
|
repairRate = 0.0033;
|
||||||
|
|
||||||
//Value changed halfway between base and classic.
|
//Value changed halfway between base and classic.
|
||||||
//Classic is 54, Base is 75
|
//Classic is 54, Base is 75
|
||||||
//Shield breaks right at two mine-disc
|
//Shield breaks right at two mine-disc
|
||||||
|
|
@ -1853,8 +1853,8 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
|
||||||
splashEmitter[0] = PlayerFoamDropletsEmitter;
|
splashEmitter[0] = PlayerFoamDropletsEmitter;
|
||||||
splashEmitter[1] = PlayerFoamEmitter;
|
splashEmitter[1] = PlayerFoamEmitter;
|
||||||
splashEmitter[2] = PlayerBubbleEmitter;
|
splashEmitter[2] = PlayerBubbleEmitter;
|
||||||
mediumSplashSoundVelocity = 10.0;
|
mediumSplashSoundVelocity = 10.0;
|
||||||
hardSplashSoundVelocity = 20.0;
|
hardSplashSoundVelocity = 20.0;
|
||||||
exitSplashSoundVelocity = 5.0;
|
exitSplashSoundVelocity = 5.0;
|
||||||
|
|
||||||
footstepSplashHeight = 0.35;
|
footstepSplashHeight = 0.35;
|
||||||
|
|
@ -1953,7 +1953,7 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
|
||||||
observeParameters = "0.5 4.5 4.5";
|
observeParameters = "0.5 4.5 4.5";
|
||||||
|
|
||||||
shieldEffectScale = "0.7 0.7 1.0";
|
shieldEffectScale = "0.7 0.7 1.0";
|
||||||
|
|
||||||
//Kills autopoints
|
//Kills autopoints
|
||||||
detectsUsingLOSEnemy[1] = true;
|
detectsUsingLOSEnemy[1] = true;
|
||||||
detectsUsingLOSEnemy[2] = true;
|
detectsUsingLOSEnemy[2] = true;
|
||||||
|
|
@ -1998,7 +1998,7 @@ datablock PlayerData(LightMaleBiodermArmor) : LightMaleHumanArmor
|
||||||
|
|
||||||
|
|
||||||
debrisShapeName = "bio_player_debris.dts";
|
debrisShapeName = "bio_player_debris.dts";
|
||||||
|
|
||||||
//Foot Prints
|
//Foot Prints
|
||||||
decalData = LightBiodermFootprint;
|
decalData = LightBiodermFootprint;
|
||||||
decalOffset = 0.3;
|
decalOffset = 0.3;
|
||||||
|
|
@ -2023,7 +2023,7 @@ datablock PlayerData(MediumMaleBiodermArmor) : MediumMaleHumanArmor
|
||||||
debrisShapeName = "bio_player_debris.dts";
|
debrisShapeName = "bio_player_debris.dts";
|
||||||
|
|
||||||
//Foot Prints
|
//Foot Prints
|
||||||
decalData = MediumBiodermFootprint;
|
decalData = MediumBiodermFootprint;
|
||||||
decalOffset = 0.35;
|
decalOffset = 0.35;
|
||||||
|
|
||||||
waterBreathSound = WaterBreathBiodermSound;
|
waterBreathSound = WaterBreathBiodermSound;
|
||||||
|
|
@ -2049,7 +2049,7 @@ datablock PlayerData(HeavyMaleBiodermArmor) : HeavyMaleHumanArmor
|
||||||
//Foot Prints
|
//Foot Prints
|
||||||
decalData = HeavyBiodermFootprint;
|
decalData = HeavyBiodermFootprint;
|
||||||
decalOffset = 0.4;
|
decalOffset = 0.4;
|
||||||
|
|
||||||
waterBreathSound = WaterBreathBiodermSound;
|
waterBreathSound = WaterBreathBiodermSound;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2122,17 +2122,17 @@ function Armor::onMount(%this,%obj,%vehicle,%node)
|
||||||
|
|
||||||
if(!%obj.inStation)
|
if(!%obj.inStation)
|
||||||
%obj.lastWeapon = (%obj.getMountedImage($WeaponSlot) == 0 ) ? "" : %obj.getMountedImage($WeaponSlot).item;
|
%obj.lastWeapon = (%obj.getMountedImage($WeaponSlot) == 0 ) ? "" : %obj.getMountedImage($WeaponSlot).item;
|
||||||
|
|
||||||
%obj.unmountImage($WeaponSlot);
|
%obj.unmountImage($WeaponSlot);
|
||||||
|
|
||||||
if(!%obj.client.isAIControlled())
|
if(!%obj.client.isAIControlled())
|
||||||
{
|
{
|
||||||
%obj.setControlObject(%vehicle);
|
%obj.setControlObject(%vehicle);
|
||||||
%obj.client.setObjectActiveImage(%vehicle, 2);
|
%obj.client.setObjectActiveImage(%vehicle, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//E3 respawn...
|
//E3 respawn...
|
||||||
|
|
||||||
if(%obj == %obj.lastVehicle.lastPilot && %obj.lastVehicle != %vehicle)
|
if(%obj == %obj.lastVehicle.lastPilot && %obj.lastVehicle != %vehicle)
|
||||||
{
|
{
|
||||||
schedule(15000, %obj.lastVehicle,"vehicleAbandonTimeOut", %obj.lastVehicle);
|
schedule(15000, %obj.lastVehicle,"vehicleAbandonTimeOut", %obj.lastVehicle);
|
||||||
|
|
@ -2140,14 +2140,14 @@ function Armor::onMount(%this,%obj,%vehicle,%node)
|
||||||
}
|
}
|
||||||
if(%vehicle.lastPilot !$= "" && %vehicle == %vehicle.lastPilot.lastVehicle)
|
if(%vehicle.lastPilot !$= "" && %vehicle == %vehicle.lastPilot.lastVehicle)
|
||||||
%vehicle.lastPilot.lastVehicle = "";
|
%vehicle.lastPilot.lastVehicle = "";
|
||||||
|
|
||||||
%vehicle.abandon = false;
|
%vehicle.abandon = false;
|
||||||
%vehicle.lastPilot = %obj;
|
%vehicle.lastPilot = %obj;
|
||||||
%obj.lastVehicle = %vehicle;
|
%obj.lastVehicle = %vehicle;
|
||||||
|
|
||||||
// update the vehicle's team
|
// update the vehicle's team
|
||||||
if((%vehicle.getTarget() != -1) && %vehicle.getDatablock().cantTeamSwitch $= "")
|
if((%vehicle.getTarget() != -1) && %vehicle.getDatablock().cantTeamSwitch $= "")
|
||||||
{
|
{
|
||||||
setTargetSensorGroup(%vehicle.getTarget(), %obj.client.getSensorGroup());
|
setTargetSensorGroup(%vehicle.getTarget(), %obj.client.getSensorGroup());
|
||||||
if( %vehicle.turretObject > 0 )
|
if( %vehicle.turretObject > 0 )
|
||||||
setTargetSensorGroup(%vehicle.turretObject.getTarget(), %obj.client.getSensorGroup());
|
setTargetSensorGroup(%vehicle.turretObject.getTarget(), %obj.client.getSensorGroup());
|
||||||
|
|
@ -2207,9 +2207,9 @@ function Armor::onUnmount( %this, %obj, %vehicle, %node )
|
||||||
%obj.use(%obj.lastWeapon);
|
%obj.use(%obj.lastWeapon);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(%obj.getMountedImage($WeaponSlot) == 0)
|
if(%obj.getMountedImage($WeaponSlot) == 0)
|
||||||
%obj.selectWeaponSlot( 0 );
|
%obj.selectWeaponSlot( 0 );
|
||||||
}
|
}
|
||||||
//Inform gunner position when pilot leaves...
|
//Inform gunner position when pilot leaves...
|
||||||
//if(%vehicle.getDataBlock().showPilotInfo !$= "")
|
//if(%vehicle.getDataBlock().showPilotInfo !$= "")
|
||||||
// if((%gunner = %vehicle.getMountNodeObject(1)) != 0)
|
// if((%gunner = %vehicle.getMountNodeObject(1)) != 0)
|
||||||
|
|
@ -2271,7 +2271,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode)
|
||||||
//to ensure they mount the turret before the passenger seat, regardless of where they collide...
|
//to ensure they mount the turret before the passenger seat, regardless of where they collide...
|
||||||
if (%obj.client.isAIControlled())
|
if (%obj.client.isAIControlled())
|
||||||
{
|
{
|
||||||
%transform = %col.getTransform();
|
%transform = %col.getTransform();
|
||||||
|
|
||||||
//either the AI is *required* to pilot, or they'll pick the first available passenger seat
|
//either the AI is *required* to pilot, or they'll pick the first available passenger seat
|
||||||
if (%client.pilotVehicle)
|
if (%client.pilotVehicle)
|
||||||
|
|
@ -2312,7 +2312,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode)
|
||||||
}
|
}
|
||||||
if(%col.noEnemyControl && %obj.team != %col.team)
|
if(%col.noEnemyControl && %obj.team != %col.team)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
commandToClient(%obj.client,'SetDefaultVehicleKeys', true);
|
commandToClient(%obj.client,'SetDefaultVehicleKeys', true);
|
||||||
//If pilot or passenger then bind a few extra keys
|
//If pilot or passenger then bind a few extra keys
|
||||||
if(%node == 0)
|
if(%node == 0)
|
||||||
|
|
@ -2329,7 +2329,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode)
|
||||||
if (%obj.client.isAIControlled() && %node == 1 && (%type $= "BomberFlyer" || %type $= "AssaultVehicle"))
|
if (%obj.client.isAIControlled() && %node == 1 && (%type $= "BomberFlyer" || %type $= "AssaultVehicle"))
|
||||||
{
|
{
|
||||||
//%client.player.setActionThread(%col.getDataBlock().mountPose[0], true, true);
|
//%client.player.setActionThread(%col.getDataBlock().mountPose[0], true, true);
|
||||||
%client.player.setActionThread(sitting, true, true);
|
%client.player.setActionThread(sitting, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
%col.mountObject(%obj,%node);
|
%col.mountObject(%obj,%node);
|
||||||
|
|
@ -2350,7 +2350,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode)
|
||||||
%gotSomething = false;
|
%gotSomething = false;
|
||||||
// it's corpse-looting time!
|
// it's corpse-looting time!
|
||||||
// weapons -- don't pick up more than you are allowed to carry!
|
// weapons -- don't pick up more than you are allowed to carry!
|
||||||
for(%i = 0; ( %obj.weaponCount < %obj.getDatablock().maxWeapons ) && $InvWeapon[%i] !$= ""; %i++)
|
for(%i = 0; ( %obj.weaponCount < %obj.getDatablock().maxWeapons ) && $InvWeapon[%i] !$= ""; %i++)
|
||||||
{
|
{
|
||||||
%weap = $NameToInv[$InvWeapon[%i]];
|
%weap = $NameToInv[$InvWeapon[%i]];
|
||||||
if ( %col.hasInventory( %weap ) )
|
if ( %col.hasInventory( %weap ) )
|
||||||
|
|
@ -2498,7 +2498,7 @@ function Player::resetFlagTossWait(%this)
|
||||||
|
|
||||||
function Player::resetSitMessage(%obj)
|
function Player::resetSitMessage(%obj)
|
||||||
{
|
{
|
||||||
%obj.noSitMessage = false;
|
%obj.noSitMessage = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function Player::setInvincible(%this, %val)
|
function Player::setInvincible(%this, %val)
|
||||||
|
|
@ -2508,9 +2508,9 @@ function Player::setInvincible(%this, %val)
|
||||||
|
|
||||||
function Player::causedRecentDamage(%this, %val)
|
function Player::causedRecentDamage(%this, %val)
|
||||||
{
|
{
|
||||||
%this.causedRecentDamage = %val;
|
%this.causedRecentDamage = %val;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasLargePack(%player)
|
function hasLargePack(%player)
|
||||||
{
|
{
|
||||||
%pack = %player.getMountedImage($BackpackSlot);
|
%pack = %player.getMountedImage($BackpackSlot);
|
||||||
|
|
@ -2609,7 +2609,7 @@ function Armor::doDismount(%this, %obj, %forced)
|
||||||
%obj.unmount();
|
%obj.unmount();
|
||||||
if(%obj.mVehicle)
|
if(%obj.mVehicle)
|
||||||
%obj.mVehicle.getDataBlock().playerDismounted(%obj.mVehicle, %obj);
|
%obj.mVehicle.getDataBlock().playerDismounted(%obj.mVehicle, %obj);
|
||||||
|
|
||||||
// bots don't change their control objects when in vehicles
|
// bots don't change their control objects when in vehicles
|
||||||
if(!%obj.client.isAIControlled())
|
if(!%obj.client.isAIControlled())
|
||||||
{
|
{
|
||||||
|
|
@ -2652,7 +2652,7 @@ function resetObserveFollow( %client, %dismount )
|
||||||
if ( %client.observers[%i].clientObserve != %client )
|
if ( %client.observers[%i].clientObserve != %client )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
%client.observers[%i].camera.setOrbitMode( %client.player, %client.player.getTransform(), 0.5, 4.5, 4.5);
|
%client.observers[%i].camera.setOrbitMode( %client.player, %client.player.getTransform(), 0.5, 4.5, 4.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -2666,7 +2666,7 @@ function resetObserveFollow( %client, %dismount )
|
||||||
%params = %client.player.getTransform();
|
%params = %client.player.getTransform();
|
||||||
else
|
else
|
||||||
%params = %mount.getDataBlock().observeParameters;
|
%params = %mount.getDataBlock().observeParameters;
|
||||||
|
|
||||||
for( %i = 0; %i < %client.observeCount; %i++ )
|
for( %i = 0; %i < %client.observeCount; %i++ )
|
||||||
{
|
{
|
||||||
// z0dd - ZOD, 5/21/03. Make sure this client actually obs this client
|
// z0dd - ZOD, 5/21/03. Make sure this client actually obs this client
|
||||||
|
|
@ -2675,7 +2675,7 @@ function resetObserveFollow( %client, %dismount )
|
||||||
|
|
||||||
%client.observers[%i].camera.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
%client.observers[%i].camera.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2683,7 +2683,7 @@ function resetObserveFollow( %client, %dismount )
|
||||||
|
|
||||||
function Player::scriptKill(%player, %damageType)
|
function Player::scriptKill(%player, %damageType)
|
||||||
{
|
{
|
||||||
%player.scriptKilled = 1;
|
%player.scriptKilled = 1;
|
||||||
%player.setInvincible(false);
|
%player.setInvincible(false);
|
||||||
%player.damage(0, %player.getPosition(), 10000, %damageType);
|
%player.damage(0, %player.getPosition(), 10000, %damageType);
|
||||||
}
|
}
|
||||||
|
|
@ -2695,7 +2695,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// z0dd - ZOD, 6/09/02. Check to see if this vehicle is destroyed,
|
// z0dd - ZOD, 6/09/02. Check to see if this vehicle is destroyed,
|
||||||
// if it is do no damage. Fixes vehicle ghosting bug. We do not
|
// if it is do no damage. Fixes vehicle ghosting bug. We do not
|
||||||
// check for isObject here, destroyed objects fail it even though
|
// check for isObject here, destroyed objects fail it even though
|
||||||
// they exist as objects, go figure.
|
// they exist as objects, go figure.
|
||||||
|
|
@ -2730,7 +2730,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(%damageType != $DamageType::Laser && %damageType != $DamageType::Bullet && %damageType != $DamageType::Blaster)
|
if(%damageType != $DamageType::Laser && %damageType != $DamageType::Bullet && %damageType != $DamageType::Blaster)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2740,7 +2740,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
|
|
||||||
%targetClient = %targetObject.getOwnerClient();
|
%targetClient = %targetObject.getOwnerClient();
|
||||||
if(isObject(%mineSC))
|
if(isObject(%mineSC))
|
||||||
%sourceClient = %mineSC;
|
%sourceClient = %mineSC;
|
||||||
else
|
else
|
||||||
%sourceClient = isObject(%sourceObject) ? %sourceObject.getOwnerClient() : 0;
|
%sourceClient = isObject(%sourceObject) ? %sourceObject.getOwnerClient() : 0;
|
||||||
|
|
||||||
|
|
@ -2754,7 +2754,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
else if(%damageType == $DamageType::Suicide)
|
else if(%damageType == $DamageType::Suicide)
|
||||||
%sourceTeam = 0;
|
%sourceTeam = 0;
|
||||||
//--------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------
|
||||||
// z0dd - ZOD, 4/8/02. Check to see if this turret has a valid owner, if not clear the variable.
|
// z0dd - ZOD, 4/8/02. Check to see if this turret has a valid owner, if not clear the variable.
|
||||||
else if(isObject(%sourceObject) && %sourceObject.getClassName() $= "Turret")
|
else if(isObject(%sourceObject) && %sourceObject.getClassName() $= "Turret")
|
||||||
{
|
{
|
||||||
%sourceTeam = getTargetSensorGroup(%sourceObject.getTarget());
|
%sourceTeam = getTargetSensorGroup(%sourceObject.getTarget());
|
||||||
|
|
@ -2794,11 +2794,11 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
%damageScale = %data.damageScale[%damageType];
|
%damageScale = %data.damageScale[%damageType];
|
||||||
if(%damageScale !$= "")
|
if(%damageScale !$= "")
|
||||||
%amount *= %damageScale;
|
%amount *= %damageScale;
|
||||||
|
|
||||||
%flash = %targetObject.getDamageFlash() + (%amount * 2);
|
%flash = %targetObject.getDamageFlash() + (%amount * 2);
|
||||||
if (%flash > 0.75)
|
if (%flash > 0.75)
|
||||||
%flash = 0.75;
|
%flash = 0.75;
|
||||||
|
|
||||||
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
|
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
|
||||||
// No Schedules by DarkTiger Ver.2
|
// No Schedules by DarkTiger Ver.2
|
||||||
%targetClient.mineDisc = false;
|
%targetClient.mineDisc = false;
|
||||||
|
|
@ -2807,17 +2807,17 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
case $DamageType::Disc:
|
case $DamageType::Disc:
|
||||||
if((getSimTime() - %targetClient.mdcTime1) < 256)
|
if((getSimTime() - %targetClient.mdcTime1) < 256)
|
||||||
%targetClient.mineDisc = true;
|
%targetClient.mineDisc = true;
|
||||||
|
|
||||||
%targetClient.mdcTime2 = getSimTime();
|
%targetClient.mdcTime2 = getSimTime();
|
||||||
|
|
||||||
case $DamageType::Mine:
|
case $DamageType::Mine:
|
||||||
if((getSimTime() - %targetClient.mdcTime2) < 256)
|
if((getSimTime() - %targetClient.mdcTime2) < 256)
|
||||||
%targetClient.mineDisc = true;
|
%targetClient.mineDisc = true;
|
||||||
|
|
||||||
%targetClient.mdcTime1 = getSimTime();
|
%targetClient.mdcTime1 = getSimTime();
|
||||||
}
|
}
|
||||||
// -- End Mine+Disc insert.
|
// -- End Mine+Disc insert.
|
||||||
|
|
||||||
%previousDamage = %targetObject.getDamagePercent();
|
%previousDamage = %targetObject.getDamagePercent();
|
||||||
%targetObject.setDamageFlash(%flash);
|
%targetObject.setDamageFlash(%flash);
|
||||||
%targetObject.applyDamage(%amount);
|
%targetObject.applyDamage(%amount);
|
||||||
|
|
@ -2826,49 +2826,49 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
%targetClient.lastDamagedBy = %damagingClient;
|
%targetClient.lastDamagedBy = %damagingClient;
|
||||||
%targetClient.lastDamaged = getSimTime();
|
%targetClient.lastDamaged = getSimTime();
|
||||||
|
|
||||||
//now call the "onKilled" function if the client was... you know...
|
//now call the "onKilled" function if the client was... you know...
|
||||||
if(%targetObject.getState() $= "Dead")
|
if(%targetObject.getState() $= "Dead")
|
||||||
{
|
{
|
||||||
// where did this guy get it?
|
// where did this guy get it?
|
||||||
%damLoc = %targetObject.getDamageLocation(%position);
|
%damLoc = %targetObject.getDamageLocation(%position);
|
||||||
|
|
||||||
// should this guy be blown apart?
|
// should this guy be blown apart?
|
||||||
if( %damageType == $DamageType::Explosion ||
|
if( %damageType == $DamageType::Explosion ||
|
||||||
%damageType == $DamageType::TankMortar ||
|
%damageType == $DamageType::TankMortar ||
|
||||||
%damageType == $DamageType::Mortar ||
|
%damageType == $DamageType::Mortar ||
|
||||||
%damageType == $DamageType::MortarTurret ||
|
%damageType == $DamageType::MortarTurret ||
|
||||||
%damageType == $DamageType::BomberBombs ||
|
%damageType == $DamageType::BomberBombs ||
|
||||||
%damageType == $DamageType::SatchelCharge ||
|
%damageType == $DamageType::SatchelCharge ||
|
||||||
%damageType == $DamageType::Missile )
|
%damageType == $DamageType::Missile )
|
||||||
{
|
{
|
||||||
if( %previousDamage >= 0.35 ) // only if <= 35 percent damage remaining
|
if( %previousDamage >= 0.35 ) // only if <= 35 percent damage remaining
|
||||||
{
|
{
|
||||||
%targetObject.setMomentumVector(%momVec);
|
%targetObject.setMomentumVector(%momVec);
|
||||||
%targetObject.blowup();
|
%targetObject.blowup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this should be funny...
|
// this should be funny...
|
||||||
if( %damageType == $DamageType::VehicleSpawn )
|
if( %damageType == $DamageType::VehicleSpawn )
|
||||||
{
|
{
|
||||||
%targetObject.setMomentumVector("0 0 1");
|
%targetObject.setMomentumVector("0 0 1");
|
||||||
%targetObject.blowup();
|
%targetObject.blowup();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we were killed, max out the flash
|
// If we were killed, max out the flash
|
||||||
%targetObject.setDamageFlash(0.75);
|
%targetObject.setDamageFlash(0.75);
|
||||||
|
|
||||||
%damLoc = %targetObject.getDamageLocation(%position);
|
%damLoc = %targetObject.getDamageLocation(%position);
|
||||||
Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc);
|
Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc);
|
||||||
}
|
}
|
||||||
else if ( %amount > 0.1 )
|
else if ( %amount > 0.1 )
|
||||||
{
|
{
|
||||||
if( %targetObject.station $= "" && %targetObject.isCloaked() )
|
if( %targetObject.station $= "" && %targetObject.isCloaked() )
|
||||||
{
|
{
|
||||||
%targetObject.setCloaked( false );
|
%targetObject.setCloaked( false );
|
||||||
%targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true );
|
%targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true );
|
||||||
}
|
}
|
||||||
|
|
||||||
playPain( %targetObject );
|
playPain( %targetObject );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2883,101 +2883,101 @@ function Armor::applyConcussion( %this, %dist, %radius, %sourceObject, %targetOb
|
||||||
{
|
{
|
||||||
%percentage = 1 - ( %dist / %radius );
|
%percentage = 1 - ( %dist / %radius );
|
||||||
%random = getRandom();
|
%random = getRandom();
|
||||||
|
|
||||||
if( %sourceObject == %targetObject )
|
if( %sourceObject == %targetObject )
|
||||||
{
|
{
|
||||||
%flagChance = 1.0;
|
%flagChance = 1.0;
|
||||||
%itemChance = 1.0;
|
%itemChance = 1.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%flagChance = 0.75;
|
%flagChance = 0.75;
|
||||||
%itemChance = 0.75;
|
%itemChance = 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
%probabilityFlag = %flagChance * %percentage;
|
%probabilityFlag = %flagChance * %percentage;
|
||||||
%probabilityItem = %itemChance * %percentage;
|
%probabilityItem = %itemChance * %percentage;
|
||||||
|
|
||||||
if( %random <= %probabilityFlag )
|
if( %random <= %probabilityFlag )
|
||||||
Game.applyConcussion( %targetObject );
|
Game.applyConcussion( %targetObject );
|
||||||
|
|
||||||
if( %random <= %probabilityItem )
|
if( %random <= %probabilityItem )
|
||||||
{
|
{
|
||||||
%player = %targetObject;
|
%player = %targetObject;
|
||||||
%numWeapons = 0;
|
%numWeapons = 0;
|
||||||
|
|
||||||
// blaster 0
|
// blaster 0
|
||||||
// plasma 1
|
// plasma 1
|
||||||
// chain 2
|
// chain 2
|
||||||
// disc 3
|
// disc 3
|
||||||
// grenade 4
|
// grenade 4
|
||||||
// snipe 5
|
// snipe 5
|
||||||
// elf 6
|
// elf 6
|
||||||
// mortar 7
|
// mortar 7
|
||||||
|
|
||||||
//get our inventory
|
//get our inventory
|
||||||
if( %weaps[0] = %player.getInventory("Blaster") > 0 ) %numWeapons++;
|
if( %weaps[0] = %player.getInventory("Blaster") > 0 ) %numWeapons++;
|
||||||
if( %weaps[1] = %player.getInventory("Plasma") > 0 ) %numWeapons++;
|
if( %weaps[1] = %player.getInventory("Plasma") > 0 ) %numWeapons++;
|
||||||
if( %weaps[2] = %player.getInventory("Chaingun") > 0 ) %numWeapons++;
|
if( %weaps[2] = %player.getInventory("Chaingun") > 0 ) %numWeapons++;
|
||||||
if( %weaps[3] = %player.getInventory("Disc") > 0 ) %numWeapons++;
|
if( %weaps[3] = %player.getInventory("Disc") > 0 ) %numWeapons++;
|
||||||
if( %weaps[4] = %player.getInventory("GrenadeLauncher") > 0 ) %numWeapons++;
|
if( %weaps[4] = %player.getInventory("GrenadeLauncher") > 0 ) %numWeapons++;
|
||||||
if( %weaps[5] = %player.getInventory("SniperRifle") > 0 ) %numWeapons++;
|
if( %weaps[5] = %player.getInventory("SniperRifle") > 0 ) %numWeapons++;
|
||||||
if( %weaps[6] = %player.getInventory("ELFGun") > 0 ) %numWeapons++;
|
if( %weaps[6] = %player.getInventory("ELFGun") > 0 ) %numWeapons++;
|
||||||
if( %weaps[7] = %player.getInventory("Mortar") > 0 ) %numWeapons++;
|
if( %weaps[7] = %player.getInventory("Mortar") > 0 ) %numWeapons++;
|
||||||
|
|
||||||
%foundWeapon = false;
|
%foundWeapon = false;
|
||||||
%attempts = 0;
|
%attempts = 0;
|
||||||
|
|
||||||
if( %numWeapons > 0 )
|
if( %numWeapons > 0 )
|
||||||
{
|
{
|
||||||
while( !%foundWeapon )
|
while( !%foundWeapon )
|
||||||
{
|
{
|
||||||
%rand = mFloor( getRandom() * 8 );
|
%rand = mFloor( getRandom() * 8 );
|
||||||
if( %weaps[ %rand ] )
|
if( %weaps[ %rand ] )
|
||||||
{
|
{
|
||||||
%foundWeapon = true;
|
%foundWeapon = true;
|
||||||
|
|
||||||
switch ( %rand )
|
switch ( %rand )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
%player.use("Blaster");
|
%player.use("Blaster");
|
||||||
case 1:
|
case 1:
|
||||||
%player.use("Plasma");
|
%player.use("Plasma");
|
||||||
case 2:
|
case 2:
|
||||||
%player.use("Chaingun");
|
%player.use("Chaingun");
|
||||||
case 3:
|
case 3:
|
||||||
%player.use("Disc");
|
%player.use("Disc");
|
||||||
case 4:
|
case 4:
|
||||||
%player.use("GrenadeLauncher");
|
%player.use("GrenadeLauncher");
|
||||||
case 5:
|
case 5:
|
||||||
%player.use("SniperRifle");
|
%player.use("SniperRifle");
|
||||||
case 6:
|
case 6:
|
||||||
%player.use("ElfGun");
|
%player.use("ElfGun");
|
||||||
case 7:
|
case 7:
|
||||||
%player.use("Mortar");
|
%player.use("Mortar");
|
||||||
}
|
}
|
||||||
|
|
||||||
%image = %player.getMountedImage( $WeaponSlot );
|
%image = %player.getMountedImage( $WeaponSlot );
|
||||||
%player.throw( %image.item );
|
%player.throw( %image.item );
|
||||||
%player.client.setWeaponsHudItem( %image.item, 0, 0 );
|
%player.client.setWeaponsHudItem( %image.item, 0, 0 );
|
||||||
%player.throwPack();
|
%player.throwPack();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%attempts++;
|
%attempts++;
|
||||||
if( %attempts > 10 )
|
if( %attempts > 10 )
|
||||||
%foundWeapon = true;
|
%foundWeapon = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%targetObject.throwPack();
|
%targetObject.throwPack();
|
||||||
%targetObject.throwWeapon();
|
%targetObject.throwWeapon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -3000,7 +3000,7 @@ function playPain( %obj )
|
||||||
%client = %obj.client;
|
%client = %obj.client;
|
||||||
%random = getRandom(1) + 1;
|
%random = getRandom(1) + 1;
|
||||||
%desc = AudioClosest3d;
|
%desc = AudioClosest3d;
|
||||||
|
|
||||||
playTargetAudio( %client.target, $PainCry[%random], %desc, false);
|
playTargetAudio( %client.target, $PainCry[%random], %desc, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3050,8 +3050,8 @@ function Player::pickup(%this,%obj,%amount)
|
||||||
%this.getMountedImage($BackpackSlot) != 0)
|
%this.getMountedImage($BackpackSlot) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
// don't pick up a weapon (other than targeting laser) if player's at maxWeapons
|
// don't pick up a weapon (other than targeting laser) if player's at maxWeapons
|
||||||
else if(%data.className $= Weapon
|
else if(%data.className $= Weapon
|
||||||
&& %data.getName() !$= "TargetingLaser" // Special case
|
&& %data.getName() !$= "TargetingLaser" // Special case
|
||||||
&& %this.weaponCount >= %this.getDatablock().maxWeapons)
|
&& %this.weaponCount >= %this.getDatablock().maxWeapons)
|
||||||
return 0;
|
return 0;
|
||||||
// don't allow players to throw large packs at pilots (thanks Wizard)
|
// don't allow players to throw large packs at pilots (thanks Wizard)
|
||||||
|
|
@ -3067,7 +3067,7 @@ function Player::use( %this,%data )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Convert the word "Backpack" to whatever is in the backpack slot.
|
// Convert the word "Backpack" to whatever is in the backpack slot.
|
||||||
if ( %data $= "Backpack" )
|
if ( %data $= "Backpack" )
|
||||||
{
|
{
|
||||||
if ( %this.inStation )
|
if ( %this.inStation )
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -3082,17 +3082,17 @@ function Player::use( %this,%data )
|
||||||
messageClient( %this.client, 'MsgCantUsePack', '\c2You can\'t use your pack while in a weaponry position.~wfx/misc/misc.error.wav' );
|
messageClient( %this.client, 'MsgCantUsePack', '\c2You can\'t use your pack while in a weaponry position.~wfx/misc/misc.error.wav' );
|
||||||
return( false );
|
return( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
%image = %this.getMountedImage( $BackpackSlot );
|
%image = %this.getMountedImage( $BackpackSlot );
|
||||||
if ( %image )
|
if ( %image )
|
||||||
%data = %image.item;
|
%data = %image.item;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't use some items when piloting or your a weapon operator
|
// Can't use some items when piloting or your a weapon operator
|
||||||
if ( %this.isPilot() || %this.isWeaponOperator() )
|
if ( %this.isPilot() || %this.isWeaponOperator() )
|
||||||
if ( %data.getName() !$= "RepairKit" )
|
if ( %data.getName() !$= "RepairKit" )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return ShapeBase::use( %this, %data );
|
return ShapeBase::use( %this, %data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3125,13 +3125,13 @@ function Player::isWeaponOperator(%this)
|
||||||
}
|
}
|
||||||
|
|
||||||
return( false );
|
return( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
function Player::liquidDamage(%obj, %data, %damageAmount, %damageType)
|
function Player::liquidDamage(%obj, %data, %damageAmount, %damageType)
|
||||||
{
|
{
|
||||||
if(%obj.getState() !$= "Dead")
|
if(%obj.getState() !$= "Dead")
|
||||||
{
|
{
|
||||||
%data.damageObject(%obj, 0, "0 0 0", %damageAmount, %damageType);
|
%data.damageObject(%obj, 0, "0 0 0", %damageAmount, %damageType);
|
||||||
%obj.lDamageSchedule = %obj.schedule(50, "liquidDamage", %data, %damageAmount, %damageType);
|
%obj.lDamageSchedule = %obj.schedule(50, "liquidDamage", %data, %damageAmount, %damageType);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -3160,7 +3160,7 @@ function Armor::onEnterLiquid(%data, %obj, %coverage, %type)
|
||||||
case 5:
|
case 5:
|
||||||
//Hot Lava
|
//Hot Lava
|
||||||
%obj.liquidDamage(%data, $DamageHotLava, $DamageType::Lava);
|
%obj.liquidDamage(%data, $DamageHotLava, $DamageType::Lava);
|
||||||
case 6:
|
case 6:
|
||||||
//Crusty Lava
|
//Crusty Lava
|
||||||
%obj.liquidDamage(%data, $DamageCrustyLava, $DamageType::Lava);
|
%obj.liquidDamage(%data, $DamageCrustyLava, $DamageType::Lava);
|
||||||
case 7:
|
case 7:
|
||||||
|
|
@ -3281,46 +3281,46 @@ function playDeathAnimation(%player, %damageLocation, %type)
|
||||||
{
|
{
|
||||||
%vertPos = firstWord(%damageLocation);
|
%vertPos = firstWord(%damageLocation);
|
||||||
%quadrant = getWord(%damageLocation, 1);
|
%quadrant = getWord(%damageLocation, 1);
|
||||||
|
|
||||||
//echo("vert Pos: " @ %vertPos);
|
//echo("vert Pos: " @ %vertPos);
|
||||||
//echo("quad: " @ %quadrant);
|
//echo("quad: " @ %quadrant);
|
||||||
|
|
||||||
if( %type == $DamageType::Explosion || %type == $DamageType::Mortar || %type == $DamageType::Grenade)
|
if( %type == $DamageType::Explosion || %type == $DamageType::Mortar || %type == $DamageType::Grenade)
|
||||||
{
|
{
|
||||||
if(%quadrant $= "front_left" || %quadrant $= "front_right")
|
if(%quadrant $= "front_left" || %quadrant $= "front_right")
|
||||||
%curDie = $PlayerDeathAnim::ExplosionBlowBack;
|
%curDie = $PlayerDeathAnim::ExplosionBlowBack;
|
||||||
else
|
else
|
||||||
%curDie = $PlayerDeathAnim::TorsoBackFallForward;
|
%curDie = $PlayerDeathAnim::TorsoBackFallForward;
|
||||||
}
|
}
|
||||||
else if(%vertPos $= "head")
|
else if(%vertPos $= "head")
|
||||||
{
|
{
|
||||||
if(%quadrant $= "front_left" || %quadrant $= "front_right" )
|
if(%quadrant $= "front_left" || %quadrant $= "front_right" )
|
||||||
%curDie = $PlayerDeathAnim::HeadFrontDirect;
|
%curDie = $PlayerDeathAnim::HeadFrontDirect;
|
||||||
else
|
else
|
||||||
%curDie = $PlayerDeathAnim::HeadBackFallForward;
|
%curDie = $PlayerDeathAnim::HeadBackFallForward;
|
||||||
}
|
}
|
||||||
else if(%vertPos $= "torso")
|
else if(%vertPos $= "torso")
|
||||||
{
|
{
|
||||||
if(%quadrant $= "front_left" )
|
if(%quadrant $= "front_left" )
|
||||||
%curDie = $PlayerDeathAnim::TorsoLeftSpinDeath;
|
%curDie = $PlayerDeathAnim::TorsoLeftSpinDeath;
|
||||||
else if(%quadrant $= "front_right")
|
else if(%quadrant $= "front_right")
|
||||||
%curDie = $PlayerDeathAnim::TorsoRightSpinDeath;
|
%curDie = $PlayerDeathAnim::TorsoRightSpinDeath;
|
||||||
else if(%quadrant $= "back_left" )
|
else if(%quadrant $= "back_left" )
|
||||||
%curDie = $PlayerDeathAnim::TorsoBackFallForward;
|
%curDie = $PlayerDeathAnim::TorsoBackFallForward;
|
||||||
else if(%quadrant $= "back_right")
|
else if(%quadrant $= "back_right")
|
||||||
%curDie = $PlayerDeathAnim::TorsoBackFallForward;
|
%curDie = $PlayerDeathAnim::TorsoBackFallForward;
|
||||||
}
|
}
|
||||||
else if (%vertPos $= "legs")
|
else if (%vertPos $= "legs")
|
||||||
{
|
{
|
||||||
if(%quadrant $= "front_left" || %quadrant $= "back_left")
|
if(%quadrant $= "front_left" || %quadrant $= "back_left")
|
||||||
%curDie = $PlayerDeathAnim::LegsLeftGimp;
|
%curDie = $PlayerDeathAnim::LegsLeftGimp;
|
||||||
if(%quadrant $= "front_right" || %quadrant $= "back_right")
|
if(%quadrant $= "front_right" || %quadrant $= "back_right")
|
||||||
%curDie = $PlayerDeathAnim::LegsRightGimp;
|
%curDie = $PlayerDeathAnim::LegsRightGimp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%curDie $= "" || %curDie < 1 || %curDie > 11)
|
if(%curDie $= "" || %curDie < 1 || %curDie > 11)
|
||||||
%curDie = 1;
|
%curDie = 1;
|
||||||
|
|
||||||
%player.setActionThread("Death" @ %curDie);
|
%player.setActionThread("Death" @ %curDie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
// GrenadeProjectileData : ProjectileData
|
// GrenadeProjectileData : ProjectileData
|
||||||
// SeekerProjectileData : ProjectileData
|
// SeekerProjectileData : ProjectileData
|
||||||
// SniperProjectileData : ProjectileData
|
// SniperProjectileData : ProjectileData
|
||||||
//
|
//
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
//-------------------------------------- Default functions
|
//-------------------------------------- Default functions
|
||||||
//
|
//
|
||||||
|
|
@ -33,12 +33,12 @@ function SniperProjectileData::onCollision(%data, %projectile, %targetObject, %m
|
||||||
{
|
{
|
||||||
%damLoc = firstWord(%targetObject.getDamageLocation(%position));
|
%damLoc = firstWord(%targetObject.getDamageLocation(%position));
|
||||||
if(%damLoc $= "head")
|
if(%damLoc $= "head")
|
||||||
{
|
{
|
||||||
%targetObject.getOwnerClient().headShot = 1;
|
%targetObject.getOwnerClient().headShot = 1;
|
||||||
%modifier = %data.rifleHeadMultiplier;
|
%modifier = %data.rifleHeadMultiplier;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%modifier = 1;
|
%modifier = 1;
|
||||||
%targetObject.getOwnerClient().headShot = 0;
|
%targetObject.getOwnerClient().headShot = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -72,10 +72,11 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot)
|
||||||
{
|
{
|
||||||
%obj.cantFire = 1;
|
%obj.cantFire = 1;
|
||||||
%preventTime = %data.stateTimeoutValue[4];
|
%preventTime = %data.stateTimeoutValue[4];
|
||||||
|
//%preventTime = (%data.stateTimeoutValue[4] + %data.stateTimeoutValue[3]) - 0.032;
|
||||||
%obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj);
|
%obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj);
|
||||||
}
|
}
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
%data.lightStart = getSimTime();
|
%data.lightStart = getSimTime();
|
||||||
|
|
||||||
if( %obj.station $= "" && %obj.isCloaked() )
|
if( %obj.station $= "" && %obj.isCloaked() )
|
||||||
|
|
@ -89,7 +90,7 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if( %obj.getEnergyLevel() > 20 )
|
// if( %obj.getEnergyLevel() > 20 )
|
||||||
// {
|
// {
|
||||||
// %obj.setCloaked( false );
|
// %obj.setCloaked( false );
|
||||||
// %obj.reCloak = %obj.schedule( 500, "setCloaked", true );
|
// %obj.reCloak = %obj.schedule( 500, "setCloaked", true );
|
||||||
// }
|
// }
|
||||||
|
|
@ -97,15 +98,15 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot)
|
||||||
//We check if the player is still cloaked now. So no need to limit to 20% energy for the cloak in/out animation
|
//We check if the player is still cloaked now. So no need to limit to 20% energy for the cloak in/out animation
|
||||||
%obj.setCloaked( false );
|
%obj.setCloaked( false );
|
||||||
%obj.reCloak = schedule( 500, 0, "checkCloakState", %obj);
|
%obj.reCloak = schedule( 500, 0, "checkCloakState", %obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( %obj.client > 0 )
|
if( %obj.client > 0 )
|
||||||
{
|
{
|
||||||
%obj.setInvincibleMode(0 ,0.00);
|
%obj.setInvincibleMode(0 ,0.00);
|
||||||
%obj.setInvincible( false ); // fire your weapon and your invincibility goes away.
|
%obj.setInvincible( false ); // fire your weapon and your invincibility goes away.
|
||||||
}
|
}
|
||||||
|
|
||||||
%vehicle = 0;
|
%vehicle = 0;
|
||||||
if(%data.usesEnergy)
|
if(%data.usesEnergy)
|
||||||
{
|
{
|
||||||
|
|
@ -119,11 +120,11 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
%energy = %obj.getEnergyLevel();
|
%energy = %obj.getEnergyLevel();
|
||||||
|
|
||||||
if(%data.useCapacitor && %data.usesEnergy)
|
if(%data.useCapacitor && %data.usesEnergy)
|
||||||
{
|
{
|
||||||
if( %useEnergyObj.turretObject.getCapacitorLevel() < %data.minEnergy )
|
if( %useEnergyObj.turretObject.getCapacitorLevel() < %data.minEnergy )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +165,7 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot)
|
||||||
%obj.lastProjectile = %p;
|
%obj.lastProjectile = %p;
|
||||||
%obj.deleteLastProjectile = %data.deleteLastProjectile;
|
%obj.deleteLastProjectile = %data.deleteLastProjectile;
|
||||||
MissionCleanup.add(%p);
|
MissionCleanup.add(%p);
|
||||||
|
|
||||||
// AI hook
|
// AI hook
|
||||||
if(%obj.client)
|
if(%obj.client)
|
||||||
%obj.client.projectile = %p;
|
%obj.client.projectile = %p;
|
||||||
|
|
@ -172,9 +173,9 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot)
|
||||||
if(%data.usesEnergy)
|
if(%data.usesEnergy)
|
||||||
{
|
{
|
||||||
if(%data.useMountEnergy)
|
if(%data.useMountEnergy)
|
||||||
{
|
{
|
||||||
if( %data.useCapacitor )
|
if( %data.useCapacitor )
|
||||||
{
|
{
|
||||||
%vehicle.turretObject.setCapacitorLevel( %vehicle.turretObject.getCapacitorLevel() - %data.fireEnergy );
|
%vehicle.turretObject.setCapacitorLevel( %vehicle.turretObject.getCapacitorLevel() - %data.fireEnergy );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -222,7 +223,7 @@ function MissileLauncherImage::onFire(%data,%obj,%slot)
|
||||||
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
||||||
if(!%p)
|
if(!%p)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
MissileSet.add(%p);
|
MissileSet.add(%p);
|
||||||
|
|
@ -253,7 +254,7 @@ function MissileLauncherImage::onWetFire(%data, %obj, %slot)
|
||||||
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
||||||
if(!%p)
|
if(!%p)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
MissileSet.add(%p);
|
MissileSet.add(%p);
|
||||||
|
|
@ -269,7 +270,7 @@ function MissileBarrelLarge::onFire(%data,%obj,%slot)
|
||||||
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
||||||
if(!%p)
|
if(!%p)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
MissileSet.add(%p); // z0dd - ZOD, 8/10/03. Bots need this.
|
MissileSet.add(%p); // z0dd - ZOD, 8/10/03. Bots need this.
|
||||||
|
|
@ -298,7 +299,7 @@ function MortarImage::onFire(%data,%obj,%slot)
|
||||||
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
||||||
if(!%p)
|
if(!%p)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// z0dd - ZOD, 5/22/03, Spawn a mortar at the end of the projectiles lifetime.
|
// z0dd - ZOD, 5/22/03, Spawn a mortar at the end of the projectiles lifetime.
|
||||||
// Addresses long range mortar spam exploit.
|
// Addresses long range mortar spam exploit.
|
||||||
|
|
@ -358,7 +359,7 @@ function SniperRifleImage::onFire(%data,%obj,%slot)
|
||||||
%obj.lastProjectile = %p;
|
%obj.lastProjectile = %p;
|
||||||
MissionCleanup.add(%p);
|
MissionCleanup.add(%p);
|
||||||
serverPlay3D(SniperRifleFireSound, %obj.getTransform());
|
serverPlay3D(SniperRifleFireSound, %obj.getTransform());
|
||||||
|
|
||||||
// AI hook
|
// AI hook
|
||||||
if(%obj.client)
|
if(%obj.client)
|
||||||
%obj.client.projectile = %p;
|
%obj.client.projectile = %p;
|
||||||
|
|
@ -375,7 +376,7 @@ function ElfGunImage::onFire(%data, %obj, %slot)
|
||||||
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
||||||
if(!%p)
|
if(!%p)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
if(!%p.hasTarget())
|
if(!%p.hasTarget())
|
||||||
|
|
@ -389,7 +390,7 @@ function TargetingLaserImage::onFire(%data,%obj,%slot)
|
||||||
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
// z0dd - ZOD, 9/3/02. Anti rapid fire mortar/missile fix.
|
||||||
if(!%p)
|
if(!%p)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
%p.setTarget(%obj.team);
|
%p.setTarget(%obj.team);
|
||||||
|
|
@ -403,13 +404,14 @@ function ShockLanceImage::onFire(%this, %obj, %slot)
|
||||||
%obj.setInvincibleMode(0, 0.00);
|
%obj.setInvincibleMode(0, 0.00);
|
||||||
%obj.setInvincible( false );
|
%obj.setInvincible( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
// z0dd - ZOD, 4/10/04. ilys - Added rapidfire shocklance fix
|
// z0dd - ZOD, 4/10/04. ilys - Added rapidfire shocklance fix
|
||||||
if(%obj.cantfire !$= "")
|
if(%obj.cantfire !$= "")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
%obj.cantfire = 1;
|
%obj.cantfire = 1;
|
||||||
%preventTime = %this.stateTimeoutValue[4];
|
%preventTime = %this.stateTimeoutValue[4];
|
||||||
|
//%preventTime = (%data.stateTimeoutValue[4] + %data.stateTimeoutValue[3]) - 0.032;
|
||||||
%obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj);
|
%obj.reloadSchedule = schedule(%preventTime * 1000, %obj, resetFire, %obj);
|
||||||
|
|
||||||
if( %obj.getEnergyLevel() < %this.minEnergy ) // z0dd - ZOD, 5/22/03. Check energy level first
|
if( %obj.getEnergyLevel() < %this.minEnergy ) // z0dd - ZOD, 5/22/03. Check energy level first
|
||||||
|
|
@ -427,7 +429,7 @@ function ShockLanceImage::onFire(%this, %obj, %slot)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if( %obj.getEnergyLevel() > 20 )
|
// if( %obj.getEnergyLevel() > 20 )
|
||||||
// {
|
// {
|
||||||
// %obj.setCloaked( false );
|
// %obj.setCloaked( false );
|
||||||
// %obj.reCloak = %obj.schedule( 500, "setCloaked", true );
|
// %obj.reCloak = %obj.schedule( 500, "setCloaked", true );
|
||||||
// }
|
// }
|
||||||
|
|
@ -435,7 +437,7 @@ function ShockLanceImage::onFire(%this, %obj, %slot)
|
||||||
//We check if the player is still cloaked now. So no need to limit to 20% energy for the cloak in/out animation
|
//We check if the player is still cloaked now. So no need to limit to 20% energy for the cloak in/out animation
|
||||||
%obj.setCloaked( false );
|
%obj.setCloaked( false );
|
||||||
%obj.reCloak = schedule( 500, 0, "checkCloakState", %obj);
|
%obj.reCloak = schedule( 500, 0, "checkCloakState", %obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%muzzlePos = %obj.getMuzzlePoint(%slot);
|
%muzzlePos = %obj.getMuzzlePoint(%slot);
|
||||||
|
|
@ -482,7 +484,7 @@ function ShockLanceImage::onFire(%this, %obj, %slot)
|
||||||
MissionCleanup.add(%p);
|
MissionCleanup.add(%p);
|
||||||
|
|
||||||
%damageMultiplier = 1.0;
|
%damageMultiplier = 1.0;
|
||||||
|
|
||||||
if(%hitObj.getDataBlock().getClassName() $= "PlayerData")
|
if(%hitObj.getDataBlock().getClassName() $= "PlayerData")
|
||||||
{
|
{
|
||||||
// Now we see if we hit from behind...
|
// Now we see if we hit from behind...
|
||||||
|
|
@ -512,13 +514,13 @@ function ShockLanceImage::onFire(%this, %obj, %slot)
|
||||||
}
|
}
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
%totalDamage = %this.Projectile.DirectDamage * %damageMultiplier;
|
%totalDamage = %this.Projectile.DirectDamage * %damageMultiplier;
|
||||||
%hitObj.getDataBlock().damageObject(%hitobj, %p.sourceObject, %hitpos, %totalDamage, $DamageType::ShockLance);
|
%hitObj.getDataBlock().damageObject(%hitobj, %p.sourceObject, %hitpos, %totalDamage, $DamageType::ShockLance);
|
||||||
|
|
||||||
%noDisplay = false;
|
%noDisplay = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( %noDisplay )
|
if( %noDisplay )
|
||||||
{
|
{
|
||||||
|
|
@ -554,7 +556,7 @@ function ELFProjectileData::zapTarget(%data, %projectile, %target, %targeter)
|
||||||
if( %target.teamDamageStateOnZap || !%teammates )
|
if( %target.teamDamageStateOnZap || !%teammates )
|
||||||
%target.setRechargeRate(%oldERate - %data.drainEnergy);
|
%target.setRechargeRate(%oldERate - %data.drainEnergy);
|
||||||
else
|
else
|
||||||
%target.setRechargeRate(%oldERate);
|
%target.setRechargeRate(%oldERate);
|
||||||
|
|
||||||
%projectile.checkELFStatus(%data, %target, %targeter);
|
%projectile.checkELFStatus(%data, %target, %targeter);
|
||||||
}
|
}
|
||||||
|
|
@ -705,7 +707,7 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse
|
||||||
//%amount = (1.0 - (%dist / %radius)) * %coverage * %damage;
|
//%amount = (1.0 - (%dist / %radius)) * %coverage * %damage;
|
||||||
|
|
||||||
//error( "damage: " @ %amount @ " at distance: " @ %dist @ " radius: " @ %radius @ " maxDamage: " @ %damage );
|
//error( "damage: " @ %amount @ " at distance: " @ %dist @ " radius: " @ %radius @ " maxDamage: " @ %damage );
|
||||||
|
|
||||||
%data = %targetObject.getDataBlock();
|
%data = %targetObject.getDataBlock();
|
||||||
%className = %data.className;
|
%className = %data.className;
|
||||||
|
|
||||||
|
|
@ -714,7 +716,7 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse
|
||||||
%p = %targetObject.getWorldBoxCenter();
|
%p = %targetObject.getWorldBoxCenter();
|
||||||
%momVec = VectorSub(%p, %position);
|
%momVec = VectorSub(%p, %position);
|
||||||
%momVec = VectorNormalize(%momVec);
|
%momVec = VectorNormalize(%momVec);
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// z0dd - ZOD, 7/08/02. More kick when player damages self with disc or mortar.
|
// z0dd - ZOD, 7/08/02. More kick when player damages self with disc or mortar.
|
||||||
// Stronger DJs and mortar jumps without impacting others (mainly HoFs)
|
// Stronger DJs and mortar jumps without impacting others (mainly HoFs)
|
||||||
|
|
@ -730,7 +732,7 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
%impulseVec = VectorScale(%momVec, %impulse * (1.0 - (%dist / %radius)));
|
%impulseVec = VectorScale(%momVec, %impulse * (1.0 - (%dist / %radius)));
|
||||||
%doImpulse = true;
|
%doImpulse = true;
|
||||||
}
|
}
|
||||||
|
|
@ -740,27 +742,27 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse
|
||||||
%momVec = VectorSub(%p, %position);
|
%momVec = VectorSub(%p, %position);
|
||||||
%momVec = VectorNormalize(%momVec);
|
%momVec = VectorNormalize(%momVec);
|
||||||
%impulseVec = VectorScale(%momVec, %impulse * (1.0 - (%dist / %radius)));
|
%impulseVec = VectorScale(%momVec, %impulse * (1.0 - (%dist / %radius)));
|
||||||
|
|
||||||
if( getWord( %momVec, 2 ) < -0.5 )
|
if( getWord( %momVec, 2 ) < -0.5 )
|
||||||
%momVec = "0 0 1";
|
%momVec = "0 0 1";
|
||||||
|
|
||||||
// Add obj's velocity into the momentum vector
|
// Add obj's velocity into the momentum vector
|
||||||
%velocity = %targetObject.getVelocity();
|
%velocity = %targetObject.getVelocity();
|
||||||
//%momVec = VectorNormalize( vectorAdd( %momVec, %velocity) );
|
//%momVec = VectorNormalize( vectorAdd( %momVec, %velocity) );
|
||||||
%doImpulse = true;
|
%doImpulse = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%momVec = "0 0 1";
|
%momVec = "0 0 1";
|
||||||
%doImpulse = false;
|
%doImpulse = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%amount > 0)
|
if(%amount > 0)
|
||||||
%data.damageObject(%targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %explosionSource.theClient, %explosionSource);
|
%data.damageObject(%targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %explosionSource.theClient, %explosionSource);
|
||||||
else if( %explosionSource.getDataBlock().getName() $= "ConcussionGrenadeThrown" && %data.getClassName() $= "PlayerData" )
|
else if( %explosionSource.getDataBlock().getName() $= "ConcussionGrenadeThrown" && %data.getClassName() $= "PlayerData" )
|
||||||
{
|
{
|
||||||
%data.applyConcussion( %dist, %radius, %sourceObject, %targetObject );
|
%data.applyConcussion( %dist, %radius, %sourceObject, %targetObject );
|
||||||
|
|
||||||
if(!$teamDamage && %sourceObject != %targetObject && %sourceObject.client.team == %targetObject.client.team)
|
if(!$teamDamage && %sourceObject != %targetObject && %sourceObject.client.team == %targetObject.client.team)
|
||||||
{
|
{
|
||||||
messageClient(%targetObject.client, 'msgTeamConcussionGrenade', '\c1You were hit by %1\'s concussion grenade.', getTaggedString(%sourceObject.client.name));
|
messageClient(%targetObject.client, 'msgTeamConcussionGrenade', '\c1You were hit by %1\'s concussion grenade.', getTaggedString(%sourceObject.client.name));
|
||||||
|
|
|
||||||
87
Classic/scripts/server.cs
Executable file → Normal file
87
Classic/scripts/server.cs
Executable file → Normal file
|
|
@ -861,7 +861,7 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
||||||
messageClient(%client, 'MsgClientJoin', "",
|
messageClient(%client, 'MsgClientJoin', "",
|
||||||
%recipient.name,
|
%recipient.name,
|
||||||
%recipient,
|
%recipient,
|
||||||
%recipient.target,
|
"",
|
||||||
%recipient.isAIControlled(),
|
%recipient.isAIControlled(),
|
||||||
%recipient.isAdmin,
|
%recipient.isAdmin,
|
||||||
%recipient.isSuperAdmin,
|
%recipient.isSuperAdmin,
|
||||||
|
|
@ -879,15 +879,15 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
||||||
if ( $CurrentMissionType !$= "SinglePlayer" )
|
if ( $CurrentMissionType !$= "SinglePlayer" )
|
||||||
{
|
{
|
||||||
// z0dd - ZOD, 5/08/04. Send message of any gameplay changes
|
// z0dd - ZOD, 5/08/04. Send message of any gameplay changes
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Sniper Mod: \c3%1.', ($Host::ClassicLoadSniperChanges ? 'Enabled' : 'Disabled') );
|
//messageClient( %client, 'MsgClassic', 'Classic \c2Sniper Mod: \c3%1.', ($Host::ClassicLoadSniperChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Missile Mod: \c3%1.', ($Host::ClassicLoadMissileChanges ? 'Enabled' : 'Disabled') );
|
//messageClient( %client, 'MsgClassic', 'Classic \c2Missile Mod: \c3%1.', ($Host::ClassicLoadMissileChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Mortar Mod: \c3%1.', ($Host::ClassicLoadMortarChanges ? 'Enabled' : 'Disabled') );
|
//messageClient( %client, 'MsgClassic', 'Classic \c2Mortar Mod: \c3%1.', ($Host::ClassicLoadMortarChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Blaster Mod: \c3%1.', ($Host::ClassicLoadBlasterChanges ? 'Enabled' : 'Disabled') );
|
//messageClient( %client, 'MsgClassic', 'Classic \c2Blaster Mod: \c3%1.', ($Host::ClassicLoadBlasterChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Plasma Turret Mod: \c3%1.', ($Host::ClassicLoadPlasmaTurretChanges ? 'Enabled' : 'Disabled') );
|
//messageClient( %client, 'MsgClassic', 'Classic \c2Plasma Turret Mod: \c3%1.', ($Host::ClassicLoadPlasmaTurretChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Player Mod: \c3%1.', ($Host::ClassicLoadPlayerChanges ? 'Enabled' : 'Disabled') );
|
//messageClient( %client, 'MsgClassic', 'Classic \c2Player Mod: \c3%1.', ($Host::ClassicLoadPlayerChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Havoc Mod: \c3%1.', ($Host::ClassicLoadHavocChanges ? 'Enabled' : 'Disabled') );
|
//messageClient( %client, 'MsgClassic', 'Classic \c2Havoc Mod: \c3%1.', ($Host::ClassicLoadHavocChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2Mine Mod: \c3%1.', ($Host::ClassicLoadMineChanges ? 'Enabled' : 'Disabled') );
|
//messageClient( %client, 'MsgClassic', 'Classic \c2Mine Mod: \c3%1.', ($Host::ClassicLoadMineChanges ? 'Enabled' : 'Disabled') );
|
||||||
// messageClient( %client, 'MsgClassic', 'Classic \c2V-Ramming Mod: \c3%1.', ($Host::ClassicLoadVRamChanges ? 'Enabled' : 'Disabled') );
|
//messageClient( %client, 'MsgClassic', 'Classic \c2V-Ramming Mod: \c3%1.', ($Host::ClassicLoadVRamChanges ? 'Enabled' : 'Disabled') );
|
||||||
|
|
||||||
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
||||||
messageClient(%client, 'MsgClientJoin', 'Welcome to Tribes2 %1.',
|
messageClient(%client, 'MsgClientJoin', 'Welcome to Tribes2 %1.',
|
||||||
|
|
@ -899,12 +899,12 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
||||||
%client.isSuperAdmin,
|
%client.isSuperAdmin,
|
||||||
%client.isSmurf,
|
%client.isSmurf,
|
||||||
%client.sendGuid );
|
%client.sendGuid );
|
||||||
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
|
||||||
|
|
||||||
|
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
||||||
messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game.',
|
messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game.',
|
||||||
%client.name,
|
%client.name,
|
||||||
%client,
|
%client,
|
||||||
%client.target,
|
"",
|
||||||
false, // isBot
|
false, // isBot
|
||||||
%client.isAdmin,
|
%client.isAdmin,
|
||||||
%client.isSuperAdmin,
|
%client.isSuperAdmin,
|
||||||
|
|
@ -1100,17 +1100,17 @@ function GameConnection::onDrop(%client, %reason)
|
||||||
// reset the server if everyone has left the game
|
// reset the server if everyone has left the game
|
||||||
if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::EmptyServerReset && !$resettingServer && !$LoadingMission && $CurrentMissionType !$= $Host::MissionType )
|
if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::EmptyServerReset && !$resettingServer && !$LoadingMission && $CurrentMissionType !$= $Host::MissionType )
|
||||||
{
|
{
|
||||||
// Timed Server Reset: $Host::EmptyServerReset = 1; --- Time in Minutes $Host::EmptyServerResetTime = 120;
|
// Timed Server Reset: $Host::EmptyServerReset = 1; --- Time in Minutes $Host::EmptyServerResetTime = 120;
|
||||||
if(isEventPending($EmptyServerResetSchedule))
|
if(isEventPending($EmptyServerResetSchedule))
|
||||||
{
|
{
|
||||||
error(formatTimeString("HH:nn:ss") SPC "Previous Timed Server Reset schedule cancelled..." );
|
error(formatTimeString("HH:nn:ss") SPC "Previous Timed Server Reset schedule cancelled..." );
|
||||||
cancel($EmptyServerResetSchedule);
|
cancel($EmptyServerResetSchedule);
|
||||||
}
|
}
|
||||||
|
|
||||||
%resettime = $Host::EmptyServerResetTime * 60000;
|
%resettime = $Host::EmptyServerResetTime * 60000;
|
||||||
if(%resettime <= 0) %resettime = 1;
|
if(%resettime <= 0) %resettime = 1;
|
||||||
$EmptyServerResetSchedule = schedule(%resettime, 0, "ResetServerTimed");
|
$EmptyServerResetSchedule = schedule(%resettime, 0, "ResetServerTimed");
|
||||||
error(formatTimeString("HH:nn:ss") SPC "Timed Server Reset schedule started..." );
|
error(formatTimeString("HH:nn:ss") SPC "Timed Server Reset schedule started..." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1764,8 +1764,13 @@ function serverCmdSAD(%client, %password)
|
||||||
%client.isSuperAdmin = true;
|
%client.isSuperAdmin = true;
|
||||||
MessageAll( 'MsgSuperAdminPlayer', '\c2%2 has become a Super Admin by force.', %client, %name);
|
MessageAll( 'MsgSuperAdminPlayer', '\c2%2 has become a Super Admin by force.', %client, %name);
|
||||||
%adminmsg = " has become a Super Admin by force.";
|
%adminmsg = " has become a Super Admin by force.";
|
||||||
adminLog(%client, %adminmsg);
|
adminLog(%client, %adminmsg);
|
||||||
logEcho(%client.nameBase @ " has become a Super Admin by force.");
|
logEcho(%client.nameBase @ " has become a Super Admin by force.");
|
||||||
|
|
||||||
|
//Update everyones client and put an SA by your name
|
||||||
|
messageAll( 'MsgClientDrop', "", %client.name, %client);
|
||||||
|
messageAll('MsgClientJoin', "",%client.name, %client, "",%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid);
|
||||||
|
messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team );
|
||||||
}
|
}
|
||||||
|
|
||||||
case $Host::AdminPassword:
|
case $Host::AdminPassword:
|
||||||
|
|
@ -1780,8 +1785,13 @@ function serverCmdSAD(%client, %password)
|
||||||
%client.isSuperAdmin = false;
|
%client.isSuperAdmin = false;
|
||||||
MessageAll( 'MsgAdminForce', '\c2%2 has become a Admin by force.', %client, %name);
|
MessageAll( 'MsgAdminForce', '\c2%2 has become a Admin by force.', %client, %name);
|
||||||
%adminmsg = " has become an Admin by force.";
|
%adminmsg = " has become an Admin by force.";
|
||||||
adminLog(%client, %adminmsg);
|
adminLog(%client, %adminmsg);
|
||||||
logEcho(%client.nameBase @ " has become an Admin by force.");
|
logEcho(%client.nameBase @ " has become an Admin by force.");
|
||||||
|
|
||||||
|
//Update everyones client and put an A by your name
|
||||||
|
messageAll( 'MsgClientDrop', "", %client.name, %client);
|
||||||
|
messageAll('MsgClientJoin', "",%client.name, %client, "",%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid);
|
||||||
|
messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team );
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
messageClient(%client, 'MsgPasswordFailed', '\c2Illegal SAD PW.');
|
messageClient(%client, 'MsgPasswordFailed', '\c2Illegal SAD PW.');
|
||||||
|
|
@ -2564,15 +2574,21 @@ function serverCmdStripAdmin(%client, %admin)
|
||||||
%admin.isSuperAdmin = 0;
|
%admin.isSuperAdmin = 0;
|
||||||
messageClient(%admin, 'MsgStripAdminPlayer', 'You have stripped yourself of admin privledges.');
|
messageClient(%admin, 'MsgStripAdminPlayer', 'You have stripped yourself of admin privledges.');
|
||||||
adminLog(%client, " stripped admin from " @ %admin.nameBase);
|
adminLog(%client, " stripped admin from " @ %admin.nameBase);
|
||||||
|
messageAll('MsgClientDrop', "", %client.name, %client);
|
||||||
|
messageAll('MsgClientJoin', "",%client.name, %client, "",%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid);
|
||||||
|
messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(%client.isSuperAdmin)
|
else if(%client.isSuperAdmin)
|
||||||
{
|
{
|
||||||
messageAll( 'MsgStripAdminPlayer', '\c2%1 removed %2\'s admin privledges.', %client.name, %admin.name, %admin );
|
messageAll('MsgStripAdminPlayer', '\c2%1 removed %2\'s admin privledges.', %client.name, %admin.name, %admin );
|
||||||
messageClient(%admin, 'MsgStripAdminPlayer', 'You are being stripped of your admin privledges by %1.', %client.name);
|
messageClient(%admin, 'MsgStripAdminPlayer', 'You are being stripped of your admin privledges by %1.', %client.name);
|
||||||
%admin.isAdmin = 0;
|
%admin.isAdmin = 0;
|
||||||
%admin.isSuperAdmin = 0;
|
%admin.isSuperAdmin = 0;
|
||||||
adminLog(%client, " stripped admin from " @ %admin.nameBase);
|
adminLog(%client, " stripped admin from " @ %admin.nameBase);
|
||||||
|
messageAll( 'MsgClientDrop', "", %client.name, %client);
|
||||||
|
messageAll('MsgClientJoin', "",%client.name, %client, "",%client.isAIControlled(),%client.isAdmin,%client.isSuperAdmin,%client.isSmurf,%client.sendGuid);
|
||||||
|
messageAll('MsgClientJoinTeam', "", %client.name, %game.getTeamName(0), %client, %client.team );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
messageClient(%client, 'MsgError', '\c2Only Super Admins can use this command.');
|
messageClient(%client, 'MsgError', '\c2Only Super Admins can use this command.');
|
||||||
|
|
@ -2910,7 +2926,10 @@ function startTourneyCountdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
// lets get it on!
|
// lets get it on!
|
||||||
Countdown( 30 * 1000 );
|
if($Host::warmupTime <= 30)
|
||||||
|
Countdown(30 * 1000);
|
||||||
|
else
|
||||||
|
Countdown($Host::warmupTime * 1000); //Follow warmupTime!
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkTourneyMatchStart()
|
function checkTourneyMatchStart()
|
||||||
|
|
@ -2984,7 +3003,11 @@ function checkTourneyMatchStart()
|
||||||
Game.scheduleVote = "";
|
Game.scheduleVote = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
Countdown(30 * 1000);
|
// lets get it on!
|
||||||
|
if($Host::warmupTime <= 30)
|
||||||
|
Countdown(30 * 1000);
|
||||||
|
else
|
||||||
|
Countdown($Host::warmupTime * 1000); //Follow warmupTime!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3066,6 +3089,12 @@ function EndCountdown(%timeMS)
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(%timeMS >= 900000 && $Host::TournamentMode)
|
||||||
|
Game.endfifteenminuteCount = schedule(%timeMS - 900000, Game, "notifyMatchEndMinutes", 900000);
|
||||||
|
if(%timeMS >= 600000 && $Host::TournamentMode)
|
||||||
|
Game.endtenminuteCount = schedule(%timeMS - 600000, Game, "notifyMatchEndMinutes", 600000);
|
||||||
|
if(%timeMS >= 300000 && $Host::TournamentMode)
|
||||||
|
Game.endfiveminuteCount = schedule(%timeMS - 300000, Game, "notifyMatchEndMinutes", 300000);
|
||||||
if(%timeMS >= 180000)
|
if(%timeMS >= 180000)
|
||||||
Game.endthreeminuteCount = schedule(%timeMS - 180000, Game, "notifyMatchEndMinutes", 180000);
|
Game.endthreeminuteCount = schedule(%timeMS - 180000, Game, "notifyMatchEndMinutes", 180000);
|
||||||
if(%timeMS >= 120000)
|
if(%timeMS >= 120000)
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ $Host::AllowPlayerVoteSkipMission = 1;
|
||||||
$Host::AllowPlayerVoteTimeLimit = 1;
|
$Host::AllowPlayerVoteTimeLimit = 1;
|
||||||
$Host::AllowPlayerVoteTournamentMode = 1;
|
$Host::AllowPlayerVoteTournamentMode = 1;
|
||||||
$Host::AllowPlayerVoteTeamDamage = 1;
|
$Host::AllowPlayerVoteTeamDamage = 1;
|
||||||
$Host::AllowPlayerTournamentModeVotekick = 1;
|
$Host::AllowPlayerVoteNextMission = 1;
|
||||||
$Host::NoBaseRapeEnabled = 1; //Enable or Disable No Base Rape
|
$Host::NoBaseRapeEnabled = 1; //Enable or Disable No Base Rape
|
||||||
$Host::NoBaseRapePlayerCount = 14; //Min number players the turn off No Base Rape
|
$Host::NoBaseRapePlayerCount = 14; //Min number players the turn off No Base Rape
|
||||||
$Host::AveragePings = 1; //Show Average ping in F2 menu
|
$Host::AveragePings = 1; //Show Average ping in F2 menu
|
||||||
|
|
@ -212,6 +212,8 @@ $Host::LoadScreenShowLogo = 0;
|
||||||
$Host::LoadScreenShowLogoName = "dpub/DPUB_logo"; //Logo location Filename
|
$Host::LoadScreenShowLogoName = "dpub/DPUB_logo"; //Logo location Filename
|
||||||
$Host::MapChangeMSG = 0; //Center Print between mapchanges
|
$Host::MapChangeMSG = 0; //Center Print between mapchanges
|
||||||
$Host::MapChangeMSGContent = "<color:3cb4b4><font:Sui Generis:22>Pickup Night\n<color:3cb4b4><font:Univers:16>Saturday, March 5th\n<color:3cb4b4><font:Univers:16>Join discord for details";
|
$Host::MapChangeMSGContent = "<color:3cb4b4><font:Sui Generis:22>Pickup Night\n<color:3cb4b4><font:Univers:16>Saturday, March 5th\n<color:3cb4b4><font:Univers:16>Join discord for details";
|
||||||
|
$Host::MultipleMapRotation = 0; //Rotate thru multiple map rotation files 1,2,3, etc
|
||||||
|
$Host::MultipleMapRotationCount = 3; //How many multiple map rotation files (mapRotation1.cs, mapRotation2.cs, mapRotation3.cs, etc)
|
||||||
|
|
||||||
//LakRabbit
|
//LakRabbit
|
||||||
$Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled
|
$Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue