1 Index: src/game/server/entities/character.cpp
2 ===================================================================
3 --- src/game/server/entities/character.cpp (revision 1937)
4 +++ src/game/server/entities/character.cpp (working copy)
6 last_weapon = WEAPON_HAMMER;
9 + if(game.controller->is_instagib())
11 + active_weapon = WEAPON_RIFLE;
12 + last_weapon = WEAPON_RIFLE;
17 this->player = player;
20 dbg_msg("game", "kill killer='%d:%s' victim='%d:%s' weapon=%d special=%d",
21 killer, server_clientname(killer),
22 player->client_id, server_clientname(player->client_id), weapon, mode_special);
26 + game.create_sound(pos, SOUND_GRENADE_EXPLODE);
27 + game.create_explosion(pos, player->client_id, WEAPON_RIFLE, true);
30 + if(game.get_player_char(killer))
31 + game.get_player_char(killer)->spree_add();
34 // send the kill message
35 NETMSG_SV_KILLMSG msg;
37 player->respawn_tick = server_tick()+server_tickspeed()/2;
40 +char spree_note[4][32] = { "is on a killing spree", "is on a rampage", "is dominating", "is unstoppable" };
42 +void CHARACTER::spree_add()
47 + int p = (int)spree/5-1;
51 + str_format(buf, sizeof(buf), "%s %s with %d kills!", server_clientname(player->client_id), spree_note[p], spree);
52 + game.send_chat(-1, GAMECONTEXT::CHAT_ALL, buf);
56 +void CHARACTER::spree_end(int killer)
61 + str_format(buf, sizeof(buf), "%s %d-kills killing spree was ended by %s", server_clientname(player->client_id), spree, server_clientname(killer));
62 + game.send_chat(-1, GAMECONTEXT::CHAT_ALL, buf);
67 +bool CHARACTER::on_spree()
74 bool CHARACTER::take_damage(vec2 force, int dmg, int from, int weapon)
78 if(game.controller->is_friendly_fire(player->client_id, from) && !config.sv_teamdamage)
81 + if(game.controller->is_instagib() && weapon == WEAPON_GAME)
84 + if(game.controller->is_instagib())
86 + game.create_sound(pos, SOUND_HIT, cmask_one(from));
91 // player only inflicts half damage on self
92 if(from == player->client_id)
93 Index: src/game/server/entities/character.hpp
94 ===================================================================
95 --- src/game/server/entities/character.hpp (revision 1937)
96 +++ src/game/server/entities/character.hpp (working copy)
100 int player_state; // if the client is chatting, accessing a menu or so
104 // the player core for the physics
109 void die(int killer, int weapon);
112 + void spree_end(int killer);
115 bool take_damage(vec2 force, int dmg, int from, int weapon);
117 Index: src/game/server/entities/laser.cpp
118 ===================================================================
119 --- src/game/server/entities/laser.cpp (revision 1937)
120 +++ src/game/server/entities/laser.cpp (working copy)
122 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
123 #include <engine/e_server_interface.h>
124 +#include <engine/e_config.h>
125 #include <game/generated/g_protocol.hpp>
126 #include <game/server/gamecontext.hpp>
131 game.create_sound(pos, SOUND_RIFLE_BOUNCE);
133 + if(bounces == 1 && config.sv_laserjumps)
134 + game.create_explosion(pos, owner, WEAPON_GAME, false);
138 Index: src/game/server/gamecontroller.cpp
139 ===================================================================
140 --- src/game/server/gamecontroller.cpp (revision 1937)
141 +++ src/game/server/gamecontroller.cpp (working copy)
144 unbalanced_tick = -1;
145 force_balanced = false;
148 num_spawn_points[0] = 0;
149 num_spawn_points[1] = 0;
151 subtype = WEAPON_NINJA;
155 + if(type != -1 && !is_instagib())
157 PICKUP *pickup = new PICKUP(type, subtype);
159 @@ -329,10 +330,18 @@
162 // give default weapons
163 - chr->weapons[WEAPON_HAMMER].got = 1;
164 - chr->weapons[WEAPON_HAMMER].ammo = -1;
165 - chr->weapons[WEAPON_GUN].got = 1;
166 - chr->weapons[WEAPON_GUN].ammo = 10;
169 + chr->weapons[WEAPON_RIFLE].got = 1;
170 + chr->weapons[WEAPON_RIFLE].ammo = -1;
174 + chr->weapons[WEAPON_HAMMER].got = 1;
175 + chr->weapons[WEAPON_HAMMER].ammo = -1;
176 + chr->weapons[WEAPON_GUN].got = 1;
177 + chr->weapons[WEAPON_GUN].ammo = 10;
181 void GAMECONTROLLER::do_warmup(int seconds)
183 server_setbrowseinfo(gametype, prog);
186 +void GAMECONTROLLER::make_instagib(char *new_gametype)
189 + gametype = new_gametype;
192 +bool GAMECONTROLLER::is_instagib() const
197 bool GAMECONTROLLER::is_teamplay() const
199 return game_flags&GAMEFLAG_TEAMS;
200 Index: src/game/server/gamecontroller.hpp
201 ===================================================================
202 --- src/game/server/gamecontroller.hpp (revision 1937)
203 +++ src/game/server/gamecontroller.hpp (working copy)
211 const char *gametype;
213 + void make_instagib(char *gametype);
214 + bool is_instagib() const;
216 bool is_teamplay() const;
219 Index: src/game/server/hooks.cpp
220 ===================================================================
221 --- src/game/server/hooks.cpp (revision 1937)
222 +++ src/game/server/hooks.cpp (working copy)
224 //players = new PLAYER[MAX_CLIENTS];
227 - if(strcmp(config.sv_gametype, "mod") == 0)
228 + if(strcmp(config.sv_gametype, "ictf") == 0)
230 + game.controller = new GAMECONTROLLER_CTF;
231 + game.controller->make_instagib("iCTF");
233 + else if(strcmp(config.sv_gametype, "itdm") == 0)
235 + game.controller = new GAMECONTROLLER_TDM;
236 + game.controller->make_instagib("iTDM");
238 + else if(strcmp(config.sv_gametype, "idm") == 0)
240 + game.controller = new GAMECONTROLLER_DM;
241 + game.controller->make_instagib("iDM");
243 + else if(strcmp(config.sv_gametype, "mod") == 0)
244 game.controller = new GAMECONTROLLER_MOD;
245 else if(strcmp(config.sv_gametype, "ctf") == 0)
246 game.controller = new GAMECONTROLLER_CTF;
247 Index: src/game/variables.hpp
248 ===================================================================
249 --- src/game/variables.hpp (revision 1937)
250 +++ src/game/variables.hpp (working copy)
253 MACRO_CONFIG_INT(dbg_focus, 0, 0, 1, CFGFLAG_CLIENT, "")
254 MACRO_CONFIG_INT(dbg_tuning, 0, 0, 1, CFGFLAG_CLIENT, "")
257 +MACRO_CONFIG_INT(sv_laserjumps, 1, 0, 1, CFGFLAG_SERVER, "Enable laser jumps")