Progress continues. Many things have been added. Pulsegun is complete.

I've started implementing various pickups.
This commit is contained in:
Marisa the Magician 2018-05-19 00:48:40 +02:00
commit bcab8e79ae
96 changed files with 950 additions and 144 deletions

89
zscript/armoritems.zsc Normal file
View file

@ -0,0 +1,89 @@
Class UTArmorBonus : ArmorBonus replaces ArmorBonus
{
Default
{
Tag "Armor Bonus";
Armor.SaveAmount 5;
Inventory.PickupMessage "You picked up an Armor Bonus.";
Inventory.PickupSound "misc/ut_shard";
}
States
{
Spawn:
XANH A -1;
Stop;
}
}
// TODO system for separating the 4 armor pickups (like Hexen's, but not as strict)
Class UTArmor : Inventory
{
}
Class UTThighPads : BasicArmorPickup replaces GreenArmor
{
Default
{
Tag "Thigh Pads";
Armor.SaveAmount 50;
Armor.SavePercent 50;
Inventory.PickupMessage "You got the Thigh Pads.";
Inventory.PickupSound "misc/ut_armor";
}
States
{
Spawn:
THIG A -1;
Stop;
}
}
Class UTBodyArmor : BasicArmorPickup replaces BlueArmor
{
Default
{
Tag "Body Armor";
Armor.SaveAmount 100;
Armor.SavePercent 75;
Inventory.PickupMessage "You got the Body Armor.";
Inventory.PickupSound "misc/ut_armor";
}
States
{
Spawn:
UARM A -1;
Stop;
}
}
Class UTShieldBelt : Inventory replaces Megasphere
{
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive )
{
if ( !passive || (damage <= 0) ) return;
newdamage = max(0,damage-Amount);
Owner.A_PlaySound("belt/absorb");
if ( amount-damage <= 0 ) Owner.A_Print("The Shield Belt has depleted.");
Owner.TakeInventory("UTShieldBelt",min(amount,damage));
}
Default
{
Tag "Shield Belt";
+COUNTITEM;
+INVENTORY.AUTOACTIVATE;
+Inventory.UNTOSSABLE;
+INVENTORY.ALWAYSPICKUP;
+INVENTORY.BIGPOWERUP;
Inventory.Amount 150;
Inventory.MaxAmount 150;
Inventory.InterHubAmount 150;
Inventory.PickupMessage "You got the Shield Belt.";
Inventory.PickupSound "belt/pickup";
}
States
{
Spawn:
BELT A -1;
Stop;
}
}

View file

@ -1,3 +1,22 @@
Class Tier3Ammo : RandomSpawner replaces Shell
{
Default
{
DropItem "BioAmmo", 255, 1;
DropItem "ShockAmmo", 255, 1;
}
}
Class Tier3Ammo2 : Tier3Ammo replaces ShellBox {}
Class Tier3Weapon : RandomSpawner replaces Shotgun
{
Default
{
DropItem "BioRifle", 255, 1;
DropItem "ShockRifle", 255, 1;
}
}
Class Tier3Weapon2 : Tier3Weapon replaces SuperShotgun {}
Class BioAmmo : Ammo
{
Default
@ -372,7 +391,7 @@ Class BioRifle : UTWeapon
Vector3 x, y, z;
double a, s;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+8.0*y-5.0*z;
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+8.0*y-5.0*z;
Actor p;
if ( alt )
{

View file

@ -1,3 +1,29 @@
Class Tier5Ammo : RandomSpawner replaces RocketAmmo
{
Default
{
DropItem "FlakAmmo2", 255, 1;
//DropItem "UTRocketAmmo2", 255, 1;
}
}
Class Tier5Ammo2 : RandomSpawner replaces RocketBox
{
Default
{
DropItem "FlakAmmo", 255, 1;
//DropItem "UTRocketAmmo", 255, 1;
}
}
Class Tier5Weapon : RandomSpawner replaces RocketLauncher
{
Default
{
DropItem "FlakCannon", 255, 1;
//DropItem "UTRocketLauncher", 255, 1;
}
}
Class FlakAmmo : Ammo
{
Default
@ -400,7 +426,7 @@ Class FlakLight : DynamicLight
Destroy();
return;
}
if ( target.player ) SetOrigin(target.pos+(0,0,target.player.viewheight),true);
if ( target.player ) SetOrigin(target.Vec3Offset(0,0,target.player.viewz-target.pos.z),true);
else SetOrigin(target.pos,true);
if ( cnt++ > 2 ) Destroy();
}
@ -425,7 +451,7 @@ Class FlakCannon : UTWeapon
Vector3 x, y, z;
double a, s;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+2.0*y-3.0*z;
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+2.0*y-3.0*z;
A_Overlay(-2,"MuzzleFlash");
A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true);
A_OverlayRenderstyle(-2,STYLE_Add);
@ -461,7 +487,7 @@ Class FlakCannon : UTWeapon
Vector3 x, y, z;
double a, s;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+2.0*y-3.0*z;
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+2.0*y-3.0*z;
A_Overlay(-2,"MuzzleFlash");
A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true);
A_OverlayRenderstyle(-2,STYLE_Add);

