Skip to content

Commit

Permalink
Merge pull request #148 from FortressOne/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
drzel authored Jun 10, 2019
2 parents 07807ff + 21b1f63 commit d4f3d82
Show file tree
Hide file tree
Showing 30 changed files with 1,810 additions and 535 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ FortressOne Server v0.1.0

New features
------
* Server option for overriding map class restrictions (except civilian). `serverinfo override_mapclasses 1` or `serverinfo omc 1`.
* Option for maximum grenades for all classes. `localinfo max_gren1_<class> <number>`, short `localinfo mg1_<classnum> <number>`. Works for gren1s and gren2s. Eg `localinfo max_gren1_scout 0` to remove caltrops or `localinfo mg2_9 2` to reduce max EMPs to 2.
* Option to fully restock player's clip and finish reload immediately if in progress. `localinfo stock_reload 1` (`localinfo srd 1`) will trigger only on flag capture (with stock_on_cap enabled). `2` will trigger whenever any tfgoal gives you the appropriate ammo.
* Option for statusbar flaginfo. `setinfo sbflaginfo 1` (default). Setting it to `2` will skip the tf tips on respawn and show flag info all the time.
* Admin system created to allow for easy setup of pub/pug/quad/duel games, kick players etc `localinfo adminpwd <password>` and `cmd adminpwd <password>; wait; adminmenu`
* Loc support added to server, show locations for dropped flag.
* Nailgrenades changed to "Shock/Laser Grenades" to lower spam/not stop bunnyhopping on hit (0 original, 1 laser, 2 burst). `localinfo nailgren_type 1` and `nginfo` in game for all configurable settings.
* Option for flaginfo on sbar. `setinfo sbflaginfo on`
* Option for hitsounds (1 - enemies only, 2 - enemies and teammates). `setinfo hitsound 2`
* Option for medic to be immune from concussion effects. `localinfo medicnocuss on`.
* Option to adjust concussion grenade effect time in seconds. `localinfo cussgrentime n`.
* Increased nail velocity. Disable with `localinfo old_ng_velocity on`.
* Nailgun and Super-nailgun damage configurable with `localinfo ng_damage` and `localinfo sng_damage`.
* Keys and flags glow their colour.
* Capping player gets full restock.
* Option to adjust conussion grenade effect time in seconds. `localinfo cussgrentime`.
* Option to fully restock player on cap. `localinfo stock_on_cap on`.
* Option for packs to fully restock health and armour of player. `localinfo stockfull on`.
Expand Down
57 changes: 54 additions & 3 deletions admin.qc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ void () Admin_DoBan = {
self.admin_use = world;
};

void () Admin_ForceSpectator = {
bprint4(PRINT_HIGH, self.admin_use.netname, " was made spectator by ", self.netname, ". There's probably a good reason for this.\n");
stuffcmd(self.admin_use, "observe\n");
self.admin_mode = 0;
self.admin_use = world;
};

