flak_m/zscript/utcommon.zsc
Marisa Kirisame 5248ac8fd6 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.
2018-05-20 02:10:30 +02:00

209 lines
No EOL
3.5 KiB
Text

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();
if ( !Owner || !Owner.player || (Owner.player.ReadyWeapon != self) ) return;
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";
Weapon.BobSpeed 1.5;
Weapon.BobRangeX 0.2;
Weapon.BobRangeY 0.4;
+WEAPON.NOALERT;
}
}
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;
ui void StartMenu()
{
if ( gamestate != GS_TITLELEVEL ) return;
if ( CVar.GetCVar('flak_protomenu',players[consoleplayer]).GetBool() )
{
S_ChangeMusic("xyzdMenu");
tex = TexMan.CheckForTexture("protobg",TexMan.Type_Any);
}
else
{
S_ChangeMusic("utmenu23");
tex = TexMan.CheckForTexture("finalbg",TexMan.Type_Any);
}
}
override void ConsoleProcess( ConsoleEvent e )
{
if ( e.Name ~== "refreshmenu" ) StartMenu();
}
override void PostUiTick()
{
if ( gametic <= 0 ) StartMenu();
}
override void RenderOverlay( RenderEvent e )
{
if ( gamestate != GS_TITLELEVEL ) return;
if ( tex.IsNull() || !tex.IsValid() ) return;
Screen.Dim("Black",1.0,0,0,Screen.GetWidth(),Screen.GetHeight());
Screen.DrawTexture(tex,true,0,0,DTA_VirtualWidth,1024,DTA_VirtualHeight,768);
}
}