-
-
Notifications
You must be signed in to change notification settings - Fork 232
Range Modifiers #3385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Crepestrom
wants to merge
6
commits into
PixelGuys:master
Choose a base branch
from
Crepestrom:Range-Buffs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Range Modifiers #3385
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| pub const bad_at = @import("bad_at.zig"); | ||
| pub const durable = @import("durable.zig"); | ||
| pub const fragile = @import("fragile.zig"); | ||
| pub const single_use = @import("single_use.zig"); | ||
| pub const good_at = @import("good_at.zig"); | ||
| pub const heavy = @import("heavy.zig"); | ||
| pub const bad_at = @import("bad_at.zig"); | ||
| pub const light = @import("light.zig"); | ||
| pub const heavy = @import("heavy.zig"); | ||
| pub const powerful = @import("powerful.zig"); | ||
| pub const single_use = @import("single_use.zig"); | ||
| pub const weak = @import("weak.zig"); | ||
| pub const long = @import("long.zig"); | ||
| pub const short = @import("short.zig"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| const std = @import("std"); | ||
|
|
||
| const main = @import("main"); | ||
| const ProceduralItem = main.items.ProceduralItem; | ||
|
|
||
| pub const Data = packed struct(u128) { multStrength: f32, flatStrength: f32, pad: u64 = undefined }; | ||
|
|
||
| pub const priority = 1; | ||
|
|
||
| pub fn loadData(zon: main.ZonElement) Data { | ||
| return .{ | ||
| .multStrength = @max(0, zon.get(f32, "multStrength") orelse 0), | ||
| .flatStrength = @max(0, zon.get(f32, "flatStrength") orelse 0), | ||
| }; | ||
| } | ||
|
|
||
| pub fn combineModifiers(data1: Data, data2: Data) ?Data { | ||
| return .{ | ||
| .multStrength = std.math.hypot(data1.multStrength, data2.multStrength), | ||
| .flatStrength = std.math.hypot(data1.flatStrength, data2.flatStrength), | ||
| }; | ||
| } | ||
|
|
||
| pub fn changeBlockRange(data: Data) struct { f32, f32 } { | ||
| return .{data.flatStrength, data.multStrength}; | ||
| } | ||
|
|
||
| pub fn printTooltip(outString: *main.ListManaged(u8), data: Data) void { | ||
| if (data.multStrength != 0 and data.flatStrength != 0) outString.print("#00f870**Far Reaching**#808080 *Increases range by **{d:.0}%** and **+{d:.0}**", .{data.multStrength*100, data.flatStrength}); | ||
| if (data.multStrength != 0 and data.flatStrength == 0) outString.print("#00f870**Far Reaching**#808080 *Increases range by **{d:.0}%**", .{data.multStrength*100}); | ||
| if (data.multStrength == 0 and data.flatStrength != 0) outString.print("#00f870**Far Reaching**#808080 *Increases range by **+{d:.0}**", .{data.flatStrength}); | ||
| if (data.multStrength == 0 and data.flatStrength == 0) outString.print("#ff0000**Far Reaching did not find any multStrength and Flatstrength**", .{}); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| const std = @import("std"); | ||
|
|
||
| const main = @import("main"); | ||
| const ProceduralItem = main.items.ProceduralItem; | ||
|
|
||
| pub const Data = packed struct(u128) { multStrength: f32, flatStrength: f32, pad: u64 = undefined }; | ||
|
|
||
| pub const priority = 1; | ||
|
|
||
| pub fn loadData(zon: main.ZonElement) Data { | ||
| return .{ | ||
| .multStrength = @max(0, zon.get(f32, "multStrength") orelse 0), | ||
| .flatStrength = @max(0, zon.get(f32, "flatStrength") orelse 0), | ||
| }; | ||
| } | ||
|
|
||
| pub fn combineModifiers(data1: Data, data2: Data) ?Data { | ||
| return .{ | ||
| .multStrength = std.math.hypot(data1.multStrength, data2.multStrength), | ||
| .flatStrength = std.math.hypot(data1.flatStrength, data2.flatStrength), | ||
| }; | ||
| } | ||
|
|
||
| pub fn changeBlockRange(data: Data) struct { f32, f32 } { | ||
| return .{data.flatStrength, data.multStrength}; | ||
| } | ||
|
|
||
| pub fn printTooltip(outString: *main.ListManaged(u8), data: Data) void { | ||
| if (data.multStrength != 0 and data.flatStrength != 0) outString.print("#f80088**Short**#808080 *Decreases range by **{d:.0}%** and **+{d:.0}**", .{data.multStrength*100, data.flatStrength}); | ||
| if (data.multStrength != 0 and data.flatStrength == 0) outString.print("#f80088**Short**#808080 *Decreases range by **{d:.0}%**", .{data.multStrength*100}); | ||
| if (data.multStrength == 0 and data.flatStrength != 0) outString.print("#f80088**Short**#808080 *Decreases range by **+{d:.0}**", .{data.flatStrength}); | ||
| if (data.multStrength == 0 and data.flatStrength == 0) outString.print("#ff0000**Short did not find any multStrength and Flatstrength**", .{}); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.