A couple more things, including an ambient glow shader effect, some more item replacements, and menu options.

Damage Amplifier has been implemented. Armor items are being worked on. Powerups will come later, then I'll continue doing more weapons.
This commit is contained in:
Marisa the Magician 2018-05-20 02:10:30 +02:00
commit 5248ac8fd6
108 changed files with 920 additions and 175 deletions

View file

@ -160,6 +160,13 @@ Class BioGel : Actor
A_SetRoll(roll+rollvel,SPF_INTERPOLATE);
A_SetPitch(pitch+pitchvel,SPF_INTERPOLATE);
A_SetPitch(pitch+yawvel,SPF_INTERPOLATE);
if ( waterlevel > 0 )
{
vel.xy *= 0.98;
rollvel *= 0.98;
pitchvel *= 0.98;
yawvel *= 0.98;
}
}
if ( !InStateSequence(CurState,FindState("XDeath")) && ((!bNOGRAVITY && !Random[GES](0,2)) || !Random[GES](0,10)) )
{
@ -211,7 +218,8 @@ Class BioGel : Actor
roll = 0;
LineTrace(angle+180,172,0,TRF_THRUACTORS,data:d);
SetOrigin(d.HitLocation+normal*0.5,false);
hittype = HIT_WALL;
if ( waterlevel > 0 ) hittype = HIT_FLOOR;
else hittype = HIT_WALL;
}
else if ( pos.z <= floorz+4 )
{
@ -229,7 +237,8 @@ Class BioGel : Actor
angle = atan2(normal.y,normal.x);
roll = FRandom[GES](0,360);
SetOrigin((pos.x,pos.y,ceilingz)+normal*0.5,false);
if ( normal dot (0,0,-1) > 0.7 )
if ( waterlevel > 0 ) hittype = HIT_FLOOR;
else if ( normal dot (0,0,-1) > 0.7 )
hittype = HIT_CEILING;
else hittype = HIT_FLOOR;
}
@ -385,6 +394,7 @@ Class BioRifle : UTWeapon
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
}
A_PlaySound("ges/fire",CHAN_WEAPON);
invoker.FireEffect();
A_AlertMonsters();
if ( alt ) A_QuakeEx(1+0.5*invoker.charge,1+0.5*invoker.charge,1+0.5*invoker.charge,5+1.2*invoker.charge,0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05+0.01*invoker.charge);
else A_QuakeEx(1,1,1,5,0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05);

View file

