Compare commits

..

No commits in common. "c453013abf77405ad8dfcfc1e33211ec5ac8e0e6" and "b750dd6663f249dd412ae6459abaea68beafe838" have entirely different histories.

5 changed files with 56 additions and 105 deletions

View File

@ -1,25 +1,20 @@
stretcher KiriInstantFade fader KiriInstantFade
{ {
// You don't need this anymore! It's just here because a bunch of DecayStart 60.0
// sprays were already made that use it! DecayTime 0.0
// These numbers are designed to do nothing, and wait a long time
// before doing it. It's a no-op.
GoalX 1.0
GoalY 1.0
StretchStart 9999999.0
StretchTime 9999999.0
} }
decal KiriTestDecal decal KiriTestDecal
{ {
pic KSPYA0 pic KSPYA0
animator KiriInstantFade
randomflipx randomflipx
} }
decal SnekSpray_TransPride decal SnekSpray_TransPride
{ {
pic KSPYA0 pic KSPYA0
animator KiriInstantFade
randomflipx randomflipx
translucent 0.8 translucent 0.8
} }
@ -27,6 +22,7 @@ decal SnekSpray_TransPride
decal SnekSpray_LesbianPride decal SnekSpray_LesbianPride
{ {
pic KSPYB0 pic KSPYB0
animator KiriInstantFade
randomflipx randomflipx
translucent 0.8 translucent 0.8
} }
@ -34,6 +30,7 @@ decal SnekSpray_LesbianPride
decal SnekSpray_NBPride decal SnekSpray_NBPride
{ {
pic KSPYC0 pic KSPYC0
animator KiriInstantFade
randomflipx randomflipx
translucent 0.8 translucent 0.8
} }
@ -41,6 +38,7 @@ decal SnekSpray_NBPride
decal SnekSpray_AcePride decal SnekSpray_AcePride
{ {
pic KSPYD0 pic KSPYD0
animator KiriInstantFade
randomflipx randomflipx
translucent 0.8 translucent 0.8
} }
@ -48,29 +46,34 @@ decal SnekSpray_AcePride
decal SnekSpray_ProgressPride decal SnekSpray_ProgressPride
{ {
pic KSPYE0 pic KSPYE0
animator KiriInstantFade
translucent 0.8 translucent 0.8
} }
decal SnekSpray_DemiPride decal SnekSpray_DemiPride
{ {
pic KSPYF0 pic KSPYF0
animator KiriInstantFade
translucent 0.8 translucent 0.8
} }
decal SnekSpray_PanPride decal SnekSpray_PanPride
{ {
pic KSPYG0 pic KSPYG0
animator KiriInstantFade
translucent 0.8 translucent 0.8
} }
decal SnekSpray_SwitchPride decal SnekSpray_SwitchPride
{ {
pic KSPYH0 pic KSPYH0
animator KiriInstantFade
} }
decal SnekSpray_BiPride decal SnekSpray_BiPride
{ {
pic KSPYI0 pic KSPYI0
animator KiriInstantFade
translucent 0.8 translucent 0.8
randomflipx randomflipx
} }
@ -78,6 +81,7 @@ decal SnekSpray_BiPride
decal SnekSpray_GayPride decal SnekSpray_GayPride
{ {
pic KSPYJ0 pic KSPYJ0
animator KiriInstantFade
translucent 0.8 translucent 0.8
randomflipx randomflipx
} }

View File

@ -1,6 +1,7 @@
decal SnekSpray_Example decal SnekSpray_Example
{ {
pic KSPEA0 pic KSPEA0
animator KiriInstantFade
translucent 0.8 translucent 0.8
randomflipx randomflipx
} }

View File

@ -35,7 +35,7 @@ sprite JMPRD0, 49, 43 {
} }
sprite JMPKA0, 48, 32 { sprite JMPKA0, 48, 32 {
offset 24, 32 offset 24, 16
patch JMPKA0,0,0 { } patch JMPKA0,0,0 { }
} }
@ -77,7 +77,7 @@ Sprite "KCPLD0", 130, 108
{ {
XScale 4 XScale 4
YScale 4 YScale 4
Offset 64, 100 Offset 64, 52
Patch "sprites/cacoplush/cacoplushie_pickup.png", 0, 0 Patch "sprites/cacoplush/cacoplushie_pickup.png", 0, 0
} }
@ -111,7 +111,7 @@ Sprite "KCPLG0", 130, 108
Sprite "KSPRB0", 48, 48 Sprite "KSPRB0", 48, 48
{ {
Offset 24, 48 Offset 24, 24
Patch KSPRB0,0,0 { } Patch KSPRB0,0,0 { }
} }

