
		The SARACEN's Modules v1.5b

What this source code does is set up six brand new items called Modules. The Modules
do not spawn from normal entity locations in the map file - instead they are spawned
automatically by the server from random Deathmatch Start locations. Each Module is
only spawned once per arena, and only one can be carried at a time - if you are
carrying one Module and wish to pick up a different one, you must first drop the one
you are carrying. Unlike normal Powerups, Modules last for as long as a player chooses
to carry them. If a player is killed, he drops the Module he was carrying. Every 60
seconds, any Modules that are lying around the map will be moved to a new location.

The six different Modules are listed below, with their respective behaviours:

Amplifier Module = Essentially half a Quad Damage. Whenever you shoot someone, the
                   damage you cause them is more than normal, but less than what it
                   would be if you had a Quad Damage.
Dampener Module  = Essentially half a Battle Suit. Whenever you are damaged, the
                   amount of damage you recieve is less than normal, but more than it
                   would be if you had a Battle Suit. Unlike the Battle Suit, the
                   Dampener does NOT make you invulnerable to "splash" damage.
Healer Module    = Essentially half a Regeneration. As long as you carry the Healer,
                   your health will constantly regenerate up to 100%, at a rate of
                   5 points per second.
Booster Module   = Essentially half a Speed. You move faster than you would normally,
                   but not as fast as if you had a Speed. Unlike the Speed, the Booster
                   has no effect upon your rate of fire.
Lifter Module    = Halves the effect that gravity has upon your body, allowing you to
                   jump higher, and fall further without getting hurt. Try Rocket
                   Jumping off a Jump Pad when you're carrying this!!
Cloaker Module   = Essentially a conditional Invisibility. When you're stationary, you
                   will appear exactly the same as if you had an Invisibility. If you
                   jump or run about, however, you will become visible until you stand
                   still, again.

There are also some new console variables, as follows:

g_quadfactor (default = 3) When carrying a Quad Damage, all pain inflicted will be
                   multiplied by this number. When carrying an Amplifier, all pain
                   inflicted will be multiplied by half this number.
                   (this one was actually part of the original game)
g_quadskitz (default = 1) If set to 1, the effects of a Quad Damage will combine
                   with those of an Amplifier if the player is carrying both, ie
                   all pain inflicted will be multiplied by (3/2) times the value
                   of g_quadfactor. If set to 0, the Quad Damage will override the
                   Amplifier, not combine with it.
g_suitfactor (default = 50) When carrying a Battle Suit, all pain recieved will be
                   reduced by this percentage. When carrying a Dampener, all pain
                   recieved will be reduced by half this percentage.
g_suitskitz (default = 1) If set to 1, the effects of a Battle Suit will combine
                   with those of a Dampener if the player is carrying both, ie all
                   pain recieved will be reduced by (3/2) the percentage value of
                   g_suitfactor. If set to 0, the Battle Suit will override the
                   Dampener, not combine with it.
g_speedfactormove (default = 30) When carrying a Speed, the player will move this
                   percentage faster than normal. When carrying a Booster, the
                   player will move half this percentage faster.
g_speedfactorweapon (default = 30) When carrying a Speed, the player will fire this
                   percentage faster than normal.
                   (maximum rate-of-fire for ANY weapon is 20 shots per second)
                   (Booster Module does not affect rate-of-fire)
g_speedskitz (default = 1) If set to 1, the effects of a Speed will combine with
                   those of a Booster if the player is carrying both, ie the player
                   will move (3/2) times the percentage value of g_speedfactormove
                   faster than normal. If set to 0, the Speed will override the
                   Booster, not combine with it.
                   (does not affect the player's rate-of-fire).
mpflags (default = 0) This one operates on the same principle as my other Item Flags
                   console variables (available separately <TM>). Simply add the
                   corresponding Flag Values together to ban those Modules from
                   spawning:
                                      Amplifier =  1
                                      Dampener  =  2
                                      Healer    =  4
                                      Booster   =  8
                                      Lifter    = 16
                                      Cloaker   = 32
                   eg to ban the Cloaker and Healer, 4 + 32 = 36, so we set the
                   mpflags variable to 36.
g_maxModules (default = 1) The server will spawn this number of each (non-banned)
                   Module in the level.
                   (latched - changes won't take effect until map restart).
cg_drawteamicon (default = 1) If a player sets this to 1, he will see that triangle
                   icon printed above his teammates' heads. If he sets it to 0, the
                   icon won't be drawn.

It would be a good idea to bind a key to "+button5", which will enable you to drop
the currently-held Module. I use the F key, so I go (at the console)
	\bind f "+button5"

BUGS:
- As yet, there are no custom models for the Modules, so they will each appear as
	spining rings - the Amplifier is red the Dampener gold, the Healer purple, the
	Booster yellow, the Lifter light blue, and the Cloaker a clear glassy color.
- The Dampener doesn't play a sound when you shoot at your own feet with a rocket.
- For some reason, if you stand with your back in a corner and drop your Module, you
	don't actually drop the Module, even though you no longer have one. This used
	to result in the "disappearance" of that Module for the rest of the game; I
	haven't fixed the not-being-dropped problem, but I did stop Modules gradually
	disappearing, never to be seen again (I think).
- I have no idea how the Amplifier sounds will play when using the Gauntlet...

====================================================================================

The following files contain the code.

cgame/cg_draw.c
cgame/cg_event.c
cgame/cg_local.h
cgame/cg_players.c
cgame/cg_predict.c
cgame/cg_weapons.c

game/bg_misc.c
game/bg_pmove.c
game/bg_public.c
game/g_active.c
game/g_combat.c
game/g_items.c
game/g_local.c
game/g_main.c
game/g_spawn.c
game/g_trigger.c
game/g_weapon.c

ui/ui_controls2.c
ui/ui_itemflags.c

That enough for ya?
Search for entries marked with:		// The SARACEN

====================================================================================

		Added in version 1.0:
The Modules. Code, sounds, shaders, the lot.

		Added in version 1.2:
Phixed the bug that wouldn't let you select the "drop module" button from
	the menus (it's under Setup->Controls->Misc).
Made all g_****factor and g_****skitz variables ServerInfo variables, to make
	things a little cleaner (g_quadfactor is now ServerInfo, as well).
Added the ability to control the effect of the Speed powerup on a player's
	rate-of-fire.

		Added in version 1.5:
Moved "do I spawn a Module?" check from the regulator's personal count to the
	level locals struct.
Added g_maxModules to control number of sets of Modules spawned in level

		Added in version 1.5b
Stopped clients registering Modules if g_maxModules was set to 0, since that
	one can't be changed mid-game.

		Added in version 1.6
Added bug-evasion code to stop modules vanishing forever if dropped when
	player is in a corner.

		Added in version 1.8
Basic Bot support (they won't drop Modules, though).

		Coming in future versions:
Phix da bugz!!

Like it? Email thesaracen@ozemail.com.au or ICQ 59037191
The sound file "mod_pickup.wav" is a modified version of the file "quadfire1.wav",
which was taken from the game Quake II Mission Pack: The Reckoning by Xatrix,
published by Activision. They own it. I don't really have permission to use it, and
I will quite happily find a different sound to use if either Xatrix or Activision ask
me to do so. Any other persons using this sound file as a result of using my code or
my mod should NOT be held liable in ANY way.

====================================================================================

This is open source. Anyone who wishes to incorporate these Modules into their
own mods may do so, just please give me credit. Enjoy!