77
zscript/healitems.zsc Normal file
View file

@ -0,0 +1,77 @@
Class UTHealthPack : Health replaces Soulsphere
{
Default
{
Tag "Big Keg O' Health";
+COUNTITEM;
+INVENTORY.AUTOACTIVATE;
+INVENTORY.ALWAYSPICKUP;
+INVENTORY.FANCYPICKUPSOUND;
Inventory.Amount 100;
Inventory.MaxAmount 200;
Inventory.PickupMessage "You picked up the Big Keg O' Health.";
Inventory.PickupSound "misc/ut_keg";
}
States
{
Spawn:
HBOX A -1;
Stop;
}
}
Class UTHealthBox : Health replaces Medikit
{
Default
{
Tag "Health Box";
Inventory.Amount 50;
Inventory.PickupMessage "You picked up a Health Box.";
Health.LowMessage 25,"You picked up a Health Box that you REALLY need!";
Inventory.PickupSound "misc/ut_heal";
}
States
{
Spawn:
HBOX B -1;
Stop;
}
}
Class UTMedBox : Health replaces Stimpack
{
Default
{
Tag "Health Pack";
Inventory.Amount 20;
Inventory.PickupMessage "You picked up a Health Pack.";
Inventory.PickupSound "misc/ut_heal";
}
States
{
Spawn:
HBOX C -1;
Stop;
}
}
Class UTHealthBonus : Health replaces HealthBonus
{
Default
{
Tag "Health Vial";
+COUNTITEM;
+INVENTORY.ALWAYSPICKUP;
Inventory.Amount 5;
Inventory.MaxAmount 200;
Inventory.PickupMessage "You picked up a Health Vial.";
Inventory.PickupSound "misc/ut_heal";
RenderStyle "Add";
}
States
{
Spawn:
VIAL A -1;
Stop;
}
}

0
zscript/powerups.zsc Normal file
View file

View file

