here it is (the random mutation works fine, but the killing mutation does not work at all):
Code:
symbols
thing mutant local
thing victim local
thing killer local
thing kill local
sound catch=21forceabsorb1.wav local
sound release=forceabsorb02.wav local
model oldmodel local
model mutantskin=kyA17.3do local
int random local
int numplayers local
int score local
message loading
message pulse
message trigger
message killed
end
# ========================================================================================
code
loading:
if(!IsServer()) Return;
mutant = -1;
SetPulse(10);
Return;
pulse:
numplayers = GetNumPlayers();
if(numplayers < 2)
{
jkStringClear();
jkStringConcatAsciiString("You are alone");
jkStringOutput(-3, -1);
Return;
}
jkStringClear();
jkStringConcatAsciiString("Timed Mutation");
jkStringOutput(-3, -1);
random = Rand() * (numplayers - 1);
victim = GetPlayerThing(random);
if(victim == mutant) victim = GetPlayerThing(random + 1);
SendTrigger(-1, 112, mutant, victim, -1, -1);
Return;
trigger:
if(GetSourceRef() == 112)
{
SetPulse(0);
mutant = GetParam(0);
victim = GetParam(1);
SetThingModel(mutant, oldmodel);
PlaySoundThing(release, mutant, 1.0, -1, -1, 0x80);
oldmodel = GetThingModel(victim);
SetThingModel(victim, mutantskin);
PlaySoundThing(catch, victim, 1.0, -1, -1, 0x80);
mutant = victim;
SetPulse(60);
}
Return;
killed:
victim = GetSenderRef();
kill = GetSourceRef();
killer = GetThingParent(kill);
if(victim == killer) Return;
if(killer == mutant)
{
jkStringClear();
jkStringConcatAsciiString("Mutation due to kill");
jkStringOutput(-3, -1);
SendTrigger(-1, 112, mutant, victim, -1, -1);
}
else if(victim == mutant)
{
jkStringClear();
jkStringConcatAsciiString("Mutant got killed");
jkStringOutput(-3, -1);
score = GetPlayerScore(killer);
score = score + 5;
SetPlayerScore(killer, score);
}
Return;
end"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
![http://forums.massassi.net/html/wink.gif [http://forums.massassi.net/html/wink.gif]](http://forums.massassi.net/html/wink.gif)
![http://forums.massassi.net/html/smile.gif [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)