diff --git a/source_data/HDSnekTechExampleSpray/decaldef.txt b/source_data/HDSnekTechExampleSpray/decaldef.txt new file mode 100644 index 0000000..4f35616 --- /dev/null +++ b/source_data/HDSnekTechExampleSpray/decaldef.txt @@ -0,0 +1,7 @@ +decal SnekSpray_Example +{ + pic KSPEA0 + animator KiriInstantFade + translucent 0.8 + randomflipx +} diff --git a/source_data/HDSnekTechExampleSpray/sprites/sprays/example_spray.png b/source_data/HDSnekTechExampleSpray/sprites/sprays/example_spray.png new file mode 100644 index 0000000..b33a110 Binary files /dev/null and b/source_data/HDSnekTechExampleSpray/sprites/sprays/example_spray.png differ diff --git a/source_data/HDSnekTechExampleSpray/textures.txt b/source_data/HDSnekTechExampleSpray/textures.txt new file mode 100644 index 0000000..e94e37e --- /dev/null +++ b/source_data/HDSnekTechExampleSpray/textures.txt @@ -0,0 +1,7 @@ +Sprite "KSPEA0", 250, 150 +{ + XScale 2 + YScale 2 + Offset 125, 75 + Patch "sprites/sprays/example_spray.png", 0, 0 +} diff --git a/source_data/HDSnekTechExampleSpray/zscript.zs b/source_data/HDSnekTechExampleSpray/zscript.zs new file mode 100644 index 0000000..c91f8a5 --- /dev/null +++ b/source_data/HDSnekTechExampleSpray/zscript.zs @@ -0,0 +1,9 @@ +class SnekSpray_Example : SnekTechSprayerPattern +{ + default + { + SnekTechSprayerPattern.decalName "SnekSpray_Example"; + } +} + + diff --git a/zscript/snektech.zs b/zscript/snektech.zs index c932d1e..d9f7d86 100644 --- a/zscript/snektech.zs +++ b/zscript/snektech.zs @@ -85,7 +85,7 @@ class SnekTechEventHandler : EventHandler DoSnekTechBackpackSpawnCheck( e.Thing, SNEKTECH_SPRAYCAN, - "Sprayer"); + "SnekTechSprayer"); } override void CheckReplacement(ReplaceEvent e) diff --git a/zscript/spraycan.zs b/zscript/spraycan.zs index e65fe74..a443f52 100644 --- a/zscript/spraycan.zs +++ b/zscript/spraycan.zs @@ -21,7 +21,7 @@ enum KiriSprayerStatus KIRI_SPRAY_WS_PRESSURE = 2 } -class Sprayer : HDWeapon +class SnekTechSprayer : HDWeapon { default { @@ -109,7 +109,7 @@ class Sprayer : HDWeapon if(invoker.GetPressure() < KIRI_SPRAY_PRESSURE_PER_USE) { - invoker.owner.A_Log("Not enough pressure to spray."); + invoker.owner.A_Log("Not enough pressure to spray.", true); } else { @@ -118,7 +118,7 @@ class Sprayer : HDWeapon float zOffset = GunHeight() * 0.8; FLineTraceData lineTraceData; - class sprayerPatternClass = "SprayerPattern"; + class sprayerPatternClass = "SnekTechSprayerPattern"; // Find the spray pattern class that matches the // player's CVar for selected pattern. @@ -126,10 +126,10 @@ class Sprayer : HDWeapon "snektech_spraypattern", invoker.owner.player).GetString(); for(int i = 0; i < AllActorClasses.size(); i++) { - class thisPatternClass = (class)(AllActorClasses[i]); + class thisPatternClass = (class)(AllActorClasses[i]); if(thisPatternClass) { if(thisPatternClass.GetClassName() == currentSprayCVar) { - sprayerPatternClass = (class)(AllActorClasses[i]); + sprayerPatternClass = (class)(AllActorClasses[i]); break; } } @@ -155,10 +155,10 @@ class Sprayer : HDWeapon CHAN_WEAPON); [success, spawnedThing] = A_SpawnItemEx( - "SprayerDecalSpawner", + "SnekTechSprayerDecalSpawner", xofs : 0, yofs : 0, zofs : zOffset); - SprayerDecalSpawner spawner = SprayerDecalSpawner(spawnedThing); + SnekTechSprayerDecalSpawner spawner = SnekTechSprayerDecalSpawner(spawnedThing); if(success && spawner) { spawner.A_SetPitch(pitch); @@ -172,7 +172,7 @@ class Sprayer : HDWeapon } else { - invoker.owner.A_Log("Not close enough to a wall to spray."); + invoker.owner.A_Log("Not close enough to a wall to spray.", true); } } @@ -298,7 +298,7 @@ class Sprayer : HDWeapon ret.clear(); for(int i = 0; i < AllActorClasses.Size(); i++) { class c = AllActorClasses[i]; - if(c is "SprayerPattern" && c != "SprayerPattern") { + if(c is "SnekTechSprayerPattern" && c != "SnekTechSprayerPattern") { ret.push(c.GetClassName()); } } @@ -324,7 +324,7 @@ class Sprayer : HDWeapon // Set the new CVar. CVar.GetCVar("snektech_spraypattern", owner.player).SetString(patternList[newIndex]); currentPattern = CVar.GetCVar("snektech_spraypattern", owner.player).GetString(); - owner.A_Log("Selected spray pattern: "..currentPattern); + owner.A_Log("Selected spray pattern: "..currentPattern, true); // Current pattern is referenced in the help text, so reset // it. @@ -358,7 +358,7 @@ class Sprayer : HDWeapon } } -class SprayerDecalSpawner : Actor +class SnekTechSprayerDecalSpawner : Actor { default { @@ -382,10 +382,10 @@ class SprayerDecalSpawner : Actor A_SprayDecal(actualDecalName, KIRI_SPRAY_DISTANCE); // Figure out a new ID number. - ThinkerIterator iter = ThinkerIterator.Create("SprayerDecalSpawner"); - SprayerDecalSpawner otherSpawner; + ThinkerIterator iter = ThinkerIterator.Create("SnekTechSprayerDecalSpawner"); + SnekTechSprayerDecalSpawner otherSpawner; int maxId = 0; - while(otherSpawner = SprayerDecalSpawner(iter.Next())) { + while(otherSpawner = SnekTechSprayerDecalSpawner(iter.Next())) { if(otherSpawner == self) { continue; @@ -401,14 +401,14 @@ class SprayerDecalSpawner : Actor thisSprayerId = maxId + 1; // Clear old sprayers. - iter = ThinkerIterator.Create("SprayerDecalSpawner"); - while(otherSpawner = SprayerDecalSpawner(iter.Next())) { + iter = ThinkerIterator.Create("SnekTechSprayerDecalSpawner"); + while(otherSpawner = SnekTechSprayerDecalSpawner(iter.Next())) { if(otherSpawner == self) { continue; } - if(otherSpawner.thisSprayerId < (thisSprayerId - 5)) { + if(otherSpawner.thisSprayerId < (thisSprayerId - 10)) { if(otherSpawner.master == master) { otherSpawner.Destroy(); } @@ -429,93 +429,93 @@ class SprayerDecalSpawner : Actor } } -class SprayerPattern : Actor +class SnekTechSprayerPattern : Actor { string decalName; property decalName:decalName; default { - SprayerPattern.decalName "KiriTestDecal"; + SnekTechSprayerPattern.decalName "KiriTestDecal"; } } -class SnekSpray_TransPride : SprayerPattern +class SnekSpray_TransPride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_TransPride"; + SnekTechSprayerPattern.decalName "SnekSpray_TransPride"; } } -class SnekSpray_LesbianPride : SprayerPattern +class SnekSpray_LesbianPride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_LesbianPride"; + SnekTechSprayerPattern.decalName "SnekSpray_LesbianPride"; } } -class SnekSpray_NBPride : SprayerPattern +class SnekSpray_NBPride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_NBPride"; + SnekTechSprayerPattern.decalName "SnekSpray_NBPride"; } } -class SnekSpray_AcePride : SprayerPattern +class SnekSpray_AcePride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_AcePride"; + SnekTechSprayerPattern.decalName "SnekSpray_AcePride"; } } -class SnekSpray_ProgressPride : SprayerPattern +class SnekSpray_ProgressPride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_ProgressPride"; + SnekTechSprayerPattern.decalName "SnekSpray_ProgressPride"; } } -class SnekSpray_DemiPride : SprayerPattern +class SnekSpray_DemiPride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_DemiPride"; + SnekTechSprayerPattern.decalName "SnekSpray_DemiPride"; } } -class SnekSpray_PanPride : SprayerPattern +class SnekSpray_PanPride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_PanPride"; + SnekTechSprayerPattern.decalName "SnekSpray_PanPride"; } } -class SnekSpray_SwitchPride : SprayerPattern +class SnekSpray_SwitchPride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_SwitchPride"; + SnekTechSprayerPattern.decalName "SnekSpray_SwitchPride"; } } -class SnekSpray_BiPride : SprayerPattern +class SnekSpray_BiPride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_BiPride"; + SnekTechSprayerPattern.decalName "SnekSpray_BiPride"; } } -class SnekSpray_GayPride : SprayerPattern +class SnekSpray_GayPride : SnekTechSprayerPattern { default { - SprayerPattern.decalName "SnekSpray_GayPride"; + SnekTechSprayerPattern.decalName "SnekSpray_GayPride"; } }