Working on indicators.

This commit is contained in:
Kiri 2023-08-26 10:22:04 -07:00
parent 5d2d4e6c49
commit 91fa319fe0
15 changed files with 131 additions and 16 deletions

BIN
graphics/jmpr_reticle1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
graphics/jmpr_reticle2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
graphics/jmpr_reticle3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

31
source_data/Makefile Normal file
View File

@ -0,0 +1,31 @@
all : \
../sprites/jmpka0.png \
../sprites/jmpra0.png \
../sprites/jmppa0.png \
../sprites/jmppb0.png \
../sprites/jmppc0.png \
../graphics/jmpr_reticle.png
../sprites/jmpka0.png : kit.aseprite
aseprite -b $^ --save-as $@
../sprites/jmpra0.png : jmpra0.aseprite
aseprite -b $^ --save-as $@
# Base sprite with no numerical indicator, but anim frames (0,1,2) for
# status light.
../sprites/jmppa0.png ../sprites/jmppb0.png ../sprites/jmppc0.png : povsprite.aseprite
aseprite -b $^ \
--ignore-layer "numberindicatorleft" \
--ignore-layer "numberindicatorright" \
--frame-range 0,2 --save-as $@
# Correct Aseprite's automatic naming to Doom's. (Number at the
# end is for rotations, letters are for frame numbers.)
mv ../sprites/jmppa1.png ../sprites/jmppb0.png
mv ../sprites/jmppa2.png ../sprites/jmppc0.png
../graphics/jmpr_reticle.png : jmpr_reticle.aseprite
aseprite -b $^ \
--frame-range 0,2 --save-as $@

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
sprites/jmppa0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
sprites/jmppb0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
sprites/jmppc0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -2,14 +2,17 @@ sprite JMPRA0, 49, 43 {
offset 24, 21
patch JMPRA0,0,0 { }
}
sprite JMPRB0, 49, 43 {
offset 24, 21
patch JMPRA0,0,0 { translation "112:120=160:167" }
}
sprite JMPRC0, 49, 43 {
offset 24, 21
patch JMPRA0,0,0 { translation "112:120=32:47" }
}
sprite JMPRD0, 49, 43 {
offset 24, 21
patch JMPRA0,0,0 { translation "112:120=96:111" }
@ -20,3 +23,20 @@ sprite JMPKA0, 48, 32 {
patch JMPKA0,0,0 { }
}
sprite JMPPA0, 320, 200 {
offset 0, 32
patch JMPPA0,0,0 { }
}
sprite JMPPB0, 320, 200 {
offset 0, 32
patch JMPPB0,0,0 { }
}
sprite JMPPC0, 320, 200 {
offset 0, 32
patch JMPPC0,0,0 { }
}

View File

@ -243,6 +243,8 @@ class JumperCablesDeployed : HDUPK
class JumperCablesUsable : HDWeapon
{
int lastIndicatorStatus;
default
{
+weapon.wimpy_weapon;
@ -277,6 +279,29 @@ class JumperCablesUsable : HDWeapon
return GetSpareWeaponRegular(newowner,reverse,doselect);
}
override void DrawSightPicture(
HDStatusBar statusBar,
HDWeapon weapon,
HDPlayerPawn playerPawn,
bool sightbob,
Vector2 bob,
double fov,
bool scopeview,
Actor hpc,
String whichdot)
{
// int cx,cy,cw,ch;
// [cx,cy,cw,ch]=screen.GetClipRect();
// statusBar.SetClipRect(cx,cy,cw,ch);
String filename = String.Format("graphics/jmpr_reticle%d.png", lastIndicatorStatus + 1);
console.printf("blep, %s %d\n", filename, frame);
statusBar.drawImage(
filename,
(0, 0) + bob,
statusBar.DI_SCREEN_CENTER | statusBar.DI_ITEM_TOP,
scale : (0.5, 0.5));
}
states
{
@ -286,11 +311,11 @@ class JumperCablesUsable : HDWeapon
stop;
select:
TNT1 A 0;
JMPP A 0;
goto super::select;
ready:
TNT1 A 1 {
JMPP # 1 {
if(PressingFire()) {
SetWeaponState("deploy");
}
@ -299,25 +324,38 @@ class JumperCablesUsable : HDWeapon
FLineTraceData linetraceData;
DoLineTrace(HDPlayerPawn(invoker.owner), linetraceData);
Vector3 hitPos;
if(linetraceData.hitType != TRACE_HitNone) {
Vector3 hitPos = linetraceData.hitLocation - Vec3Offset(0, 0, 0);
SpawnParticleForLineTrace(
HDPlayerPawn(invoker.owner),
linetraceData);
hitPos = linetraceData.hitLocation - Vec3Offset(0, 0, 0);
}
SpawnParticleForLineTrace(
HDPlayerPawn(invoker.owner),
linetraceData);
// console.printf("blep, %d\n", frame);
//player.getpsprite(PSP_WEAPON).frame = randompick(0, 1, 2);
// invoker.lastIndicatorStatus += 1;
// invoker.lastIndicatorStatus %= 3;
}
goto readyend;
readyend:
#### # 0 A_ReadyEnd();
#### # 0 A_Jump(256,"ready");
deploy:
TNT1 AA 1;
TNT1 AAAA 1;
TNT1 AAAA 1;
JMPP AA 1;
#### #### 1;
#### #### 1;
TNT1 A 0 A_JumpIf(!pressingfire(),"ready");
TNT1 A 4 A_StartSound("weapons/pismagclick",CHAN_WEAPON);
TNT1 A 2 A_StartSound("derp/crawl",CHAN_WEAPON,CHANF_OVERLAP);
#### # 0 A_JumpIf(!pressingfire(),"ready");
#### # 4 A_StartSound("weapons/pismagclick",CHAN_WEAPON);
#### # 2 A_StartSound("derp/crawl",CHAN_WEAPON,CHANF_OVERLAP);
TNT1 A 1 {
#### # 1 {
// invoker.owner.A_Log("Blep");
A_WeaponReady(WRF_NOFIRE | WRF_ALLOWRELOAD | WRF_ALLOWUSER4);
AttachCables(HDPlayerPawn(invoker.owner));
@ -325,7 +363,7 @@ class JumperCablesUsable : HDWeapon
goto ready;
user3:
#### A 0 A_MagManager("HDBattery");
#### # 0 A_MagManager("HDBattery");
goto ready;
}
@ -348,6 +386,30 @@ class JumperCablesUsable : HDWeapon
if(LineTraceFindbrokenLine(linetraceData)) {
particleColor = "green";
// Found somethine we can fix!
player.getpsprite(PSP_WEAPON).frame = 1;
} else {
if(linetraceData.hitType == TRACE_HitNone) {
// Didn't hit anything (yellow light).
player.getpsprite(PSP_WEAPON).frame = 0;
} else{
// Hit something, but it's not broken (green light).
player.getpsprite(PSP_WEAPON).frame = 2;
}
}
invoker.lastIndicatorStatus = player.getpsprite(PSP_WEAPON).frame;
if(linetraceData.hitType == TRACE_HitNone) {
return;
}
Vector3 hitPos = linetraceData.hitLocation - Vec3Offset(0, 0, 0);
@ -407,8 +469,10 @@ class JumperCablesUsable : HDWeapon
pawn.angle,
48,
pawn.pitch,
flags : TRF_THRUACTORS,
offsetz : pawn.height * 0.8,
flags : TRF_THRUACTORS | TRF_ABSOFFSET,
offsetz : pawn.gunPos.z, // * 0.8,
offsetforward : pawn.gunPos.x,
offsetside : pawn.gunPos.y,
data : linetraceData);
}