Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b217fd6
Golbo
Crepestrom Apr 12, 2026
fe88d23
oops not a branch
Crepestrom Apr 12, 2026
bba651a
Merge branch 'PixelGuys:master' into master
Crepestrom Apr 12, 2026
0907c9b
Merge branch 'PixelGuys:master' into master
Crepestrom Apr 18, 2026
cd6cb17
Merge branch 'PixelGuys:master' into master
Crepestrom Apr 19, 2026
6661fea
Merge remote-tracking branch 'upstream/master'
Crepestrom Apr 22, 2026
7f5bf66
Merge remote-tracking branch 'upstream/master'
Crepestrom Apr 28, 2026
565e3c2
Merge remote-tracking branch 'upstream/master'
Crepestrom May 2, 2026
1d4f3ee
Merge remote-tracking branch 'upstream/master'
Crepestrom May 7, 2026
bb44a4c
Merge remote-tracking branch 'upstream/master'
Crepestrom May 8, 2026
ce89c93
Merge remote-tracking branch 'upstream/master'
Crepestrom May 9, 2026
3dee6fb
Merge remote-tracking branch 'upstream/master'
Crepestrom Jun 5, 2026
c0c9b4e
Merge remote-tracking branch 'upstream/master'
Crepestrom Jun 6, 2026
85cb92d
Merge remote-tracking branch 'upstream/master'
Crepestrom Jun 13, 2026
0a87c7a
Merge remote-tracking branch 'upstream/master'
Crepestrom Jun 27, 2026
7e037b5
Merge remote-tracking branch 'upstream/master'
Crepestrom Jun 28, 2026
1a12312
Merge remote-tracking branch 'upstream/master'
Crepestrom Jul 7, 2026
97155bf
Merge remote-tracking branch 'upstream/master'
Crepestrom Jul 10, 2026
bf8f638
Merge remote-tracking branch 'upstream/master'
Crepestrom Jul 16, 2026
a52aad2
almost complete
Crepestrom Jul 19, 2026
34667ae
Revert "almost complete"
Crepestrom Jul 19, 2026
dcfb4e3
Merge remote-tracking branch 'upstream/master'
Crepestrom Jul 22, 2026
83ca9dc
Merge remote-tracking branch 'upstream/master'
Crepestrom Aug 1, 2026
db4be3c
Merge remote-tracking branch 'upstream/master'
Crepestrom Aug 22, 2026
e7ec715
Merge remote-tracking branch 'upstream/master'
Crepestrom Sep 5, 2026
c28f6b2
Merge remote-tracking branch 'upstream/master'
Crepestrom Sep 19, 2026
3a325e9
finished pr
Crepestrom Sep 19, 2026
f9f6880
formating and added negative stats
Crepestrom Sep 19, 2026
1b09c2b
renamed and added tool names
Crepestrom Sep 19, 2026
2df1886
oops swapped swing speed and duriability
Crepestrom Sep 19, 2026
a563df0
Merge remote-tracking branch 'upstream/master'
Crepestrom Sep 20, 2026
f856b85
new iteration of visuals
Crepestrom Sep 21, 2026
75bd7ce
Merge remote-tracking branch 'upstream/master'
Crepestrom Sep 28, 2026
1444196
Merge remote-tracking branch 'upstream/master'
Crepestrom Oct 4, 2026
f6b5eed
removed unnessicacy function
Crepestrom Oct 7, 2026
d29fe32
Revert "removed unnessicacy function"
Crepestrom Oct 7, 2026
905f9c4
enum is now enum
Crepestrom Oct 11, 2026
e2423c0
swapped merging function
Crepestrom Oct 11, 2026
2e90d3f
alphabetical
Crepestrom Oct 11, 2026
c204714
tagname
Crepestrom Oct 11, 2026
8b7df7e
adjustments
Crepestrom Oct 11, 2026
aaf1624
Merge remote-tracking branch 'upstream/master' into Basic-Stat-Modifi…
Crepestrom Oct 11, 2026
d6a9bcf
intentional break
Crepestrom Oct 11, 2026
ea822e9
seeing if c fails again
Crepestrom Oct 11, 2026
42946ea
Revert "seeing if c fails again"
Crepestrom Oct 11, 2026
2fe83cb
Reapply "seeing if c fails again"
Crepestrom Oct 11, 2026
4570179
finished pr
Crepestrom Sep 19, 2026
47b2951
formating and added negative stats
Crepestrom Sep 19, 2026
3f95f17
renamed and added tool names
Crepestrom Sep 19, 2026
de24822
oops swapped swing speed and duriability
Crepestrom Sep 19, 2026
0942848
new iteration of visuals
Crepestrom Sep 21, 2026
84cc01b
enum is now enum
Crepestrom Oct 11, 2026
76c17e9
swapped merging function
Crepestrom Oct 11, 2026
2e1bf8c
alphabetical
Crepestrom Oct 11, 2026
b33fba3
tagname
Crepestrom Oct 11, 2026
a56efec
adjustments
Crepestrom Oct 11, 2026
19f34f8
Take patch version from -Dversion argument (#3680)
yel0h Oct 7, 2026
ae67bc0
Expose the number of ThreadPool threads in the launchConfig (#3675)
IntegratedQuantum Oct 7, 2026
edd67bf
Vulkan framebuffers (#3646)
IntegratedQuantum Oct 7, 2026
ff552e6
Add music track registry and biome mood (#3679)
yel0h Oct 7, 2026
072ec05
Mesh selection vulkan (#3685)
Wunka Oct 8, 2026
3f2f1da
Spawn command can reset a specific players spawn (#3572)
Crepestrom Oct 10, 2026
9d98ce2
Silt and frosted grass (#3691)
careeoki Oct 10, 2026
c135181
intentional break
Crepestrom Oct 11, 2026
8c59731
seeing if c fails again
Crepestrom Oct 11, 2026
64dc03d
Revert "seeing if c fails again"
Crepestrom Oct 11, 2026
e7018f7
Reapply "seeing if c fails again"
Crepestrom Oct 11, 2026
8d4376c
Revert "Reapply "seeing if c fails again""
Crepestrom Oct 11, 2026
99dd254
Merge branch 'Basic-Stat-Modifier-Combined' of https://github.com/Cre…
Crepestrom Oct 11, 2026
96f40bb
Reapply "Reapply "seeing if c fails again""
Crepestrom Oct 11, 2026
719ad24
Update src/proceduralItem/modifiers/base_stat.zig
Crepestrom Oct 13, 2026
71d33c3
oops wrong operation
Crepestrom Oct 13, 2026
be4b814
damnit anotther error in input
Crepestrom Oct 13, 2026
3b7db74
oh neat i dont have to define explicit values
Crepestrom Oct 13, 2026
f5869e5
formatting?
Crepestrom Oct 13, 2026
b4de959
formatting?
Crepestrom Oct 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/amber_ore.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
.textureRoughness = 0.1,
.modifiers = .{
.{
.id = "light",
.id = "base_stat",
.targetProperty = "swingSpeed",
.strength = 0.5,
.restriction = .{
.id = .encased,
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/baobab.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.45,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/birch.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.45,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/bolete.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
.textureRoughness = 0.5,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.45,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/cirrus.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "light",
.id = "base_stat",
.targetProperty = "swingSpeed",
.strength = 0.15,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/glimmergill.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
.textureRoughness = 0.5,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.50,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/mahogany.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.45,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/oak.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.45,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/palm.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.45,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/pine.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.45,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/toadstool.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
.textureRoughness = 0.5,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.45,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/branch/willow.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.45,
},
},
Expand Down
8 changes: 5 additions & 3 deletions assets/cubyz/blocks/diamond_ore.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
.textureRoughness = 0.1,
.modifiers = .{
.{
.id = "fragile",
.strength = 0.5,
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = -0.5,
.restriction = .{
.id = .not,
.child = .{
Expand All @@ -37,7 +38,8 @@
},
},
.{
.id = "powerful",
.id = "base_stat",
.targetProperty = "damage",
.strength = 0.5,
.restriction = .{
.id = .encased,
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/jade_ore.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
.textureRoughness = 0.1,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 1.5,
.restriction = .{
.id = .encased,
Expand Down
5 changes: 3 additions & 2 deletions assets/cubyz/blocks/obsidian.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
.textureRoughness = 0.1,
.modifiers = .{
.{
.id = "fragile",
.strength = 0.33,
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = -0.33,
},
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/planks/baobab.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
.swingSpeed = 4.2,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.4,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/planks/birch.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.4,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/planks/cirrus.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "light",
.id = "base_stat",
.targetProperty = "swingSpeed",
.strength = 0.1,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/planks/mahogany.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.4,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/planks/oak.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.4,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/planks/palm.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
.swingSpeed = 5.2,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.4,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/planks/pine.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.4,
},
},
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/planks/willow.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
.textureRoughness = 0.7,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.4,
},
},
Expand Down
5 changes: 3 additions & 2 deletions assets/cubyz/blocks/ruby_ore.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
.textureRoughness = 0.1,
.modifiers = .{
.{
.id = "fragile",
.strength = 0.45,
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = -0.45,
.restriction = .{
.id = .not,
.child = .{
Expand Down
5 changes: 3 additions & 2 deletions assets/cubyz/blocks/sandstone/_defaults.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
.textureRoughness = 0.9,
.modifiers = .{
.{
.id = "fragile",
.strength = 0.20,
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = -0.20,
.restriction = .{
.id = .not,
.child = .{
Expand Down
3 changes: 2 additions & 1 deletion assets/cubyz/blocks/voidstone/_defaults.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
.textureRoughness = 0.4,
.modifiers = .{
.{
.id = "durable",
.id = "base_stat",
.targetProperty = "maxDurability",
.strength = 0.1,
},
.{
Expand Down
10 changes: 5 additions & 5 deletions src/items.zig
Original file line number Diff line number Diff line change
Expand Up @@ -800,13 +800,13 @@ pub const ProceduralItemType = struct { // MARK: ProceduralItemType
pixelSourcesOverlay: [16][16]u8,
};

const ProceduralItemProperty = enum {
damage,
maxDurability,
pub const ProceduralItemProperty = enum(u8) {
Comment thread
IntegratedQuantum marked this conversation as resolved.
Outdated
damage = 0,
Comment thread
IntegratedQuantum marked this conversation as resolved.
Outdated
maxDurability = 1,
/// how long it takes before the next swing happens
swingSpeed,
swingSpeed = 2,

fn fromString(string: []const u8) ?ProceduralItemProperty {
pub fn fromString(string: []const u8) ?ProceduralItemProperty {
return std.meta.stringToEnum(ProceduralItemProperty, string) orelse {
std.log.err("Couldn't find procedural Item property {s}.", .{string});
return null;
Expand Down
7 changes: 1 addition & 6 deletions src/proceduralItem/modifiers/_list.zig
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
pub const bad_at = @import("bad_at.zig");
pub const durable = @import("durable.zig");
pub const fragile = @import("fragile.zig");
pub const good_at = @import("good_at.zig");
pub const heavy = @import("heavy.zig");
pub const light = @import("light.zig");
pub const powerful = @import("powerful.zig");
pub const single_use = @import("single_use.zig");
pub const weak = @import("weak.zig");
pub const base_stat = @import("base_stat.zig");
Comment thread
IntegratedQuantum marked this conversation as resolved.
Outdated
54 changes: 54 additions & 0 deletions src/proceduralItem/modifiers/base_stat.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const std = @import("std");

const main = @import("main");
const ProceduralItem = main.items.ProceduralItem;

pub const Data = packed struct(u128) { strength: f32, targetProperty: main.items.ProceduralItemProperty, pad: u88 = undefined };

pub const priority = 1;

fn getModifierName(data: Data) []const u8 {
if (data.strength >= 0) {
switch (data.targetProperty) {
.damage => return "#f84a00**Powerful**",
.maxDurability => return "#500090**Durable**",
.swingSpeed => return "#9fffde**Light**",
}
} else {
switch (data.targetProperty) {
.damage => return "#fcb5e3**Weak**",
.maxDurability => return "#ccddff**Fragile**",
.swingSpeed => return "#ffcc30**Heavy**",
}
}
}

pub fn loadData(zon: main.ZonElement) Data {
return .{
.strength = zon.get(f32, "strength") orelse 0,
.targetProperty = main.items.ProceduralItemProperty.fromString(zon.get([]const u8, "targetProperty") orelse "missing .targetProperty field") orelse blk: {
std.log.err("replacing with .damage", .{});
Comment thread
IntegratedQuantum marked this conversation as resolved.
Outdated
break :blk .damage;
},
};
}

pub fn combineModifiers(data1: Data, data2: Data) ?Data {
if (data1.targetProperty != data2.targetProperty) return null;
return .{
.strength = std.math.hypot(data1.strength, data2.strength),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need extra handling for negative numbers.
Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.desmos.com/calculator

i have chosen this function for that because

  • 2 equal +50% -50% will cancel out
    it keeps the hypotneuse scaling for stats

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and it follows the old scaling on the positive numbers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok it is swapped now

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you change the function, please explain (in the code) how you derived it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be best to just preserve status quo behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops forgot to save the graph to be able to be shared

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also i wrote the function wrong the first time
i should have updated it to match this graph
https://www.desmos.com/calculator/evdonhlker

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does preserve the status quo (matching the old scaling exactly) for

  • only positive numbers
  • or only negative numbers
    but the new function allows those two to be combined together

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does preserve the status quo (matching the old scaling exactly) for [...] only negative numbers

I don't see that. Please try to understand the old code before making these claims. The old code ensured that the negative value was never below 100%

.targetProperty = data1.targetProperty,
};
}

pub fn changeProceduralItemParameters(proceduralItem: *ProceduralItem, data: Data) void {
proceduralItem.setProperty(data.targetProperty, proceduralItem.getProperty(data.targetProperty)*(1 + data.strength));
}

pub fn printTooltip(outString: *main.ListManaged(u8), data: Data) void {
if (data.strength >= 0) {
outString.print("{s} #808080(#30ca64+**{d:.0}% #808080{})", .{getModifierName(data), data.strength*100, data.targetProperty});
} else {
outString.print("{s} #808080(#fd3535**{d:.0}% #808080{})", .{getModifierName(data), data.strength*100, data.targetProperty});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we should use the . here, I think it should be only used for tags.
You can use @tagName to get the name without the .

Also in my opinion the parenthesis are also kind of pointless. The different colors already provide enough seperation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the parethisis just look nice
also is now tagname

}
}
24 changes: 0 additions & 24 deletions src/proceduralItem/modifiers/durable.zig

This file was deleted.

Loading
Loading