diff --git a/spanker.lsl b/spanker.lsl index afa669e..e15f069 100644 --- a/spanker.lsl +++ b/spanker.lsl @@ -1,5 +1,5 @@ -integer CHANNEL = 73517; +integer g_iChannel; integer g_iHandle = 0; integer g_iLinkBum; @@ -16,25 +16,24 @@ integer g_iTimeRight; integer g_iTimeRLV; -integer TIME_HEAL = 10; +integer TIME_HEAL = 20; integer SIDE_LEFT = 0; integer SIDE_RIGHT = 1; -integer g_iNumOfStages = 8; +integer g_iNumOfStages = 10; integer g_iRlvLocked = 0; integer g_iRlvOn = 0; string g_sCurAnim = ""; -string GetTexture(integer iFace) -{ - list l = llGetLinkPrimitiveParams(g_iLinkTheme, [PRIM_TEXTURE, iFace]); - return (string)llList2Key(l, 0); -} +string TEXTURE = "ccf8fd66-54a4-43bf-971f-56c347913724"; // Fill in your texture UUID here! -SetTexture(integer iFace, string sTexture) +SetRed(integer iFace, integer iIntensity) { - llSetLinkPrimitiveParamsFast(g_iLinkBum, [PRIM_TEXTURE, iFace, sTexture, <1,1,1>, <0,0,0>, 0]); + //float fAlpha = 1.0 - ((1.0 / g_iNumOfStages) * iIntensity); + float fAlpha = ((1.0 / g_iNumOfStages) * iIntensity); + llSetLinkPrimitiveParamsFast(g_iLinkBum, [PRIM_TEXTURE, iFace, TEXTURE, <1,1,1>, <0,0,0>, 0, + PRIM_COLOR, iFace, <1,1,1>, fAlpha]); } PlayRandomAnim() @@ -63,7 +62,7 @@ PlayRandomSound() Reset() { - SetTexture(ALL_SIDES, TEXTURE_TRANSPARENT); + llSetLinkTexture(g_iLinkBum, TEXTURE_TRANSPARENT, ALL_SIDES); g_iCountLeft = 0; g_iCountRight = 0; if (g_iRlvOn && g_iRlvLocked) { @@ -80,8 +79,7 @@ HitLeft() g_iRlvLocked = TRUE; } g_iCountLeft++; - string sTexture = GetTexture(g_iCountLeft-1); - SetTexture(SIDE_LEFT, sTexture); + SetRed(SIDE_LEFT, g_iCountLeft); PlayRandomSound(); PlayRandomAnim(); g_iTimeLeft = llGetUnixTime() + TIME_HEAL; @@ -95,8 +93,7 @@ HitRight() g_iRlvLocked = TRUE; } g_iCountRight++; - string sTexture = GetTexture(g_iCountRight-1); - SetTexture(SIDE_RIGHT, sTexture); + SetRed(SIDE_RIGHT, g_iCountRight); PlayRandomSound(); PlayRandomAnim(); g_iTimeRight = llGetUnixTime() + TIME_HEAL; @@ -115,10 +112,11 @@ default llPreloadSound("slap"); if (llGetAttached()) llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); // RLV detection: - g_iHandle = llListen(CHANNEL, "", "", ""); + g_iChannel = 9999 + llRound(llFrand(9999999.0)); + g_iHandle = llListen(g_iChannel, "", "", ""); g_iTimeRLV = llGetUnixTime() + 120; llSetTimerEvent(30.0); - llOwnerSay("@versionnew="+(string)CHANNEL); + llOwnerSay("@versionnew="+(string)g_iChannel); } on_rez(integer i) @@ -143,7 +141,7 @@ default integer iTimeStamp = llGetUnixTime(); if (g_iTimeRLV) { - if (g_iTimeRLV > iTimeStamp) llOwnerSay("@versionnew="+(string)CHANNEL); + if (g_iTimeRLV > iTimeStamp) llOwnerSay("@versionnew="+(string)g_iChannel); else { // no rlv detected, we'll do without g_iTimeRLV = 0; @@ -157,23 +155,19 @@ default if (g_iCountLeft && iTimeStamp >= g_iTimeLeft) { g_iCountLeft--; - string sTexture; - if (g_iCountLeft==0) sTexture = TEXTURE_TRANSPARENT; + if (g_iCountLeft==0) SetRed(SIDE_LEFT, 0); else { - sTexture = GetTexture(g_iCountLeft-1); + SetRed(SIDE_LEFT, g_iCountLeft); g_iTimeLeft = llGetUnixTime() + TIME_HEAL; } - SetTexture(SIDE_LEFT, sTexture); } if (g_iCountRight && iTimeStamp >= g_iTimeRight) { g_iCountRight--; - string sTexture; - if (g_iCountRight==0) sTexture = TEXTURE_TRANSPARENT; + if (g_iCountRight==0) SetRed(SIDE_RIGHT, 0); else { - sTexture = GetTexture(g_iCountRight-1); + SetRed(SIDE_RIGHT, g_iCountRight); g_iTimeRight = llGetUnixTime() + TIME_HEAL; } - SetTexture(SIDE_RIGHT, sTexture); } if (g_iCountLeft==0 && g_iCountRight==0) { if (g_iRlvOn && g_iRlvLocked) { diff --git a/texture.png b/texture.png new file mode 100644 index 0000000..27f19c1 Binary files /dev/null and b/texture.png differ diff --git a/texture.psd b/texture.psd new file mode 100644 index 0000000..a1c32e8 Binary files /dev/null and b/texture.psd differ diff --git a/textures 512px/1.png b/textures 512px/1.png deleted file mode 100644 index 713025d..0000000 Binary files a/textures 512px/1.png and /dev/null differ diff --git a/textures 512px/2.png b/textures 512px/2.png deleted file mode 100644 index 2a0a140..0000000 Binary files a/textures 512px/2.png and /dev/null differ diff --git a/textures 512px/3.png b/textures 512px/3.png deleted file mode 100644 index ac20b50..0000000 Binary files a/textures 512px/3.png and /dev/null differ diff --git a/textures 512px/4.png b/textures 512px/4.png deleted file mode 100644 index a303239..0000000 Binary files a/textures 512px/4.png and /dev/null differ diff --git a/textures 512px/5.png b/textures 512px/5.png deleted file mode 100644 index cafac86..0000000 Binary files a/textures 512px/5.png and /dev/null differ diff --git a/textures 512px/6.png b/textures 512px/6.png deleted file mode 100644 index f3a043e..0000000 Binary files a/textures 512px/6.png and /dev/null differ diff --git a/textures 512px/7.png b/textures 512px/7.png deleted file mode 100644 index bd70a93..0000000 Binary files a/textures 512px/7.png and /dev/null differ diff --git a/textures 512px/8.png b/textures 512px/8.png deleted file mode 100644 index 68eda57..0000000 Binary files a/textures 512px/8.png and /dev/null differ diff --git a/textures 512px/textures.psd b/textures 512px/textures.psd deleted file mode 100644 index b71d237..0000000 Binary files a/textures 512px/textures.psd and /dev/null differ diff --git a/theme.blend b/theme.blend deleted file mode 100644 index c188455..0000000 Binary files a/theme.blend and /dev/null differ diff --git a/theme.dae b/theme.dae deleted file mode 100644 index 61ef548..0000000 --- a/theme.dae +++ /dev/null @@ -1,304 +0,0 @@ - - - - - Blender User - Blender 2.92.0 commit date:2021-02-24, commit time:16:25, hash:02948a2cab44 - - 2021-06-11T08:48:40 - 2021-06-11T08:48:40 - - Z_UP - - - - - - - - 0 0 0 1 - - - 0.8 0.8 0.8 1 - - - 1.45 - - - - - - - - - - - 0 0 0 1 - - - 0.8 0.8 0.8 1 - - - 1.45 - - - - - - - - - - - 0 0 0 1 - - - 0.8 0.8 0.8 1 - - - 1.45 - - - - - - - - - - - 0 0 0 1 - - - 0.8 0.8 0.8 1 - - - 1.45 - - - - - - - - - - - 0 0 0 1 - - - 0.8 0.8 0.8 1 - - - 1.45 - - - - - - - - - - - 0 0 0 1 - - - 0.8 0.8 0.8 1 - - - 1.45 - - - - - - - - - - - 0 0 0 1 - - - 0.8 0.8 0.8 1 - - - 1.45 - - - - - - - - - - - 0 0 0 1 - - - 0.8 0.8 0.8 1 - - - 1.45 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1 1 0 1 1 0 -1 0.5 0 -1 0 0 1 0 0 1 0.5 0 0.5 1 0 0 1 0 -0.5 1 0 -0.5 0 0 -0.5 0.5 0 0 0 0 0 0.5 0 0.5 0 0 0.5 0.5 0 - - - - - - - - - - 0 0 1 - - - - - - - - - - 0.9980358 0.749018 0.749018 0.9980358 0.749018 0.749018 0.2509821 0.749018 0.001964092 0.9980358 0.001964092 0.749018 0.5 0.749018 0.2509821 0.9980358 0.2509821 0.749018 0.749018 0.749018 0.5 0.9980358 0.5 0.749018 0.2509821 0.5 0.001964092 0.749018 0.001964092 0.5 0.5 0.5 0.2509821 0.749018 0.2509821 0.5 0.749018 0.5 0.5 0.749018 0.5 0.5 0.9980358 0.5 0.749018 0.749018 0.749018 0.5 0.9980358 0.749018 0.9980358 0.9980358 0.749018 0.9980358 0.2509821 0.749018 0.2509821 0.9980358 0.001964092 0.9980358 0.5 0.749018 0.5 0.9980358 0.2509821 0.9980358 0.749018 0.749018 0.749018 0.9980358 0.5 0.9980358 0.2509821 0.5 0.2509821 0.749018 0.001964092 0.749018 0.5 0.5 0.5 0.749018 0.2509821 0.749018 0.749018 0.5 0.749018 0.749018 0.5 0.749018 0.9980358 0.5 0.9980358 0.749018 0.749018 0.749018 - - - - - - - - - - - - - - -

10 0 3 0 0 4 2 0 5 10 0 27 8 0 28 0 0 29

-
- - - - -

12 0 6 8 0 7 10 0 8 12 0 30 7 0 31 8 0 32

-
- - - - -

14 0 9 7 0 10 12 0 11 14 0 33 6 0 34 7 0 35

-
- - - - -

5 0 0 6 0 1 14 0 2 5 0 24 1 0 25 6 0 26

-
- - - - -

9 0 12 2 0 13 3 0 14 9 0 36 10 0 37 2 0 38

-
- - - - -

11 0 15 10 0 16 9 0 17 11 0 39 12 0 40 10 0 41

-
- - - - -

13 0 18 12 0 19 11 0 20 13 0 42 14 0 43 12 0 44

-
- - - - -

4 0 21 14 0 22 13 0 23 4 0 45 5 0 46 14 0 47

-
-
-
-
- - - - 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\ No newline at end of file