void () CeaseFire_think =
{
local entity te;
Expand Down Expand Up @@ -159,10 +166,13 @@ void () Admin_CeaseFire = {
dremove(te);
}
cease_fire = 0;
bprint(2, "RESUME FIRE\n");
if (cb_prematch) {
StartTimer();
//Make sure you don't just start the countdown on resume when not everyone's readied up
if (is_countdown || v_ready == TeamFortress_GetNoPlayers () ) {
StartTimer();
}
}
bprint(2, "RESUME FIRE\n");
te = find(world, classname, "player");
while (te) {
CenterPrint3(te, "RESUME FIRE\nCalled by: ", self.netname, "\n");
Expand All @@ -174,6 +184,42 @@ void () Admin_CeaseFire = {
}
};

void () Admin_Pause = {
if (!is_paused) {
setpause(1);
is_paused = 1;
pause_actor = self.netname;
if (cb_prematch && infokey(world, "status") == "Countdown") {
StopTimer();
bprint2(2, pause_actor, " stops the countdown\n");
return;
}
bprint2(2, pause_actor, " paused the game\n");
}
else {
if (cb_prematch) {
//Make sure you don't just start the countdown on resume when not everyone's readied up
if (is_countdown || v_ready == TeamFortress_GetNoPlayers () ) {
StartTimer();
}
setpause(0);
is_paused = 0;
return;
}
pause_actor = self.netname;
if (!unpause_requested) {
bprint2(2, pause_actor, " has requested to unpause the game in 5 seconds\n");
unpause_requested = 1;
}
else {
bprint2(2, pause_actor, " cancels unpause request\n");
unpause_requested = 0;
unpause_countdown = 0;
unpause_lastcountnumber = 0;
}
}
}

void (entity p) CheckAutoKick = {
local float rnum;
local entity te;
Expand Down Expand Up @@ -210,6 +256,10 @@ void (entity p) CheckAutoKick = {

void (string cl_pwd) Admin_Check =
{
if (self.is_admin) {
sprint(self, PRINT_HIGH, "You are already an admin\n");
return;
}
local string st2;

st2 = infokey(world, "adminpwd");
Expand Down Expand Up @@ -239,4 +289,5 @@ void () Admin_Aliases =
TeamFortress_Alias("adminmenu", TF_ADMIN_ADMINMENU, 0);
TeamFortress_Alias("startmatch", TF_ADMIN_FORCESTARTMATCH, 0);
TeamFortress_Alias("readystatus", TF_ADMIN_READYSTATUS, 0);
};
stuffcmd(self,"alias ceasefire \"cmd ceasefire\"\n");
};
3 changes: 3 additions & 0 deletions buttons.qc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define BUTTON_START_OUT 32

void () button_return;
void (entity pe_player, float dontstopdead) Spy_CheckForFuncTouch;

void () button_wait = {
self.state = STATE_TOP;
Expand Down Expand Up @@ -70,6 +71,8 @@ void () button_touch = {
if (other.classname != "player")
return;

Spy_CheckForFuncTouch(other, 0);

if (self.goal_activation & TFGA_SPANNER)
return;

Expand Down
109 changes: 84 additions & 25 deletions clan.qc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void () StartMatch =

TeamFortress_RemoveTimers();
self.frags = 0;
self.real_frags = 0;
self.real_frags = 0;
setspawnparms(self);
if (!quadmode)
PutClientInServer();
Expand All @@ -97,6 +97,18 @@ void () StartMatch =
gren.nextthink = (time + 0.1);
gren = find(gren, classname, "grenade");
}
te = find(world, classname, "detpack");
while (te){
if (te.weaponmode == 1) {
TeamFortress_SetSpeed (te.enemy);
dremove(te.oldenemy);
dremove(te.observer_list);
}
dremove(te.linked_list);
dremove(te);
te = find (te, classname, "detpack");
}

cb_prematch = 0;
cease_fire = 0;

Expand All @@ -121,7 +133,7 @@ void () StartMatch =
if (!quadmode) {
te.think = MatchThink;
te.nextthink = (time + 1);
}
}
}
st = infokey(world, "spectalk");
f2 = stof(st);
Expand Down Expand Up @@ -182,7 +194,7 @@ void () PreMatch_Think = {
}
if (!quadmode)
StartMatch();
else
else
StartQuadRound();
return;
}
Expand Down Expand Up @@ -250,6 +262,7 @@ void () PreMatch_Think = {
}
strunzone(num);
}

self.nextthink = (time + 1);
};

Expand All @@ -262,7 +275,7 @@ void () ResetBreakAndReady = {
v_break = 0;
v_ready = 0;
te = find (te, classname, "player");
}
}
}

void () StartTimer =
Expand Down Expand Up @@ -304,7 +317,7 @@ void () StartTimer =
te.nextthink = 0.01;
}

ResetBreakAndReady();
ResetBreakAndReady();
timer = spawn();
timer.owner = world;
timer.classname = "prematch";
Expand Down Expand Up @@ -425,13 +438,13 @@ void () DumpClanScores = {
if ((no_teams == 2) && (((team1score == team2score) && teamfrags)
|| ((team1frags == team2frags) && !teamfrags))) {
bprint(PRINT_HIGH, " draw ");
}
}
else if ((no_teams == 3) &&
((((team1score == team2score) == team3score) && teamfrags)
|| (((team1frags == team2frags) == team3frags) &&
!teamfrags))) {
bprint(PRINT_HIGH, " draw ");
}
}
else if ((no_teams == 3)
&&
(((((team1score == team2score) == team3score) == team4score)
Expand All @@ -440,7 +453,7 @@ void () DumpClanScores = {
((((team1frags == team2frags) == team3frags) == team4frags)
&& !teamfrags))) {
bprint(PRINT_HIGH, " draw ");
}
}
else {
st = GetTeamName(winners);
bprint(PRINT_HIGH, st, " defeated ");
Expand Down Expand Up @@ -736,6 +749,43 @@ void () TeamFortress_ShowIDs = {
sprint(self, PRINT_HIGH, "None\n");
};

void () CenterPrint_Players_NotReady = {
string players_not_ready;
entity te;
players_not_ready = "Not ready: ";

local float first = 0;
te = find (world, classname, "player");
while (te) {
if (te.is_ready == 0)
{
first = first + 1;
if (first == 1)
{
players_not_ready = strcat(players_not_ready, te.netname);
}
else if (first > 1 && first < 5)
{
players_not_ready = strcat(players_not_ready, ", ", te.netname);
}
else if (first >= 5)
{
players_not_ready = strcat(players_not_ready, " and others...");
break;
}
}
te = find (te, classname, "player");
}
players_not_ready = strcat(players_not_ready, "\n", "Type \s/ready\s in the console to toggle your ready status\n");

te = find(world, classname, "player");
while (te)
{
CenterPrint(te, players_not_ready);
te = find(te, classname, "player");
}
}

void () Broadcast_Players_NotReady = {
local entity te;
if (v_ready != 0) {
Expand All @@ -747,11 +797,11 @@ void () Broadcast_Players_NotReady = {
if (!first)
players_not_ready = strcat(players_not_ready, ", ");
else
first = 0;
first = 0;
players_not_ready = strcat(players_not_ready, te.netname);
}
te = find (te, classname, "player");
}
}
players_not_ready = strcat(players_not_ready, "\n");
bprint(1, players_not_ready);
te = find (world, classname, "player");
Expand Down Expand Up @@ -796,7 +846,7 @@ void () PlayerReady =
if (self.playerclass == 0) {
sprint(self, 2, "You must choose a class first.\n");
return;
}
}
if (intermission_running)
return;
if (self.classname != "player")
Expand All @@ -810,8 +860,12 @@ void () PlayerReady =
bprint2 (3, self.netname, " is ready to start the match\n");
f1 = TeamFortress_GetNoPlayers ();
if (v_ready == f1 ) {
bprint (2, "All players ready, starting match\n");
StartTimer ();
if(cease_fire) {
bprint (2, "All players ready, match will start after ceasefire ends.\n");
} else {
bprint (2, "All players ready, starting match\n");
StartTimer ();
}
return;
}
Broadcast_Players_NotReady();
Expand All @@ -831,17 +885,22 @@ void () RemoveVotes = {
};

void () PreMatch_Message = {
local entity p = find (world, classname, "player");
while (p != world) {
if (p.netname != "") {
sprint(p, PRINT_HIGH, "Currently in \sprematch\s time\n");
if (p.is_ready)
sprint(p, PRINT_HIGH, "You are \sready\s to start the match.\n Type \s/notready\s in the console if you are not ready\n");
else
sprint(p, PRINT_HIGH, "Type \s/ready\s in the console if you are ready to start the match\n");
stuffcmd(p, "play buttons/switch04.wav\n");
self.cnt2 = self.cnt2 + 1;
if (self.cnt2 % 30 == 0)
{
local entity p = find (world, classname, "player");
while (p != world) {
if (p.netname != "") {
sprint(p, PRINT_HIGH, "Currently in \sprematch\s time\n");
if (p.is_ready)
sprint(p, PRINT_HIGH, "You are \sready\s to start the match.\n Type \s/notready\s in the console if you are not ready\n");
else
sprint(p, PRINT_HIGH, "Type \s/ready\s in the console if you are ready to start the match\n");
stuffcmd(p, "play buttons/switch04.wav\n");
}
p = find(p, classname, "player");
}
p = find(p, classname, "player");
}
self.nextthink = time + 30;
}
CenterPrint_Players_NotReady();
self.nextthink = time + 1;
}
Loading

0 comments on commit d4f3d82

Please sign in to comment.