Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version "2.4"
- class VanillaRocket : Rocket Replaces Rocket
- {
- PlayerInfo plr ;
- override void BeginPlay()
- {
- plr = players[consoleplayer] ;
- super.BeginPlay() ;
- }
- States
- {
- Death:
- MISL B 8 Bright A_Explode ;
- MISL C 6 Bright ;
- MISL D 4 Bright ;
- TNT1 A 0
- {
- if( plr && Cvar.GetCVar( "ve_shortrocket", plr ).GetBool() ) A_StopSound() ;
- }
- Stop ;
- }
- }
- class VanEssHandler : EventHandler
- {
- private ui transient cvar lowres, detail, resolution, quantize_h, quantize_w, par, lowres_psp, smoothx, smoothy, smoothlog, crycolour ;//, alphabright ;
- private ui void get_cvars( PlayerInfo plr )
- {
- lowres = Cvar.GetCVar( "ve_lowres", plr );
- detail = Cvar.GetCVar( "ve_detail", plr );
- resolution = Cvar.GetCVar( "ve_resolution", plr );
- quantize_h = Cvar.GetCVar( "ve_quantize_h", plr );
- quantize_w = Cvar.GetCVar( "ve_quantize_w", plr );
- par = Cvar.GetCVar( "ve_par", plr );
- lowres_psp = Cvar.GetCVar( "ve_lowres_psp", plr );
- smoothx = Cvar.GetCVar( "ve_smoothx", plr );
- smoothy = Cvar.GetCVar( "ve_smoothy", plr );
- smoothlog = Cvar.GetCVar( "ve_smoothlog", plr );
- crycolour = Cvar.GetCVar( "ve_crycolour", plr );
- //alphabright = Cvar.GetCVar( "ve_alphabright", plr );
- }
- private ui bool should_get_cvars()
- {
- return( lowres == null );
- }
- override void UiTick()
- {
- PlayerInfo plr = players[ consoleplayer ];
- if( plr )
- {
- if( should_get_cvars() ) { get_cvars( plr ); }
- if( lowres.GetBool() )
- {
- double detail = detail.GetInt() * .5 ;
- double height = max( resolution.GetInt(), 48 );
- if( quantize_h.GetBool() ) height = screen.getheight() / int( screen.getheight() / height + .5);
- double width = screen.getwidth() ;
- if( detail <= 1 )
- {
- double stdaspect = 4. / 3 ;
- double pxlaspect = 42. / par.GetInt() ;
- double stdwidth = screen.getheight() * stdaspect ;
- double addwidth = screen.getwidth() / stdwidth ;
- width = height * stdaspect * addwidth * pxlaspect * detail ;
- if( quantize_w.GetBool() ) width = screen.getwidth() / int( screen.getwidth() / width + .5);
- }
- if( lowres_psp.GetBool() )
- {
- Shader.SetUniform2f( plr, "VanResPSP", "upres", ( width, height ));
- Shader.SetUniform2f( plr, "VanResPSP", "dnres", ( 1. / max( width, .25 ), 1. / height ));
- Shader.SetUniform2f( plr, "VanResPSP", "smoothing", (smoothx.GetFloat() * .01, smoothy.GetFloat() * .01));
- Shader.SetUniform1f( plr, "VanResPSP", "log", smoothlog.GetFloat() * .01 );
- Shader.SetEnabled( plr, "VanResPSP", true );
- Shader.SetEnabled( plr, "VanRes", false );
- }
- else
- {
- Shader.SetUniform2f( plr, "VanRes", "upres", ( width, height ));
- Shader.SetUniform2f( plr, "VanRes", "dnres", ( 1. / max( width, .25 ), 1. / height ));
- Shader.SetUniform2f( plr, "VanRes", "smoothing", (smoothx.GetFloat() * .01, smoothy.GetFloat() * .01));
- Shader.SetUniform1f( plr, "VanRes", "log", smoothlog.GetFloat() * .01 );
- Shader.SetEnabled( plr, "VanRes", true );
- Shader.SetEnabled( plr, "VanResPSP", false );
- }
- }
- else
- {
- Shader.SetEnabled( plr, "VanRes", false );
- Shader.SetEnabled( plr, "VanResPSP", false );
- }
- int crymode = crycolour.GetInt() ;
- if( crymode > 0 )
- {
- Shader.SetUniform1i( plr, "CRYspace", "crymode", crymode );
- Shader.SetEnabled( plr, "CRYspace", true );
- }
- else Shader.SetEnabled( plr, "CRYspace", false );
- //if( alphabright.GetBool() ) Shader.SetEnabled( plr, "AlphaBright", true );
- //else Shader.SetEnabled( plr, "AlphaBright", false );
- }
- }
- }
- class StretchHandler : EventHandler
- {
- override void WorldThingSpawned( WorldEvent e )
- {
- if( e.Thing.sprite )
- {
- //if( e.Thing is "PlayerPawn" ) return ;
- e.Thing.A_SetInventory( "SpriteScaler", 1 );
- }
- }
- private ui transient cvar par_stretch ;
- private ui void get_cvars( PlayerInfo plr )
- {
- par_stretch = Cvar.GetCVar( "ve_par_stretch", plr );
- }
- private ui bool should_get_cvars()
- {
- return( par_stretch == null );
- }
- override void RenderOverlay( RenderEvent e )
- {
- PlayerInfo p = players[ consoleplayer ] ;
- if( p )
- {
- if( should_get_cvars() ) { get_cvars( p ); }
- double pitch ;
- switch( par_stretch.GetInt() )
- {
- case 0:
- Shader.SetEnabled( p, "SceneStretch", false );
- Shader.SetEnabled( p, "BBloomStretch", false );
- Shader.SetEnabled( p, "BBloomStretchSolo", false );
- break;
- case 1:
- Shader.SetEnabled( p, "SceneStretch", true );
- pitch = 1.0 - abs( e.viewPitch ) * 1.0 / 6.0 / 90.0 ;
- Shader.SetUniform1f( p, "BBloomStretch", "pitch", pitch );
- Shader.SetEnabled( p, "BBloomStretch", true );
- Shader.SetEnabled( p, "BBloomStretchSolo", false );
- break;
- case 2:
- pitch = 1. - abs( e.viewPitch ) * 13. / 48. / 90.0 ;
- Shader.SetUniform1f( p, "BBloomStretchSolo", "pitch", pitch );
- Shader.SetEnabled( p, "BBloomStretchSolo", true );
- Shader.SetEnabled( p, "SceneStretch", false );
- Shader.SetEnabled( p, "BBloomStretch", false );
- break;
- }
- }
- }
- }
- class SpriteScaler : Inventory
- {
- PlayerInfo plr ;
- bool toggled ;
- private transient Cvar stretchCvar ;
- override void BeginPlay()
- {
- plr = players[consoleplayer] ;
- toggled = false ;
- super.BeginPlay();
- }
- /*
- override void OnDestroy()
- {
- PlayerInfo plr = players[consoleplayer] ;
- if( plr && owner )
- {
- owner.A_SetInventory( "SpriteScaler", 0 );
- }
- super.OnDestroy() ;
- }
- */
- override void DoEffect()
- {
- //let pmobj = PlayerPawn( players[consoleplayer].mo );
- //if( pmobj == null ) return ;
- //PlayerInfo plr = players[consoleplayer] ;
- if( plr && plr.mo && owner )
- {
- if( stretchCvar == null ) { stretchCvar = Cvar.GetCVar( "ve_par_stretch", plr ); }
- if( stretchCvar.GetInt() == 2 )
- {
- if( !toggled )
- {
- if( owner.scale.x == owner.default.scale.x )
- {
- owner.scale.x *= .75 ;
- }
- toggled = true ;
- }
- }
- else if( toggled )
- {
- if( owner.scale.x == owner.default.scale.x * .75 )
- {
- owner.scale.x = owner.default.scale.x ;
- }
- toggled = false ;
- }
- }
- super.doeffect() ;
- }
- }
- class LowDingHandler : StaticEventHandler
- {
- PlayerInfo plr;
- int duration;
- override void PlayerEntered(PlayerEvent e)
- {
- plr = players[e.playernumber];
- if( Cvar.GetCVar("ve_showdisk", plr).GetInt() > 0 ) duration = 140 ;
- else duration = 0 ;
- }
- override void NetworkProcess(ConsoleEvent e)
- {
- if(e.Name == "lower_duration") --duration;
- }
- override void RenderOverlay(RenderEvent e)
- {
- if(plr && duration > 0)
- {
- EventHandler.SendNetworkEvent("lower_duration");
- if(duration % 16 >= 8)
- {
- if(gameinfo.gametype==GAME_Doom)
- {
- string disktype = Cvar.GetCVar("ve_showdisk", plr).GetInt() == 2 ? "STCDROM" : "STDISK";
- TextureID Disk = TexMan.CheckForTexture(disktype, TexMan.Type_Any);
- Screen.DrawTexture(Disk, false, 304, 184, DTA_320x200, true);
- }
- else if(gameinfo.gametype==GAME_Strife)
- {
- TextureID Disk = TexMan.CheckForTexture ("STDISK", TexMan.Type_Any);
- Screen.DrawTexture(Disk, false, 306, 184, DTA_320x200, true);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement