Added help text and did some other TODO stuff.

This commit is contained in:
Kiri 2023-03-22 23:36:04 -07:00
parent 36ce85d5b9
commit 8079c70ebd
2 changed files with 40 additions and 22 deletions

View File

@ -10,6 +10,9 @@ x Sparks
x Debris when destroyed x Debris when destroyed
x Show remaining batteries as ammo x Show remaining batteries as ammo
x Switching to mag manager goes to batteries screen x Switching to mag manager goes to batteries screen
x Empty batteries disappear
x Add (or make sure) loadout code in loadout editor
x Help screen
- Pickup sprites for every angle - Pickup sprites for every angle
- Spool of wire, a tool, and some electical tape - Spool of wire, a tool, and some electical tape
@ -17,7 +20,7 @@ x Switching to mag manager goes to batteries screen
- 1st-person sprites - 1st-person sprites
- Wire cutters and electrical tape - Wire cutters and electrical tape
- Help screen
- Add (or make sure) loadout code in loadout editor

View File

@ -140,6 +140,7 @@ class JumperCablesDeployed : HDUPK
charges -= 1; charges -= 1;
Console.printf("battery used, now: %d", charges); Console.printf("battery used, now: %d", charges);
if(charges <= 0) { if(charges <= 0) {
charges = 0;
DespawnToBattery(); DespawnToBattery();
} }
@ -186,6 +187,8 @@ class JumperCablesDeployed : HDUPK
void SpawnSpark() void SpawnSpark()
{ {
float sparkSpeed = 5.0;
float sparkOffset = 2.0;
A_StartSound("misc/arccrackle", CHAN_AUTO); A_StartSound("misc/arccrackle", CHAN_AUTO);
A_SpawnParticle( A_SpawnParticle(
"white", "white",
@ -194,13 +197,13 @@ class JumperCablesDeployed : HDUPK
frandom(1, 7), // size frandom(1, 7), // size
0, // angle 0, // angle
// offset... // offset...
frandom(-1.0, 1.0), frandom(-sparkOffset, sparkOffset),
frandom(-1.0, 1.0), frandom(-sparkOffset, sparkOffset),
frandom(-1.0, 1.0), frandom(-sparkOffset, sparkOffset),
// vel... // vel...
frandom(-1.0, 1.0), frandom(-sparkSpeed, sparkSpeed),
frandom(-1.0, 1.0), frandom(-sparkSpeed, sparkSpeed),
frandom(-1.0, 1.0)); frandom(-sparkSpeed, sparkSpeed));
} }
override void Tick() override void Tick()
@ -208,7 +211,6 @@ class JumperCablesDeployed : HDUPK
if(frandom(0.0, 1.0) < 0.02) { if(frandom(0.0, 1.0) < 0.02) {
SpawnSpark(); SpawnSpark();
} }
} }
// TODO: Tick function (or whatever) where we set the sprite to indicate the charge level. // TODO: Tick function (or whatever) where we set the sprite to indicate the charge level.
@ -484,6 +486,14 @@ class JumperCablesUsable : HDWeapon
int batteryCharges = batteryAmmo.TakeMag(true); int batteryCharges = batteryAmmo.TakeMag(true);
Console.printf("batteryCharges: %d", batteryCharges); Console.printf("batteryCharges: %d", batteryCharges);
if(batteryCharges < 1) {
// Handle getting an empty battery. Just give it back.
invoker.owner.A_Log("No charged batteries available to use.");
batteryAmmo.AddAMag(batteryCharges);
} else {
JumperCablesDeployed deployed = JumperCablesDeployed( JumperCablesDeployed deployed = JumperCablesDeployed(
Spawn( Spawn(
"JumperCablesDeployed", "JumperCablesDeployed",
@ -505,6 +515,7 @@ class JumperCablesUsable : HDWeapon
} }
} }
} }
}
override void DrawHUDStuff(HDStatusBar statusBar, HDWeapon weapon, HDPlayerPawn pawn) override void DrawHUDStuff(HDStatusBar statusBar, HDWeapon weapon, HDPlayerPawn pawn)
{ {
@ -521,5 +532,9 @@ class JumperCablesUsable : HDWeapon
} }
} }
override String GetHelpText()
{
return WEPHELP_FIRE.." Deploy\n";
}
} }