You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not strictly necessary for game play, but it'd be nice to have and I reckon it'd definitely make things feel more polished. This should make a relatively friendly first issue so I've included an overview of the steps below,
Create a new PlayerAttackStrength component in Sources/Core/Sources/ECS/Components. This component should just store a ticksSinceLastReset property which stores the tick number in which the player last did an action that reset their attack strength (e.g. switching hot bar slots, left clicking an entity or nothing, cancelling breaking a block in survival; not sure if there are any others)
Add an instance of that component as a property in Sources/Core/Sources/Player/Player.swift (and remember to add the component to the createEntity call in Player.add(to:))
Update PlayerInputSystem and PlayerBlockBreakingSystem to reset ticksSinceLastReset whenever an action is performed that should reset the player's attack strength. Remember to increment this values every tick as well (do it before anything resets it so that the reset value doesn't immediately get incremented).
Add two new icons to Sources/Core/Sources/GUI/GUISprite.swift; attackStrengthIndicatorForeground and attackStrengthIndicatorBackground. To get the positions and sizes, open ~/Library/Application Support/dev.stackotter.delta-client/assets/minecraft/textures/gui/icons.png in Preview and measure by making selections.
Add a currentAttackStrengthMultiplier(for item: Item, factor: Float) -> Float function which computes Float(ticksSinceLastReset + factor) / Float(item.properties?.toolProperties?.speed ?? 4)
Update Sources/Core/Sources/GUI/InGameGUI.swift to display the attack strength indicator under the crosshair (you should be able to make use of InGameGUI.continuousMeter)
If you need any help feel free to ask on the Discord server!
The text was updated successfully, but these errors were encountered:
Not strictly necessary for game play, but it'd be nice to have and I reckon it'd definitely make things feel more polished. This should make a relatively friendly first issue so I've included an overview of the steps below,
PlayerAttackStrength
component inSources/Core/Sources/ECS/Components
. This component should just store aticksSinceLastReset
property which stores the tick number in which the player last did an action that reset their attack strength (e.g. switching hot bar slots, left clicking an entity or nothing, cancelling breaking a block in survival; not sure if there are any others)Sources/Core/Sources/Player/Player.swift
(and remember to add the component to thecreateEntity
call inPlayer.add(to:)
)PlayerInputSystem
andPlayerBlockBreakingSystem
to resetticksSinceLastReset
whenever an action is performed that should reset the player's attack strength. Remember to increment this values every tick as well (do it before anything resets it so that the reset value doesn't immediately get incremented).Sources/Core/Sources/GUI/GUISprite.swift
;attackStrengthIndicatorForeground
andattackStrengthIndicatorBackground
. To get the positions and sizes, open~/Library/Application Support/dev.stackotter.delta-client/assets/minecraft/textures/gui/icons.png
in Preview and measure by making selections.currentAttackStrengthMultiplier(for item: Item, factor: Float) -> Float
function which computesFloat(ticksSinceLastReset + factor) / Float(item.properties?.toolProperties?.speed ?? 4)
Sources/Core/Sources/GUI/InGameGUI.swift
to display the attack strength indicator under the crosshair (you should be able to make use ofInGameGUI.continuousMeter
)If you need any help feel free to ask on the Discord server!
The text was updated successfully, but these errors were encountered: