From bcac79a048922a35eee002375929590464ca0f89 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Fri, 20 Sep 2019 19:52:15 -0400 Subject: [PATCH] add impulse command for spectating --- default_sc.cfg | 2 ++ source/client.qc | 29 +++++++++++++++++++++++++++++ todo | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/default_sc.cfg b/default_sc.cfg index 73c5f23..92165f9 100644 --- a/default_sc.cfg +++ b/default_sc.cfg @@ -8,6 +8,8 @@ alias pronoun_xey "impulse 26" alias pronoun_ze_hir "impulse 27" alias pronoun_ze_zir "impulse 28" +alias spectate "impulse 13" + set sc_cheats 0 set sc_lives 0 set sc_dist_ammo 0 diff --git a/source/client.qc b/source/client.qc index 01046d2..b954178 100644 --- a/source/client.qc +++ b/source/client.qc @@ -1148,6 +1148,34 @@ void(float pro) change_pronoun = { pronoun_possessive(pro), "\n"); }; +void() spectate = { + switch(self.spectating) { + case SPECTATING_NOT: + bprint(self.netname, " has become a spectator\n"); + become_spectator(); + break; + case SPECTATING_SPECTATING: + bprint(self.netname, " has returned from spectating\n"); + setspawnparms(self); + PutClientInServer(); + break; + case SPECTATING_DEAD: + centerprint(self, + "You have no life force left\n" + "and cannot return to\n" + "the mortal world yet"); + break; + case SPECTATING_INTERMISSION: + case SPECTATING_FINALE: + centerprint(self, + "You are incorporeal as you wait\n" + "for the next cycle\n" + "and cannot return to\n" + "the mortal world yet"); + break; + } +}; + void() ImpulseCommands = { if(self.impulse >= 1 && self.impulse <= 8) { W_ChangeWeapon(self.impulse); @@ -1159,6 +1187,7 @@ void() ImpulseCommands = { case 10: W_CycleWeapon(); break; case 11: cheat_quad(); break; case 12: W_CycleWeaponReverse(); break; + case 13: spectate(); break; } } diff --git a/todo b/todo index c7aa565..e968fcf 100644 --- a/todo +++ b/todo @@ -14,7 +14,6 @@ all done useful features: configurable enemy stats -impulse command for spectating indicators for where other players are users can cancel map ends (" initiated travel to ") @@ -34,6 +33,7 @@ corpse pickups have keys custom pronouns distributed ammo enforcers are broken +impulse command for spectating lives counting no friendly fire restart map after 10 seconds when everyone is dead