Move files and folders to new repo format to enable multi-project format

This commit is contained in:
2025-03-06 22:07:25 -08:00
parent 12cbb82ac9
commit a09f6ec5a5
3973 changed files with 1781 additions and 2938 deletions

View File

@@ -0,0 +1,78 @@
// Color range swap shader for Godot 4; Sprite3D version by Sithoid
// Based on 2D shader by nonunknown https://godotshaders.com/shader/color-range-swap/
// 3d lifehacks by Anonzs https://www.reddit.com/r/godot/comments/11dklv0/sprite3d_shader/
// Billboard projection by mrdunk https://ask.godotengine.org/152606/how-to-do-i-make-a-shader-a-billboard-face-the-player
shader_type spatial;
render_mode depth_draw_opaque, depth_prepass_alpha; // Prepass is needed to cast a shadow
// Set this parameter to your actual texture in script, e.g. with
// material_override.set_shader_parameter("sprite_texture", texture)
uniform sampler2D sprite_texture : source_color, filter_nearest;
// Hue on a HSV scale (0 to 1) that will be keyed out. Defaults are set to key out bright cyan
uniform float _min = 0.49;
uniform float _max = 0.5;
// Target color (RGBA) that will appear instead of the mask (it will respect brightness)
uniform vec4 color : source_color = vec4(0.59, 0.12, 0.32, 1.0); // Dark pink by default
uniform bool billboard = false; // Toggle billboard mode (set this in script)
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
// All components are in the range [0…1], including hue.
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
// ===== nonunknown got those from: https://gamedev.stackexchange.com/a/75928
vec4 to_gray(vec4 tex) {
float avg = (tex.r + tex.g + tex.b) / 3.0;
return vec4(vec3(avg),tex.a);
}
vec4 to_color(vec4 gray, vec4 col) {
return gray * col;
}
// ===== end
// == Billboard projection by mrdunk
void vertex() {
if (billboard) {
mat4 modified_model_view = VIEW_MATRIX * mat4(
INV_VIEW_MATRIX[0],
INV_VIEW_MATRIX[1],
INV_VIEW_MATRIX[2],
MODEL_MATRIX[3]
);
MODELVIEW_MATRIX = modified_model_view;
}
}
// end ===
void fragment() {
vec4 tex = texture(sprite_texture, UV);
vec3 hsv = rgb2hsv(tex.rgb);
// the .r here represents HUE, .g is SATURATION, .b is LUMINANCE
if (hsv.r >= _min && hsv.r <= _max) {
tex = to_gray(tex);
tex = to_color(tex, color);
}
// To replace multiple colors, just copy this "if" statement
// and repeat it with different variables (such as _min1, _min2 and color2)
ALBEDO = tex.rgb;
ALPHA = tex.a;
}

View File

@@ -0,0 +1 @@
uid://b1n357imav0y6

View File

@@ -0,0 +1,37 @@
using Chickensoft.Introspection;
using Godot;
namespace Zennysoft.Game.Ma;
[Meta, Id("throwable_item")]
public partial class ThrowableItem : InventoryItem
{
[Export]
private ThrowableItemStats _throwableItemStats { get; set; }
public override string ItemName => _throwableItemStats.Name;
public override string Description => _throwableItemStats.Description;
public override float SpawnRate => _throwableItemStats.SpawnRate;
public override double ThrowDamage => _throwableItemStats.ThrowDamage;
public override float ThrowSpeed => _throwableItemStats.ThrowSpeed;
public ElementType ElementType => _throwableItemStats.ElementType;
public ThrowableItemTag ThrowableItemTag => _throwableItemStats.ThrowableItemTag;
public int HealHPAmount => _throwableItemStats.HealHPAmount;
public int HealVTAmount => _throwableItemStats.HealVTAmount;
public void SetElementType(ElementType elementType) => _throwableItemStats.ElementType = elementType;
public void SetDescription(string description) => _throwableItemStats.Description = description;
public int Count { get; }
public override InventoryItemStats ItemStats { get => _throwableItemStats; set => _throwableItemStats = (ThrowableItemStats)value; }
}