View File

@ -284,8 +284,8 @@ class KiriCacodemonPlushie : HDWeapon {
A_StartSound("potion/chug"); A_StartSound("potion/chug");
invoker.owner.A_TakeInventory("SecondBlood", 1, TIF_NOTAKEINFINITE); invoker.owner.A_TakeInventory("SecondBlood", 1, TIF_NOTAKEINFINITE);
invoker.setMonsterHealth( invoker.setMonsterHealth(
int(invoker.getMonsterHealth() + invoker.getMonsterHealth() +
invoker.getMonsterMaxHealth() * 0.25)); invoker.getMonsterMaxHealth() * 0.25);
// Throw out a spend blood bag. // Throw out a spend blood bag.
A_SpawnItemEx( A_SpawnItemEx(
@ -303,14 +303,13 @@ class KiriCacodemonPlushie : HDWeapon {
HDBleedingWound hbl = HDBleedingWound.inflict( HDBleedingWound hbl = HDBleedingWound.inflict(
invoker.owner, 2, 1, source : invoker.owner); invoker.owner, 2, 1, source : invoker.owner);
// FIXME this gets rounded down to 0 HDPlayerPawn(invoker.owner).bloodloss += 0.1;
//HDPlayerPawn(invoker.owner).bloodloss += 0.1;
A_StartSound(invoker.owner.painsound); A_StartSound(invoker.owner.painsound);
invoker.setMonsterHealth( invoker.setMonsterHealth(
int(invoker.getMonsterHealth() + invoker.getMonsterHealth() +
invoker.getMonsterMaxHealth() * 0.1)); invoker.getMonsterMaxHealth() * 0.1);
} }
} }

View File

@ -113,6 +113,8 @@ class SnekTechSprayer : HDWeapon
} else { } else {
Actor spawnedThing;
bool success;
float zOffset = GunHeight() * 0.8; float zOffset = GunHeight() * 0.8;
FLineTraceData lineTraceData; FLineTraceData lineTraceData;
@ -152,12 +154,15 @@ class SnekTechSprayer : HDWeapon
"kiri/spraycan_spray", "kiri/spraycan_spray",
CHAN_WEAPON); CHAN_WEAPON);
let normal = lineTraceData.HitDir; [success, spawnedThing] = A_SpawnItemEx(
let spawnedThing = Actor.Spawn("SnekTechSprayerDecalSpawner", lineTraceData.HitLocation - normal); "SnekTechSprayerDecalSpawner",
xofs : 0, yofs : 0, zofs : zOffset);
SnekTechSprayerDecalSpawner spawner = SnekTechSprayerDecalSpawner(spawnedThing); SnekTechSprayerDecalSpawner spawner = SnekTechSprayerDecalSpawner(spawnedThing);
if(spawner) { if(success && spawner) {
spawner.angle = VectorAngle(-normal.x, -normal.y); spawner.A_SetPitch(pitch);
spawner.A_SetAngle(angle);
spawner.actualDecalName = actualDecalName; spawner.actualDecalName = actualDecalName;
spawner.master = invoker.owner; spawner.master = invoker.owner;
@ -174,12 +179,8 @@ class SnekTechSprayer : HDWeapon
} }
goto waiting; goto waiting;
unload:
KSPR A 2 { invoker.CycleSprayPattern(-1); }
goto waiting;
firemode: firemode:
KSPR A 2 { invoker.CycleSprayPattern(1); } KSPR A 2 { invoker.CycleSprayPattern(); }
goto waiting; goto waiting;
waiting: waiting:
@ -247,8 +248,8 @@ class SnekTechSprayer : HDWeapon
} }
int time = level.TotalTime; int time = level.TotalTime;
int lastChargedTime = int(round( int lastChargedTime = round(
float(pressure - KIRI_SPRAY_MAXPRESSURE) / float(KIRI_SPRAY_PRESSURE_DECAY_RATE) + time)); float(pressure - KIRI_SPRAY_MAXPRESSURE) / float(KIRI_SPRAY_PRESSURE_DECAY_RATE) + time);
weaponstatus[KIRI_SPRAY_WS_PRESSURE] = lastChargedTime; weaponstatus[KIRI_SPRAY_WS_PRESSURE] = lastChargedTime;
} }
@ -303,7 +304,7 @@ class SnekTechSprayer : HDWeapon
} }
} }
void CycleSprayPattern(int increment) void CycleSprayPattern()
{ {
// Find the current entry in the list of patterns. // Find the current entry in the list of patterns.
String currentPattern = CVar.GetCVar("snektech_spraypattern", owner.player).GetString(); String currentPattern = CVar.GetCVar("snektech_spraypattern", owner.player).GetString();
@ -317,27 +318,13 @@ class SnekTechSprayer : HDWeapon
currentIndex = -1; currentIndex = -1;
} }
// Increment/decrement the index. // Increment the index.
int newIndex = (currentIndex + increment) % patternList.size(); int newIndex = (currentIndex + 1) % patternList.size();
if(newIndex < 0) {
newIndex = patternList.size() - 1;
}
// Set the new CVar. // Set the new CVar.
currentPattern = patternList[newIndex]; CVar.GetCVar("snektech_spraypattern", owner.player).SetString(patternList[newIndex]);
// first, update the Actual cvar currentPattern = CVar.GetCVar("snektech_spraypattern", owner.player).GetString();
if (owner.PlayerNumber() == consoleplayer) owner.A_Log("Selected spray pattern: "..currentPattern, true);
CVar.FindCVar("snektech_spraypattern").SetString(currentPattern);
// then update the per-player copy so the help text is correct
CVar.GetCVar("snektech_spraypattern", owner.player).SetString(currentPattern);
// Print it.
owner.A_Log(
String.format(
"Selected spray pattern: (%d/%d) %s",
newIndex + 1, patternList.size(),
currentPattern),
true);
// Current pattern is referenced in the help text, so reset // Current pattern is referenced in the help text, so reset
// it. // it.
@ -366,13 +353,12 @@ class SnekTechSprayer : HDWeapon
return return
WEPHELP_FIREMODE .. " Cycle pattern (current: "..currentPattern..").\n".. WEPHELP_FIREMODE .. " Cycle pattern (current: "..currentPattern..").\n"..
WEPHELP_UNLOAD .. " Cycle pattern (backwards).\n"..
WEPHELP_ALTFIRE .. " Shake the can.\n".. WEPHELP_ALTFIRE .. " Shake the can.\n"..
WEPHELP_FIRE .. " "..messages[messageIndex % messages.Size()].."\n"; WEPHELP_FIRE .. " "..messages[messageIndex % messages.Size()].."\n";
} }
} }
class SnekTechSprayerDecalSpawner : Decal class SnekTechSprayerDecalSpawner : Actor
{ {
default default
{ {
@ -386,65 +372,14 @@ class SnekTechSprayerDecalSpawner : Decal
stop; stop;
} }
int timeSinceLastSpray;
int thisSprayerId; int thisSprayerId;
String actualDecalName; String actualDecalName;
Array<Thinker> decals;
void SpawnDecal()
{
Thinker think;
array<thinker> seen;
// find every decal that Isn't ours
let iter = ThinkerIterator.Create('Thinker', STAT_DECAL);
while (think = iter.Next()) {
// BaseDecal isn't exported to zscript so we have to filter this manually
if (think.GetClassName() == 'BaseDecal') {
seen.Push(think);
}
}
// pass the decal name as a map editor type of argument
args[0] = -int(name(actualDecalName));
// spawn the decal
Super.SpawnDecal();
// then find every decal that we spawned
iter.Reinit();
while (think = iter.Next()) {
if (think.GetClassName() == 'BaseDecal' &&
seen.Find(think) == seen.Size())
{
decals.Push(think);
}
}
}
override void OnDestroy()
{
for (let i = 0; i < decals.Size(); i++) {
if (decals[i]) {
decals[i].Destroy();
}
}
}
// Decal::BeginPlay deletes the actor
override void BeginPlay() {Actor.BeginPlay();}
override void PostBeginPlay() override void PostBeginPlay()
{ {
Super.PostBeginPlay(); Super.PostBeginPlay();
A_SprayDecal(actualDecalName, KIRI_SPRAY_DISTANCE);
// copy A_SprayDecal z offset
setz(pos.z + height / 2);
SpawnDecal();
if (decals.Size() == 0) {
Destroy();
return;
}
// Figure out a new ID number. // Figure out a new ID number.
ThinkerIterator iter = ThinkerIterator.Create("SnekTechSprayerDecalSpawner"); ThinkerIterator iter = ThinkerIterator.Create("SnekTechSprayerDecalSpawner");
@ -482,6 +417,18 @@ class SnekTechSprayerDecalSpawner : Decal
} }
} }
} }
override void Tick()
{
super.Tick();
timeSinceLastSpray++;
if(timeSinceLastSpray >= 35 * 60) {
A_SprayDecal(actualDecalName, KIRI_SPRAY_DISTANCE);
timeSinceLastSpray = 0;
}
}
} }
class SnekTechSprayerPattern : Actor class SnekTechSprayerPattern : Actor