Finally add player models (sorta rudimentary but they work).

Updated blood and gore code, it's less WIP now.
Updated readme with some additional notes.
Removed Heretic compat player classes as they are no longer needed.
This commit is contained in:
Marisa the Magician 2019-07-22 02:58:48 +02:00
commit 96411592b3
57 changed files with 2341 additions and 227 deletions

View file

@ -80,7 +80,7 @@ Class UTBloodDrop : Actor
}
void A_BloodDie()
{
// TODO
// TODO leave decals
}
States
{
@ -112,9 +112,12 @@ Class UTBloodSpurt : Actor
str = FRandom[Blood](2.0,3.2)*args[0];
int sz = 7*args[0];
double ang, pt;
if ( !flak_blood ) sz /= 3;
for ( int i=0; i<sz; i++ )
{
let d = Spawn("UTBloodDrop",pos);
Actor d;
if ( flak_blood ) d = Spawn("UTBloodDrop",pos);
else d = Spawn("Blood",pos,ALLOW_REPLACE);
d.translation = translation;
d.SetShade(fillcolor);
ang = angle+FRandom[Blood](-3,3)*str;
@ -160,9 +163,12 @@ Class UTBloodTrail : Actor
if ( !target ) return;
SetOrigin(target.pos,true);
double ang, pt;
for ( int i=0; i<3; i++ )
int max = flak_blood?3:Random[Blood](-2,1);
for ( int i=0; i<max; i++ )
{
let d = Spawn("UTBloodDrop",pos);
Actor d;
if ( flak_blood ) d = Spawn("UTBloodDrop",pos);
else d = Spawn("Blood",pos,ALLOW_REPLACE);
d.translation = translation;
d.SetShade(fillcolor);
ang = FRandom[Blood](0,360);
@ -232,7 +238,7 @@ Class UTGibber : Actor
bool dummy;
for ( int i=0; i<gibsize; i++ )
{
let a = Spawn(gibcls[Random[Blod](0,3)],pos+(FRandom[Blod](-0.5,0.5)*radius,FRandom[Blod](-0.5,0.5)*radius,FRandom[Blod](0.2,0.8)*height));
let a = Spawn(gibcls[Random[Blod](0,3)],Vec3Offset(FRandom[Blod](-0.5,0.5)*radius,FRandom[Blod](-0.5,0.5)*radius,FRandom[Blod](0.2,0.8)*height));
a.translation = translation;
a.SetShade(fillcolor);
a.scale *= FRandom[Blod](1.7,2.3)*scale.x;
@ -243,7 +249,7 @@ Class UTGibber : Actor
}
for ( int i=0; i<gibsize; i++ )
{
let a = Spawn("UTBloodPuff",pos+(FRandom[Blod](-0.8,0.8)*radius,FRandom[Blod](-0.8,0.8)*radius,FRandom[Blod](0.1,0.9)*height));
let a = Spawn("UTBloodPuff",Vec3Offset(FRandom[Blod](-12,12),FRandom[Blod](-12,12),FRandom[Blod](0.1,0.9)*height));
a.translation = translation;
a.SetShade(fillcolor);
a.scale *= FRandom[Blod](1.8,2.3)*scale.x;
@ -282,6 +288,152 @@ Class UTGibber : Actor
}
}
Class UTFemaleLegGibber : UTGibber
{
bool firstgib;
override void BurstGibs()
{
static const class<Actor> parts[] = {"UTFemaleFoot","UTThigh"};
static const double partofsy[] = {9,8};
static const double partofsz[] = {9,20};
Actor a;
double ang, pt;
Vector3 dir;
if ( !firstgib )
{
firstgib = true;
for ( int i=0; i<2; i++ )
{
Actor a = Spawn(parts[i],Vec3Offset(-partofsy[i]*sin(angle),partofsy[i]*cos(angle),partofsz[i]));
ang = FRandom[Blod](0,360);
pt = FRandom[Blod](-90,90);
dir = (cos(pt)*cos(ang),cos(pt)*sin(ang),sin(-pt));
a.vel = rvel*0.6+dir*FRandom[Blod](8.0,12.0);
}
}
for ( int i=0; i<gibsize; i++ )
{
Vector3 box = (FRandom[Blod](-8,8),FRandom[Blod](7,12),FRandom[Blod](5,18));
let a = Spawn("UTBloodPuff",Vec3Offset(box.x*cos(angle)-box.y*sin(angle),box.x*sin(angle)+box.y*cos(angle),box.z));
ang = FRandom[Blod](0,360);
pt = FRandom[Blod](-90,90);
dir = (cos(pt)*cos(ang),cos(pt)*sin(ang),sin(-pt));
a.vel = rvel*0.2+dir*FRandom[Blod](1.5,3.0);
}
A_CountDown();
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
gibsize = 3;
reactiontime = 5;
}
States
{
Spawn:
TNT1 A 0 NoDelay; // no sound, done by player
TNT1 A 1 BurstGibs();
Wait;
}
}
Class UTPlayerGibber : UTGibber
{
bool firstgib;
override void BurstGibs()
{
static const class<Actor> bossparts[] = {"UTBossArm","UTBossArm","UTBossFoot","UTBossFoot","UTMaleTorso","UTHeadBoss"};
static const class<Actor> maleparts[] = {"UTMaleArm","UTMaleArm","UTMaleFoot","UTMaleFoot","UTMaleTorso","UTHeadMale"};
static const class<Actor> femaleparts[] = {"UTFemaleArm","UTFemaleArm","UTFemaleFoot","UTFemaleFoot","UTFemaleTorso","UTHeadFemale"};
static const class<Actor> extraparts[] = {"UTThigh","UTThigh","UTHeart","UTLiver","UTStomach"};
static const double partofsy[] =
{
14,
-14,
9,
-9,
0,
0,
8,
-8,
-2,
5,
-3
};
static const double partofsz[] =
{
36,
36,
9,
9,
32,
48,
20,
20,
40,
32,
35
};
Actor a;
double ang, pt;
Vector3 dir;
if ( !firstgib )
{
firstgib = true;
for ( int i=0; i<11; i++ )
{
Actor a;
if ( i < 6 )
{
if ( UTPlayer(Gibbed).DollType == UTPlayer.DOLL_Boss )
a = Spawn(bossparts[i],Vec3Offset(-partofsy[i]*sin(angle),partofsy[i]*cos(angle),partofsz[i]));
else if ( UTPlayer(Gibbed).DollType == UTPlayer.DOLL_Female )
a = Spawn(femaleparts[i],Vec3Offset(-partofsy[i]*sin(angle),partofsy[i]*cos(angle),partofsz[i]));
else a = Spawn(maleparts[i],Vec3Offset(-partofsy[i]*sin(angle),partofsy[i]*cos(angle),partofsz[i]));
}
else a = Spawn(extraparts[i-6],Vec3Offset(-partofsy[i]*sin(angle),partofsy[i]*cos(angle),partofsz[i]));
ang = FRandom[Blod](0,360);
pt = FRandom[Blod](-90,90);
if ( a is 'UTHead' )
{
pt = FRandom[Blod](-90,-15);
if ( UTPlayer(Gibbed).player )
{
UTPlayer(Gibbed).player.Camera = a;
UTHead(a).headowner = UTPlayer(Gibbed).player;
}
}
dir = (cos(pt)*cos(ang),cos(pt)*sin(ang),sin(-pt));
a.vel = rvel*0.6+dir*FRandom[Blod](8.0,12.0);
}
}
for ( int i=0; i<gibsize; i++ )
{
let a = Spawn("UTBloodPuff",Vec3Offset(FRandom[Blod](-0.8,0.8)*radius,FRandom[Blod](-0.8,0.8)*radius,FRandom[Blod](0.1,0.9)*height));
ang = FRandom[Blod](0,360);
pt = FRandom[Blod](-90,90);
dir = (cos(pt)*cos(ang),cos(pt)*sin(ang),sin(-pt));
a.vel = rvel*0.2+dir*FRandom[Blod](1.5,3.0);
}
A_CountDown();
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
gibsize = 3;
reactiontime = 5;
}
States
{
Spawn:
TNT1 A 0 NoDelay; // no sound, done by player
TNT1 A 1 BurstGibs();
Wait;
}
}
// Chunks
Class UTGib : Actor
{
@ -312,9 +464,9 @@ Class UTGib : Actor
if ( bloodcolor ) tracer.SetShade(bloodcolor);
else tracer.SetShade(gameinfo.defaultbloodcolor);
tracer.translation = bloodtranslation;
rollvel = FRandom[Blod](5,15)*RandomPick[Blod](-1,1);
anglevel = FRandom[Blod](5,15)*RandomPick[Blod](-1,1);
pitchvel = FRandom[Blod](5,15)*RandomPick[Blod](-1,1);
rollvel = FRandom[Blod](3,6)*RandomPick[Blod](-1,1);
anglevel = FRandom[Blod](3,6)*RandomPick[Blod](-1,1);
pitchvel = FRandom[Blod](3,6)*RandomPick[Blod](-1,1);
}
void A_HandleBounce()
{
@ -333,9 +485,12 @@ Class UTGib : Actor
else if ( spd > 20 ) vel *= 0.8;
A_PlaySound("misc/gibp");
double ang, pt;
for ( int i=0; i<6; i++ )
int max = flak_blood?6:2;
for ( int i=0; i<max; i++ )
{
let d = Spawn("UTBloodDrop",pos);
Actor d;
if ( flak_blood ) d = Spawn("UTBloodDrop",pos);
else d = Spawn("Blood",pos,ALLOW_REPLACE);
d.translation = bloodtranslation;
if ( bloodcolor ) d.SetShade(bloodcolor);
else d.SetShade(gameinfo.defaultbloodcolor);
@ -346,9 +501,9 @@ Class UTGib : Actor
d.vel = dir*FRandom[Blood](0.8,1.2);
d.scale *= 0.75*FRandom[Blood](0.6,1.4);
}
rollvel = FRandom[Blod](5,15)*RandomPick[Blod](-1,1);
anglevel = FRandom[Blod](5,15)*RandomPick[Blod](-1,1);
pitchvel = FRandom[Blod](5,15)*RandomPick[Blod](-1,1);
rollvel = FRandom[Blod](3,6)*RandomPick[Blod](-1,1);
anglevel = FRandom[Blod](3,6)*RandomPick[Blod](-1,1);
pitchvel = FRandom[Blod](3,6)*RandomPick[Blod](-1,1);
}
States
{
@ -380,25 +535,71 @@ Class UTFemaleTorso : UTGib {}
Class UTMaleArm : UTGib {}
Class UTMaleFoot : UTGib {}
Class UTMaleTorso : UTGib {}
Class UTBossArm : UTGib {}
Class UTBossFoot : UTGib {}
Class UTBossTorso : UTGib {}
Class UTHeart : UTGib
{
States
{
Spawn:
UGIB ABCDEF 2;
UGIB ABCDEF 1
{
roll += rollvel;
angle += anglevel;
pitch += pitchvel;
}
Loop;
Bounce:
UGIB A 0;
Goto Spawn;
Death:
UGIB ABCDEFABCDEFABCDEF 2;
UGIB ABCDEFABCDEF 4;
UGIB ABCDEF 8;
UGIB A -1;
Stop;
UGIB A 1 A_SetTics(Random[Blod](12,18)*15);
UGIB A 1 A_FadeOut(0.05);
Wait;
}
}
Class UTLiver : UTGib {}
Class UTStomach : UTGib {}
Class UTHeadFemale : UTGib {}
Class UTHeadMale : UTGib {}
Class UTHead : UTGib
{
PlayerInfo headowner;
override void PostBeginPlay()
{
Super.PostBeginPlay();
UTMainHandler.DoFlash(self,Color(128,255,0,0),150);
UTMainHandler.DoFlash(self,Color(96,255,0,0),0);
}
override void Tick()
{
Super.Tick();
if ( headowner && headowner.mo && (headowner.mo.Health > 0) && (headowner.Camera == self) )
{
headowner.Camera = headowner.mo;
headowner = null;
}
}
override void OnDestroy()
{
if ( headowner && (headowner.Camera == self) && headowner.mo )
{
headowner.Camera = headowner.mo;
headowner = null;
}
Super.OnDestroy();
}
States
{
Death:
UGIB A 1 A_SetTics(Random[Blod](12,18)*15);
UGIB A 0 A_JumpIf(headowner,"Death");
UGIB A 1 A_FadeOut(0.05);
Wait;
}
}
Class UTHeadFemale : UTHead {}
Class UTHeadMale : UTHead {}
Class UTHeadBoss : UTHead {}