Added help text and did some other TODO stuff.
This commit is contained in:
parent
36ce85d5b9
commit
8079c70ebd
7
TODO.md
7
TODO.md
@ -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
|
|
||||||
|
|
||||||
|
|
||||||
|
55
zscript.zs
55
zscript.zs
@ -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,23 +486,32 @@ class JumperCablesUsable : HDWeapon
|
|||||||
int batteryCharges = batteryAmmo.TakeMag(true);
|
int batteryCharges = batteryAmmo.TakeMag(true);
|
||||||
Console.printf("batteryCharges: %d", batteryCharges);
|
Console.printf("batteryCharges: %d", batteryCharges);
|
||||||
|
|
||||||
JumperCablesDeployed deployed = JumperCablesDeployed(
|
if(batteryCharges < 1) {
|
||||||
Spawn(
|
|
||||||
"JumperCablesDeployed",
|
|
||||||
linetraceData.hitLocation - linetraceData.hitDir * 4));
|
|
||||||
|
|
||||||
deployed.lineDefIndex = brokenLine.index();
|
// Handle getting an empty battery. Just give it back.
|
||||||
deployed.bNoGravity = true;
|
invoker.owner.A_Log("No charged batteries available to use.");
|
||||||
deployed.charges = batteryCharges;
|
batteryAmmo.AddAMag(batteryCharges);
|
||||||
|
|
||||||
if(linetraceData.hitType == TRACE_HitFloor || linetraceData.hitType == TRACE_HitCeiling) {
|
|
||||||
deployed.SetFlatSprite(invoker.owner.angle);
|
|
||||||
} else {
|
} 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";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user