-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
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 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) - Add an instance of that component as a property in
Sources/Core/Sources/Player/Player.swift
(and remember to add the component to thecreateEntity
call inPlayer.add(to:)
) - Update
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). - Add two new icons to
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. - Add a
currentAttackStrengthMultiplier(for item: Item, factor: Float) -> Float
function which computesFloat(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 ofInGameGUI.continuousMeter
)
If you need any help feel free to ask on the Discord server!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers