Added client specific messeges

This commit is contained in:
ChocoTaco 2019-03-23 12:50:57 -04:00
parent 00fa39610b
commit ceb76a3edf

View file

@ -214,9 +214,10 @@ 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.isObserver =0; %client.setSensorGroup(%client.team);
%client.isObserver = 0;
} }
function DMGame::resetScore(%game, %client) function DMGame::resetScore(%game, %client)
@ -231,9 +232,10 @@ function DMGame::resetScore(%game, %client)
%client.killCounter = 0;// not a score thing but needs to be reset %client.killCounter = 0;// not a score thing but needs to be reset
} }
function DMGame::forceObserver( %game, %client, %reason ){ function DMGame::forceObserver( %game, %client, %reason )
{
parent::forceObserver( %game, %client, %reason ); parent::forceObserver( %game, %client, %reason );
%client.isObserver =1; %client.isObserver = 1;
} }
function DMGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc) function DMGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc)
@ -242,31 +244,32 @@ function DMGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %imple
DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc); DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
if($ProcessBonusActive) ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
schedule(300, 0, "ProcessBonusDM", %game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
else
ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
} }
function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc) function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc)
{ {
$ProcessBonusActive = true;
if(%clVictim.isMarked && $DMGame::mode) if(%clVictim.isMarked && $DMGame::mode)
{ {
if(%clKiller $= "")
return;
if(%clVictim !$= %clKiller) if(%clVictim !$= %clKiller)
{ {
if(%clKiller $= "") %temprampage = mfloor((%clVictim.killCounter - $DMGame::wpKillCount) * %game.SCORE_PER_KILLSTREAKBONUS);
return;
//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 );
if(%temprampage > 0)
messageClient(%clVictim, 'Msgding', '\c4%1 has ended your %2X Kill Streak. You\'ve been rewarded with %3 extra points!~wfx/misc/flag_lost.wav', %clKiller.name, %clVictim.killCounter, %temprampage);
else
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
@ -274,13 +277,19 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
%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 );
if(%temprampage > 0)
messageClient(%clVictim, 'Msgding', '\c4%1 has ended your %2X Kill Streak. You\'ve been rewarded with %3 extra points!~wfx/misc/flag_lost.wav', %clKiller.name, %clVictim.killCounter, %temprampage);
else
messageClient(%clVictim, 'Msgding', '\c2%1 has ended your %2X Kill Streak.~wfx/misc/flag_lost.wav', %clKiller.name, %clVictim.killCounter);
} }
Game.recalcScore(%clKiller); Game.recalcScore(%clKiller);
} }
else if(%clVictim == %clKiller) else if(%clVictim == %clKiller)
messageAll('Msgding', '\c1%1\'s %2x kill streak ended.', %clVictim.name, %clVictim.killCounter); {
messageAll('Msgding', '\c2%1\'s Kill Streak has ended. No bonus rewarded.', %clVictim.name, %clVictim.killCounter);
}
for(%a = 0; %a < ClientGroup.getCount(); %a++) for(%a = 0; %a < ClientGroup.getCount(); %a++)
{ {
%client = ClientGroup.getObject(%a); %client = ClientGroup.getObject(%a);
@ -296,7 +305,7 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
if(%game.lastGuy != %clKiller && %clVictim == %game.lastGuy) if(%game.lastGuy != %clKiller && %clVictim == %game.lastGuy)
{ {
%clKiller.Bonus++; %clKiller.Bonus++;
messageClient(%clKiller, 'MsgPingWaypoint', '\c1Bonus Target Count %1.~wfx/misc/~wfx/misc/flag_lost.wav',%clKiller.Bonus); messageClient(%clKiller, 'MsgPingWaypoint', '\c2Bonus Target Count %1.~wfx/misc/~wfx/misc/flag_lost.wav',%clKiller.Bonus);
} }
} }
%clKiller.killCounter++; %clKiller.killCounter++;
@ -314,27 +323,35 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
%bonusClient = %cl;// we have a new %bonusClient = %cl;// we have a new
} }
} }
if(%bonusClient !$= %game.lastGuy && %bonusClient !$= 0)
{
for(%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
messageClient(%cl, 'MsgPingWaypoint', '\c1%1 is on a kill streak.~wgui/vote_nopass.wav',%bonusClient.name); if(%bonusClient !$= 0 && %clKiller == %bonusClient)
{
if(%bonusClient == %game.lastGuy)
{
//give waypointed player a kill bonus
%bonusClient.KillStreakBonus++;
%bonusClient.scoreKillStreakBonus++;
messageClient(%bonusClient, 'MsgPingWaypoint', '\c2You\'ve increase your Kill Streak to %1!', %bonusClient.killCounter);
}
else
{
for(%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
hideTargetWaypoint(%cl,%game.lastGuy); hideTargetWaypoint(%cl,%game.lastGuy);
if(%cl != %bonusClient){ if(%cl !$= %bonusClient)
markTargetDM(%cl,%bonusClient); {
} markTargetDM(%cl,%bonusClient);
} }
%game.lastGuy.isMarked = 0; }
%bonusClient.isMarked = 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 );
%game.lastGuy = %bonusClient; messageClient(%bonusClient, 'MsgPingWaypoint', '\c2You\'re on a Kill Streak. Get more kills for extra points!~wfx/misc/target_waypoint.wav', %bonusClient.killCounter);
}
else if(%bonusClient == %game.lastGuy && %bonusClient !$= 0) %game.lastGuy.isMarked = 0;
{ //give waypointed player a kill bonus %bonusClient.isMarked = 1;
%bonusClient.KillStreakBonus++; %game.lastGuy = %bonusClient;
%bonusClient.scoreKillStreakBonus++; }
} }
case 2: // player with the highest score case 2: // player with the highest score
%bonusClient = 0; %bonusClient = 0;
@ -363,8 +380,6 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
%game.lastGuy = %bonusClient; %game.lastGuy = %bonusClient;
} }
} }
$ProcessBonusActive = false;
} }
//function listDM(){// for debug //function listDM(){// for debug
//for(%a = 0; %a < ClientGroup.getCount(); %a++){ //for(%a = 0; %a < ClientGroup.getCount(); %a++){