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.
522 lines
12 KiB
Text
522 lines
12 KiB
Text
Class WeaponPowerUp : Inventory
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_WPOWERUP";
|
|
Inventory.PickupMessage "$I_WPOWERUP";
|
|
Inventory.PickupSound "misc/p_pkup";
|
|
+COUNTITEM;
|
|
+INVENTORY.BIGPOWERUP;
|
|
}
|
|
override bool TryPickup( in out Actor toucher )
|
|
{
|
|
if ( !toucher.FindInventory("DispersionPistol") ) return false;
|
|
let damo = DispersionAmmo(toucher.FindInventory("DispersionAmmo"));
|
|
if ( damo )
|
|
{
|
|
damo.BackpackMaxAmount = damo.MaxAmount = min(90,damo.MaxAmount+10);
|
|
damo.Amount = min(damo.MaxAmount,damo.Amount+10);
|
|
}
|
|
let dpis = DispersionPistol(toucher.FindInventory("DispersionPistol"));
|
|
if ( dpis && (dpis.upgradelevel < 4) )
|
|
{
|
|
if ( toucher.player && (toucher.player.ReadyWeapon == dpis) && (toucher.player.PendingWeapon == WP_NOCHANGE) )
|
|
{
|
|
dpis.upgradelevel++;
|
|
let psp = toucher.player.FindPSprite(PSP_Weapon);
|
|
psp.SetState(dpis.FindState("Upgrade"));
|
|
}
|
|
else
|
|
{
|
|
dpis.pendingupgrade = true;
|
|
ScriptUtil.SetWeapon(toucher,"DispersionPistol");
|
|
}
|
|
}
|
|
GoAwayAndDie();
|
|
return true;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
tracer = Spawn("WeaponPowerUpX",pos);
|
|
tracer.angle = angle;
|
|
tracer.target = self;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
WPOW A -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class WeaponPowerUpX : ASMDAmmoX
|
|
{
|
|
States
|
|
{
|
|
Spawn:
|
|
WPOW ABCDEFGHIJKLMNOPQRST 3 Bright;
|
|
Loop;
|
|
}
|
|
}
|
|
|
|
Class DispersionAmmo : Ammo
|
|
{
|
|
double rechargephase, rechargespeed;
|
|
|
|
Default
|
|
{
|
|
Inventory.Icon "I_Disper";
|
|
Inventory.Amount 10;
|
|
Inventory.MaxAmount 50;
|
|
Ammo.BackpackAmount 0;
|
|
Ammo.BackpackMaxAmount 50;
|
|
}
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
if ( !Owner ) return;
|
|
if ( Amount < 10 ) rechargespeed = 1.1;
|
|
else rechargespeed = 0.11*Amount;
|
|
rechargephase += 1./rechargespeed;
|
|
if ( rechargephase < 35 ) return;
|
|
rechargephase = 0;
|
|
Amount = min(Amount+1,MaxAmount);
|
|
}
|
|
}
|
|
|
|
Class DispLight1 : EnforcerLight
|
|
{
|
|
Default
|
|
{
|
|
args 96,64,255,80;
|
|
}
|
|
}
|
|
Class DispLight2 : EnforcerLight
|
|
{
|
|
Default
|
|
{
|
|
args 64,255,96,80;
|
|
}
|
|
}
|
|
Class DispLight3 : EnforcerLight
|
|
{
|
|
Default
|
|
{
|
|
args 255,255,96,80;
|
|
}
|
|
}
|
|
Class DispLight4 : EnforcerLight
|
|
{
|
|
Default
|
|
{
|
|
args 255,160,64,80;
|
|
}
|
|
}
|
|
Class DispLight5 : EnforcerLight
|
|
{
|
|
Default
|
|
{
|
|
args 255,96,64,80;
|
|
}
|
|
}
|
|
|
|
Class DispersionPistol : UnrealWeapon
|
|
{
|
|
int upgradelevel;
|
|
bool pendingupgrade;
|
|
double chargesize, count;
|
|
bool bCharging;
|
|
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
if ( sting_dpistol ) AmmoUse2 = 1;
|
|
else AmmoUse2 = AmmoUse1/2;
|
|
}
|
|
action void A_DispFire()
|
|
{
|
|
Weapon weap = Weapon(invoker);
|
|
if ( !weap ) return;
|
|
if ( weap.Ammo1.Amount <= 0 ) return;
|
|
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
|
|
DispersionAmmo(weap.Ammo1).rechargephase = 0;
|
|
A_PlaySound("dpistol/fire",CHAN_WEAPON,Dampener.Active(self)?.4:1.,pitch:1.2);
|
|
double mult = Amplifier.GetMult(self,80);
|
|
invoker.FireEffect();
|
|
switch ( invoker.upgradelevel )
|
|
{
|
|
case 0:
|
|
UTMainHandler.DoFlash(self,Color(80,96,64,255),1);
|
|
A_Overlay(PSP_FLASH,"Flash1");
|
|
break;
|
|
case 1:
|
|
UTMainHandler.DoFlash(self,Color(80,64,255,96),1);
|
|
A_Overlay(PSP_FLASH,"Flash2");
|
|
break;
|
|
case 2:
|
|
UTMainHandler.DoFlash(self,Color(80,255,255,96),1);
|
|
A_Overlay(PSP_FLASH,"Flash3");
|
|
break;
|
|
case 3:
|
|
UTMainHandler.DoFlash(self,Color(80,255,160,64),1);
|
|
A_Overlay(PSP_FLASH,"Flash4");
|
|
break;
|
|
default:
|
|
UTMainHandler.DoFlash(self,Color(80,255,96,64),1);
|
|
A_Overlay(PSP_FLASH,"Flash5");
|
|
break;
|
|
}
|
|
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
|
|
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
|
|
UTMainHandler.DoSwing(self,(FRandom[DPistol](-0.1,-0.3),FRandom[DPistol](-0.1,0.3)),2,-0.3,3,SWING_Spring,0,3);
|
|
if ( !Dampener.Active(self) ) A_AlertMonsters();
|
|
A_QuakeEx(2,2,2,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
|
|
}
|
|
action void A_DispAltFire()
|
|
{
|
|
Weapon weap = Weapon(invoker);
|
|
if ( !weap ) return;
|
|
A_WeaponOffset(0,32);
|
|
invoker.bCharging = false;
|
|
if ( self is 'UTPlayer' )
|
|
UTPlayer(self).PlayAttacking();
|
|
DispersionAmmo(weap.Ammo1).rechargephase = 0;
|
|
A_PlaySound("dpistol/fire",CHAN_WEAPON,Dampener.Active(self)?.4:1.);
|
|
double mult = Amplifier.GetMult(self,int(invoker.ChargeSize*50)+50);
|
|
invoker.FireEffect();
|
|
int ulevel = sting_dpistol?0:invoker.upgradelevel;
|
|
switch ( ulevel )
|
|
{
|
|
case 0:
|
|
UTMainHandler.DoFlash(self,Color(80,96,64,255),1);
|
|
A_Overlay(PSP_FLASH,"Flash1");
|
|
break;
|
|
case 1:
|
|
UTMainHandler.DoFlash(self,Color(80,64,255,96),1);
|
|
A_Overlay(PSP_FLASH,"Flash2");
|
|
break;
|
|
case 2:
|
|
UTMainHandler.DoFlash(self,Color(80,255,255,96),1);
|
|
A_Overlay(PSP_FLASH,"Flash3");
|
|
break;
|
|
case 3:
|
|
UTMainHandler.DoFlash(self,Color(80,255,160,64),1);
|
|
A_Overlay(PSP_FLASH,"Flash4");
|
|
break;
|
|
default:
|
|
UTMainHandler.DoFlash(self,Color(80,255,96,64),1);
|
|
A_Overlay(PSP_FLASH,"Flash5");
|
|
break;
|
|
}
|
|
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
|
|
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
|
|
double ss = 0.5+invoker.chargesize*0.3;
|
|
UTMainHandler.DoSwing(self,(FRandom[DPistol](-0.1,-0.3)*ss,FRandom[DPistol](-0.1,0.3))*ss,2,-0.3,3,SWING_Spring,0,3);
|
|
if ( !Dampener.Active(self) ) A_AlertMonsters();
|
|
int qs = int(1+invoker.chargesize*0.3);
|
|
A_QuakeEx(qs,qs,qs,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
|
|
}
|
|
action bool A_DispCharge()
|
|
{
|
|
Weapon weap = Weapon(invoker);
|
|
if ( !weap ) return false;
|
|
DispersionAmmo(weap.Ammo1).rechargephase = 0;
|
|
UTMainHandler.DoSwing(self,(FRandom[DPistol](-1,1),FRandom[DPistol](-1,1)),0.02*invoker.chargesize,0,2,SWING_Spring);
|
|
A_WeaponOffset(FRandom[DPistol](-1,1)*1.2*invoker.chargesize,32+FRandom[DPistol](-1,1)*1.2*invoker.chargesize);
|
|
if ( !Dampener.Active(self) ) A_AlertMonsters();
|
|
invoker.chargesize += (2.-invoker.upgradelevel*0.15)/35.;
|
|
invoker.count += 1./35.;
|
|
if ( invoker.count < 0.3 ) return false;
|
|
invoker.count = 0;
|
|
weap.DepleteAmmo(weap.bAltFire,true,1);
|
|
if ( (weap.Ammo1.Amount <= 0) || (invoker.chargesize >= 5.) )
|
|
return true;
|
|
return false;
|
|
}
|
|
override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount )
|
|
{
|
|
if ( bCharging ) return true;
|
|
return Super.CheckAmmo(fireMode,autoSwitch,requireAmmo,ammocount);
|
|
}
|
|
Default
|
|
{
|
|
Tag "$T_DPISTOL";
|
|
Inventory.PickupMessage "$I_DPISTOL";
|
|
Weapon.UpSound "dpistol/select";
|
|
Weapon.SlotNumber 1;
|
|
Weapon.SelectionOrder 1;
|
|
Weapon.AmmoType "DispersionAmmo";
|
|
Weapon.AmmoUse 1;
|
|
Weapon.AmmoType2 "DispersionAmmo";
|
|
Weapon.AmmoUse2 1;
|
|
Weapon.AmmoGive 50;
|
|
UTWeapon.DropAmmo 25;
|
|
+WEAPON.WIMPY_WEAPON;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
DPIP A -1;
|
|
Stop;
|
|
DPIP B -1;
|
|
Stop;
|
|
Ready:
|
|
DPS1 A 0
|
|
{
|
|
if ( invoker.upgradelevel == 0 ) return ResolveState("Ready1");
|
|
else if ( invoker.upgradelevel == 1 ) return ResolveState("Ready2");
|
|
else if ( invoker.upgradelevel == 2 ) return ResolveState("Ready3");
|
|
else if ( invoker.upgradelevel == 3 ) return ResolveState("Ready4");
|
|
return ResolveState("Ready5");
|
|
}
|
|
Ready1:
|
|
DPS1 ABCDEFGHIJK 2;
|
|
DPI1 A 5;
|
|
Goto Idle;
|
|
Ready2:
|
|
DPS2 ABCDEFGHIJK 2;
|
|
DPI2 A 5;
|
|
Goto Idle;
|
|
Ready3:
|
|
DPS3 ABCDEFGHIJK 2;
|
|
DPI3 A 5;
|
|
Goto Idle;
|
|
Ready4:
|
|
DPS4 ABCDEFGHIJK 2;
|
|
DPI4 A 5;
|
|
Goto Idle;
|
|
Ready5:
|
|
DPS5 ABCDEFGHIJK 2;
|
|
DPI5 A 5;
|
|
Goto Idle;
|
|
Dummy:
|
|
TNT1 A 1
|
|
{
|
|
A_CheckReload();
|
|
A_WeaponReady();
|
|
}
|
|
Wait;
|
|
Idle:
|
|
#### # 0
|
|
{
|
|
if ( invoker.pendingupgrade )
|
|
{
|
|
invoker.pendingupgrade = false;
|
|
invoker.upgradelevel++;
|
|
return ResolveState("Upgrade");
|
|
}
|
|
A_Overlay(-9999,"Dummy");
|
|
if ( invoker.upgradelevel == 0 ) return ResolveState("Idle1");
|
|
else if ( invoker.upgradelevel == 1 ) return ResolveState("Idle2");
|
|
else if ( invoker.upgradelevel == 2 ) return ResolveState("Idle3");
|
|
else if ( invoker.upgradelevel == 3 ) return ResolveState("Idle4");
|
|
return ResolveState("Idle5");
|
|
}
|
|
Idle1:
|
|
DPI1 AB 30;
|
|
Goto Idle1;
|
|
Idle2:
|
|
DPI2 AB 30;
|
|
Goto Idle2;
|
|
Idle3:
|
|
DPI3 AB 30;
|
|
Goto Idle3;
|
|
Idle4:
|
|
DPI4 AB 30;
|
|
Goto Idle4;
|
|
Idle5:
|
|
DPI5 AB 30;
|
|
Goto Idle5;
|
|
Fire:
|
|
#### # 0
|
|
{
|
|
A_Overlay(-9999,"Null");
|
|
if ( invoker.upgradelevel == 0 ) return ResolveState("Fire1");
|
|
else if ( invoker.upgradelevel == 1 ) return ResolveState("Fire2");
|
|
else if ( invoker.upgradelevel == 2 ) return ResolveState("Fire3");
|
|
else if ( invoker.upgradelevel == 3 ) return ResolveState("Fire4");
|
|
return ResolveState("Fire5");
|
|
}
|
|
Fire1:
|
|
#### # 3 A_DispFire();
|
|
DPF1 ABC 5;
|
|
DPI1 A 5 A_Refire("Fire1");
|
|
Goto Idle;
|
|
Fire2:
|
|
#### # 3 A_DispFire();
|
|
DPF2 ABC 5;
|
|
DPI2 A 5 A_Refire("Fire2");
|
|
Goto Idle;
|
|
Fire3:
|
|
#### # 3 A_DispFire();
|
|
DPF3 ABC 5;
|
|
DPI3 A 5 A_Refire("Fire3");
|
|
Goto Idle;
|
|
Fire4:
|
|
#### # 3 A_DispFire();
|
|
DPF4 ABC 5;
|
|
DPI4 A 5 A_Refire("Fire4");
|
|
Goto Idle;
|
|
Fire5:
|
|
#### # 3 A_DispFire();
|
|
DPF5 ABC 5;
|
|
DPI5 A 5 A_Refire("Fire5");
|
|
Goto Idle;
|
|
AltFire:
|
|
#### # 0
|
|
{
|
|
invoker.chargesize = invoker.count = 0.;
|
|
invoker.bCharging = true;
|
|
// need to make sure player does the repeat fire anim
|
|
if ( self is 'UPlayer' )
|
|
UPlayer(self).PlayAttacking();
|
|
A_PlaySound("dpistol/charge",CHAN_WEAPON,Dampener.Active(self)?.4:1.);
|
|
A_Overlay(-9999,"Null");
|
|
if ( invoker.upgradelevel == 0 ) return ResolveState("AltFire1");
|
|
else if ( invoker.upgradelevel == 1 ) return ResolveState("AltFire2");
|
|
else if ( invoker.upgradelevel == 2 ) return ResolveState("AltFire3");
|
|
else if ( invoker.upgradelevel == 3 ) return ResolveState("AltFire4");
|
|
return ResolveState("AltFire5");
|
|
}
|
|
AltFire1:
|
|
#### # 1 A_JumpIf(A_DispCharge(),2);
|
|
#### # 0 A_ReFire("AltFire1");
|
|
AltRelease1:
|
|
#### # 3 A_DispAltFire();
|
|
DPF1 ABC 8;
|
|
DPI1 A 6;
|
|
Goto Idle;
|
|
AltFire2:
|
|
#### # 1 A_JumpIf(A_DispCharge(),2);
|
|
#### # 0 A_ReFire("AltFire2");
|
|
AltRelease2:
|
|
#### # 3 A_DispAltFire();
|
|
DPF2 ABC 8;
|
|
DPI2 A 6;
|
|
Goto Idle;
|
|
AltFire3:
|
|
#### # 1 A_JumpIf(A_DispCharge(),2);
|
|
#### # 0 A_ReFire("AltFire3");
|
|
AltRelease3:
|
|
#### # 3 A_DispAltFire();
|
|
DPF3 ABC 8;
|
|
DPI3 A 6;
|
|
Goto Idle;
|
|
AltFire4:
|
|
#### # 1 A_JumpIf(A_DispCharge(),2);
|
|
#### # 0 A_ReFire("AltFire4");
|
|
AltRelease4:
|
|
#### # 3 A_DispAltFire();
|
|
DPF4 ABC 8;
|
|
DPI4 A 6;
|
|
Goto Idle;
|
|
AltFire5:
|
|
#### # 1 A_JumpIf(A_DispCharge(),2);
|
|
#### # 0 A_ReFire("AltFire5");
|
|
AltRelease5:
|
|
#### # 3 A_DispAltFire();
|
|
DPF5 ABC 8;
|
|
DPI5 A 6;
|
|
Goto Idle;
|
|
Upgrade:
|
|
#### # 0
|
|
{
|
|
A_Overlay(-9999,"Null");
|
|
invoker.AmmoUse1 = min(6,invoker.upgradelevel+1);
|
|
if ( invoker.upgradelevel == 0 ) return ResolveState("Idle");
|
|
else if ( invoker.upgradelevel == 1 ) return ResolveState("Upgrade1");
|
|
else if ( invoker.upgradelevel == 2 ) return ResolveState("Upgrade2");
|
|
else if ( invoker.upgradelevel == 3 ) return ResolveState("Upgrade3");
|
|
return ResolveState("Upgrade4");
|
|
}
|
|
Upgrade1:
|
|
#### # 0 A_PlaySound("dpistol/up1",CHAN_6,Dampener.Active(self)?.2:1.);
|
|
DPU1 ABCD 9;
|
|
DPI2 A 4;
|
|
Goto Idle;
|
|
Upgrade2:
|
|
#### # 0 A_PlaySound("dpistol/up2",CHAN_6,Dampener.Active(self)?.2:1.);
|
|
DPU2 ABCDEFGHI 9;
|
|
DPI3 A 4;
|
|
Goto Idle;
|
|
Upgrade3:
|
|
#### # 0 A_PlaySound("dpistol/up3",CHAN_6,Dampener.Active(self)?.2:1.);
|
|
DPU3 ABCDEFGHI 9;
|
|
DPI4 A 4;
|
|
Goto Idle;
|
|
Upgrade4:
|
|
#### # 0 A_PlaySound("dpistol/up4",CHAN_6,Dampener.Active(self)?.2:1.);
|
|
DPU4 ABCDEFGHI 9;
|
|
DPI5 A 4;
|
|
Goto Idle;
|
|
Select:
|
|
DPS1 A 1 A_Raise(int.max);
|
|
Wait;
|
|
Deselect:
|
|
#### # 0
|
|
{
|
|
A_Overlay(-9999,"Null");
|
|
if ( invoker.upgradelevel == 0 ) return ResolveState("Deselect1");
|
|
else if ( invoker.upgradelevel == 1 ) return ResolveState("Deselect2");
|
|
else if ( invoker.upgradelevel == 2 ) return ResolveState("Deselect3");
|
|
else if ( invoker.upgradelevel == 3 ) return ResolveState("Deselect4");
|
|
return ResolveState("Deselect5");
|
|
}
|
|
Deselect1:
|
|
DPD1 ABCDE 2;
|
|
DPD1 E 1 A_Lower(int.max);
|
|
Wait;
|
|
Deselect2:
|
|
DPD2 ABCDE 2;
|
|
DPD2 E 1 A_Lower(int.max);
|
|
Wait;
|
|
Deselect3:
|
|
DPD3 ABCDE 2;
|
|
DPD3 E 1 A_Lower(int.max);
|
|
Wait;
|
|
Deselect4:
|
|
DPD4 ABCDE 2;
|
|
DPD4 E 1 A_Lower(int.max);
|
|
Wait;
|
|
Deselect5:
|
|
DPD5 ABCDE 2;
|
|
DPD5 E 1 A_Lower(int.max);
|
|
Wait;
|
|
Flash1:
|
|
DPFF A 2 Bright
|
|
{
|
|
let l = Spawn("DispLight1",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
Flash2:
|
|
DPFF B 2 Bright
|
|
{
|
|
let l = Spawn("DispLight2",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
Flash3:
|
|
DPFF C 2 Bright
|
|
{
|
|
let l = Spawn("DispLight3",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
Flash4:
|
|
DPFF D 2 Bright
|
|
{
|
|
let l = Spawn("DispLight4",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
Flash5:
|
|
DPFF E 2 Bright
|
|
{
|
|
let l = Spawn("DispLight5",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
}
|
|
}
|