View File

@@ -0,0 +1 @@
uid://dj28ol2cpeiwm

View File

@@ -0,0 +1,27 @@
[gd_scene load_steps=3 format=3 uid="uid://1fl6s352e2ej"]
[ext_resource type="Script" uid="uid://dj28ol2cpeiwm" path="res://src/items/throwable/ThrowableItem.cs" id="1_nac2l"]
[sub_resource type="BoxShape3D" id="BoxShape3D_03cqg"]
size = Vector3(0.778381, 0.929947, 0.731567)
[node name="ThrowableItem" type="Node3D"]
script = ExtResource("1_nac2l")
[node name="Pickup" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 4
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0600509, 0.26725, 0.180481)
shape = SubResource("BoxShape3D_03cqg")
[node name="Sprite" type="Sprite3D" parent="Pickup"]
unique_name_in_owner = true
transform = Transform3D(0.999973, 0.00489444, -0.00548299, -0.00488109, 0.999985, 0.00244357, 0.00549488, -0.00241672, 0.999982, 0, 0, 0)
pixel_size = 0.0005
billboard = 2
shaded = true
texture_filter = 0
render_priority = 100

View File

@@ -0,0 +1,22 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
namespace Zennysoft.Game.Ma;
[GlobalClass]
[Meta, Id("throwable_item_stats")]
public partial class ThrowableItemStats : InventoryItemStats
{
[Export]
[Save("throwable_item_tag")]
public ThrowableItemTag ThrowableItemTag { get; set; } = ThrowableItemTag.None;
[Export]
[Save("throwable_item_element")]
public ElementType ElementType { get; set; } = ElementType.None;
[Export]
[Save("throwable_item_usable_tag")]
public UsableItemTag UsableItemTag { get; set; } = UsableItemTag.None;
}

View File

@@ -0,0 +1 @@
uid://d3wlunkcuv2w2

View File

@@ -0,0 +1,45 @@
using System.Text.Json.Serialization;
namespace Zennysoft.Game.Ma;
public enum ThrowableItemTag
{
None,
LowerTargetTo1HP,
CanChangeAffinity,
TeleportToRandomLocation,
WarpToExitIfFound
}
[JsonSerializable(typeof(ThrowableItemTag))]
public partial class ThrowableItemTagEnumContext : JsonSerializerContext;
public enum UsableItemTag
{
None,
DoubleEXP,
IdentifyAllItemsCostHP,
BriefImmunity,
SwapHPAndVT,
TeleportAllEnemiesToRoom,
TurnAllEnemiesIntoHealingItem,
KillHalfEnemiesInRoom,
AbsorbHPFromAllEnemiesInRoom,
HealsAllInRoomToMaxHP,
DealElementalDamageToAllEnemiesInRoom,
RaiseCurrentWeaponAttack,
RaiseCurrentDefenseArmor,
RaiseLevel,
RandomEffect,
}
[JsonSerializable(typeof(UsableItemTag))]
public partial class UsableItemTagEnumContext : JsonSerializerContext;
public enum BoxItemTag
{
RandomNewItem,
}
[JsonSerializable(typeof(BoxItemTag))]
public partial class BoxItemTagEnumContext : JsonSerializerContext;

View File

@@ -0,0 +1 @@
uid://tbf6epgxojl

View File

@@ -0,0 +1,20 @@
[gd_resource type="Resource" script_class="ThrowableItemStats" load_steps=3 format=3 uid="uid://bph8c6by4s047"]
[ext_resource type="Script" uid="uid://d3wlunkcuv2w2" path="res://src/items/throwable/ThrowableItemStats.cs" id="1_ewck5"]
[ext_resource type="Texture2D" uid="uid://mi70lolgtf3n" path="res://src/items/throwable/textures/GEOMANCER-DICE.png" id="1_jhits"]
[resource]
script = ExtResource("1_ewck5")
ThrowableItemTags = Array[int]([1])
ElementType = 0
UsableItemTags = Array[int]([])
Name = "Geomantic Dice"
Description = "Inflicts base damage when thrown.
Use item to change Affinity."
Texture = ExtResource("1_jhits")
SpawnRate = 0.1
ThrowSpeed = 20.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 20
ItemTags = Array[int]([])