@ -1,3 +1,21 @@
Class Tier4Ammo : RandomSpawner replaces ClipBox
{
Default
{
DropItem "PulseAmmo", 255, 1;
//DropItem "RipperAmmo", 255, 1;
}
}
Class Tier4Weapon : RandomSpawner replaces Chaingun
{
Default
{
DropItem "PulseGun", 255, 1;
//DropItem "Ripper", 255, 1;
}
}
Class PulseAmmo : Ammo
{
Default
@ -18,28 +36,106 @@ Class PulseAmmo : Ammo
}
}
Class PulseBallLight : DynamicLight
{
double pulseofs;
Default
{
DynamicLight.Type "Point";
Args 32,255,0,10;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
pulseofs = FRandom[Pulse](0,360);
}
override void Tick()
{
Super.Tick();
if ( !target || target.InStateSequence(target.CurState,target.ResolveState("Death")) )
{
Destroy();
return;
}
SetOrigin(target.pos,true);
args[LIGHT_INTENSITY] = 10+sin(gametic*80+pulseofs)*5;
}
}
Class PulseExplLight : DynamicLight
{
double lifetime;
Default
{
DynamicLight.Type "Point";
ReactionTime 20;
Args 32,255,0,30;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
lifetime = 1.0;
}
override void Tick()
{
Super.Tick();
if ( globalfreeze || level.frozen ) return;
args[LIGHT_RED] = 16*lifetime;
args[LIGHT_GREEN] = 255*lifetime;
lifetime -= 1./ReactionTime;
if ( lifetime <= 0 ) Destroy();
}
}
Class PulseBall : Actor
{
Default
{
Obituary "%o ate %k's burning plasma death.";
DamageType 'Pulsed';
RenderStyle "Add";
DamageFunction Random[Pulse](15,25);
PROJECTILE;
Scale 0.2;
Speed 30;
Radius 4;
Height 4;
}
override void PostBeginPlay()
{
A_PlaySound("pulse/fly",CHAN_BODY,0.8,true,8.0);
let l = Spawn("PulseBallLight",pos);
l.target = self;
}
action void A_BallExp()
{
A_SetScale(0.45);
A_PlaySound("pulse/hit",CHAN_BODY);
A_SprayDecal("BoltScorch");
Spawn("PulseExplLight",pos);
int numpt = Random[Pulse](20,40);
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);
}
}
action void A_Trail()
{
if ( Random[Pulse](0,4) ) return;
int numpt = Random[Pulse](2,5);
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);
}
}
States
{
Spawn:
PBAL ABCDE 1 Bright;
PBAL ABCDE 1 Bright A_Trail();
Loop;
Death:
TNT1 A 0 A_BallExp();
@ -48,19 +144,190 @@ Class PulseBall : Actor
}
}
Class PulseBolt : Actor
Class PulseBoltLight : DynamicLight
{
bool lived;
Default
{
DynamicLight.Type "Point";
+DYNAMICLIGHT.ATTENUATE;
Args 32,255,0,50;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
args[LIGHT_INTENSITY] = Random[Pulse](50,60);
}
override void Tick()
{
Super.Tick();
if ( globalfreeze || level.frozen ) return;
if ( lived ) Destroy();
lived = true;
}
}
Class StarterBolt : PulseBolt
Class PulseBoltTracer : LineTracer
{
Actor ignore;
override ETraceStatus TraceCallback()
{
if ( Results.HitType == TRACE_HitActor )
{
if ( Results.HitActor == ignore ) return TRACE_Skip;
if ( Results.HitActor.bSHOOTABLE ) return TRACE_Stop;
return TRACE_Skip;
}
else if ( (Results.HitType == TRACE_HitWall) && (Results.Tier == TIER_Middle) )
{
if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&Line.ML_BlockHitscan) )
return TRACE_Stop;
return TRACE_Skip;
}
return TRACE_Stop;
}
}
Class PulseBolt : Actor
{
PulseBoltTracer t;
double accdamage;
int lasthit;
Actor damagedactor;
double beamsize;
Actor weffect;
double phase;
override void OnDestroy()
{
Super.OnDestroy();
if ( weffect ) weffect.Destroy();
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
t = new("PulseBoltTracer");
t.ignore = target;
beamsize = 40;
}
override void Tick()
{
Super.Tick();
if ( globalfreeze || level.frozen ) return;
if ( !target )
{
Destroy();
return;
}
phase += 10;
// update beam
int numpt;
Vector3 x, y, z;
Vector3 origin;
if ( target.player )
{
[x, y, z] = Matrix4.GetAxes(target.pitch,target.angle,target.roll);
origin = (0,0,target.player.viewz-target.pos.z)+5.0*x+3.0*y-1.5*z;
}
else origin = (0,0,target.missileheight);
SetOrigin(target.Vec3Offset(origin.x,origin.y,origin.z),true);
A_SetAngle(target.angle,SPF_INTERPOLATE);
A_SetPitch(target.BulletSlope(),SPF_INTERPOLATE);
// draw beam
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
for ( double i=0; i<=beamsize; i+=0.5 )
{
origin = Level.Vec3Diff(pos,pos+x*i
+sin(i*0.834-phase)*y*0.1435*min(1,(i*0.1)**.5)
+sin(i*0.836-phase)*y*0.1342*min(1,(i*0.1)**.5)
+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);
}
for ( int i=50; i<beamsize; i+=100 )
{
origin = Vec3Offset(x.x*i,x.y*i,x.z*i);
Spawn("PulseBoltLight",origin);
}
// check beam
t.Trace(pos,cursector,x,beamsize,0);
if ( t.Results.HitType != TRACE_HitNone )
{
if ( t.Results.HitType == TRACE_HitActor )
{
if ( !damagedactor )
{
accdamage = min(0.5*(level.time-lasthit),0.1);
t.Results.HitActor.DamageMobj(self,target,Random[Pulse](65,75)*accdamage,'zapped');
accdamage = 0;
}
else if ( t.Results.HitActor != damagedactor )
{
t.Results.HitActor.DamageMobj(self,target,Random[Pulse](65,75)*accdamage,'zapped');
accdamage = 0;
}
lasthit = level.time;
damagedactor = t.Results.HitActor;
accdamage += 1./TICRATE;
if ( accdamage > 0.22 )
{
t.Results.HitActor.DamageMobj(self,target,Random[Pulse](65,75)*accdamage,'zapped');
accdamage = 0;
}
}
origin = Level.Vec3Diff(pos,t.Results.HitPos);
numpt = Random[Pulse](10,20)*!Random[Pulse](0,2);
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);
}
beamsize = t.Results.Distance;
A_SprayDecal("BoltScorch",beamsize+8);
return;
}
else if ( damagedactor )
{
damagedactor.DamageMobj(self,target,Random[Pulse](65,75)*accdamage,'zapped');
accdamage = 0;
damagedactor = null;
}
origin = Level.Vec3Diff(pos,t.Results.HitPos);
numpt = Random[Pulse](5,10)*!Random[Pulse](0,5);
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);
}
beamsize = min(400,beamsize+40);
}
Default
{
Obituary "%o ate %k's burning plasma death.";
RenderStyle "Add";
Radius 0.1;
Height 0;
+NOGRAVITY;
+NOCLIP;
+DONTSPLASH;
}
States
{
Spawn:
PBLT A 1 Bright;
Loop;
}
}
Class PulseGun : UTWeapon
{
int clipcount;
double sangle;
StarterBolt beam;
Actor beam;
Property ClipCount : clipcount;
@ -119,7 +386,7 @@ Class PulseGun : UTWeapon
double a;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+4.0*y-2.0*z;
origin += y*cos(invoker.sangle)*4.0+z*sin(invoker.sangle)*4.0;
origin += y*cos(invoker.sangle)*2.0+z*sin(invoker.sangle)*2.0;
invoker.sangle += 100;
Actor p = Spawn("PulseBall",origin);
p.angle = angle;
@ -137,7 +404,7 @@ Class PulseGun : UTWeapon
action void A_StartBeam()
{
A_PlaySound("pulse/bolt",CHAN_WEAPON,1.0,true);
invoker.beam = StarterBolt(Spawn("StarterBolt",pos));
invoker.beam = Spawn("PulseBolt",pos);
invoker.beam.target = self;
}
action void A_StopBeam()
@ -186,84 +453,29 @@ Class PulseGun : UTWeapon
PGNI A 0 A_PlaySound("pulse/fire",CHAN_WEAPON,1.0,true);
Hold:
PGNF A 1 A_PulseFire();
PGNF B 1;
PGNF Y 0 A_PulseRefire(1);
Goto Release;
PGNF C 1 A_PulseFire();
PGNF D 1;
PGNF Y 0 A_PulseRefire(1);
Goto Release;
PGNF E 1 A_PulseFire();
PGNF F 1;
PGNF Y 0 A_PulseRefire(1);
PGNF BCDEF 1;
PNGF G 0 A_PulseRefire(1);
Goto Release;
PGNF G 1 A_PulseFire();
PGNF H 1;
PGNF Y 0 A_PulseRefire(1);
PGNF HIJKL 1;
PNGF M 0 A_PulseRefire(1);
Goto Release;
PGNF I 1 A_PulseFire();
PGNF J 1;
PGNF Y 0 A_PulseRefire(1);
Goto Release;
PGNF K 1 A_PulseFire();
PGNF L 1;
PGNF Y 0 A_PulseRefire(1);
Goto Release;
PGNF M 1 A_PulseFire();
PGNF N 1;
PGNF Y 0 A_PulseRefire(1);
Goto Release;
PGNF O 1 A_PulseFire();
PGNF P 1;
PGNF Y 0 A_PulseRefire(1);
Goto Release;
PGNF Q 1 A_PulseFire();
PGNF R 1;
PGNF Y 0 A_PulseRefire(1);
Goto Release;
PGNF S 1 A_PulseFire();
PGNF T 1;
PGNF Y 0 A_PulseRefire(1);
PGNF N 1 A_PulseFire();
PGNF OPQRS 1;
PNGF T 0 A_PulseRefire(1);
Goto Release;
PGNF U 1 A_PulseFire();
PGNF V 1;
PGNF Y 0 A_PulseRefire(1);
Goto Release;
PGNF W 1 A_PulseFire();
PGNF X 1;
PGNF Y 0 A_PulseRefire(1);
Goto Release;
PGNF Y 1 A_PulseFire();
PGNF Z 1;
PGNF VWXYZ 1;
PGF2 A 0 A_PulseRefire(1);
Goto Release;
PGF2 A 1 A_PulseFire();
PGF2 B 1;
PGF2 C 0 A_PulseRefire(1);
Goto Release;
PGF2 C 1 A_PulseFire();
PGF2 D 1;
PGF2 E 0 A_PulseRefire(1);
Goto Release;
PGF2 E 1 A_PulseFire();
PGF2 F 1;
PGF2 BCDEF 1;
PGF2 G 0 A_PulseRefire(1);
Goto Release;
PGF2 G 1 A_PulseFire();
PGF2 H 1;
PGF2 I 0 A_PulseRefire(1);
PGF2 H 1 A_PulseFire();
PGF2 IJKLM 1;
PGF2 N 0 A_PulseRefire();
Goto Release;
PGF2 I 1 A_PulseFire();
PGF2 J 1;
PGF2 K 0 A_PulseRefire(1);
Goto Release;
PGF2 K 1 A_PulseFire();
PGF2 L 1;
PGF2 M 0 A_PulseRefire(1);
Goto Release;
PGF2 M 1 A_PulseFire();
PGF2 N 1;
PGNF A 0 A_PulseRefire("Hold");
Release:
PGNC A 0 A_PlaySound("pulse/down",CHAN_WEAPON);
PGNC ABCDEFGHIJKLMNOPQRSTUVWXY 1;
@ -274,24 +486,34 @@ Class PulseGun : UTWeapon
PGBL A 0 A_StartBeam();
AltHold:
PGBL A 1 A_DrainAmmo();
PGBL B 0 A_PulseRefire(1);
Goto AltRelease;
PGBL B 1;
PGBL C 0 A_PulseRefire(1);
Goto AltRelease;
PGBL C 1 A_DrainAmmo();
PGBL C 1;
PGBL D 0 A_PulseRefire(1);
Goto AltRelease;
PGBL D 1;
PGBL E 0 A_PulseRefire(1);
Goto AltRelease;
PGBL E 1 A_DrainAmmo();
PGBL E 1;
PGBL F 0 A_PulseRefire(1);
Goto AltRelease;
PGBL F 1;
PGBL G 0 A_PulseRefire(1);
Goto AltRelease;
PGBL G 1 A_DrainAmmo();
PGBL G 1;
PGBL H 0 A_PulseRefire(1);
Goto AltRelease;
PGBL H 1;
PGBL I 0 A_PulseRefire(1);
Goto AltRelease;
PGBL I 1 A_DrainAmmo();
PGBL I 1;
PGBL J 0 A_PulseRefire(1);
Goto AltRelease;
PGBL J 1;
PGBL A 0 A_PulseRefire("AltHold");
PGBL A 0 A_PulseRefire();
AltRelease:
PGBE A 0 A_StopBeam();
PGBE ABCDE 1;
@ -310,7 +532,7 @@ Class PulseGun : UTWeapon
PGNS A 1 A_Raise(int.max);
Wait;
MuzzleFlash:
PMUZ A 1 Bright;
PMUZ A 2 Bright;
Stop;
}
}

