![]() |
|
|
#1 |
|
Registered User
Join Date: Nov. 26th, 2004
Posts: 3
|
I decided I would make a new gametype called OddMan. I have it all worked out and seems to work perfectly. It is a deathmatch game that has a player become the OddMan. To become him, you must kill first and you will be rewared with zero points. Everytime the OddMan kills, he gets a point. If somebody kills you, they get five points. The whole time, the OddMan has regenerating health(by one), UDamage, and the Offensive Effect and Regen Crosses around him. The code is:
Code:
class OddMan extends Deathmatch;
var Pawn OddMan;
var xEmitter Effect;
function unsetOddMan()
{
setTimer(0, false);
OddMan = None;
}
function setOddMan(Pawn O)
{
setTimer(0.5, true);
OddMan = O;
Spawn(class'OffensiveEffect', OddMan,, OddMan.Location,
OddMan.Rotation);
Spawn(class'RegenCrosses', OddMan,, OddMan.Location,
OddMan.Rotation);
}
function Timer()
{
if(OddMan != None)
{
OddMan.EnableUDamage(1.0);
if(OddMan.Role == ROLE_Authority)
{
OddMan.GiveHealth(1, 1000);
if(OddMan.Health == 1000)
OddMan.AddShieldStrength(1);
}
}
}
function Killed(Controller Killer, Controller Killed, Pawn
KilledPawn, class<DamageType> damageType)
{
if(OddMan == None)
{
setOddMan(Killer.Pawn);
}
else if(Killed.Pawn == OddMan)
{
if(Killer == Killed)
{
unsetOddMan();
Super.Killed(Killer, Killed, KilledPawn,
damageType);
}
else
{
setOddMan(Killer.Pawn);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
}
}
else if(Killer.Pawn == OddMan)
{
if(Killer == Killed)
{
unsetOddMan();
Super.Killed(Killer, Killed, KilledPawn,
damageType);
}
else
{
Super.Killed(Killer, Killed, KilledPawn, damageType);
}
}
}
defaultproperties
{
GameName = "OddMan"
}
EDIT: Okay I changed the code a bit and put the spawn functions right under the health regeneration code...However something terrible has happened, it doesn't stop spawning!!! Is there anyway to stop it from running more than once? PERFECTED CODE: Code:
class OddMan extends Deathmatch;
var Pawn OddMan;
var xEmitter Effect;
function unsetOddMan()
{
setTimer(0, false);
OddMan = None;
}
function setOddMan(Pawn O)
{
setTimer(0.5, true);
OddMan = O;
}
function Timer()
{
if(OddMan != None)
{
OddMan.EnableUDamage(1.0);
if(OddMan.Role == ROLE_Authority)
{
OddMan.GiveHealth(1, 500);
if(OddMan.Health == 500)
OddMan.AddShieldStrength(1);
}
if(Effect == None)
{
Effect = Spawn(class'OffensiveEffect',
OddMan,, OddMan.Location, OddMan.Rotation);
Effect = Spawn(class'RegenCrosses', OddMan,,
OddMan.Location, OddMan.Rotation);
}
}
}
function Killed(Controller Killer, Controller Killed, Pawn
KilledPawn, class<DamageType> damageType)
{
if(OddMan == None)
{
setOddMan(Killer.Pawn);
}
else if(Killed.Pawn == OddMan)
{
if(Killer == Killed)
{
unsetOddMan();
Super.Killed(Killer, Killed, KilledPawn,
damageType);
}
else
{
setOddMan(Killer.Pawn);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
Super.Killed(Killer, Killed, KilledPawn,
damageType);
}
}
else if(Killer.Pawn == OddMan)
{
if(Killer == Killed)
{
unsetOddMan();
Super.Killed(Killer, Killed, KilledPawn,
damageType);
}
else
{
Super.Killed(Killer, Killed, KilledPawn, damageType);
}
}
}
defaultproperties
{
GameName = "OddMan"
}
I knew it had to be something stupid Go ahead and compile the code if you want to try it out* Have fun and thanks again!*NOTE: This game was the first game ever made by me so if it sucks, you should know why. Feel free to change it at your will
Last edited by MooLue4000; 2nd Dec 2004 at 04:49 PM. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|