View File

@@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="ThrowableItemStats" load_steps=3 format=3 uid="uid://lo37qfyxlhx1"]
[ext_resource type="Texture2D" uid="uid://cagebvc1lp28y" path="res://src/items/throwable/textures/tablet.PNG" id="1_xt2mp"]
[ext_resource type="Script" uid="uid://d3wlunkcuv2w2" path="res://src/items/throwable/ThrowableItemStats.cs" id="2_m680r"]
[resource]
script = ExtResource("2_m680r")
ThrowableItemTag = 0
ElementType = 0
UsableItemTag = 0
Name = "Gospel of Dimension"
Description = "Teleports target to a random location."
Texture = ExtResource("1_xt2mp")
SpawnRate = 0.1
ThrowSpeed = 20.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 20
ItemTag = 0

View File

@@ -0,0 +1,20 @@
[gd_resource type="Resource" script_class="ThrowableItemStats" load_steps=3 format=3 uid="uid://35ag8vp8kvtx"]
[ext_resource type="Texture2D" uid="uid://cagebvc1lp28y" path="res://src/items/throwable/textures/tablet.PNG" id="1_26kno"]
[ext_resource type="Script" uid="uid://d3wlunkcuv2w2" path="res://src/items/throwable/ThrowableItemStats.cs" id="1_pn8sr"]
[resource]
script = ExtResource("1_pn8sr")
ThrowableItemTag = 0
ElementType = 0
UsableItemTag = 0
Name = "Gospel of Escape"
Description = "Warps target to the exit. No effect on player if exit has not been found."
Texture = ExtResource("1_26kno")
SpawnRate = 0.5
ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTag = 0
metadata/_custom_type_script = "uid://d3wlunkcuv2w2"

View File

@@ -0,0 +1,17 @@
[gd_resource type="Resource" script_class="ThrowableItemStats" load_steps=3 format=3 uid="uid://qqg0gdcb8fwg"]
[ext_resource type="Texture2D" uid="uid://dhfn51smm818x" path="res://src/items/throwable/textures/spell sign - luck.PNG" id="1_3605p"]
[ext_resource type="Script" uid="uid://d3wlunkcuv2w2" path="res://src/items/throwable/ThrowableItemStats.cs" id="1_s3pq7"]
[resource]
script = ExtResource("1_s3pq7")
ThrowableItemTags = Array[int]([])
UsableItemTags = Array[int]([0])
Name = "Spell Sign: Knowledge"
Description = "Doubles experience points earned. Effect is temporary."
Texture = ExtResource("1_3605p")
SpawnRate = 0.1
ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://mi70lolgtf3n"
path.s3tc="res://.godot/imported/GEOMANCER-DICE.png-29575eb9771a13eb2cd0b8f4bb92f76c.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://src/items/throwable/textures/GEOMANCER-DICE.png"
dest_files=["res://.godot/imported/GEOMANCER-DICE.png-29575eb9771a13eb2cd0b8f4bb92f76c.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dhfn51smm818x"
path.s3tc="res://.godot/imported/spell sign - luck.PNG-f0fcf0db4cd4291911c8889eda080fdc.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://src/items/throwable/textures/spell sign - luck.PNG"
dest_files=["res://.godot/imported/spell sign - luck.PNG-f0fcf0db4cd4291911c8889eda080fdc.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cagebvc1lp28y"
path="res://.godot/imported/tablet.PNG-95771620877422607611342ad4de8709.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/items/throwable/textures/tablet.PNG"
dest_files=["res://.godot/imported/tablet.PNG-95771620877422607611342ad4de8709.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0