1.2 update w/ GZDoom 4.9 features:

- Changeable player skins.
 - Ammo LEDs are now 1:1 with UT by using canvas textures.
 - Integrate some add-ons, including reskins.
 - Various fixes (some backported from Demolitionist).
 - Migrated from libeye to Gutamatics.
This commit is contained in:
Marisa the Magician 2022-11-05 23:59:16 +01:00
commit 602a89cc68
1761 changed files with 4461 additions and 1597 deletions

View file

@ -290,35 +290,37 @@ Class UTRocketLauncher : UTWeapon
{
bool LockedOn;
Actor LockedTarget;
TextureID lockontex;
int locktics;
bool bSingleRocket;
UTRocketLauncherLED ammoled;
ui Canvas AmmoLed;
ui TextureID LedBase, LedFont;
ui TextureID lockontex;
override void DoEffect()
override void RenderOverlay( RenderEvent e )
{
Super.DoEffect();
if ( !ammoled )
Vector2 fnt[] =
{
let ti = ThinkerIterator.Create("UTRocketLauncherLED");
while ( ammoled=UTRocketLauncherLED(ti.Next()) ) break;
if ( !ammoled ) ammoled = UTRocketLauncherLED(Spawn("UTRocketLauncherLED"));
}
if ( !Owner || !Owner.player || (Owner != players[consoleplayer].Camera) ) return;
ammoled.mygun = self;
TexMan.SetCameraToTexture(ammoled,"RAmmoLed",90);
(0,1), (21,1), (42,1), (63,1), (84,1),
(105,1), (126,1), (147,1), (168,1), (189,1)
};
if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("MiniALed");
if ( !LedFont ) LedFont = TexMan.CheckForTexture("models/LEDFont2.png",TexMan.Type_Any);
AmmoLed.Clear(0,0,64,64,"Black");
int dg3 = (Ammo1.Amount/100)%10;
int dg2 = (Ammo1.Amount/10)%10;
int dg1 = Ammo1.Amount%10;
AmmoLed.DrawTexture(LedFont,false,2,14,DTA_SrcX,fnt[dg3].x,DTA_SrcY,fnt[dg3].y,DTA_SrcWidth,20,DTA_SrcHeight,35,DTA_DestWidth,20,DTA_DestHeight,35,DTA_Color,0xFFFF0000);
AmmoLed.DrawTexture(LedFont,false,22,14,DTA_SrcX,fnt[dg2].x,DTA_SrcY,fnt[dg2].y,DTA_SrcWidth,20,DTA_SrcHeight,35,DTA_DestWidth,20,DTA_DestHeight,35,DTA_Color,0xFFFF0000);
AmmoLed.DrawTexture(LedFont,false,42,14,DTA_SrcX,fnt[dg1].x,DTA_SrcY,fnt[dg1].y,DTA_SrcWidth,20,DTA_SrcHeight,35,DTA_DestWidth,20,DTA_DestHeight,35,DTA_Color,0xFFFF0000);
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
lockontex = TexMan.CheckForTexture("Crosshr6",TexMan.Type_Any);
}
override void PreRender( double lbottom )
{
if ( LockedTarget ) Screen.DrawTexture(lockontex,false,Screen.GetWidth()*0.5,Screen.GetHeight()*0.5);
if ( LockedTarget )
{
if ( !lockontex ) lockontex = TexMan.CheckForTexture("Crosshr6",TexMan.Type_Any);
Screen.DrawTexture(lockontex,false,Screen.GetWidth()*0.5,Screen.GetHeight()*0.5);
}
}
override void Tick()
@ -395,8 +397,8 @@ Class UTRocketLauncher : UTWeapon
{
a = FRandom[Eightball](0,360);
s = FRandom[Eightball](0,(num>1)?12:0);
Vector3 dir = (x2+cos(a)*y2*s*0.004+sin(a)*z2*s*0.004).unit();
p = Spawn("UTGrenade",level.Vec3Offset(origin,cos(a)*y*s+sin(a)*z*s));
Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s*0.004);
p = Spawn("UTGrenade",level.Vec3Offset(origin,dt_Utility.CircleOffset(y,z,a,s)));
p.vel = x*(vel dot x)*0.4 + dir*p.speed*FRandom[Eightball](1.0,1.2);
p.vel.z += 3.5;
p.target = self;
@ -405,7 +407,7 @@ Class UTRocketLauncher : UTWeapon
else if ( num <= 1 )
{
// single rocket
p = Spawn("UTRocket",level.Vec3Offset(origin,cos(a)*y*s+sin(a)*z*s));
p = Spawn("UTRocket",level.Vec3Offset(origin,dt_Utility.CircleOffset(y,z,a,s)));
p.vel = x2*p.speed;
p.target = self;
p.tracer = invoker.LockedTarget;
@ -418,7 +420,7 @@ Class UTRocketLauncher : UTWeapon
s = (num>1)?6:0;
for ( int i=0; i<num; i++ )
{
p = Spawn("UTRocket",level.Vec3Offset(origin,cos(a)*y*s+sin(a)*z*s));
p = Spawn("UTRocket",level.Vec3Offset(origin,dt_Utility.CircleOffset(y,z,a,s)));
p.vel = x2*p.speed;
p.target = self;
p.tracer = invoker.LockedTarget;
@ -465,7 +467,7 @@ Class UTRocketLauncher : UTWeapon
while ( a = Actor(t.Next()) )
{
if ( !a.bSHOOTABLE || (a.Health <= 0) || a.bKilled || !a.bIsMonster || a.bCorpse || (a == self) || isTeammate(a) || !CheckSight(a) ) continue;
Vector3 viewdir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 viewdir = dt_Utility.Vec3FromAngle(angle,pitch);
Vector3 reldir = level.Vec3Diff(Vec2OffsetZ(0,0,player.viewz),a.Vec2OffsetZ(0,0,a.pos.z+a.height*0.5));
double reldist = reldir.length();
if ( reldist > 2000 ) continue;
@ -502,6 +504,7 @@ Class UTRocketLauncher : UTWeapon
Weapon.AmmoUse2 1;
Weapon.AmmoGive 6;
UTWeapon.DropAmmo 3;
UTWeapon.NameColor "FF 00 00";
}
States
{