181 lines
3.5 KiB
Text
181 lines
3.5 KiB
Text
Class SMiniAmmo : Ammo
|
|
{
|
|
Default
|
|
{
|
|
Inventory.Icon "I_SMini";
|
|
Inventory.Amount 20;
|
|
Inventory.MaxAmount 40;
|
|
Ammo.BackpackAmount 0;
|
|
Ammo.BackpackMaxAmount 80;
|
|
}
|
|
override bool TryPickup( in out Actor toucher )
|
|
{
|
|
if ( !sting_dubious ) return false; // not allowed
|
|
return Super.TryPickup(toucher);
|
|
}
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
if ( sting_dubious ) return;
|
|
if ( Owner ) Owner.RemoveInventory(self);
|
|
Destroy();
|
|
}
|
|
}
|
|
|
|
Class SMiniBlast : Actor
|
|
{
|
|
}
|
|
|
|
Class SMiniGun : UnrealWeapon
|
|
{
|
|
override bool TryPickup( in out Actor toucher )
|
|
{
|
|
if ( !sting_dubious ) return false; // not allowed
|
|
return Super.TryPickup(toucher);
|
|
}
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
if ( sting_dubious ) return;
|
|
if ( !Owner )
|
|
{
|
|
let r = Spawn("BFG9000",pos,ALLOW_REPLACE);
|
|
r.spawnangle = spawnangle;
|
|
r.spawnpoint = spawnpoint;
|
|
r.angle = angle;
|
|
r.pitch = pitch;
|
|
r.roll = roll;
|
|
r.special = special;
|
|
r.args[0] = args[0];
|
|
r.args[1] = args[1];
|
|
r.args[2] = args[2];
|
|
r.args[3] = args[3];
|
|
r.args[4] = args[4];
|
|
r.ChangeTid(tid);
|
|
r.SpawnFlags = SpawnFlags&~MTF_SECRET;
|
|
r.HandleSpawnFlags();
|
|
r.SpawnFlags = SpawnFlags;
|
|
r.bCountSecret = SpawnFlags&MTF_SECRET;
|
|
r.vel = vel;
|
|
r.master = master;
|
|
r.target = target;
|
|
r.tracer = tracer;
|
|
r.bDropped = bDropped;
|
|
Destroy();
|
|
}
|
|
else
|
|
{
|
|
Owner.RemoveInventory(self);
|
|
Destroy();
|
|
}
|
|
}
|
|
action void A_SMiniFire( bool bAlt = false )
|
|
{
|
|
if ( bAlt ) invoker.special1 = 0;
|
|
else
|
|
{
|
|
State which = ResolveState("FireOne");
|
|
if ( invoker.special1 == 1 ) which = ResolveState("FireTwo");
|
|
else if ( invoker.special1 == 2 ) which = ResolveState("FireThree");
|
|
else if ( invoker.special1 == 3 ) which = ResolveState("FireFour");
|
|
player.SetPSprite(PSP_WEAPON,which);
|
|
invoker.special1 = (invoker.special1%4)+1;
|
|
}
|
|
A_PlaySound(bAlt?"smini/altfire":"smini/fire",CHAN_WEAPON);
|
|
// TODO everything
|
|
}
|
|
action void A_Cooldown()
|
|
{
|
|
// TODO steam effect
|
|
invoker.special2--;
|
|
if ( invoker.special2 <= 0 )
|
|
player.SetPSprite(PSP_WEAPON,ResolveState("Idle"));
|
|
}
|
|
Default
|
|
{
|
|
Tag "$T_SMINI";
|
|
Inventory.PickupMessage "$I_SMINI";
|
|
Weapon.UpSound "smini/select";
|
|
Weapon.SlotNumber 0;
|
|
Weapon.SelectionOrder 1;
|
|
Weapon.SlotPriority 0.9;
|
|
Weapon.AmmoType "SMiniAmmo";
|
|
Weapon.AmmoUse 1;
|
|
Weapon.AmmoType2 "SMiniAmmo";
|
|
Weapon.AmmoUse2 4;
|
|
Weapon.AmmoGive 20;
|
|
Inventory.RespawnTics 2100;
|
|
+INVENTORY.IGNORESKILL;
|
|
+WEAPON.NOAUTOFIRE;
|
|
UTWeapon.DropAmmo 4;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
SMIP A -1;
|
|
Stop;
|
|
SMIP B -1;
|
|
Stop;
|
|
Select:
|
|
SMIS A 1 A_Raise(int.max);
|
|
Wait;
|
|
Ready:
|
|
SMIS ABCDEFGHI 2 A_WeaponReady(WRF_NOFIRE);
|
|
Goto Idle;
|
|
Dummy:
|
|
TNT1 A 1
|
|
{
|
|
A_CheckReload();
|
|
A_WeaponReady();
|
|
}
|
|
Wait;
|
|
Idle:
|
|
SMII A 0 A_Overlay(-9999,"Dummy");
|
|
SMII ABCDE 20;
|
|
Goto Idle+1;
|
|
Fire:
|
|
SMIF A 0
|
|
{
|
|
A_Overlay(-9999,"Dummy");
|
|
A_SMiniFire(false);
|
|
}
|
|
FireOne:
|
|
SMIF ABCDEF 2;
|
|
SMII A 0 A_Refire("Fire");
|
|
Goto Release;
|
|
FireTwo:
|
|
SMIF GHIJKL 2;
|
|
SMII A 0 A_Refire("Fire");
|
|
Goto Release;
|
|
FireThree:
|
|
SMIF MNOPQR 2;
|
|
SMII A 0 A_Refire("Fire");
|
|
Goto Release;
|
|
FireFour:
|
|
SMIF STUVWX 2;
|
|
SMII A 0 A_Refire("Fire");
|
|
Goto Release;
|
|
AltFire:
|
|
SMIA A 0
|
|
{
|
|
A_Overlay(-9999,"Dummy");
|
|
A_SMiniFire(true);
|
|
}
|
|
SMIA ABCDEFGHIJ 3;
|
|
SMII A 0 A_Refire("AltFire");
|
|
Goto Release;
|
|
Release:
|
|
SMII A 0
|
|
{
|
|
A_PlaySound("smini/endfire",CHAN_ITEM);
|
|
invoker.special2 = 25;
|
|
}
|
|
SMII A 1 A_Cooldown();
|
|
Wait;
|
|
Deselect:
|
|
#### # 1 A_Overlay(-9999,"Null");
|
|
SMID ABCDEF 1;
|
|
SMID F 1 A_Lower(int.max);
|
|
Wait;
|
|
}
|
|
}
|