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 Show remaining batteries as ammo
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
- 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
- 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;
Console.printf("battery used, now: %d", charges);
if(charges <= 0) {
charges = 0;
DespawnToBattery();
}
@ -186,6 +187,8 @@ class JumperCablesDeployed : HDUPK
void SpawnSpark()
{
float sparkSpeed = 5.0;
float sparkOffset = 2.0;
A_StartSound("misc/arccrackle", CHAN_AUTO);
A_SpawnParticle(
"white",
@ -194,13 +197,13 @@ class JumperCablesDeployed : HDUPK
frandom(1, 7), // size
0, // angle
// offset...
frandom(-1.0, 1.0),
frandom(-1.0, 1.0),
frandom(-1.0, 1.0),
frandom(-sparkOffset, sparkOffset),
frandom(-sparkOffset, sparkOffset),
frandom(-sparkOffset, sparkOffset),
// vel...
frandom(-1.0, 1.0),
frandom(-1.0, 1.0),
frandom(-1.0, 1.0));
frandom(-sparkSpeed, sparkSpeed),
frandom(-sparkSpeed, sparkSpeed),
frandom(-sparkSpeed, sparkSpeed));
}
override void Tick()
@ -208,7 +211,6 @@ class JumperCablesDeployed : HDUPK
if(frandom(0.0, 1.0) < 0.02) {
SpawnSpark();
}
}
// TODO: Tick function (or whatever) where we set the sprite to indicate the charge level.
@ -484,23 +486,32 @@ class JumperCablesUsable : HDWeapon
int batteryCharges = batteryAmmo.TakeMag(true);
Console.printf("batteryCharges: %d", batteryCharges);
JumperCablesDeployed deployed = JumperCablesDeployed(
Spawn(
"JumperCablesDeployed",
linetraceData.hitLocation - linetraceData.hitDir * 4));
if(batteryCharges < 1) {
deployed.lineDefIndex = brokenLine.index();
deployed.bNoGravity = true;
deployed.charges = batteryCharges;
// Handle getting an empty battery. Just give it back.
invoker.owner.A_Log("No charged batteries available to use.");
batteryAmmo.AddAMag(batteryCharges);
if(linetraceData.hitType == TRACE_HitFloor || linetraceData.hitType == TRACE_HitCeiling) {
deployed.SetFlatSprite(invoker.owner.angle);
} else {
Vector2 lineDir = linetraceData.hitLine.v2.p - linetraceData.hitLine.v1.p;
deployed.SetWallSprite(lineDir);
}
brokenLine.special = originalSpecial;
JumperCablesDeployed deployed = JumperCablesDeployed(
Spawn(
"JumperCablesDeployed",
linetraceData.hitLocation - linetraceData.hitDir * 4));
deployed.lineDefIndex = brokenLine.index();
deployed.bNoGravity = true;
deployed.charges = batteryCharges;
if(linetraceData.hitType == TRACE_HitFloor || linetraceData.hitType == TRACE_HitCeiling) {
deployed.SetFlatSprite(invoker.owner.angle);
} else {
Vector2 lineDir = linetraceData.hitLine.v2.p - linetraceData.hitLine.v1.p;
deployed.SetWallSprite(lineDir);
}
brokenLine.special = originalSpecial;
}
}
}
}
@ -521,5 +532,9 @@ class JumperCablesUsable : HDWeapon
}
}
override String GetHelpText()
{
return WEPHELP_FIRE.." Deploy\n";
}
}