Skip to content

Commit

Permalink
1.5.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultrinik committed Oct 2, 2024
1 parent 95cf782 commit c568adb
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 17 deletions.
56 changes: 42 additions & 14 deletions heaven's call/content/shaders.xml
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@
<param name="Enabled" type="float"/>
<param name="BlackPosition" type="vec3"/>
<param name="Time" type="float"/>
<param name="WarpCheck" type="vec2"/>
</parameters>

<vertex><![CDATA[
Expand All @@ -495,29 +496,49 @@
attribute vec2 TexCoord;
attribute vec4 RenderData;
attribute float Scale;
attribute float Enabled;
attribute vec3 BlackPosition;
attribute float Time;
attribute vec2 WarpCheck;
varying vec4 Color0;
varying vec2 TexCoord0;
varying vec4 RenderDataOut;
varying float ScaleOut;
varying float EnabledOut;
varying vec3 BlackPositionOut;
varying float TimeOut;
varying float YWarping;
uniform mat4 Transform;
void main(void)
{
RenderDataOut = RenderData;
ScaleOut = Scale; // Passing data to fragment shader
EnabledOut = Enabled; // Passing data to fragment shader
BlackPositionOut = BlackPosition; // Passing data to fragment shader
TimeOut = Time; // Passing data to fragment shader
Color0 = Color;
TexCoord0 = TexCoord;
gl_Position = Transform * vec4(Position.xyz, 1.0);
if (Enabled > 0.0) {
EnabledOut = Enabled; // Passing data to fragment shader
TimeOut = Time; // Passing data to fragment shader
vec4 TargetPos;
TargetPos.xy = (BlackPosition.xy / RenderData.zw) * Scale;
TargetPos.zw = (BlackPosition.zy / RenderData.zw) * Scale;
BlackPositionOut = vec3(TargetPos.xy, distance(TargetPos.xy, TargetPos.zw)); // Passing data to fragment shader
vec2 WarpChecker = (WarpCheck.xy / RenderData.zw) * Scale;
float xDistance = distance(vec2(WarpChecker.x, TargetPos.y), TargetPos.xy);
float yDistance = distance(vec2(TargetPos.x, WarpChecker.y), TargetPos.xy);
YWarping = xDistance / yDistance; // Passing data to fragment shader
}
}
]]></vertex>
Expand All @@ -527,26 +548,33 @@
varying vec2 TexCoord0;
varying vec4 RenderDataOut;
varying float ScaleOut;
varying float EnabledOut;
varying vec3 BlackPositionOut;
varying float TimeOut;
varying float YWarping;
uniform sampler2D Texture0;
float warpedDistance(vec2 a, vec2 b) {
vec2 diff = a - b;
float distanceSquared = (diff.x * diff.x) + (diff.y * diff.y * YWarping * YWarping);
return sqrt(distanceSquared);
}
void main(void)
{
float aspect = RenderDataOut.z/RenderDataOut.w;
vec4 Color = Color0 * texture2D(Texture0, TexCoord0);
vec2 pos = (BlackPositionOut.xy / RenderDataOut.zw) * ScaleOut ;
vec2 rad = (BlackPositionOut.zy / RenderDataOut.zw) * ScaleOut * 1.02;
float radius = length((rad - pos) * vec2(aspect,1.0)); //Actual radius
float dist = length((TexCoord0 - pos) * vec2(aspect,1.0)); //Distance from pixel to center
if (dist < radius * TimeOut) {
Color.r -= EnabledOut * Color.r;
Color.g -= EnabledOut * Color.g;
Color.b -= EnabledOut * Color.b;
if (EnabledOut > 0.0){
float dist = warpedDistance(TexCoord0.xy, BlackPositionOut.xy);
if (dist < 0.035 * TimeOut){
Color.r = 0.0;
Color.g = 0.0;
Color.b = 0.0;
}
}
gl_FragColor = Color;
}
]]></fragment>
Expand Down
2 changes: 2 additions & 0 deletions heaven's call/main.LUA
Original file line number Diff line number Diff line change
Expand Up @@ -1747,13 +1747,15 @@ function mod:ShadersRender(shaderName)
Enabled = 1,
BlackPosition = {position.X, position.Y, radius.X},
Time = time,
WarpCheck = {position.X + 1, position.Y + 1},
}
return params
else
local params = {
Enabled = 0,
BlackPosition = {0, 0, 0},
Time = 0,
WarpCheck = {0, 0},
}
return params
end
Expand Down
2 changes: 1 addition & 1 deletion heaven's call/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ A once cheerful and expresfull rabbit, not tainted by the penance of the light.
[*] [url=https://twitter.com/Aladar_C137] Aladar[/url]: Creator of the original concept for Venus.
[/list]
[h1][b] If you are going to report a bug or post a suggestion, please do so in the appropriate discussion. [/b][/h1]</description>
<version>1.5.14</version>
<version>1.5.15</version>
<visibility>Public</visibility>
<tag id="Lua"/>
<tag id="Items"/>
Expand Down
Binary file modified heaven's call/resources/gfx/familiar/moons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions heaven's call/scripts/lunaritems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ function mod:PocketizeItem(player)
if player:GetActiveItem(ActiveSlot.SLOT_PRIMARY) == mod.Items.Mars or player:GetActiveItem(ActiveSlot.SLOT_PRIMARY) == mod.Items.Saturnus then
slot = ActiveSlot.SLOT_PRIMARY
elseif player:GetActiveItem(ActiveSlot.SLOT_SECONDARY) == mod.Items.Mars or player:GetActiveItem(ActiveSlot.SLOT_SECONDARY) == mod.Items.Saturnus then
slot = ActiveSlot.SLOT_SECONDARY
slot = ActiveSlot.SLOT_SECONDARY
end

if slot and player:GetActiveItem(ActiveSlot.SLOT_POCKET == 0) then
if slot and player:GetActiveItem(ActiveSlot.SLOT_POCKET) == 0 then
player:SetPocketActiveItem(player:GetActiveItem(slot), ActiveSlot.SLOT_POCKET, false)
player:RemoveCollectible(player:GetActiveItem(slot), false, slot, false)
end
Expand Down Expand Up @@ -2261,9 +2261,19 @@ mod:AddCallback(ModCallbacks.MC_POST_EFFECT_UPDATE, function(_, blackhole)
data.Init_HC = true

data.Position_HC = blackhole.Position

mod.ModFlags.blackHolePosition = blackhole.Position
mod.ModFlags.blackHoleTime = 0
mod.ModFlags.blackHole = true

local room = game:GetRoom()
if room:IsMirrorWorld() then
local ogY = mod.ModFlags.blackHolePosition.Y
local center = room:GetCenterPos()
local direction = mod.ModFlags.blackHolePosition - center
mod.ModFlags.blackHolePosition = center - direction
mod.ModFlags.blackHolePosition.Y = ogY
end
end

if data.Position_HC and mod.ModFlags.blackHoleTime then
Expand Down

0 comments on commit c568adb

Please sign in to comment.