Skip to content

Flat modifiers - #3378

Open
Crepestrom wants to merge 8 commits into
PixelGuys:masterfrom
Crepestrom:flat-modifiers
Open

Flat modifiers#3378
Crepestrom wants to merge 8 commits into
PixelGuys:masterfrom
Crepestrom:flat-modifiers

Conversation

@Crepestrom

@Crepestrom Crepestrom commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Allows for items to have flat bonuses as well as percentage bonuses
Usefull for addons and creating even more intersting materials

Also changes uranium to have less mass damage and hardness damage in exchange for a damage boost on the modifier
image

@Crepestrom
Crepestrom marked this pull request as ready for review July 17, 2026 05:50
@Wunka Wunka moved this to Low Priority in PRs to review Jul 17, 2026

@SpellDigger SpellDigger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

as a side note, the way modifiers are applied are out of order, if we are really going to do this you should find a way to put the modifiers on some order so flat bonuses get added before/after multiplicative bonuses

Comment thread src/proceduralItem/modifiers/bad_at.zig Outdated
Comment thread assets/cubyz/items/uranium_ingot.zig.zon
@Crepestrom

Copy link
Copy Markdown
Contributor Author

yeah though it technically does have an order
its powerful first then good_at
though there is no order between powerful and weak

@SpellDigger

Copy link
Copy Markdown
Contributor

yeah though it technically does have an order its powerful first then good_at though there is no order between powerful and weak

it infact does not have an order, its just the way good_at works imitates an order becuase the effect is applied when mining not on the tool stats itself

@Crepestrom

Copy link
Copy Markdown
Contributor Author

ye

@SpellDigger

Copy link
Copy Markdown
Contributor

yea so im asking YOU to make sure theres some sort of order between flat and multiplicative property modifications

@Crepestrom

Copy link
Copy Markdown
Contributor Author

ye i am doing that

Comment thread src/items.zig
Comment on lines +518 to 526
for (tempModifiers.items) |mod| {
mod.changeProceduralItemParametersFlat(proceduralItem);
}
for (tempModifiers.items) |mod| {
mod.changeProceduralItemParametersMult(proceduralItem);
}
for (tempModifiers.items) |mod| {
mod.changeProceduralItemParameters(proceduralItem);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is a very inefficient way to do it, change the implementation to only need a single for loop

Comment on lines +24 to 30
pub fn changeProceduralItemParametersFlat(proceduralItem: *ProceduralItem, data: Data) void {
proceduralItem.setProperty(.swingSpeed, proceduralItem.getProperty(.swingSpeed) - data.flatStrength);
}

pub fn changeProceduralItemParametersMult(proceduralItem: *ProceduralItem, data: Data) void {
proceduralItem.setProperty(.swingSpeed, proceduralItem.getProperty(.swingSpeed)*(1 - data.multStrength));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is unecessary bloat, change the implementation in such a way that only changeProceduralItemParameters is needed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ngl scrap that, u prob could get away with 2 functions instead of 3 mostly to account for cases like single_use having changeProceduralItemParameters override the properties

@Wunka Wunka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You are changing a lot here.

  1. please state an exact reason for this. Why should this be added?
  2. please only touch the powerfull modifier and not rename strength to "multStrength", to have the least amount of changes. (I would even only keep the powerfull changes for testing and not to merge, as its another question which modifers should get this)
  3. as with powerfull, the uranium change will only be for testing should not be merged at the end.

@IntegratedQuantum

Copy link
Copy Markdown
Member

I think we should try to reduce the number of modifiers, the current system was made in a time where we didn't have to consider armor and accessories yet. Duplicating this logic 1 million times is not very fun.

@IntegratedQuantum IntegratedQuantum moved this from Low Priority to WIP/not ready for review in PRs to review Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: WIP/not ready for review

Development

Successfully merging this pull request may close these issues.

4 participants