View file

@ -119,11 +119,11 @@ Class ShockBeam : Actor
Default
{
Obituary "%k inflicted mortal damage upon %o with the Shock Rifle";
DamageType 'jolted';
RenderStyle "Add";
Radius 0.1;
Height 0;
Scale 0.4;
DamageFunction Random[ASMD](30,45);
+NOGRAVITY;
+NOCLIP;
+DONTSPLASH;
@ -151,7 +151,7 @@ Class ShockBeam : Actor
Spawn("ShockBeamLight",Vec3Offset(tracedir.x*i,tracedir.y*i,tracedir.z*i));
for ( int i=0; i<t.Results.Distance; i+=4 )
{
Vector3 pofs = tracedir*FRandom[ASMD](-4,4)+(FRandom[ASMD](-1,1),FRandom[ASMD](-1,1),FRandom[ASMD](-1,1));
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);
@ -301,6 +301,7 @@ Class ShockBeamLight : ShockExplLight
{
Default
{
+DYNAMICLIGHT.ATTENUATE;
ReactionTime 15;
Args 0,0,0,80;
}
@ -451,7 +452,7 @@ Class ShockRifle : UTWeapon
A_QuakeEx(3,3,3,4,0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
Vector3 x, y, z;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+3.0*y-4.0*z;
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+3.0*y-4.0*z;
Actor p = Spawn("ShockBeam",origin);
p.angle = angle;
p.pitch = BulletSlope();
@ -468,7 +469,7 @@ Class ShockRifle : UTWeapon
A_QuakeEx(3,3,3,8,0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
Vector3 x, y, z;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+3.0*y-4.0*z;
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+3.0*y-4.0*z;
Actor p = Spawn("ShockBall",origin);
p.angle = angle;
p.pitch = BulletSlope();

View file

@ -2,12 +2,19 @@ Class UTWeapon : Weapon
{
override Inventory CreateTossable( int amt )
{
if ( Ammo1 && (Ammo1.Amount <= 0) ) return null;
Inventory d = Super.CreateTossable(amt);
if ( d && (d.GetClass() == GetClass()) )
d.SetState(d.ResolveState("Spawn")+1);
return d;
}
override bool SpecialDropAction( Actor dropper )
{
SetState(ResolveState("Spawn")+1);
return true;
}
override void Tick()
{
Super.Tick();

View file

@ -216,6 +216,8 @@ Class WarShell : Actor
b = Spawn("WarheadHitbox",pos);
b.target = self;
A_PlaySound("warhead/fly",CHAN_VOICE,1.0,true);
destangle = angle;
destpitch = pitch;
}
override int SpecialMissileHit( Actor victim )
{
@ -226,19 +228,7 @@ Class WarShell : Actor
{
Super.Tick();
if ( globalfreeze || level.frozen ) return;
if ( vel.length() > 0 )
{
Vector3 dir = vel.unit();
destangle = atan2(dir.y,dir.x);
destpitch = asin(-dir.z);
A_SetAngle(angle*0.9+destangle*0.1,SPF_INTERPOLATE);
A_SetPitch(pitch*0.9+destpitch*0.1,SPF_INTERPOLATE);
if ( vel.length() < 10 )
{
Vector3 dir = vel.unit();
vel += dir*1;
}
}
if ( vel.length() < 10 ) vel *= 1.1;
}
action void A_Trail()
{
@ -406,10 +396,11 @@ Class RedeemerHUD : HUDMessageBase
// shootable targetting
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)) || tr.Trace(ViewPos,Camera.CurSector,tdir.unit(),tdir.length(),0) ) continue;
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;
@ -483,7 +474,7 @@ Class RedeemerHUDHandler : EventHandler
}
}
Class WarheadLauncher : UTWeapon
Class WarheadLauncher : UTWeapon replaces BFG9000
{
Actor guided;
action void A_WarheadFire()
@ -496,16 +487,30 @@ Class WarheadLauncher : UTWeapon
A_AlertMonsters();
A_QuakeEx(6,6,6,20,0,100,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.2);
Vector3 x, y, z;
double a, s;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
vel -= x*10;
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+2.0*y-2.0*z;
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+2.0*y-2.0*z;
Actor p = Spawn("WarShell",origin);
p.angle = angle;
p.pitch = BulletSlope();
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.target = self;
}
action void A_WarheadSmoke()
{
Weapon weap = Weapon(invoker);
if ( !weap ) return;
Vector3 x, y, z;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
vel -= x*0.2;
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+2.0*y-2.0*z;
int numpt = Random[Warhead](10,20);
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (x+(FRandom[Warhead](-.8,.8),FRandom[Warhead](-.8,.8),FRandom[Warhead](-.8,.8))).unit()*FRandom[Warhead](1,2);
A_SpawnParticle(Color(1,1,1)*Random[Warhead](32,128),0,Random[Warhead](40,50),FRandom[Warhead](4,12),0,origin.x-pos.x,origin.y-pos.y,origin.z-pos.z,pvel.x,pvel.y,pvel.z,0,0,0.03,0.5,-1,0.5);
}
}
action void A_WarheadAlt()
{
Weapon weap = Weapon(invoker);
@ -516,10 +521,9 @@ Class WarheadLauncher : UTWeapon
A_AlertMonsters();
A_QuakeEx(6,6,6,20,0,100,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.2);
Vector3 x, y, z;
double a, s;
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
vel -= x*10;
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+2.0*y-2.0*z;
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+2.0*y-2.0*z;
Actor p = Spawn("GuidedWarShell",origin);
p.angle = angle;
p.pitch = BulletSlope();
@ -529,6 +533,13 @@ Class WarheadLauncher : UTWeapon
invoker.guided = p;
}
// disallow dropping while guiding
override Inventory CreateTossable( int amt )
{
if ( guided ) return null;
return Super.CreateTossable();
}
Default
{
Tag "Redeemer";
@ -560,13 +571,13 @@ Class WarheadLauncher : UTWeapon
Fire:
WARI A 3;
WARF A 3 A_WarheadFire();
WARF BCDEFG 3;
WARF BCDEFG 3 A_WarheadSmoke();
WARI A 5;
Goto Idle;
AltFire:
WARI A 3;
WARF A 3 A_WarheadAlt();
WARF BCDEFG 3;
WARF BCDEFG 3 A_WarheadSmoke();
WARI A 1 A_JumpIf(!invoker.Guided,1);
Wait;
WARI A 30;