@ -178,6 +178,14 @@ Class FlakChunk : Actor
{
Super.Tick();
if ( globalfreeze || level.frozen ) return;
if ( waterlevel > 0 )
{
vel.xy *= 0.98;
rollvel *= 0.98;
pitchvel *= 0.98;
yawvel *= 0.98;
if ( trail ) trail.Destroy();
}
lifetics++;
if ( lifetics > 3 )
{
@ -352,6 +360,15 @@ Class FlakSlug : Actor
trail.speed = 1;
vel.z += 5;
}
override void Tick()
{
Super.Tick();
if ( waterlevel > 0 )
{
vel.xy *= 0.98;
if ( trail ) trail.Destroy();
}
}
action void A_FlakExplode()
{
bForceXYBillboard = true;
@ -392,6 +409,7 @@ Class FlakSlug : Actor
Spawn:
FSLG A 1
{
if ( waterlevel > 0 ) return;
for ( int i=0; i<6; i++ )
A_SpawnParticle("AAAAAA",0,50,12.0,velx:FRandom[Flak](-0.5,0.5),vely:FRandom[Flak](-0.5,0.5),velz:FRandom[Flak](-0.5,0.5),accelz:0.02,startalphaf:0.5,sizestep:1.0);
}
@ -446,6 +464,7 @@ Class FlakCannon : UTWeapon
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("flak/fire",CHAN_WEAPON);
invoker.FireEffect();
A_AlertMonsters();
A_QuakeEx(1,1,1,3,0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05);
Vector3 x, y, z;
@ -482,6 +501,7 @@ Class FlakCannon : UTWeapon
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("flak/altfire",CHAN_WEAPON);
invoker.FireEffect();
A_AlertMonsters();
A_QuakeEx(2,2,2,6,0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
Vector3 x, y, z;

View file

@ -0,0 +1,94 @@
Class UDamage : PowerupGiver replaces InvulnerabilitySphere
{
Default
{
Tag "Damage Amplifier";
Inventory.PickupMessage "You got the Damage Amplifier!";
+COUNTITEM;
+INVENTORY.AUTOACTIVATE;
+INVENTORY.ALWAYSPICKUP;
+INVENTORY.BIGPOWERUP;
Inventory.MaxAmount 0;
Powerup.Type "DamageAmplifier";
Inventory.PickupSound "udamage/pickup";
}
action void A_CheckSkin()
{
bool isbeta = CVar.GetCVar('flak_betaudamage').GetBool();
if ( isbeta && (CurState == ResolveState("Spawn")) ) SetState(ResolveState("Spawn")+1);
else if ( !isbeta && (CurState == ResolveState("Spawn")+1) ) SetState(ResolveState("Spawn"));
}
States
{
Spawn:
UDAM A 5 A_CheckSkin();
Loop;
UDAM B 5 A_CheckSkin();
Loop;
}
}
Class DamageAmpLight : DynamicLight
{
Default
{
DynamicLight.Type "Point";
Args 238,0,255,80;
}
override void Tick()
{
Super.Tick();
if ( !target || !master )
{
Destroy();
return;
}
SetOrigin(target.pos+(0,0,target.height*0.5),true);
args[LIGHT_INTENSITY] = Random[ASMD](10,12)*8;
bDORMANT = Powerup(master).isBlinking();
}
}
Class DamageAmplifier : Powerup
{
Actor l;
Default
{
Powerup.Duration -30;
Powerup.Color "EE00FF", 0.25;
}
override void InitEffect()
{
Super.InitEffect();
l = Spawn("DamageAmpLight",Owner.pos);
l.target = Owner;
l.master = self;
}
override void DoEffect()
{
Super.DoEffect();
if ( (EffectTics == 175) || (EffectTics == 140) || (EffectTics == 105) || (EffectTics == 70) || (EffectTics == 35) )
Owner.A_PlaySound("udamage/drain",CHAN_6,1.0,false,0.25);
}
override bool isBlinking()
{
return ((EffectTics <= 175) && (EffectTics%35 >= 30));
}
void FireEffect()
{
if ( EffectTics < 350 ) Owner.A_PlaySound("udamage/fire2",CHAN_5,1.0,false,0.25);
else Owner.A_PlaySound("udamage/fire1",CHAN_5,1.0,false,0.25);
}
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive )
{
if ( passive || (damage <= 0) ) return;
newdamage = max(1,ApplyDamageFactors(GetClass(),damageType,damage,damage*3));
if ( !(Owner.player.ReadyWeapon is 'UTWeapon') ) FireEffect();
}
}

View file

@ -42,7 +42,7 @@ Class PulseBallLight : DynamicLight
Default
{
DynamicLight.Type "Point";
Args 32,255,0,10;
Args 64,255,0,10;
}
override void PostBeginPlay()
{
@ -69,7 +69,7 @@ Class PulseExplLight : DynamicLight
{
DynamicLight.Type "Point";
ReactionTime 20;
Args 32,255,0,30;
Args 64,255,0,30;
}
override void PostBeginPlay()
{
@ -80,7 +80,7 @@ Class PulseExplLight : DynamicLight
{
Super.Tick();
if ( globalfreeze || level.frozen ) return;
args[LIGHT_RED] = 16*lifetime;
args[LIGHT_RED] = 64*lifetime;
args[LIGHT_GREEN] = 255*lifetime;
lifetime -= 1./ReactionTime;
if ( lifetime <= 0 ) Destroy();
@ -117,8 +117,8 @@ Class PulseBall : Actor
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (FRandom[Pulse](-1,1),FRandom[Pulse](-1,1),FRandom[Pulse](-1,1)).unit()*FRandom[Pulse](2,4);
A_SpawnParticle("A0FFA0",SPF_FULLBRIGHT,Random[Pulse](20,40),FRandom[Pulse](2.4,4.8),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("60C040",SPF_FULLBRIGHT,Random[Pulse](30,50),FRandom[Pulse](4.8,7.2),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,Random[Pulse](20,40),FRandom[Pulse](2.4,4.8),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("40FF00",SPF_FULLBRIGHT,Random[Pulse](30,50),FRandom[Pulse](4.8,7.2),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
}
}
action void A_Trail()
@ -128,8 +128,8 @@ Class PulseBall : Actor
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (FRandom[Pulse](-1,1),FRandom[Pulse](-1,1),FRandom[Pulse](-1,1)).unit()*FRandom[Pulse](2,4);
A_SpawnParticle("A0FFA0",SPF_FULLBRIGHT,Random[Pulse](10,20),FRandom[Pulse](1.2,2.4),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("60C040",SPF_FULLBRIGHT,Random[Pulse](15,25),FRandom[Pulse](2.4,3.6),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,Random[Pulse](10,20),FRandom[Pulse](1.2,2.4),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("40FF00",SPF_FULLBRIGHT,Random[Pulse](15,25),FRandom[Pulse](2.4,3.6),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
}
}
States
@ -150,8 +150,7 @@ Class PulseBoltLight : DynamicLight
Default
{
DynamicLight.Type "Point";
+DYNAMICLIGHT.ATTENUATE;
Args 32,255,0,50;
Args 64,255,0,50;
}
override void PostBeginPlay()
{
@ -244,7 +243,7 @@ Class PulseBolt : Actor
+sin(i*0.843-phase)*z*0.1463*min(1,(i*0.1)**.5)
+sin(i*0.863-phase)*z*0.1345*min(1,(i*0.1)**.5));
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,1,FRandom[Pulse](0.6,1.2),0,origin.x,origin.y,origin.z,0,0,0,0,0,0,2);
A_SpawnParticle("60C040",SPF_FULLBRIGHT,1,FRandom[Pulse](2.4,4.8),0,origin.x,origin.y,origin.z,0,0,0,0,0,0,.1);
A_SpawnParticle("40FF00",SPF_FULLBRIGHT,1,FRandom[Pulse](2.4,4.8),0,origin.x,origin.y,origin.z,0,0,0,0,0,0,.1);
}
for ( int i=50; i<beamsize; i+=100 )
{
@ -282,8 +281,8 @@ Class PulseBolt : Actor
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = ((FRandom[Pulse](-.4,.5),FRandom[Pulse](-.4,.4),FRandom[Pulse](-.4,.4))-x).unit()*FRandom[Pulse](2,4);
A_SpawnParticle("A0FFA0",SPF_FULLBRIGHT,Random[Pulse](20,40),FRandom[Pulse](2.4,4.8),0,origin.x,origin.y,origin.z,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("60C040",SPF_FULLBRIGHT,Random[Pulse](30,50),FRandom[Pulse](4.8,7.2),0,origin.x,origin.y,origin.z,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,Random[Pulse](20,40),FRandom[Pulse](2.4,4.8),0,origin.x,origin.y,origin.z,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("40FF00",SPF_FULLBRIGHT,Random[Pulse](30,50),FRandom[Pulse](4.8,7.2),0,origin.x,origin.y,origin.z,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
}
beamsize = t.Results.Distance;
A_SprayDecal("BoltScorch",beamsize+8);
@ -300,8 +299,8 @@ Class PulseBolt : Actor
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (t.Results.HitVector+(FRandom[Pulse](-.5,.5),FRandom[Pulse](-.5,.5),FRandom[Pulse](-.5,.5))).unit()*FRandom[Pulse](2,4);
A_SpawnParticle("A0FFA0",SPF_FULLBRIGHT,Random[Pulse](20,40),FRandom[Pulse](2.4,4.8),0,origin.x,origin.y,origin.z,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("60C040",SPF_FULLBRIGHT,Random[Pulse](30,50),FRandom[Pulse](4.8,7.2),0,origin.x,origin.y,origin.z,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,Random[Pulse](20,40),FRandom[Pulse](2.4,4.8),0,origin.x,origin.y,origin.z,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("40FF00",SPF_FULLBRIGHT,Random[Pulse](30,50),FRandom[Pulse](4.8,7.2),0,origin.x,origin.y,origin.z,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
}
beamsize = min(400,beamsize+40);
}
@ -345,6 +344,8 @@ Class PulseGun : UTWeapon
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
invoker.clipcount--;
if ( CVar.GetCVar('flak_pulsereload').GetBool() && (invoker.clipcount <=0) ) invoker.clipcount = Min(50,weap.Ammo1.Amount);
invoker.FireEffect();
A_AlertMonsters();
Vector3 x, y, z;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
@ -353,8 +354,8 @@ Class PulseGun : UTWeapon
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (x+(FRandom[Pulse](-.5,.5),FRandom[Pulse](-.5,.5),FRandom[Pulse](-.5,.5))).unit()*FRandom[Pulse](2,4);
A_SpawnParticle("A0FFA0",SPF_FULLBRIGHT,Random[Pulse](10,20),FRandom[Pulse](1.2,2.4),0,origin.x-pos.x,origin.y-pos.y,origin.z-pos.z,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("60C040",SPF_FULLBRIGHT,Random[Pulse](15,25),FRandom[Pulse](2.4,3.6),0,origin.x-pos.x,origin.y-pos.y,origin.z-pos.z,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,Random[Pulse](10,20),FRandom[Pulse](1.2,2.4),0,origin.x-pos.x,origin.y-pos.y,origin.z-pos.z,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("40FF00",SPF_FULLBRIGHT,Random[Pulse](15,25),FRandom[Pulse](2.4,3.6),0,origin.x-pos.x,origin.y-pos.y,origin.z-pos.z,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
}
}
action void A_PulseRefire( statelabel flash = null )
@ -377,6 +378,8 @@ Class PulseGun : UTWeapon
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
invoker.clipcount--;
if ( CVar.GetCVar('flak_pulsereload').GetBool() && (invoker.clipcount <=0) ) invoker.clipcount = Min(50,weap.Ammo1.Amount);
invoker.FireEffect();
A_AlertMonsters();
A_QuakeEx(1,1,1,2,0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05);
A_Overlay(-2,"MuzzleFlash");
@ -397,8 +400,8 @@ Class PulseGun : UTWeapon
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (x+(FRandom[Pulse](-.5,.5),FRandom[Pulse](-.5,.5),FRandom[Pulse](-.5,.5))).unit()*FRandom[Pulse](2,4);
A_SpawnParticle("A0FFA0",SPF_FULLBRIGHT,Random[Pulse](10,20),FRandom[Pulse](1.2,2.4),0,origin.x-pos.x,origin.y-pos.y,origin.z-pos.z,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("60C040",SPF_FULLBRIGHT,Random[Pulse](15,25),FRandom[Pulse](2.4,3.6),0,origin.x-pos.x,origin.y-pos.y,origin.z-pos.z,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,Random[Pulse](10,20),FRandom[Pulse](1.2,2.4),0,origin.x-pos.x,origin.y-pos.y,origin.z-pos.z,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-0.1);
A_SpawnParticle("40FF00",SPF_FULLBRIGHT,Random[Pulse](15,25),FRandom[Pulse](2.4,3.6),0,origin.x-pos.x,origin.y-pos.y,origin.z-pos.z,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-0.1);
}
}
action void A_StartBeam()
@ -438,8 +441,12 @@ Class PulseGun : UTWeapon
PGNI A 1
{
A_CheckReload();
if ( (invoker.clipcount <= 0) && (invoker.Ammo1.Amount > 0) ) return A_Jump(255,"Reload");
A_WeaponReady(WRF_ALLOWRELOAD);
if ( CVar.GetCVar('flak_pulsereload').GetBool() )
{
if ( (invoker.clipcount <= 0) && (invoker.Ammo1.Amount > 0) ) return A_Jump(255,"Reload");
A_WeaponReady(WRF_ALLOWRELOAD);
}
else A_WeaponReady();
return A_JumpIf(!Random[Pulse](0,300),1);
}
Wait;

View file

@ -149,19 +149,17 @@ Class ShockBeam : Actor
// spawn particles
for ( int i=0; i<t.Results.Distance; i+=80 )
Spawn("ShockBeamLight",Vec3Offset(tracedir.x*i,tracedir.y*i,tracedir.z*i));
for ( int i=0; i<t.Results.Distance; i+=4 )
for ( int i=0; i<t.Results.Distance; i+=2 )
{
Vector3 pofs = Level.Vec3Diff(pos,pos+tracedir*FRandom[ASMD](-4,4)+(FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)));
A_SpawnParticle("C0A0FF",SPF_FULLBRIGHT,15,2,0,tracedir.x*i+pofs.x,tracedir.y*i+pofs.y,tracedir.z*i+pofs.z,FRandom[ASMD](-.1,.1),FRandom[ASMD](-.1,.1),FRandom[ASMD](-.1,.1),startalphaf:1,sizestep:-.1);
A_SpawnParticle("8040FF",SPF_FULLBRIGHT,20,4,0,tracedir.x*i+pofs.x,tracedir.y*i+pofs.y,tracedir.z*i+pofs.z,FRandom[ASMD](-.1,.1),FRandom[ASMD](-.1,.1),FRandom[ASMD](-.1,.1),startalphaf:.75,sizestep:-.1);
A_SpawnParticle("5020FF",SPF_FULLBRIGHT,25,6,0,tracedir.x*i+pofs.x,tracedir.y*i+pofs.y,tracedir.z*i+pofs.z,FRandom[ASMD](-.1,.1),FRandom[ASMD](-.1,.1),FRandom[ASMD](-.1,.1),startalphaf:.5,sizestep:-.1);
A_SpawnParticle("402080",SPF_FULLBRIGHT,30,8,0,tracedir.x*i+pofs.x,tracedir.y*i+pofs.y,tracedir.z*i+pofs.z,FRandom[ASMD](-.1,.1),FRandom[ASMD](-.1,.1),FRandom[ASMD](-.1,.1),startalphaf:.25,sizestep:-.1);
Vector3 pofs = Level.Vec3Diff(pos,pos+tracedir*FRandom[ASMD](0,2)+(FRandom[ASMD](-.5,.5),FRandom[ASMD](-.5,.5),FRandom[ASMD](-.5,.5)));
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,30,2,0,tracedir.x*i+pofs.x,tracedir.y*i+pofs.y,tracedir.z*i+pofs.z,FRandom[ASMD](-.03,.03),FRandom[ASMD](-.03,.03),FRandom[ASMD](-.03,.03),startalphaf:1,sizestep:-.1);
A_SpawnParticle("5020FF",SPF_FULLBRIGHT,45,4,0,tracedir.x*i+pofs.x,tracedir.y*i+pofs.y,tracedir.z*i+pofs.z,FRandom[ASMD](-.03,.03),FRandom[ASMD](-.03,.03),FRandom[ASMD](-.03,.03),startalphaf:.5,sizestep:-.1);
A_SpawnParticle("402080",SPF_FULLBRIGHT,60,8,0,tracedir.x*i+pofs.x,tracedir.y*i+pofs.y,tracedir.z*i+pofs.z,FRandom[ASMD](-.03,.03),FRandom[ASMD](-.03,.03),FRandom[ASMD](-.03,.03),startalphaf:.25,sizestep:-.1);
}
if ( totaldist >= 10000.0 )
{
// reposition and explode on air
SetOrigin(t.Results.HitPos-t.Results.HitVector*4,true);
A_SprayDecal("ShockMark",16);
ExplodeMissile(t.Results.HitLine,null);
moving = false;
let r = Spawn("ShockBeamRing",pos);
@ -199,9 +197,7 @@ Class ShockBeam : Actor
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](2,8);
A_SpawnParticle("C0A0FF",SPF_FULLBRIGHT,Random[ASMD](20,80),FRandom[ASMD](1.6,4.8),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-.05);
pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
A_SpawnParticle("8040FF",SPF_FULLBRIGHT,Random[ASMD](30,100),FRandom[ASMD](3.2,9.6),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.75,-1,-.05);
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,Random[ASMD](20,80),FRandom[ASMD](1.6,4.8),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-.05);
pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
A_SpawnParticle("5020FF",SPF_FULLBRIGHT,Random[ASMD](40,120),FRandom[ASMD](4.8,11.2),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-.05);
pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
@ -251,9 +247,7 @@ Class ShockBeam : Actor
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
A_SpawnParticle("C0A0FF",SPF_FULLBRIGHT,Random[ASMD](20,40),FRandom[ASMD](1.6,2.4),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-.1);
pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
A_SpawnParticle("8040FF",SPF_FULLBRIGHT,Random[ASMD](30,50),FRandom[ASMD](3.2,4.8),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.75,-1,-.1);
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,Random[ASMD](20,40),FRandom[ASMD](1.6,2.4),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-.1);
pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
A_SpawnParticle("5020FF",SPF_FULLBRIGHT,Random[ASMD](40,60),FRandom[ASMD](4.8,5.6),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-.1);
pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
@ -403,9 +397,7 @@ Class ShockBall : Actor
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
A_SpawnParticle("C0A0FF",SPF_FULLBRIGHT,Random[ASMD](20,40),FRandom[ASMD](1.6,2.4),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-.1);
pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
A_SpawnParticle("8040FF",SPF_FULLBRIGHT,Random[ASMD](30,50),FRandom[ASMD](3.2,4.8),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.75,-1,-.1);
A_SpawnParticle("FFFFFF",SPF_FULLBRIGHT,Random[ASMD](20,40),FRandom[ASMD](1.6,2.4),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,1,-1,-.1);
pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
A_SpawnParticle("5020FF",SPF_FULLBRIGHT,Random[ASMD](40,60),FRandom[ASMD](4.8,5.6),0,0,0,0,pvel.x,pvel.y,pvel.z,0,0,0,.5,-1,-.1);
pvel = (FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1)).unit()*FRandom[ASMD](3,12);
@ -448,6 +440,7 @@ Class ShockRifle : UTWeapon
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("shock/fire",CHAN_WEAPON);
invoker.FireEffect();
A_AlertMonsters();
A_QuakeEx(3,3,3,4,0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
Vector3 x, y, z;
@ -465,6 +458,7 @@ Class ShockRifle : UTWeapon
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("shock/altfire",CHAN_WEAPON);
invoker.FireEffect();
A_AlertMonsters();
A_QuakeEx(3,3,3,8,0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
Vector3 x, y, z;

View file

@ -22,6 +22,12 @@ Class UTWeapon : Weapon
Owner.player.WeaponState |= WF_WEAPONBOBBING; // UT weapons always bob
}
void FireEffect()
{
let amp = DamageAmplifier(Owner.FindInventory("DamageAmplifier",true));
if ( amp ) amp.FireEffect();
}
Default
{
Weapon.BobStyle "Smooth";
@ -32,6 +38,138 @@ Class UTWeapon : Weapon
}
}
Class UTTeleportLight : DynamicLight
{
Default
{
DynamicLight.Type "Point";
Args 128,160,255,80;
}
override void Tick()
{
Super.Tick();
if ( alpha <= 0 )
{
Destroy();
return;
}
args[LIGHT_RED] = 128*alpha;
args[LIGHT_GREEN] = 160*alpha;
args[LIGHT_BLUE] = 255*alpha;
args[LIGHT_INTENSITY] = Random[Tele](10,14)*8;
alpha -= 1./35;
}
}
Class UTTeleportFog : Actor replaces TeleportFog
{
Default
{
+NOBLOCKMAP;
+NOTELEPORT;
+NOGRAVITY;
RenderStyle "Add";
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
Spawn("UTTeleportLight",pos+(0,0,16));
A_PlaySound ("misc/teleport");
}
States
{
Spawn:
TELE ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 Bright A_FadeOut(1./35);
TEL2 ABCDEFGHI 1 Bright A_FadeOut(1./35);
Stop;
}
}
Class UTRedSkull : RedSkull replaces RedSkull
{
Default
{
Tag "Red Skull";
Inventory.PickupMessage "You got the Red Skull.";
}
States
{
Spawn:
USKL A -1;
Stop;
}
}
Class UTGoldSkull : YellowSkull replaces YellowSkull
{
Default
{
Tag "Gold Skull";
Inventory.PickupMessage "You got the Gold Skull.";
}
States
{
Spawn:
USKL B -1;
Stop;
}
}
Class UTBlueSkull : BlueSkull replaces BlueSkull
{
Default
{
Tag "Blue Skull";
Inventory.PickupMessage "You got the Blue Skull.";
}
States
{
Spawn:
USKL C -1;
Stop;
}
}
Class UTRedKey : RedCard replaces RedCard
{
Default
{
Tag "Red Key";
Inventory.PickupMessage "You got the Red Key.";
}
States
{
Spawn:
UKEY A -1;
Stop;
}
}
Class UTGoldKey : YellowCard replaces YellowCard
{
Default
{
Tag "Gold Key";
Inventory.PickupMessage "You got the Gold Key.";
}
States
{
Spawn:
UKEY B -1;
Stop;
}
}
Class UTBlueKey : BlueCard replaces BlueCard
{
Default
{
Tag "Blue Key";
Inventory.PickupMessage "You got the Blue Key.";
}
States
{
Spawn:
UKEY C -1;
Stop;
}
}
Class UTMenuHandler : StaticEventHandler
{
ui TextureID tex;

View file

@ -201,7 +201,7 @@ Class WarShell : Actor
Obituary "%o was vaporized by %k's Redeemer!!";
Radius 4;
Height 4;
Speed 5;
Speed 2;
DamageType 'RedeemerDeath';
PROJECTILE;
+FORCEXYBILLBOARD;
@ -228,17 +228,30 @@ Class WarShell : Actor
{
Super.Tick();
if ( globalfreeze || level.frozen ) return;
if ( vel.length() < 10 ) vel *= 1.1;
if ( !bMISSILE ) return;
if ( vel.length() > 0 )
{
if ( waterlevel > 0 )
{
vel *= 0.98;
if ( vel.length() < 5 ) vel += vel.unit()*0.5;
}
else if ( vel.length() < 10 ) vel += vel.unit()*0.5;
}
}
action void A_Trail()
{
Vector3 taildir = -(cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
if ( waterlevel > 0 )
{
for ( int i=0; i<8; i++ )
A_SpawnParticle("6060FF",0,Random[Warhead](10,30),FRandom[Warhead](2,4),0,taildir.x*32,taildir.y*32,taildir.z*32,taildir.x*2+FRandom[Warhead](-.5,.5),taildir.y*2+FRandom[Warhead](-.5,.5),taildir.z*2+FRandom[Warhead](-.5,.5),accelz:0.2,fadestepf:0);
return;
}
for ( int i=0; i<8; i++ )
A_SpawnParticle("404040",0,20,2,0,taildir.x*32,taildir.y*32,taildir.z*32,taildir.x*2+FRandom[Warhead](-.5,.5),taildir.y*2+FRandom[Warhead](-.5,.5),taildir.z*2+FRandom[Warhead](-.5,.5),accelz:0.1,sizestep:1);
for ( int i=0; i<8; i++ )
{
A_SpawnParticle("FFA020",SPF_FULLBRIGHT,10,6,0,taildir.x*35+FRandom[Warhead](-1,1),taildir.y*35+FRandom[Warhead](-1,1),taildir.z*35+FRandom[Warhead](-1,1),taildir.x*4+FRandom[Warhead](-.25,.25),taildir.y*4+FRandom[Warhead](-.25,.25),taildir.z*4+FRandom[Warhead](-.25,.25));
}
}
action void A_Vaporize()
{
@ -328,11 +341,12 @@ Class GuidedWarShell : WarShell
A_SetPitch(destpitch,SPF_INTERPOLATE);
A_SetRoll(destroll,SPF_INTERPOLATE);
vel = vel.length()*(cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
if ( vel.length() < 10 )
if ( waterlevel > 0 )
{
Vector3 dir = vel.unit();
vel += dir*1;
vel *= 0.98;
if ( vel.length() < 5 ) vel += vel.unit()*0.5;
}
else if ( vel.length() < 10 ) vel += vel.unit()*0.5;
}
lagangle2 = lagangle2*0.95+lagangle*0.05;
lagpitch2 = lagpitch2*0.95+lagpitch*0.05;
@ -394,21 +408,24 @@ Class RedeemerHUD : HUDMessageBase
if ( visibility != StatusBar.HUDMSGLayer_UnderHUD ) return;
Screen.Dim("Red",0.5,0,0,Screen.GetWidth(),Screen.GetHeight());
// shootable targetting
t.Reinit();
Actor a;
Vector3 vdir = (cos(ViewAngle)*cos(ViewPitch),sin(ViewAngle)*cos(ViewPitch),-sin(ViewPitch));
while ( a = Actor(t.Next()) )
if ( CVar.GetCVar('flak_redeemerreadout',players[consoleplayer]).GetBool() )
{
Vector3 tdir = Level.Vec3Diff(ViewPos,a.Pos+(0,0,a.Height*0.5));
if ( !a.bSHOOTABLE || (a.Health <= 0) || ((Camera is 'GuidedWarShell') && (a == GuidedWarShell(Camera).b)) || (tdir.length() > 2000) || (acos(tdir.unit() dot vdir) > players[consoleplayer].FOV) || tr.Trace(ViewPos,Camera.CurSector,tdir.unit(),tdir.length(),0) ) continue;
Vector3 wpos = ViewPos+tdir;
Vector3 spos = mkCoordUtil.WorldToScreen(wpos,ViewPos,ViewPitch,ViewAngle,ViewRoll,players[consoleplayer].FOV);
if ( spos.z > 1.0 ) continue;
Vector2 vpos = mkCoordUtil.ToViewport(spos);
Screen.DrawTexture(mark,false,vpos.x,vpos.y);
String diststr = String.Format("%f",tdir.length());
diststr.Replace(".","");
Screen.DrawText(whfont,Font.CR_UNTRANSLATED,(vpos.x-whfont.StringWidth(diststr)/2)-12,vpos.y+8,diststr);
t.Reinit();
Actor a;
Vector3 vdir = (cos(ViewAngle)*cos(ViewPitch),sin(ViewAngle)*cos(ViewPitch),-sin(ViewPitch));
while ( a = Actor(t.Next()) )
{
Vector3 tdir = Level.Vec3Diff(ViewPos,a.Pos+(0,0,a.Height*0.5));
if ( !a.bSHOOTABLE || (a.Health <= 0) || ((Camera is 'GuidedWarShell') && (a == GuidedWarShell(Camera).b)) || (tdir.length() > 2000) || (acos(tdir.unit() dot vdir) > players[consoleplayer].FOV) || tr.Trace(ViewPos,Camera.CurSector,tdir.unit(),tdir.length(),0) ) continue;
Vector3 wpos = ViewPos+tdir;
Vector3 spos = mkCoordUtil.WorldToScreen(wpos,ViewPos,ViewPitch,ViewAngle,ViewRoll,players[consoleplayer].FOV);
if ( spos.z > 1.0 ) continue;
Vector2 vpos = mkCoordUtil.ToViewport(spos);
Screen.DrawTexture(mark,false,vpos.x,vpos.y);
String diststr = String.Format("%f",tdir.length());
diststr.Replace(".","");
Screen.DrawText(whfont,Font.CR_UNTRANSLATED,(vpos.x-whfont.StringWidth(diststr)/2)-12,vpos.y+8,diststr);
}
}
// other stuff
Screen.DrawTexture(reticle,false,320,240,DTA_VirtualWidth,640,DTA_VirtualHeight,480);
@ -484,6 +501,7 @@ Class WarheadLauncher : UTWeapon replaces BFG9000
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("warhead/fire",CHAN_WEAPON);
invoker.FireEffect();
A_AlertMonsters();
A_QuakeEx(6,6,6,20,0,100,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.2);
Vector3 x, y, z;
@ -518,6 +536,7 @@ Class WarheadLauncher : UTWeapon replaces BFG9000
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("warhead/fire",CHAN_WEAPON);
invoker.FireEffect();
A_AlertMonsters();
A_QuakeEx(6,6,6,20,0,100,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.2);
Vector3 x, y, z;