mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-13 07:04:33 +00:00
Native Mine+disc support
This commit is contained in:
parent
835d997b8e
commit
7aaaecf2f7
4 changed files with 122 additions and 12 deletions
|
|
@ -386,14 +386,20 @@ function ProcessBonusDM(%game, %clVictim, %clKiller, %damageType, %implement, %d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//function listDM(){// for debug
|
|
||||||
//for(%a = 0; %a < ClientGroup.getCount(); %a++){
|
//function listDM() // for debug
|
||||||
//%client = ClientGroup.getObject(%a);
|
//{
|
||||||
//echo(%client.nameBase SPC KIlls SPC %client.killCounter);
|
// for(%a = 0; %a < ClientGroup.getCount(); %a++)
|
||||||
//}
|
// {
|
||||||
|
// %client = ClientGroup.getObject(%a);
|
||||||
|
// echo(%client.nameBase SPC KIlls SPC %client.killCounter);
|
||||||
|
// }
|
||||||
//}
|
//}
|
||||||
function markTargetDM(%client,%clTarget){// out of bountygame
|
|
||||||
if(isObject(%clTarget) && isObject(%client) && !%client.isAIControlled()){
|
function markTargetDM(%client,%clTarget) // out of bountygame
|
||||||
|
{
|
||||||
|
if(isObject(%clTarget) && isObject(%client) && !%client.isAIControlled())
|
||||||
|
{
|
||||||
%visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup());
|
%visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup());
|
||||||
%visMask |= (1 << %client.getSensorGroup());
|
%visMask |= (1 << %client.getSensorGroup());
|
||||||
setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask);
|
setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask);
|
||||||
|
|
@ -403,8 +409,10 @@ function markTargetDM(%client,%clTarget){// out of bountygame
|
||||||
%client.sendTargetTo(%client, true);
|
%client.sendTargetTo(%client, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function hideTargetWaypoint(%client,%clTarget){
|
function hideTargetWaypoint(%client,%clTarget)
|
||||||
if(isObject(%clTarget) && isObject(%client) && !%client.isAIControlled()){
|
{
|
||||||
|
if(isObject(%clTarget) && isObject(%client) && !%client.isAIControlled())
|
||||||
|
{
|
||||||
%visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup());
|
%visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup());
|
||||||
%visMask &= ~(1 << %client.getSensorGroup());
|
%visMask &= ~(1 << %client.getSensorGroup());
|
||||||
setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask);
|
setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask);
|
||||||
|
|
@ -463,7 +471,7 @@ function DMGame::scoreLimitReached(%game)
|
||||||
function DMGame::gameOver(%game)
|
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" );
|
||||||
|
|
||||||
|
|
@ -556,6 +564,7 @@ function plzBounceOffGrid(%obj, %bounceForce, %count)
|
||||||
schedule(250, 0, plzBounceOffGrid, %obj, %bounceForce, %count + 1);
|
schedule(250, 0, plzBounceOffGrid, %obj, %bounceForce, %count + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isOutOfBounds(%position)
|
function isOutOfBounds(%position)
|
||||||
{
|
{
|
||||||
%shapePos = %position;
|
%shapePos = %position;
|
||||||
|
|
@ -591,7 +600,8 @@ 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();
|
||||||
%player.setDamageLevel(%prevHurt + 0.05);
|
%player.setDamageLevel(%prevHurt + 0.05);
|
||||||
|
|
@ -676,6 +686,7 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
|
|
||||||
//function DMGame::applyConcussion(%game, %player)
|
//function DMGame::applyConcussion(%game, %player)
|
||||||
//{
|
//{
|
||||||
|
//
|
||||||
//}
|
//}
|
||||||
|
|
||||||
package DMGame
|
package DMGame
|
||||||
|
|
@ -772,6 +783,31 @@ package DMGame
|
||||||
%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.
|
||||||
|
// client.mineDisc = [true|false]
|
||||||
|
// client.mineDiscCheck [0-None|1-Disc Damage|2-Mine Damage]
|
||||||
|
// Teratos: Don't understand why "%client = %targetClient;" -- possibly to avoid carrying .minediscCheck field?
|
||||||
|
// Teratos: A little more redundant code and less readable for a few less comparisons.
|
||||||
|
%targetClient.mineDisc = false;
|
||||||
|
if(%damageType == $DamageType::Disc) {
|
||||||
|
%client = %targetClient; // Oops
|
||||||
|
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
||||||
|
%client.minediscCheck = 1;
|
||||||
|
schedule(300, 0, "resetMineDiscCheck", %client);
|
||||||
|
} else if(%client.minediscCheck == 2) { // Recent Mine damage
|
||||||
|
%client.mineDisc = true;
|
||||||
|
}
|
||||||
|
} else if (%damageType == $DamageType::Mine) {
|
||||||
|
%client = %targetClient; // Oops
|
||||||
|
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
||||||
|
%client.minediscCheck = 2;
|
||||||
|
schedule(300, 0, "resetMineDiscCheck", %client);
|
||||||
|
} else if(%client.minediscCheck == 1) { // Recent Disc damage
|
||||||
|
%client.mineDisc = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// -- End Mine+Disc insert.
|
||||||
|
|
||||||
%previousDamage = %targetObject.getDamagePercent();
|
%previousDamage = %targetObject.getDamagePercent();
|
||||||
%targetObject.setDamageFlash(%flash);
|
%targetObject.setDamageFlash(%flash);
|
||||||
|
|
@ -933,7 +969,6 @@ function killEveryone(%ignore, %message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// For voting to work properly - evo admin.ovl
|
// For voting to work properly - evo admin.ovl
|
||||||
//
|
//
|
||||||
// case "DMSLOnlyMode":
|
// case "DMSLOnlyMode":
|
||||||
|
|
|
||||||
|
|
@ -748,6 +748,31 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
%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.
|
||||||
|
// client.mineDisc = [true|false]
|
||||||
|
// client.mineDiscCheck [0-None|1-Disc Damage|2-Mine Damage]
|
||||||
|
// Teratos: Don't understand why "%client = %targetClient;" -- possibly to avoid carrying .minediscCheck field?
|
||||||
|
// Teratos: A little more redundant code and less readable for a few less comparisons.
|
||||||
|
%targetClient.mineDisc = false;
|
||||||
|
if(%damageType == $DamageType::Disc) {
|
||||||
|
%client = %targetClient; // Oops
|
||||||
|
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
||||||
|
%client.minediscCheck = 1;
|
||||||
|
schedule(300, 0, "resetMineDiscCheck", %client);
|
||||||
|
} else if(%client.minediscCheck == 2) { // Recent Mine damage
|
||||||
|
%client.mineDisc = true;
|
||||||
|
}
|
||||||
|
} else if (%damageType == $DamageType::Mine) {
|
||||||
|
%client = %targetClient; // Oops
|
||||||
|
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
||||||
|
%client.minediscCheck = 2;
|
||||||
|
schedule(300, 0, "resetMineDiscCheck", %client);
|
||||||
|
} else if(%client.minediscCheck == 1) { // Recent Disc damage
|
||||||
|
%client.mineDisc = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// -- End Mine+Disc insert.
|
||||||
|
|
||||||
%previousDamage = %targetObject.getDamagePercent();
|
%previousDamage = %targetObject.getDamagePercent();
|
||||||
%targetObject.setDamageFlash(%flash);
|
%targetObject.setDamageFlash(%flash);
|
||||||
|
|
|
||||||
|
|
@ -401,6 +401,31 @@ package SCtFGame
|
||||||
%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.
|
||||||
|
// client.mineDisc = [true|false]
|
||||||
|
// client.mineDiscCheck [0-None|1-Disc Damage|2-Mine Damage]
|
||||||
|
// Teratos: Don't understand why "%client = %targetClient;" -- possibly to avoid carrying .minediscCheck field?
|
||||||
|
// Teratos: A little more redundant code and less readable for a few less comparisons.
|
||||||
|
%targetClient.mineDisc = false;
|
||||||
|
if(%damageType == $DamageType::Disc) {
|
||||||
|
%client = %targetClient; // Oops
|
||||||
|
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
||||||
|
%client.minediscCheck = 1;
|
||||||
|
schedule(300, 0, "resetMineDiscCheck", %client);
|
||||||
|
} else if(%client.minediscCheck == 2) { // Recent Mine damage
|
||||||
|
%client.mineDisc = true;
|
||||||
|
}
|
||||||
|
} else if (%damageType == $DamageType::Mine) {
|
||||||
|
%client = %targetClient; // Oops
|
||||||
|
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
||||||
|
%client.minediscCheck = 2;
|
||||||
|
schedule(300, 0, "resetMineDiscCheck", %client);
|
||||||
|
} else if(%client.minediscCheck == 1) { // Recent Disc damage
|
||||||
|
%client.mineDisc = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// -- End Mine+Disc insert.
|
||||||
|
|
||||||
%previousDamage = %targetObject.getDamagePercent();
|
%previousDamage = %targetObject.getDamagePercent();
|
||||||
%targetObject.setDamageFlash(%flash);
|
%targetObject.setDamageFlash(%flash);
|
||||||
|
|
|
||||||
|
|
@ -2783,6 +2783,31 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
if (%flash > 0.75)
|
if (%flash > 0.75)
|
||||||
%flash = 0.75;
|
%flash = 0.75;
|
||||||
|
|
||||||
|
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
|
||||||
|
// client.mineDisc = [true|false]
|
||||||
|
// client.mineDiscCheck [0-None|1-Disc Damage|2-Mine Damage]
|
||||||
|
// Teratos: Don't understand why "%client = %targetClient;" -- possibly to avoid carrying .minediscCheck field?
|
||||||
|
// Teratos: A little more redundant code and less readable for a few less comparisons.
|
||||||
|
%targetClient.mineDisc = false;
|
||||||
|
if(%damageType == $DamageType::Disc) {
|
||||||
|
%client = %targetClient; // Oops
|
||||||
|
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
||||||
|
%client.minediscCheck = 1;
|
||||||
|
schedule(300, 0, "resetMineDiscCheck", %client);
|
||||||
|
} else if(%client.minediscCheck == 2) { // Recent Mine damage
|
||||||
|
%client.mineDisc = true;
|
||||||
|
}
|
||||||
|
} else if (%damageType == $DamageType::Mine) {
|
||||||
|
%client = %targetClient; // Oops
|
||||||
|
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
||||||
|
%client.minediscCheck = 2;
|
||||||
|
schedule(300, 0, "resetMineDiscCheck", %client);
|
||||||
|
} else if(%client.minediscCheck == 1) { // Recent Disc damage
|
||||||
|
%client.mineDisc = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// -- End Mine+Disc insert.
|
||||||
|
|
||||||
%previousDamage = %targetObject.getDamagePercent();
|
%previousDamage = %targetObject.getDamagePercent();
|
||||||
%targetObject.setDamageFlash(%flash);
|
%targetObject.setDamageFlash(%flash);
|
||||||
%targetObject.applyDamage(%amount);
|
%targetObject.applyDamage(%amount);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue