about to break stuff.

This commit is contained in:
Kiri 2023-08-27 16:55:47 -07:00
parent 0008313dd7
commit 2175871ada
10 changed files with 62 additions and 4 deletions

Binary file not shown.

2
sndinfo.txt Normal file
View File

@ -0,0 +1,2 @@
kiri/gretchencounter_click "sounds/kirigretchencounter_click.ogg"
kiri/gretchencounter_blip "sounds/kirigretchencounter_blip.ogg"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
sprites/kgcma0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
sprites/kgcna0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -25,6 +25,9 @@ class GretchenCounter : HDWeapon
}
float lastReading;
float angularVelocity;
float needlePosition;
int framesSinceLastBeep;
override double WeaponBulk()
{
@ -47,16 +50,22 @@ class GretchenCounter : HDWeapon
SARG F -1;
stop;
// Needle overlay states.
needle_indicator:
KGCN A 1; wait;
select0:
SARG F 1;
KGCM A 1;
goto select0big;
deselect0:
SARG F 1;
KGCM A 1;
goto deselect0big;
ready:
SARG F 1 {
KGCM A 1 {
A_Overlay(355, "needle_indicator");
A_OverlayPivotAlign(355, PSPA_CENTER, PSPA_BOTTOM);
UpdateDisplay();
A_WeaponReady(WRF_NOFIRE | WRF_ALLOWUSER3); // USER3 = MagManager.
}
@ -94,8 +103,18 @@ class GretchenCounter : HDWeapon
return totalReading;
}
// override void Tick()
// {
// super.Tick();
// UpdateDisplay();
// }
action void UpdateDisplay()
{
float angle_min = -45.0;
float angle_max = 45.0;
// console.printf("kjsdcsjkdcnsdjkcnsdkjcnsdc");
// ThinkerIterator iter = ThinkerIterator.Create("BFGNecroShard");
@ -124,9 +143,20 @@ class GretchenCounter : HDWeapon
GetReadingForType("BFGNecroShard", 1.0) +
GetReadingForType("HDBarrel", 2.0);
invoker.lastReading = totalReading * 0.01 + invoker.lastReading * 0.99;
// invoker.lastReading = totalReading * 0.01 + invoker.lastReading * 0.99;
float pct_reading = invoker.lastReading * 2000.0;
invoker.lastReading = totalReading;
float r = frandom(0.0, 1.0);
if(r < pct_reading)
{
console.printf("test: %f %f", r, pct_reading);
A_StartSound("kiri/gretchencounter_click");
}
// if(pct_reading > 1.0) {
// pct_reading = 1.0;
// }
@ -142,7 +172,33 @@ class GretchenCounter : HDWeapon
}
}
// if(pct_reading > 1.0) {
// pct_reading = 1.0;
// }
// A_OverlayRotate(355,
// angle_min + (angle_max - angle_min) * (1.0 - pct_reading));
invoker.angularvelocity += pct_reading - invoker.needlePosition;
invoker.angularvelocity *= 0.97;
bool wasNeedleAtMax = (invoker.needlePosition >= 0.9);
invoker.needlePosition += invoker.angularvelocity * 0.1;
invoker.needlePosition = clamp(invoker.needlePosition, 0.0, 1.0);
A_OverlayRotate(355,
angle_min + (angle_max - angle_min) * (1.0 - invoker.needlePosition));
console.printf("Ang vel %f", invoker.angularvelocity);
console.printf("Shard count: [%s] %f", meter_str, pct_reading);
invoker.framesSinceLastBeep++;
if((!wasNeedleAtMax || invoker.framesSinceLastBeep > 15) && invoker.needlePosition >= 0.9) {
A_StartSound("kiri/gretchencounter_blip");
invoker.framesSinceLastBeep = 0;
}
}
}