stinger_m/zscript/uflakcannon.zsc
Marisa Kirisame 01249eb43f Oh boy, here comes another big one.
Notable changes since last commit are the full implementation of the automag and asmd.
Also the Translator is now fully functional.
Fonts have been restructured to a neater format.
There have also been other random changes I don't have the time to document in detail.
2019-08-31 03:14:20 +02:00

161 lines
3.6 KiB
Text

Class UFlakBox : Ammo
{
Default
{
Tag "$T_FLAKAMMO";
Inventory.Icon "I_FlakAm";
Inventory.PickupMessage "";
Inventory.Amount 10;
Inventory.MaxAmount 50;
Ammo.BackpackAmount 5;
Ammo.BackpackMaxAmount 100;
Ammo.DropAmount 5;
}
override String PickupMessage()
{
return String.Format("%s%d%s",StringTable.Localize("$I_FLAKAMMOL"),Amount,StringTable.Localize("$I_FLAKAMMOR"));
}
States
{
Spawn:
FAMO A -1;
Stop;
}
}
Class UFlakAmmo : UFlakBox
{
Default
{
Tag "$T_FLAKAMMO2";
Inventory.Icon "I_FlakAm";
Inventory.PickupMessage "$I_FLAKAMMO2";
Inventory.Amount 1;
Ammo.DropAmount 1;
+INVENTORY.IGNORESKILL;
}
States
{
Spawn:
FAMO B -1;
Stop;
}
}
Class UFlakCannon : UnrealWeapon
{
action void A_Loading( bool first = false )
{
if ( first ) A_PlaySound("flak/load",CHAN_WEAPON,Dampener.Active(self)?.1:1.);
else A_PlaySound("flak/reload",CHAN_6,Dampener.Active(self)?.06:.6);
}
action void A_FireChunks()
{
Weapon weap = Weapon(invoker);
if ( !weap ) return;
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("flak/fire",CHAN_WEAPON,Dampener.Active(self)?.2:1.);
A_Overlay(PSP_FLASH,"Flash");
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
invoker.FireEffect();
UTMainHandler.DoFlash(self,Color(48,255,96,0),1);
UTMainHandler.DoSwing(self,(FRandom[Flak](-0.3,-0.8),FRandom[Flak](-0.5,0.5)),4,-1.5,2,SWING_Spring,2,2);
if ( !Dampener.Active(self) ) A_AlertMonsters();
A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05);
}
action void A_FireSlug()
{
Weapon weap = Weapon(invoker);
if ( !weap ) return;
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("flak/altfire",CHAN_WEAPON,Dampener.Active(self)?.2:1.);
A_Overlay(PSP_FLASH,"Flash");
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
invoker.FireEffect();
UTMainHandler.DoFlash(self,Color(32,255,96,0),1);
UTMainHandler.DoSwing(self,(FRandom[Flak](-0.4,-0.8),FRandom[Flak](0.4,0.8)),4,-1,3,SWING_Spring,3,5);
if ( !Dampener.Active(self) ) A_AlertMonsters();
A_QuakeEx(2,2,2,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
}
Default
{
Tag "$T_FLAKCANNON";
Inventory.PickupMessage "$I_FLAKCANNON";
Weapon.UpSound "flak/select";
Weapon.SlotNumber 6;
Weapon.SelectionOrder 4;
Weapon.AmmoType "UFlakBox";
Weapon.AmmoUse 1;
Weapon.AmmoType2 "UFlakBox";
Weapon.AmmoUse2 1;
Weapon.AmmoGive 10;
UTWeapon.DropAmmo 5;
}
States
{
Spawn:
FPCK A -1;
Stop;
FPCK B -1;
Stop;
Select:
FLKS A 1 A_Raise(int.max);
Wait;
Ready:
FLKS ABCDFGHIKLMNPQRSUVWXZ 1 A_WeaponReady(WRF_NOFIRE);
FLS2 ABC 1 A_WeaponReady(WRF_NOFIRE);
FLKL A 1 A_Loading(true);
FLKL BCEFGIJKMNO 1;
Goto Idle;
Loading:
FLKL A 1
{
A_CheckReload();
if ( invoker.Ammo1.Amount > 0 ) A_Loading();
}
FLKL BCEFGIJKMNO 1;
Goto Idle;
Idle:
FLKI A 1 A_WeaponReady();
Wait;
Fire:
FLKF A 1 A_FireChunks();
FLKF BCDEFGHI 1;
FLKF J 5;
FLKE A 1 A_PlaySound("flak/click",CHAN_6,Dampener.Active(self)?.05:.5);
FLKE BCDEFGHIJKLMN 1;
FLKE S 4;
Goto Loading;
AltFire:
FLKA A 1 A_FireSlug();
FLKA BCDEFGHIJK 1;
FLKA K 10;
Goto Loading;
Deselect:
FLKD A 0 A_JumpIfNoAmmo("Deselect2");
FLKD ABCDEF 1;
FLKD F 1 A_Lower(int.max);
Wait;
Deselect2:
FLD2 ABCDEF 1;
FLD2 F 1 A_Lower(int.max);
Wait;
Flash:
FMUZ A 3 Bright
{
let l = Spawn("FlakLight",pos);
l.target = self;
}
Stop;
/*Flash:
FLFF ABCDEFGHIJ 1 Bright;
Stop;
AltFlash:
FLFA ABCDEF 1 Bright;
Stop;*/
}
}