foobard
This commit is contained in:
410
maps/mp/gametypes/_callbacksetup.gsc
Executable file
410
maps/mp/gametypes/_callbacksetup.gsc
Executable file
@@ -0,0 +1,410 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
|
||||
// Callback Setup
|
||||
// This script provides the hooks from code into script for the gametype callback functions.
|
||||
|
||||
//=============================================================================
|
||||
// Code Callback functions
|
||||
|
||||
/*================
|
||||
Called by code after the level's main script function has run.
|
||||
================*/
|
||||
CodeCallback_StartGameType()
|
||||
{
|
||||
if( getDvar( "r_reflectionProbeGenerate" ) == "1" )
|
||||
level waittill( "eternity" );
|
||||
|
||||
// If the gametype has not beed started, run the startup
|
||||
if(!isDefined(level.gametypestarted) || !level.gametypestarted)
|
||||
{
|
||||
[[level.callbackStartGameType]]();
|
||||
|
||||
level.gametypestarted = true; // so we know that the gametype has been started up
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*================
|
||||
Called when a player begins connecting to the server.
|
||||
Called again for every map change or tournement restart.
|
||||
|
||||
Return undefined if the client should be allowed, otherwise return
|
||||
a string with the reason for denial.
|
||||
|
||||
Otherwise, the client will be sent the current gamestate
|
||||
and will eventually get to ClientBegin.
|
||||
|
||||
firstTime will be qtrue the very first time a client connects
|
||||
to the server machine, but qfalse on map changes and tournement
|
||||
restarts.
|
||||
================*/
|
||||
CodeCallback_PlayerConnect()
|
||||
{
|
||||
if( getDvar( "r_reflectionProbeGenerate" ) == "1" )
|
||||
level waittill( "eternity" );
|
||||
|
||||
self endon("disconnect");
|
||||
[[level.callbackPlayerConnect]]();
|
||||
}
|
||||
|
||||
/*================
|
||||
Called when a player drops from the server.
|
||||
Will not be called between levels.
|
||||
self is the player that is disconnecting.
|
||||
================*/
|
||||
CodeCallback_PlayerDisconnect()
|
||||
{
|
||||
self notify("disconnect");
|
||||
[[level.callbackPlayerDisconnect]]();
|
||||
}
|
||||
|
||||
/*================
|
||||
Called when a player has taken damage.
|
||||
self is the player that took damage.
|
||||
================*/
|
||||
CodeCallback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset)
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
if(sWeapon == "model1887_mp")
|
||||
iDamage += 30;
|
||||
if(sWeapon == "model1887_akimbo_mp")
|
||||
iDamage += 25;
|
||||
if(sWeapon == "cheytac_mp")
|
||||
iDamage += 40;
|
||||
if(sWeapon == "barrett_mp")
|
||||
iDamage += 20;
|
||||
if(sWeapon == "m40a3_mp")
|
||||
iDamage += 20;
|
||||
|
||||
if(sMeansOfDeath == "MOD_MELEE")
|
||||
{
|
||||
eAttacker.knifeKills++;
|
||||
if(eAttacker.knifeKills >= 5)
|
||||
iDamage = 50;
|
||||
}
|
||||
if(level.state == "ingame" && getDvarInt("show_damage_ui") == 1){
|
||||
if(getDvar("g_gametype") == "gungame_team")
|
||||
{
|
||||
if(self.team == eAttacker.team)
|
||||
{
|
||||
[[level.callbackPlayerDamage]](eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset); // tested?
|
||||
return;
|
||||
}
|
||||
}
|
||||
damagehud = eAttacker createDamageHud();
|
||||
damageHud setValue(iDamage);
|
||||
damageHud moveOverTime(1);
|
||||
damageHud.x -= 300;
|
||||
damageHud.y += (-1 * randomInt(150));
|
||||
damageHud fadeOverTime(1);
|
||||
damageHud.alpha = 0;
|
||||
eAttacker thread destroyDamageHud(damageHud);
|
||||
self thread updateDamageHud();
|
||||
}
|
||||
if(level.state != "ingame")
|
||||
iDamage = 0;
|
||||
|
||||
if(self.actual_health - iDamage > 0 && iDamage > 0)
|
||||
{
|
||||
self.actual_health -= iDamage;
|
||||
self.health = 950; // Keep engine health high to avoid bloody screen
|
||||
if(isPlayer(eAttacker))
|
||||
eAttacker thread maps\mp\gametypes\_damagefeedback::updateDamageFeedback("standard");
|
||||
|
||||
self playRumbleOnEntity("damage_heavy");
|
||||
iDamage = 20; // Enough to trigger indicator on 1000 maxhealth
|
||||
}
|
||||
else if(iDamage > 0)
|
||||
{
|
||||
iDamage = self.health; // Lethal hit
|
||||
}
|
||||
|
||||
[[level.callbackPlayerDamage]](eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset);
|
||||
}
|
||||
|
||||
updateDamageHud()
|
||||
{
|
||||
for(i=0;i<10;i++)
|
||||
{
|
||||
self stopShellshock();
|
||||
if(isDefined(self.speed) && self.speed)
|
||||
self setMoveSpeedScale(1.6);
|
||||
else
|
||||
self setMoveSpeedScale(1);
|
||||
wait .05;
|
||||
}
|
||||
self notify("takeDamage");
|
||||
}
|
||||
createDamageHud()
|
||||
{
|
||||
damageHud = createText(undefined,1.3,"CENTER", "CENTER", 0,-100);
|
||||
damageHud.glowColor = (.7,0,0);
|
||||
damageHud.x = 350;
|
||||
damageHud.y = 0;
|
||||
return damageHud;
|
||||
}
|
||||
destroyDamageHud(damageHud)
|
||||
{
|
||||
wait 1;
|
||||
damageHud destroy();
|
||||
}
|
||||
createText(text,size,align,pos,x,y,font)
|
||||
{
|
||||
if(!isDefined(font))
|
||||
hud = self createFontString("default",size);
|
||||
else
|
||||
hud = self createFontString(font,size);
|
||||
hud setPoint(align,pos,x,y);
|
||||
if(isDefined(text))
|
||||
hud setText(text);
|
||||
hud.glowAlpha = 1;
|
||||
hud.hideWhenInMenu = true;
|
||||
return hud;
|
||||
}
|
||||
|
||||
/*================
|
||||
Called when a player has been killed.
|
||||
self is the player that was killed.
|
||||
================*/
|
||||
CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
if(self == eAttacker || sMeansOfDeath == "MOD_SUICIDE" || sMeansOfDeath == "MOD_FALLING")
|
||||
{
|
||||
if(self.score >= 100)
|
||||
self.score -= 100;
|
||||
else
|
||||
self.score = 0;
|
||||
if(self.current > 0)
|
||||
self.current--;
|
||||
if(getDvar("g_gametype") != "gungame_team")
|
||||
self.gungameKills--;
|
||||
self thread mod\main::warning(3);
|
||||
}
|
||||
else if(sMeansOfDeath != "MOD_MELEE" || sWeapon == "riotshield_mp")
|
||||
{
|
||||
eAttacker playlocalsound("mp_enemy_obj_captured");
|
||||
eAttacker notify("killed_enemy");
|
||||
eAttacker.score += 100;
|
||||
if(getDvar("g_gametype") != "gungame_team")
|
||||
{
|
||||
//iPrintlnBold(getDvar("gunmode"));
|
||||
if(getDvar("gunmode") != "Kill Confirmed")
|
||||
{
|
||||
if(sWeapon == "riotshield_mp" && getDvar("gunmode") == "Fungame")
|
||||
eAttacker.gungameKills += getDvarInt("gun_kills", 1);
|
||||
else
|
||||
eAttacker.gungameKills++;
|
||||
}
|
||||
else
|
||||
thread mod\main::spawnDogTag(self, eAttacker);
|
||||
}
|
||||
else if(eAttacker.team != self)
|
||||
{
|
||||
if(eAttacker.team == "allies")
|
||||
{
|
||||
level.teamKills["allies"]++;
|
||||
if(level.teamKills["allies"] >= getRequiredKills())
|
||||
{
|
||||
level.teamKills["allies"] = 0;
|
||||
level.teamKills["allies_weapon"]++;
|
||||
level notify("upgrade_allies");
|
||||
thread mod\main::upgradeTeamUI("allies");
|
||||
thread mod\main::upgradeEnemyWeaponUI("axis");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
level.teamKills["axis"]++;
|
||||
if(level.teamKills["axis"] >= eAttacker getRequiredKills())
|
||||
{
|
||||
level.teamKills["axis"] = 0;
|
||||
level.teamKills["axis_weapon"]++;
|
||||
level notify("upgrade_axis");
|
||||
thread mod\main::upgradeTeamUI("axis");
|
||||
thread mod\main::upgradeEnemyWeaponUI("allies");
|
||||
}
|
||||
}
|
||||
eAttacker thread mod\main::scorepopup(100);
|
||||
eAttacker.streaking++;
|
||||
}
|
||||
}
|
||||
else{
|
||||
eAttacker.score += 100;
|
||||
}
|
||||
self notify("killed_lethal");
|
||||
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
|
||||
}
|
||||
getRequiredKills()
|
||||
{
|
||||
allies = 0;
|
||||
axis = 0;
|
||||
foreach(player in level.players)
|
||||
{
|
||||
if(player.team == "allies")
|
||||
allies++;
|
||||
else if(player.team == "axis")
|
||||
axis++;
|
||||
}
|
||||
if(self.team == "allies")
|
||||
return allies;
|
||||
else if(self.team == "axis")
|
||||
return axis;
|
||||
return 9999;
|
||||
}
|
||||
|
||||
getRequiredKillsOld()
|
||||
{
|
||||
if(level.players.size < 4)
|
||||
return 2;
|
||||
if(level.players.size < 6)
|
||||
return 3;
|
||||
if(level.players.size < 10)
|
||||
return 4;
|
||||
if(level.players.size < 15)
|
||||
return 5;
|
||||
return 6;
|
||||
}
|
||||
|
||||
/*================
|
||||
Called when a vehicle has taken damage.
|
||||
self is the vehicle that took damage.
|
||||
================*/
|
||||
CodeCallback_VehicleDamage( inflictor, attacker, damage, dFlags, meansOfDeath, weapon, point, dir, hitLoc, timeOffset, modelIndex, partName )
|
||||
{
|
||||
if ( isDefined( self.damageCallback ) )
|
||||
self [[self.damageCallback]]( inflictor, attacker, damage, dFlags, meansOfDeath, weapon, point, dir, hitLoc, timeOffset, modelIndex, partName );
|
||||
else
|
||||
self Vehicle_FinishDamage( inflictor, attacker, damage, dFlags, meansOfDeath, weapon, point, dir, hitLoc, timeOffset, modelIndex, partName );
|
||||
}
|
||||
|
||||
|
||||
/*================
|
||||
Called when code is forcibly ending the game.
|
||||
e.g. we suck as host.
|
||||
================*/
|
||||
CodeCallback_CodeEndGame()
|
||||
{
|
||||
self endon("disconnect");
|
||||
[[level.callbackCodeEndGame]]();
|
||||
}
|
||||
|
||||
|
||||
/*================
|
||||
Called when a player has been killed, but has last stand perk.
|
||||
self is the player that was killed.
|
||||
================*/
|
||||
CodeCallback_PlayerLastStand(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration )
|
||||
{
|
||||
self endon("disconnect");
|
||||
[[level.callbackPlayerLastStand]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
|
||||
}
|
||||
|
||||
|
||||
/*================
|
||||
Called when a player reconnects to the server
|
||||
following a host migration.
|
||||
================*/
|
||||
CodeCallback_PlayerMigrated()
|
||||
{
|
||||
self endon("disconnect");
|
||||
[[level.callbackPlayerMigrated]]();
|
||||
}
|
||||
|
||||
|
||||
/*================
|
||||
Called once when a host migration has occured.
|
||||
================*/
|
||||
CodeCallback_HostMigration()
|
||||
{
|
||||
[[level.callbackHostMigration]]();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
// Damage flags used in the playerDamage callback
|
||||
SetupDamageFlags()
|
||||
{
|
||||
// code-defined:
|
||||
level.iDFLAGS_RADIUS = 1; // damage was indirect
|
||||
level.iDFLAGS_NO_ARMOR = 2; // armor does not protect from this damage
|
||||
level.iDFLAGS_NO_KNOCKBACK = 4; // do not affect velocity, just view angles
|
||||
level.iDFLAGS_PENETRATION = 8; // damage occurred after one or more penetrations
|
||||
level.iDFLAGS_STUN = 16; // non-lethal
|
||||
level.iDFLAGS_SHIELD_EXPLOSIVE_IMPACT = 32; // missile impacted on the front of the victim's shield
|
||||
level.iDFLAGS_SHIELD_EXPLOSIVE_IMPACT_HUGE = 64; // ...and was from a projectile with "Big Explosion" checked on.
|
||||
level.iDFLAGS_SHIELD_EXPLOSIVE_SPLASH = 128; // explosive splash, somewhat deflected by the victim's shield
|
||||
|
||||
// script-defined:
|
||||
level.iDFLAGS_NO_TEAM_PROTECTION = 256;
|
||||
level.iDFLAGS_NO_PROTECTION = 512;
|
||||
level.iDFLAGS_PASSTHRU = 1024;
|
||||
}
|
||||
|
||||
|
||||
/*================
|
||||
Setup any misc callbacks stuff like defines and default callbacks
|
||||
================*/
|
||||
SetupCallbacks()
|
||||
{
|
||||
SetDefaultCallbacks();
|
||||
SetupDamageFlags();
|
||||
}
|
||||
|
||||
|
||||
/*================
|
||||
Called from the gametype script to store off the default callback functions.
|
||||
This allows the callbacks to be overridden by level script, but not lost.
|
||||
================*/
|
||||
SetDefaultCallbacks()
|
||||
{
|
||||
level.callbackStartGameType = maps\mp\gametypes\_gamelogic::Callback_StartGameType;
|
||||
level.callbackPlayerConnect = maps\mp\gametypes\_playerlogic::Callback_PlayerConnect;
|
||||
level.callbackPlayerDisconnect = maps\mp\gametypes\_playerlogic::Callback_PlayerDisconnect;
|
||||
level.callbackPlayerDamage = maps\mp\gametypes\_damage::Callback_PlayerDamage;
|
||||
level.callbackPlayerKilled = maps\mp\gametypes\_damage::Callback_PlayerKilled;
|
||||
level.callbackCodeEndGame = maps\mp\gametypes\_gamelogic::Callback_CodeEndGame;
|
||||
level.callbackPlayerLastStand = maps\mp\gametypes\_damage::Callback_PlayerLastStand;
|
||||
level.callbackPlayerMigrated = maps\mp\gametypes\_playerlogic::Callback_PlayerMigrated;
|
||||
level.callbackHostMigration = maps\mp\gametypes\_hostmigration::Callback_HostMigration;
|
||||
}
|
||||
|
||||
|
||||
/*================
|
||||
Called when a gametype is not supported.
|
||||
================*/
|
||||
AbortLevel()
|
||||
{
|
||||
println("Aborting level - gametype is not supported");
|
||||
|
||||
level.callbackStartGameType = ::callbackVoid;
|
||||
level.callbackPlayerConnect = ::callbackVoid;
|
||||
level.callbackPlayerDisconnect = ::callbackVoid;
|
||||
level.callbackPlayerDamage = ::callbackVoid;
|
||||
level.callbackPlayerKilled = ::callbackVoid;
|
||||
level.callbackCodeEndGame = ::callbackVoid;
|
||||
level.callbackPlayerLastStand = ::callbackVoid;
|
||||
level.callbackPlayerMigrated = ::callbackVoid;
|
||||
level.callbackHostMigration = ::callbackVoid;
|
||||
|
||||
setdvar("g_gametype", "gungame");
|
||||
|
||||
exitLevel(false);
|
||||
}
|
||||
|
||||
|
||||
/*================
|
||||
================*/
|
||||
callbackVoid()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
2330
maps/mp/gametypes/_gamelogic.gsc
Executable file
2330
maps/mp/gametypes/_gamelogic.gsc
Executable file
File diff suppressed because it is too large
Load Diff
18
maps/mp/gametypes/_gametypes.txt
Executable file
18
maps/mp/gametypes/_gametypes.txt
Executable file
@@ -0,0 +1,18 @@
|
||||
dm
|
||||
dom
|
||||
sd
|
||||
sab
|
||||
war
|
||||
koth
|
||||
oneflag
|
||||
arena
|
||||
dd
|
||||
vip
|
||||
ctf
|
||||
gtnw
|
||||
oitc
|
||||
gg
|
||||
ss
|
||||
m40a3
|
||||
gungame
|
||||
gungame_team
|
||||
1568
maps/mp/gametypes/_playerlogic.gsc
Executable file
1568
maps/mp/gametypes/_playerlogic.gsc
Executable file
File diff suppressed because it is too large
Load Diff
683
maps/mp/gametypes/_rank.gsc
Executable file
683
maps/mp/gametypes/_rank.gsc
Executable file
@@ -0,0 +1,683 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
|
||||
|
||||
init()
|
||||
{
|
||||
level.scoreInfo = [];
|
||||
level.xpScale = getDvarInt( "scr_xpscale" );
|
||||
|
||||
level.rankTable = [];
|
||||
|
||||
level.dogtag = loadFX( "misc/aircraft_light_wingtip_green" );
|
||||
level.dogtag2 = loadFX( "misc/flare_ambient_green" );
|
||||
level._effect["MoneyFX"] = loadfx("props/cash_player_drop");
|
||||
level.fx_airstrike_contrail = loadfx ("smoke/jet_contrail");
|
||||
level.wallbreakbomb = loadfx ("explosions/wall_explosion_pm_a");
|
||||
level.explosionfx = loadfx ("explosions/helicopter_explosion_secondary_small");
|
||||
|
||||
precacheShader("white");
|
||||
|
||||
precacheShader("cardicon_helmet_brit_ww2");
|
||||
precacheShader("cardicon_boot");
|
||||
precacheShader("cardicon_headshot");
|
||||
precacheShader("cardicon_ghost_mic");
|
||||
precacheShader("cardicon_biohazard");
|
||||
precacheShader("cardicon_juggernaut_2");
|
||||
precacheShader("cardicon_paratrooper");
|
||||
precacheShader("dpad_killstreak_sentry");
|
||||
precacheShader("cardicon_b2");
|
||||
precacheShader("cardicon_fmj");
|
||||
precacheShader("cardicon_xray");
|
||||
precacheShader("cardicon_thebomb");
|
||||
precacheShader("cardicon_chicken");
|
||||
|
||||
|
||||
precacheString( &"RANK_PLAYER_WAS_PROMOTED_N" );
|
||||
precacheString( &"RANK_PLAYER_WAS_PROMOTED" );
|
||||
precacheString( &"RANK_PROMOTED" );
|
||||
precacheString( &"MP_PLUS" );
|
||||
precacheString( &"RANK_ROMANI" );
|
||||
precacheString( &"RANK_ROMANII" );
|
||||
precacheString( &"RANK_ROMANIII" );
|
||||
|
||||
if ( level.teamBased )
|
||||
{
|
||||
registerScoreInfo( "kill", 100 );
|
||||
registerScoreInfo( "headshot", 100 );
|
||||
registerScoreInfo( "assist", 20 );
|
||||
registerScoreInfo( "suicide", 0 );
|
||||
registerScoreInfo( "teamkill", 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
registerScoreInfo( "kill", 50 );
|
||||
registerScoreInfo( "headshot", 50 );
|
||||
registerScoreInfo( "assist", 0 );
|
||||
registerScoreInfo( "suicide", 0 );
|
||||
registerScoreInfo( "teamkill", 0 );
|
||||
}
|
||||
|
||||
registerScoreInfo( "win", 1 );
|
||||
registerScoreInfo( "loss", 0.5 );
|
||||
registerScoreInfo( "tie", 0.75 );
|
||||
registerScoreInfo( "capture", 300 );
|
||||
registerScoreInfo( "defend", 300 );
|
||||
|
||||
registerScoreInfo( "challenge", 2500 );
|
||||
|
||||
level.maxRank = int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1 ));
|
||||
level.maxPrestige = int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ));
|
||||
|
||||
pId = 0;
|
||||
rId = 0;
|
||||
for ( pId = 0; pId <= level.maxPrestige; pId++ )
|
||||
{
|
||||
for ( rId = 0; rId <= level.maxRank; rId++ )
|
||||
precacheShader( tableLookup( "mp/rankIconTable.csv", 0, rId, pId+1 ) );
|
||||
}
|
||||
|
||||
rankId = 0;
|
||||
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
|
||||
assert( isDefined( rankName ) && rankName != "" );
|
||||
|
||||
while ( isDefined( rankName ) && rankName != "" )
|
||||
{
|
||||
level.rankTable[rankId][1] = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
|
||||
level.rankTable[rankId][2] = tableLookup( "mp/ranktable.csv", 0, rankId, 2 );
|
||||
level.rankTable[rankId][3] = tableLookup( "mp/ranktable.csv", 0, rankId, 3 );
|
||||
level.rankTable[rankId][7] = tableLookup( "mp/ranktable.csv", 0, rankId, 7 );
|
||||
|
||||
precacheString( tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 ) );
|
||||
|
||||
rankId++;
|
||||
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
|
||||
}
|
||||
|
||||
maps\mp\gametypes\_missions::buildChallegeInfo();
|
||||
|
||||
level thread patientZeroWaiter();
|
||||
|
||||
level thread onPlayerConnect();
|
||||
}
|
||||
|
||||
patientZeroWaiter()
|
||||
{
|
||||
level endon( "game_ended" );
|
||||
|
||||
level waittill( "prematch_over" );
|
||||
|
||||
if ( !matchMakingGame() )
|
||||
{
|
||||
if ( getDvar( "mapname" ) == "mp_rust" && randomInt( 1000 ) == 999 )
|
||||
level.patientZeroName = level.players[0].name;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( getDvar( "scr_patientZero" ) != "" )
|
||||
level.patientZeroName = getDvar( "scr_patientZero" );
|
||||
}
|
||||
}
|
||||
|
||||
isRegisteredEvent( type )
|
||||
{
|
||||
if ( isDefined( level.scoreInfo[type] ) )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
registerScoreInfo( type, value )
|
||||
{
|
||||
level.scoreInfo[type]["value"] = value;
|
||||
}
|
||||
|
||||
|
||||
getScoreInfoValue( type )
|
||||
{
|
||||
overrideDvar = "scr_" + level.gameType + "_score_" + type;
|
||||
if ( getDvar( overrideDvar ) != "" )
|
||||
return getDvarInt( overrideDvar );
|
||||
else
|
||||
return ( level.scoreInfo[type]["value"] );
|
||||
}
|
||||
|
||||
|
||||
getScoreInfoLabel( type )
|
||||
{
|
||||
return ( level.scoreInfo[type]["label"] );
|
||||
}
|
||||
|
||||
|
||||
getRankInfoMinXP( rankId )
|
||||
{
|
||||
return int(level.rankTable[rankId][2]);
|
||||
}
|
||||
|
||||
|
||||
getRankInfoXPAmt( rankId )
|
||||
{
|
||||
return int(level.rankTable[rankId][3]);
|
||||
}
|
||||
|
||||
|
||||
getRankInfoMaxXp( rankId )
|
||||
{
|
||||
return int(level.rankTable[rankId][7]);
|
||||
}
|
||||
|
||||
|
||||
getRankInfoFull( rankId )
|
||||
{
|
||||
return tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 );
|
||||
}
|
||||
|
||||
|
||||
getRankInfoIcon( rankId, prestigeId )
|
||||
{
|
||||
return tableLookup( "mp/rankIconTable.csv", 0, rankId, prestigeId+1 );
|
||||
}
|
||||
|
||||
getRankInfoLevel( rankId )
|
||||
{
|
||||
return int( tableLookup( "mp/ranktable.csv", 0, rankId, 13 ) );
|
||||
}
|
||||
|
||||
|
||||
onPlayerConnect()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
level waittill( "connected", player );
|
||||
|
||||
/#
|
||||
if ( getDvarInt( "scr_forceSequence" ) )
|
||||
player setPlayerData( "experience", 145499 );
|
||||
#/
|
||||
player.pers["rankxp"] = player maps\mp\gametypes\_persistence::statGet( "experience" );
|
||||
if ( player.pers["rankxp"] < 0 ) // paranoid defensive
|
||||
player.pers["rankxp"] = 0;
|
||||
|
||||
rankId = player getRankForXp( player getRankXP() );
|
||||
player.pers[ "rank" ] = rankId;
|
||||
player.pers[ "participation" ] = 0;
|
||||
|
||||
player.xpUpdateTotal = 0;
|
||||
player.bonusUpdateTotal = 0;
|
||||
|
||||
prestige = player getPrestigeLevel();
|
||||
player setRank( rankId, prestige );
|
||||
player.pers["prestige"] = prestige;
|
||||
|
||||
player.postGamePromotion = false;
|
||||
if ( !isDefined( player.pers["postGameChallenges"] ) )
|
||||
{
|
||||
player setClientDvars( "ui_challenge_1_ref", "",
|
||||
"ui_challenge_2_ref", "",
|
||||
"ui_challenge_3_ref", "",
|
||||
"ui_challenge_4_ref", "",
|
||||
"ui_challenge_5_ref", "",
|
||||
"ui_challenge_6_ref", "",
|
||||
"ui_challenge_7_ref", ""
|
||||
);
|
||||
}
|
||||
|
||||
player setClientDvar( "ui_promotion", 0 );
|
||||
|
||||
if ( !isDefined( player.pers["summary"] ) )
|
||||
{
|
||||
player.pers["summary"] = [];
|
||||
player.pers["summary"]["xp"] = 0;
|
||||
player.pers["summary"]["score"] = 0;
|
||||
player.pers["summary"]["challenge"] = 0;
|
||||
player.pers["summary"]["match"] = 0;
|
||||
player.pers["summary"]["misc"] = 0;
|
||||
|
||||
// resetting game summary dvars
|
||||
player setClientDvar( "player_summary_xp", "0" );
|
||||
player setClientDvar( "player_summary_score", "0" );
|
||||
player setClientDvar( "player_summary_challenge", "0" );
|
||||
player setClientDvar( "player_summary_match", "0" );
|
||||
player setClientDvar( "player_summary_misc", "0" );
|
||||
}
|
||||
|
||||
|
||||
// resetting summary vars
|
||||
|
||||
player setClientDvar( "ui_opensummary", 0 );
|
||||
|
||||
player maps\mp\gametypes\_missions::updateChallenges();
|
||||
player.explosiveKills[0] = 0;
|
||||
player.xpGains = [];
|
||||
|
||||
player.hud_scorePopup = newClientHudElem( player );
|
||||
player.hud_scorePopup.horzAlign = "center";
|
||||
player.hud_scorePopup.vertAlign = "middle";
|
||||
player.hud_scorePopup.alignX = "center";
|
||||
player.hud_scorePopup.alignY = "middle";
|
||||
player.hud_scorePopup.x = 0;
|
||||
if ( level.splitScreen )
|
||||
player.hud_scorePopup.y = -40;
|
||||
else
|
||||
player.hud_scorePopup.y = -60;
|
||||
player.hud_scorePopup.font = "hudbig";
|
||||
player.hud_scorePopup.fontscale = 0.75;
|
||||
player.hud_scorePopup.archived = false;
|
||||
player.hud_scorePopup.color = (0.5,0.5,0.5);
|
||||
player.hud_scorePopup.sort = 10000;
|
||||
player.hud_scorePopup maps\mp\gametypes\_hud::fontPulseInit( 3.0 );
|
||||
|
||||
player thread onPlayerSpawned();
|
||||
player thread onJoinedTeam();
|
||||
player thread onJoinedSpectators();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onJoinedTeam()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
for(;;)
|
||||
{
|
||||
self waittill( "joined_team" );
|
||||
self thread removeRankHUD();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onJoinedSpectators()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
for(;;)
|
||||
{
|
||||
self waittill( "joined_spectators" );
|
||||
self thread removeRankHUD();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onPlayerSpawned()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
for(;;)
|
||||
{
|
||||
self waittill("spawned_player");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
roundUp( floatVal )
|
||||
{
|
||||
if ( int( floatVal ) != floatVal )
|
||||
return int( floatVal+1 );
|
||||
else
|
||||
return int( floatVal );
|
||||
}
|
||||
|
||||
|
||||
giveRankXP( type, value )
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
lootType = "none";
|
||||
|
||||
if ( !self rankingEnabled() )
|
||||
return;
|
||||
|
||||
if ( level.teamBased && (!level.teamCount["allies"] || !level.teamCount["axis"]) )
|
||||
return;
|
||||
else if ( !level.teamBased && (level.teamCount["allies"] + level.teamCount["axis"] < 2) )
|
||||
return;
|
||||
|
||||
if ( !isDefined( value ) )
|
||||
value = getScoreInfoValue( type );
|
||||
|
||||
if ( !isDefined( self.xpGains[type] ) )
|
||||
self.xpGains[type] = 0;
|
||||
|
||||
momentumBonus = 0;
|
||||
gotRestXP = false;
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case "kill":
|
||||
case "headshot":
|
||||
case "shield_damage":
|
||||
value *= self.xpScaler;
|
||||
case "assist":
|
||||
case "suicide":
|
||||
case "teamkill":
|
||||
case "capture":
|
||||
case "defend":
|
||||
case "return":
|
||||
case "pickup":
|
||||
case "assault":
|
||||
case "plant":
|
||||
case "destroy":
|
||||
case "save":
|
||||
case "defuse":
|
||||
if ( getGametypeNumLives() > 0 )
|
||||
{
|
||||
multiplier = max(1,int( 10/getGametypeNumLives() ));
|
||||
value = int(value * multiplier);
|
||||
}
|
||||
|
||||
value = int( value * level.xpScale );
|
||||
|
||||
restXPAwarded = getRestXPAward( value );
|
||||
value += restXPAwarded;
|
||||
if ( restXPAwarded > 0 )
|
||||
{
|
||||
if ( isLastRestXPAward( value ) )
|
||||
thread maps\mp\gametypes\_hud_message::splashNotify( "rested_done" );
|
||||
|
||||
gotRestXP = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !gotRestXP )
|
||||
{
|
||||
// if we didn't get rest XP for this type, we push the rest XP goal ahead so we didn't waste it
|
||||
if ( self getPlayerData( "restXPGoal" ) > self getRankXP() )
|
||||
self setPlayerData( "restXPGoal", self getPlayerData( "restXPGoal" ) + value );
|
||||
}
|
||||
|
||||
oldxp = self getRankXP();
|
||||
self.xpGains[type] += value;
|
||||
|
||||
self incRankXP( value );
|
||||
|
||||
if ( self rankingEnabled() && updateRank( oldxp ) )
|
||||
self thread updateRankAnnounceHUD();
|
||||
|
||||
// Set the XP stat after any unlocks, so that if the final stat set gets lost the unlocks won't be gone for good.
|
||||
self syncXPStat();
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case "kill":
|
||||
case "headshot":
|
||||
case "suicide":
|
||||
case "teamkill":
|
||||
case "assist":
|
||||
case "capture":
|
||||
case "defend":
|
||||
case "return":
|
||||
case "pickup":
|
||||
case "assault":
|
||||
case "plant":
|
||||
case "defuse":
|
||||
self.pers["summary"]["score"] += value;
|
||||
self.pers["summary"]["xp"] += value;
|
||||
break;
|
||||
|
||||
case "win":
|
||||
case "loss":
|
||||
case "tie":
|
||||
self.pers["summary"]["match"] += value;
|
||||
self.pers["summary"]["xp"] += value;
|
||||
break;
|
||||
|
||||
case "challenge":
|
||||
self.pers["summary"]["challenge"] += value;
|
||||
self.pers["summary"]["xp"] += value;
|
||||
break;
|
||||
|
||||
default:
|
||||
self.pers["summary"]["misc"] += value; //keeps track of ungrouped match xp reward
|
||||
self.pers["summary"]["match"] += value;
|
||||
self.pers["summary"]["xp"] += value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
updateRank( oldxp )
|
||||
{
|
||||
newRankId = self getRank();
|
||||
if ( newRankId == self.pers["rank"] )
|
||||
return false;
|
||||
|
||||
oldRank = self.pers["rank"];
|
||||
rankId = self.pers["rank"];
|
||||
self.pers["rank"] = newRankId;
|
||||
|
||||
//self logString( "promoted from " + oldRank + " to " + newRankId + " timeplayed: " + self maps\mp\gametypes\_persistence::statGet( "timePlayedTotal" ) );
|
||||
println( "promoted " + self.name + " from rank " + oldRank + " to " + newRankId + ". Experience went from " + oldxp + " to " + self getRankXP() + "." );
|
||||
|
||||
self setRank( newRankId );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
updateRankAnnounceHUD()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
self notify("update_rank");
|
||||
self endon("update_rank");
|
||||
|
||||
team = self.pers["team"];
|
||||
if ( !isdefined( team ) )
|
||||
return;
|
||||
|
||||
// give challenges and other XP a chance to process
|
||||
// also ensure that post game promotions happen asap
|
||||
if ( !levelFlag( "game_over" ) )
|
||||
level waittill_notify_or_timeout( "game_over", 0.25 );
|
||||
|
||||
|
||||
newRankName = self getRankInfoFull( self.pers["rank"] );
|
||||
rank_char = level.rankTable[self.pers["rank"]][1];
|
||||
subRank = int(rank_char[rank_char.size-1]);
|
||||
|
||||
thread maps\mp\gametypes\_hud_message::promotionSplashNotify();
|
||||
|
||||
if ( subRank > 1 )
|
||||
return;
|
||||
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
playerteam = player.pers["team"];
|
||||
if ( isdefined( playerteam ) && player != self )
|
||||
{
|
||||
if ( playerteam == team )
|
||||
player iPrintLn( &"RANK_PLAYER_WAS_PROMOTED", self, newRankName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
endGameUpdate()
|
||||
{
|
||||
player = self;
|
||||
}
|
||||
|
||||
|
||||
scorePopup( amount, bonus, hudColor, glowAlpha )
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "joined_team" );
|
||||
self endon( "joined_spectators" );
|
||||
|
||||
if ( amount == 0 )
|
||||
return;
|
||||
|
||||
self notify( "scorePopup" );
|
||||
self endon( "scorePopup" );
|
||||
|
||||
self.xpUpdateTotal += amount;
|
||||
self.bonusUpdateTotal += bonus;
|
||||
|
||||
wait ( 0.05 );
|
||||
|
||||
if ( self.xpUpdateTotal < 0 )
|
||||
self.hud_scorePopup.label = &"";
|
||||
else
|
||||
self.hud_scorePopup.label = &"MP_PLUS";
|
||||
|
||||
self.hud_scorePopup.color = hudColor;
|
||||
self.hud_scorePopup.glowColor = hudColor;
|
||||
self.hud_scorePopup.glowAlpha = glowAlpha;
|
||||
|
||||
self.hud_scorePopup setValue(self.xpUpdateTotal);
|
||||
self.hud_scorePopup.alpha = 0.85;
|
||||
self.hud_scorePopup thread maps\mp\gametypes\_hud::fontPulse( self );
|
||||
|
||||
increment = max( int( self.bonusUpdateTotal / 20 ), 1 );
|
||||
|
||||
if ( self.bonusUpdateTotal )
|
||||
{
|
||||
while ( self.bonusUpdateTotal > 0 )
|
||||
{
|
||||
self.xpUpdateTotal += min( self.bonusUpdateTotal, increment );
|
||||
self.bonusUpdateTotal -= min( self.bonusUpdateTotal, increment );
|
||||
|
||||
self.hud_scorePopup setValue( self.xpUpdateTotal );
|
||||
|
||||
wait ( 0.05 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wait ( 1.0 );
|
||||
}
|
||||
|
||||
self.hud_scorePopup fadeOverTime( 0.75 );
|
||||
self.hud_scorePopup.alpha = 0;
|
||||
|
||||
self.xpUpdateTotal = 0;
|
||||
}
|
||||
|
||||
removeRankHUD()
|
||||
{
|
||||
self.hud_scorePopup.alpha = 0;
|
||||
}
|
||||
|
||||
getRank()
|
||||
{
|
||||
rankXp = self.pers["rankxp"];
|
||||
rankId = self.pers["rank"];
|
||||
|
||||
if ( rankXp < (getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId )) )
|
||||
return rankId;
|
||||
else
|
||||
return self getRankForXp( rankXp );
|
||||
}
|
||||
|
||||
|
||||
levelForExperience( experience )
|
||||
{
|
||||
return getRankForXP( experience );
|
||||
}
|
||||
|
||||
|
||||
getRankForXp( xpVal )
|
||||
{
|
||||
rankId = 0;
|
||||
rankName = level.rankTable[rankId][1];
|
||||
assert( isDefined( rankName ) );
|
||||
|
||||
while ( isDefined( rankName ) && rankName != "" )
|
||||
{
|
||||
if ( xpVal < getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId ) )
|
||||
return rankId;
|
||||
|
||||
rankId++;
|
||||
if ( isDefined( level.rankTable[rankId] ) )
|
||||
rankName = level.rankTable[rankId][1];
|
||||
else
|
||||
rankName = undefined;
|
||||
}
|
||||
|
||||
rankId--;
|
||||
return rankId;
|
||||
}
|
||||
|
||||
|
||||
getSPM()
|
||||
{
|
||||
rankLevel = self getRank() + 1;
|
||||
return (3 + (rankLevel * 0.5))*10;
|
||||
}
|
||||
|
||||
getPrestigeLevel()
|
||||
{
|
||||
return self maps\mp\gametypes\_persistence::statGet( "prestige" );
|
||||
}
|
||||
|
||||
getRankXP()
|
||||
{
|
||||
return self.pers["rankxp"];
|
||||
}
|
||||
|
||||
incRankXP( amount )
|
||||
{
|
||||
if ( !self rankingEnabled() )
|
||||
return;
|
||||
|
||||
if ( isDefined( self.isCheater ) )
|
||||
return;
|
||||
|
||||
xp = self getRankXP();
|
||||
newXp = (xp + amount);
|
||||
|
||||
if ( self.pers["rank"] == level.maxRank && newXp >= getRankInfoMaxXP( level.maxRank ) )
|
||||
newXp = getRankInfoMaxXP( level.maxRank );
|
||||
|
||||
self.pers["rankxp"] = newXp;
|
||||
}
|
||||
|
||||
getRestXPAward( baseXP )
|
||||
{
|
||||
if ( !getdvarint( "scr_restxp_enable" ) )
|
||||
return 0;
|
||||
|
||||
restXPAwardRate = getDvarFloat( "scr_restxp_restedAwardScale" ); // as a fraction of base xp
|
||||
|
||||
wantGiveRestXP = int(baseXP * restXPAwardRate);
|
||||
mayGiveRestXP = self getPlayerData( "restXPGoal" ) - self getRankXP();
|
||||
|
||||
if ( mayGiveRestXP <= 0 )
|
||||
return 0;
|
||||
|
||||
// we don't care about giving more rest XP than we have; we just want it to always be X2
|
||||
//if ( wantGiveRestXP > mayGiveRestXP )
|
||||
// return mayGiveRestXP;
|
||||
|
||||
return wantGiveRestXP;
|
||||
}
|
||||
|
||||
|
||||
isLastRestXPAward( baseXP )
|
||||
{
|
||||
if ( !getdvarint( "scr_restxp_enable" ) )
|
||||
return false;
|
||||
|
||||
restXPAwardRate = getDvarFloat( "scr_restxp_restedAwardScale" ); // as a fraction of base xp
|
||||
|
||||
wantGiveRestXP = int(baseXP * restXPAwardRate);
|
||||
mayGiveRestXP = self getPlayerData( "restXPGoal" ) - self getRankXP();
|
||||
|
||||
if ( mayGiveRestXP <= 0 )
|
||||
return false;
|
||||
|
||||
if ( wantGiveRestXP >= mayGiveRestXP )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
syncXPStat()
|
||||
{
|
||||
xp = self getRankXP();
|
||||
|
||||
self maps\mp\gametypes\_persistence::statSet( "experience", xp );
|
||||
}
|
||||
98
maps/mp/gametypes/gungame.gsc
Executable file
98
maps/mp/gametypes/gungame.gsc
Executable file
@@ -0,0 +1,98 @@
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
|
||||
/*QUAKED mp_dm_spawn (1.0 0.5 0.0) (-16 -16 0) (16 16 72)
|
||||
Players spawn away from enemies at one of these positions.*/
|
||||
|
||||
main()
|
||||
{
|
||||
maps\mp\gametypes\_globallogic::init();
|
||||
maps\mp\gametypes\_callbacksetup::SetupCallbacks();
|
||||
maps\mp\gametypes\_globallogic::SetupCallbacks();
|
||||
|
||||
registerTimeLimitDvar( level.gameType, 10, 0, 1440 );
|
||||
registerScoreLimitDvar( level.gameType, 1000, 0, 5000 );
|
||||
registerWinLimitDvar( level.gameType, 1, 0, 5000 );
|
||||
registerRoundLimitDvar( level.gameType, 1, 0, 10 );
|
||||
registerNumLivesDvar( level.gameType, 0, 0, 10 );
|
||||
registerHalfTimeDvar( level.gameType, 0, 0, 1 );
|
||||
|
||||
level.teamBased = false;
|
||||
level.onStartGameType = ::onStartGameType;
|
||||
level.getSpawnPoint = ::getSpawnPoint;
|
||||
level.onPlayerkilled = ::onPlayerkilled;
|
||||
|
||||
game["dialog"]["gametype"] = "gungame";
|
||||
|
||||
if ( getDvarInt( "g_hardcore" ) )
|
||||
game["dialog"]["gametype"] = "hc_" + game["dialog"]["gametype"];
|
||||
else if ( getDvarInt( "camera_thirdPerson" ) )
|
||||
game["dialog"]["gametype"] = "thirdp_" + game["dialog"]["gametype"];
|
||||
else if ( getDvarInt( "scr_diehard" ) )
|
||||
game["dialog"]["gametype"] = "dh_" + game["dialog"]["gametype"];
|
||||
else if (getDvarInt( "scr_" + level.gameType + "_promode" ) )
|
||||
game["dialog"]["gametype"] = game["dialog"]["gametype"] + "_pro";
|
||||
}
|
||||
|
||||
onStartGameType()
|
||||
{
|
||||
setClientNameMode("auto_change");
|
||||
|
||||
setObjectiveText( "allies", "Press ^3[{+actionslot 2}] ^7for FPS-Boost \n\n Mod made by ^:Santahunter^7!" );
|
||||
setObjectiveText( "axis", "Press ^3[{+actionslot 2}] ^7for FPS-Boost \n\n Mod made by ^:Santahunter^7!" );
|
||||
|
||||
if ( level.splitscreen )
|
||||
{
|
||||
setObjectiveScoreText( "allies", &"OBJECTIVES_DM" );
|
||||
setObjectiveScoreText( "axis", &"OBJECTIVES_DM" );
|
||||
}
|
||||
else
|
||||
{
|
||||
setObjectiveScoreText( "allies", &"OBJECTIVES_DM_SCORE" );
|
||||
setObjectiveScoreText( "axis", &"OBJECTIVES_DM_SCORE" );
|
||||
}
|
||||
|
||||
setObjectiveHintText( "allies", "Be the first who cycled through all guns to win! \n \n Mod made by ^:Santahunter^7!" );
|
||||
setObjectiveHintText( "axis", "Be the first who cycled through all guns to win! \n \n Mod made by ^:Santahunter^7!" );
|
||||
|
||||
level.killcam = false;
|
||||
level.spawnMins = ( 0, 0, 0 );
|
||||
level.spawnMaxs = ( 0, 0, 0 );
|
||||
maps\mp\gametypes\_spawnlogic::addSpawnPoints( "allies", "mp_dm_spawn" );
|
||||
maps\mp\gametypes\_spawnlogic::addSpawnPoints( "axis", "mp_dm_spawn" );
|
||||
level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs );
|
||||
setMapCenter(level.mapCenter);
|
||||
|
||||
allowed[0] = "dm";
|
||||
allowed[1] = "airdrop_pallet";
|
||||
maps\mp\gametypes\_gameobjects::main(allowed);
|
||||
|
||||
maps\mp\gametypes\_rank::registerScoreInfo( "kill", 00 );
|
||||
maps\mp\gametypes\_rank::registerScoreInfo( "headshot", 150 );
|
||||
maps\mp\gametypes\_rank::registerScoreInfo( "assist", 50 );
|
||||
maps\mp\gametypes\_rank::registerScoreInfo( "suicide", 0 );
|
||||
maps\mp\gametypes\_rank::registerScoreInfo( "teamkill", 0 );
|
||||
|
||||
level.QuickMessageToAll = true;
|
||||
//level thread maps\mp\gametypes\core::core();
|
||||
}
|
||||
getSpawnPoint()
|
||||
{
|
||||
spawnPoints = maps\mp\gametypes\_spawnlogic::getTeamSpawnPoints( self.pers["team"] );
|
||||
spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_DM( spawnPoints );
|
||||
return spawnPoint;
|
||||
}
|
||||
onPlayerkilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc, psOffsetTime, deathAnimDuration, killId, means)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1
maps/mp/gametypes/gungame.txt
Executable file
1
maps/mp/gametypes/gungame.txt
Executable file
@@ -0,0 +1 @@
|
||||
"Gungame"
|
||||
145
maps/mp/gametypes/gungame_team.gsc
Executable file
145
maps/mp/gametypes/gungame_team.gsc
Executable file
@@ -0,0 +1,145 @@
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
|
||||
main()
|
||||
{
|
||||
if(getdvar("mapname") == "mp_background")
|
||||
return;
|
||||
|
||||
maps\mp\gametypes\_globallogic::init();
|
||||
maps\mp\gametypes\_callbacksetup::SetupCallbacks();
|
||||
maps\mp\gametypes\_globallogic::SetupCallbacks();
|
||||
|
||||
registerRoundSwitchDvar( level.gameType, 0, 0, 9 );
|
||||
registerTimeLimitDvar( level.gameType, 10, 0, 1440 );
|
||||
registerScoreLimitDvar( level.gameType, 500, 0, 5000 );
|
||||
registerRoundLimitDvar( level.gameType, 1, 0, 10 );
|
||||
registerWinLimitDvar( level.gameType, 1, 0, 10 );
|
||||
registerRoundSwitchDvar( level.gameType, 3, 0, 30 );
|
||||
registerNumLivesDvar( level.gameType, 0, 0, 10 );
|
||||
registerHalfTimeDvar( level.gameType, 0, 0, 1 );
|
||||
|
||||
level.teamBased = true;
|
||||
level.onStartGameType = ::onStartGameType;
|
||||
level.getSpawnPoint = ::getSpawnPoint;
|
||||
level.onNormalDeath = ::onNormalDeath;
|
||||
//level.onTimeLimit = ::onTimeLimit; // overtime not fully supported yet
|
||||
|
||||
game["dialog"]["gametype"] = "tm_death";
|
||||
|
||||
if ( getDvarInt( "g_hardcore" ) )
|
||||
game["dialog"]["gametype"] = "hc_" + game["dialog"]["gametype"];
|
||||
else if ( getDvarInt( "camera_thirdPerson" ) )
|
||||
game["dialog"]["gametype"] = "thirdp_" + game["dialog"]["gametype"];
|
||||
else if ( getDvarInt( "scr_diehard" ) )
|
||||
game["dialog"]["gametype"] = "dh_" + game["dialog"]["gametype"];
|
||||
else if (getDvarInt( "scr_" + level.gameType + "_promode" ) )
|
||||
game["dialog"]["gametype"] = game["dialog"]["gametype"] + "_pro";
|
||||
|
||||
game["strings"]["overtime_hint"] = &"MP_FIRST_BLOOD";
|
||||
}
|
||||
|
||||
|
||||
onStartGameType()
|
||||
{
|
||||
setClientNameMode("auto_change");
|
||||
|
||||
if ( !isdefined( game["switchedsides"] ) )
|
||||
game["switchedsides"] = false;
|
||||
|
||||
if ( game["switchedsides"] )
|
||||
{
|
||||
oldAttackers = game["attackers"];
|
||||
oldDefenders = game["defenders"];
|
||||
game["attackers"] = oldDefenders;
|
||||
game["defenders"] = oldAttackers;
|
||||
}
|
||||
|
||||
setObjectiveText( "allies", "Each several kills of your team, your weapon ranks up! \n \n Mod made by ^:Santahunter^7!" );
|
||||
setObjectiveText( "axis", "Each several kills of your team, your weapon ranks up! \n \n Mod made by ^:Santahunter^7!" );
|
||||
|
||||
if ( level.splitscreen )
|
||||
{
|
||||
setObjectiveScoreText( "allies", &"OBJECTIVES_WAR" );
|
||||
setObjectiveScoreText( "axis", &"OBJECTIVES_WAR" );
|
||||
}
|
||||
else
|
||||
{
|
||||
setObjectiveScoreText( "allies", &"OBJECTIVES_WAR_SCORE" );
|
||||
setObjectiveScoreText( "axis", &"OBJECTIVES_WAR_SCORE" );
|
||||
}
|
||||
setObjectiveHintText( "allies", "Each several kills of your team, your weapon ranks up! \n \n Mod made by ^:Santahunter^7!" );
|
||||
setObjectiveHintText( "axis", "Each several kills of your team, your weapon ranks up! \n \n Mod made by ^:Santahunter^7!" );
|
||||
|
||||
level.killcam = false;
|
||||
level.spawnMins = ( 0, 0, 0 );
|
||||
level.spawnMaxs = ( 0, 0, 0 );
|
||||
maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_tdm_spawn_allies_start" );
|
||||
maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_tdm_spawn_axis_start" );
|
||||
maps\mp\gametypes\_spawnlogic::addSpawnPoints( "allies", "mp_tdm_spawn" );
|
||||
maps\mp\gametypes\_spawnlogic::addSpawnPoints( "axis", "mp_tdm_spawn" );
|
||||
|
||||
level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs );
|
||||
setMapCenter( level.mapCenter );
|
||||
|
||||
allowed[0] = level.gameType;
|
||||
allowed[1] = "airdrop_pallet";
|
||||
|
||||
maps\mp\gametypes\_gameobjects::main(allowed);
|
||||
}
|
||||
|
||||
|
||||
getSpawnPoint()
|
||||
{
|
||||
spawnteam = self.pers["team"];
|
||||
if ( game["switchedsides"] )
|
||||
spawnteam = getOtherTeam( spawnteam );
|
||||
|
||||
if ( level.inGracePeriod )
|
||||
{
|
||||
spawnPoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_tdm_spawn_" + spawnteam + "_start" );
|
||||
spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random( spawnPoints );
|
||||
}
|
||||
else
|
||||
{
|
||||
spawnPoints = maps\mp\gametypes\_spawnlogic::getTeamSpawnPoints( spawnteam );
|
||||
spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_NearTeam( spawnPoints );
|
||||
}
|
||||
|
||||
return spawnPoint;
|
||||
}
|
||||
|
||||
|
||||
onNormalDeath( victim, attacker, lifeId )
|
||||
{
|
||||
score = maps\mp\gametypes\_rank::getScoreInfoValue( "kill" );
|
||||
assert( isDefined( score ) );
|
||||
|
||||
attacker maps\mp\gametypes\_gamescore::giveTeamScoreForObjective( attacker.pers["team"], score );
|
||||
|
||||
if ( game["state"] == "postgame" && game["teamScores"][attacker.team] > game["teamScores"][level.otherTeam[attacker.team]] )
|
||||
attacker.finalKill = true;
|
||||
}
|
||||
|
||||
|
||||
onTimeLimit()
|
||||
{
|
||||
if ( game["status"] == "overtime" )
|
||||
{
|
||||
winner = "forfeit";
|
||||
}
|
||||
else if ( game["teamScores"]["allies"] == game["teamScores"]["axis"] )
|
||||
{
|
||||
winner = "overtime";
|
||||
}
|
||||
else if ( game["teamScores"]["axis"] > game["teamScores"]["allies"] )
|
||||
{
|
||||
winner = "axis";
|
||||
}
|
||||
else
|
||||
{
|
||||
winner = "allies";
|
||||
}
|
||||
|
||||
thread maps\mp\gametypes\_gamelogic::endGame( winner, game["strings"]["time_limit_reached"] );
|
||||
}
|
||||
1
maps/mp/gametypes/gungame_team.txt
Executable file
1
maps/mp/gametypes/gungame_team.txt
Executable file
@@ -0,0 +1 @@
|
||||
"Team Gungame"
|
||||
Reference in New Issue
Block a user