- Added all armor and health items. - Added Grilled Cheese Sandwich and Ghost Artifact. - Started work on Chanceboxes, just need to finish adding the drop lists. - Fixed Ammo division. - Reduced backpack amounts of some ammo types. - Added inventory box/bar to HUD, plus armor and powerup display. - Fix jumps still alerting monsters even if not boosting. - Added "future plans" document.
516 lines
10 KiB
Text
516 lines
10 KiB
Text
// gacha nonsense
|
|
|
|
Class Chancebox : Inventory abstract
|
|
{
|
|
Class<Actor> dropclass;
|
|
|
|
Property DropClass : dropclass;
|
|
|
|
override Inventory CreateCopy( Actor other )
|
|
{
|
|
// additional lore
|
|
SWWMLoreLibrary.Add(other.player,"Lootbox");
|
|
return Super.CreateCopy(other);
|
|
}
|
|
|
|
override bool Use( bool pickup )
|
|
{
|
|
if ( pickup ) return false;
|
|
Vector3 x, y, z;
|
|
[x, y, z] = swwm_CoordUtil.GetAxes(Owner.pitch,Owner.angle,Owner.roll);
|
|
Vector3 origin = level.Vec3Offset(Owner.Vec2OffsetZ(0,0,Owner.player.viewz),x*20-z*8);
|
|
if ( !level.IsPointInLevel(origin) ) return false;
|
|
let b = Spawn(dropclass,origin);
|
|
if ( !b ) return false;
|
|
if ( !b.TestMobjLocation() )
|
|
{
|
|
b.Destroy();
|
|
return false;
|
|
}
|
|
b.angle = Owner.angle-180;
|
|
b.vel = x*10;
|
|
b.vel.z += 2.;
|
|
return true;
|
|
}
|
|
|
|
Default
|
|
{
|
|
+INVENTORY.INVBAR;
|
|
+FLOATBOB;
|
|
Inventory.MaxAmount 32;
|
|
Inventory.InterHubAmount 32;
|
|
FloatBobStrength 0.25;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
// top side of chancebox, shoots upwards
|
|
Class ChanceTop : Actor abstract
|
|
{
|
|
Default
|
|
{
|
|
Radius 16;
|
|
Height 4;
|
|
+MISSILE;
|
|
+THRUACTORS;
|
|
+NOGRAVITY;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
vel = (0,0,20);
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A 1
|
|
{
|
|
double magvel = vel.length();
|
|
if ( magvel > 0. )
|
|
{
|
|
magvel = min(60,magvel*1.2);
|
|
vel = vel.unit()*magvel;
|
|
}
|
|
}
|
|
Wait;
|
|
Death:
|
|
TNT1 A 1 A_SpawnItemEx("ExplodiumBulletImpact");
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
// left/right side of chancebox, shoots forward
|
|
Class ChanceSide : Actor abstract
|
|
{
|
|
Default
|
|
{
|
|
Radius 16;
|
|
Height 32;
|
|
+MISSILE;
|
|
+THRUACTORS;
|
|
+NOGRAVITY;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
vel = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch))*20;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A 1
|
|
{
|
|
double magvel = vel.length();
|
|
if ( magvel > 0. )
|
|
{
|
|
magvel = min(60,magvel*1.2);
|
|
vel = vel.unit()*magvel;
|
|
}
|
|
}
|
|
Wait;
|
|
Death:
|
|
TNT1 A 1 A_SpawnItemEx("ExplodiumBulletImpact");
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class ChanceTopTier1 : ChanceTop {}
|
|
Class ChanceTopTier2 : ChanceTop {}
|
|
Class ChanceTopTier3 : ChanceTop {}
|
|
Class ChanceTopTier4 : ChanceTop {}
|
|
Class ChanceSideTier1 : ChanceSide {}
|
|
Class ChanceSideTier2 : ChanceSide {}
|
|
Class ChanceSideTier3 : ChanceSide {}
|
|
Class ChanceSideTier4 : ChanceSide {}
|
|
|
|
Class DroppedChancebox : Actor abstract
|
|
{
|
|
Class<Actor> topclass, sideclass;
|
|
|
|
Property TopClass : topclass;
|
|
Property SideClass : sideclass;
|
|
|
|
double rang;
|
|
|
|
action void A_DropSomething()
|
|
{
|
|
int num = 0;
|
|
// first pass, count up the max rng number
|
|
for ( DropItem d=GetDropItems(); d; d=d.Next )
|
|
num += d.Probability;
|
|
// second pass, pick the item
|
|
int choice = Random[Chancebox](0,num);
|
|
int num2 = 0;
|
|
for ( DropItem d=GetDropItems(); d; d=d.Next )
|
|
{
|
|
num2 += d.Probability;
|
|
if ( num2 < choice ) continue;
|
|
let thedrop = Spawn(d.Name,pos);
|
|
thedrop.angle = angle;
|
|
break;
|
|
}
|
|
int numpt = Random[ExploS](16,32);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[ExploS](-1,1),FRandom[ExploS](-1,1),FRandom[ExploS](-1,1)).unit()*FRandom[ExploS](.3,8);
|
|
let s = Spawn("SWWMSmoke",Vec3Offset(0,0,16));
|
|
s.vel = pvel;
|
|
s.SetShade(FillColor*Random[ExploS](64,85));
|
|
s.special1 = Random[ExploS](1,4);
|
|
s.alpha *= .4;
|
|
s.scale *= 2.4;
|
|
}
|
|
}
|
|
|
|
action void A_Confetti()
|
|
{
|
|
A_StartSound("chancebox/tada",CHAN_ITEM);
|
|
double ang, pt;
|
|
int numpt = Random[ExploS](64,128);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
ang = FRandom[ExploS](0,360);
|
|
pt = FRandom[ExploS](-90,30);
|
|
let c = Spawn("FancyConfetti",Vec3Offset(0,0,16));
|
|
c.vel = (cos(pt)*cos(ang),cos(pt)*sin(ang),-sin(pt))*FRandom[ExploS](2,8);
|
|
}
|
|
}
|
|
|
|
Default
|
|
{
|
|
Radius 16;
|
|
Height 32;
|
|
Gravity .7;
|
|
+CANNOTPUSH;
|
|
+MOVEWITHSECTOR;
|
|
+BLOCKASPLAYER;
|
|
+ROLLSPRITE;
|
|
}
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A 1 A_JumpIf(pos.z<=floorz,1);
|
|
Wait;
|
|
XZW1 A 35
|
|
{
|
|
A_Stop();
|
|
A_StartSound("chancebox/land",CHAN_BODY);
|
|
rang = angle;
|
|
}
|
|
XZW1 A 0 A_StartSound("chancebox/drumroll",CHAN_WEAPON);
|
|
XZW1 A 1
|
|
{
|
|
angle = rang+FRandom[Chancebox](-5,5);
|
|
pitch = FRandom[Chancebox](-5,5);
|
|
roll = FRandom[Chancebox](-5,5);
|
|
special1++;
|
|
return A_JumpIf(special1>40,"BlowUp");
|
|
}
|
|
Wait;
|
|
BlowUp:
|
|
XZW2 A 1
|
|
{
|
|
A_QuakeEx(2,2,2,9,0,500,"",QF_RELATIVE|QF_SCALEDOWN,falloff:200,rollIntensity:.2);
|
|
A_StartSound("chancebox/explode",CHAN_VOICE);
|
|
angle = rang;
|
|
pitch = roll = 0;
|
|
let t = Spawn(TopClass,Vec3Offset(0,0,32));
|
|
t.angle = angle;
|
|
let s1 = Spawn(SideClass,level.Vec3Offset(pos,(RotateVector((16,0),angle+90),0)));
|
|
s1.angle = angle+90;
|
|
let s2 = Spawn(SideClass,level.Vec3Offset(pos,(RotateVector((16,0),angle-90),0)));
|
|
s2.angle = angle-90;
|
|
A_DropSomething();
|
|
}
|
|
XZW2 BCDEFGHIJKLMNO 1;
|
|
XZW2 P -1 A_Confetti();
|
|
Stop;
|
|
Dummy:
|
|
XZW1 BCDEFG -1; // these won't actually be used, found a better way
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class DroppedChanceboxTier1 : DroppedChancebox
|
|
{
|
|
Default
|
|
{
|
|
DroppedChancebox.TopClass "ChanceTopTier1";
|
|
DroppedChancebox.SideClass "ChanceSideTier1";
|
|
StencilColor "01 01 03";
|
|
DropItem "ChanceDropShells1", 6;
|
|
DropItem "ChanceDropShells2", 6;
|
|
DropItem "ChanceDropShells3", 5;
|
|
DropItem "ChanceDropShells4", 4;
|
|
DropItem "ChanceDropShells5", 3;
|
|
DropItem "ChanceDropShells6", 2;
|
|
}
|
|
}
|
|
Class DroppedChanceboxTier2 : DroppedChancebox
|
|
{
|
|
Default
|
|
{
|
|
DroppedChancebox.TopClass "ChanceTopTier2";
|
|
DroppedChancebox.SideClass "ChanceSideTier2";
|
|
StencilColor "01 03 01";
|
|
}
|
|
}
|
|
Class DroppedChanceboxTier3 : DroppedChancebox
|
|
{
|
|
Default
|
|
{
|
|
DroppedChancebox.TopClass "ChanceTopTier3";
|
|
DroppedChancebox.SideClass "ChanceSideTier3";
|
|
StencilColor "03 01 01";
|
|
}
|
|
}
|
|
Class DroppedChanceboxTier4 : DroppedChancebox
|
|
{
|
|
Default
|
|
{
|
|
DroppedChancebox.TopClass "ChanceTopTier4";
|
|
DroppedChancebox.SideClass "ChanceSideTier4";
|
|
StencilColor "03 03 01";
|
|
}
|
|
}
|
|
|
|
Class ChanceboxTier1 : Chancebox
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_LOOTBOX1";
|
|
Inventory.PickupMessage "$T_LOOTBOX1";
|
|
Inventory.Icon "graphics/HUD/Icons/I_Chancebox1.png";
|
|
Stamina 1000;
|
|
Chancebox.DropClass "DroppedChanceboxTier1";
|
|
}
|
|
}
|
|
Class ChanceboxTier2 : Chancebox
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_LOOTBOX2";
|
|
Inventory.PickupMessage "$T_LOOTBOX2";
|
|
Inventory.Icon "graphics/HUD/Icons/I_Chancebox2.png";
|
|
Stamina 10000;
|
|
Chancebox.DropClass "DroppedChanceboxTier2";
|
|
}
|
|
}
|
|
Class ChanceboxTier3 : Chancebox
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_LOOTBOX3";
|
|
Inventory.PickupMessage "$T_LOOTBOX3";
|
|
Inventory.Icon "graphics/HUD/Icons/I_Chancebox3.png";
|
|
Stamina 100000;
|
|
Chancebox.DropClass "DroppedChanceboxTier3";
|
|
}
|
|
}
|
|
Class ChanceboxTier4 : Chancebox
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_LOOTBOX4";
|
|
Inventory.PickupMessage "$T_LOOTBOX4";
|
|
Inventory.Icon "graphics/HUD/Icons/I_Chancebox4.png";
|
|
Stamina 1000000;
|
|
Chancebox.DropClass "DroppedChanceboxTier4";
|
|
}
|
|
}
|
|
|
|
Class FancyConfetti : Actor
|
|
{
|
|
int deadtimer;
|
|
double anglevel, pitchvel, rollvel;
|
|
|
|
Default
|
|
{
|
|
Radius 2;
|
|
Height 2;
|
|
+NOBLOCKMAP;
|
|
+MISSILE;
|
|
+MOVEWITHSECTOR;
|
|
+THRUACTORS;
|
|
+NOTELEPORT;
|
|
+DONTSPLASH;
|
|
+INTERPOLATEANGLES;
|
|
+ROLLSPRITE;
|
|
+ROLLCENTER;
|
|
Gravity 0.05;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
deadtimer = 0;
|
|
anglevel = FRandom[Junk](3,12)*RandomPick[Junk](-1,1);
|
|
pitchvel = FRandom[Junk](3,12)*RandomPick[Junk](-1,1);
|
|
rollvel = FRandom[Junk](3,12)*RandomPick[Junk](-1,1);
|
|
if ( bAMBUSH ) frame = 0;
|
|
else frame = Random[Junk](0,9);
|
|
scale *= Frandom[Junk](0.8,1.2);
|
|
}
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
if ( isFrozen() ) return;
|
|
vel.xy *= 0.98;
|
|
if ( vel.z > 0 ) vel.z *= 0.98;
|
|
if ( InStateSequence(CurState,ResolveState("Death")) )
|
|
{
|
|
deadtimer++;
|
|
if ( deadtimer > 300 ) A_FadeOut(0.05);
|
|
return;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 # 1
|
|
{
|
|
angle += anglevel;
|
|
pitch += pitchvel;
|
|
roll += rollvel;
|
|
}
|
|
Loop;
|
|
Death:
|
|
XZW1 # -1
|
|
{
|
|
pitch = roll = 0;
|
|
}
|
|
Stop;
|
|
Dummy:
|
|
XZW1 ABCDEFGHIJ -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
// Chancebox drops
|
|
Class ChanceDrop : Actor abstract
|
|
{
|
|
Default
|
|
{
|
|
StencilColor "03 03 03";
|
|
+NOBLOCKMAP;
|
|
+NOGRAVITY;
|
|
}
|
|
action void A_DropTheGoods()
|
|
{
|
|
int num = 0;
|
|
for ( DropItem d=GetDropItems(); d; d=d.Next )
|
|
{
|
|
if ( Random[Chancebox](0,255) > d.Probability ) continue;
|
|
Actor i = Spawn(d.Name,pos);
|
|
i.bDROPPED = true;
|
|
i.bNOGRAVITY = false;
|
|
i.vel.z = FRandom[Chancebox](2,4);
|
|
switch ( num )
|
|
{
|
|
case 0:
|
|
i.vel.xy = (0,0);
|
|
break;
|
|
case 1:
|
|
i.vel.xy = RotateVector((FRandom[Chancebox](3,6),0),angle);
|
|
break;
|
|
case 2:
|
|
i.vel.xy = RotateVector((FRandom[Chancebox](3,6),0),angle+90);
|
|
break;
|
|
case 3:
|
|
i.vel.xy = RotateVector((FRandom[Chancebox](3,6),0),angle-90);
|
|
break;
|
|
case 4:
|
|
i.vel.xy = RotateVector((FRandom[Chancebox](3,6),0),angle+180);
|
|
break;
|
|
default:
|
|
i.vel.xy = RotateVector((FRandom[Chancebox](3,6),0),FRandom[Chancebox](0,360));
|
|
break;
|
|
}
|
|
num++;
|
|
if ( i is 'Inventory' ) Inventory(i).bTOSSED = true;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
TNT1 A 1 NoDelay A_DropTheGoods();
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class ChanceDropShells1 : ChanceDrop
|
|
{
|
|
Default
|
|
{
|
|
DropItem "RedShell2", 256;
|
|
DropItem "RedShell4", 224;
|
|
DropItem "RedShell4", 224;
|
|
DropItem "RedShell8", 192;
|
|
DropItem "RedShell8", 192;
|
|
}
|
|
}
|
|
Class ChanceDropShells2 : ChanceDrop
|
|
{
|
|
Default
|
|
{
|
|
DropItem "GreenShell2", 256;
|
|
DropItem "GreenShell4", 192;
|
|
DropItem "GreenShell4", 192;
|
|
DropItem "GreenShell8", 160;
|
|
DropItem "GreenShell8", 160;
|
|
}
|
|
}
|
|
Class ChanceDropShells3 : ChanceDrop
|
|
{
|
|
Default
|
|
{
|
|
DropItem "BlueShell2", 256;
|
|
DropItem "BlueShell4", 160;
|
|
DropItem "BlueShell4", 160;
|
|
DropItem "BlueShell8", 128;
|
|
DropItem "BlueShell8", 128;
|
|
}
|
|
}
|
|
Class ChanceDropShells4 : ChanceDrop
|
|
{
|
|
Default
|
|
{
|
|
DropItem "PurpleShell2", 256;
|
|
DropItem "PurpleShell2", 128;
|
|
DropItem "PurpleShell2", 128;
|
|
DropItem "PurpleShell4", 96;
|
|
DropItem "PurpleShell4", 96;
|
|
}
|
|
}
|
|
Class ChanceDropShells5 : ChanceDrop
|
|
{
|
|
Default
|
|
{
|
|
DropItem "WhiteShell", 256;
|
|
DropItem "WhiteShell", 128;
|
|
DropItem "WhiteShell", 128;
|
|
DropItem "WhiteShell2", 96;
|
|
DropItem "WhiteShell2", 96;
|
|
}
|
|
}
|
|
Class ChanceDropShells6 : ChanceDrop
|
|
{
|
|
Default
|
|
{
|
|
DropItem "BlackShell", 256;
|
|
DropItem "BlackShell", 64;
|
|
DropItem "BlackShell", 64;
|
|
}
|
|
}
|
|
Class ChanceDropShells7 : ChanceDrop
|
|
{
|
|
Default
|
|
{
|
|
DropItem "GoldShell", 256;
|
|
}
|
|
}
|