* added loader for ItemTypes.txt
* added loader for bodylocs.txt
* lint fix for item_types loader
* adding loader for sets.txt
* minor edit
* adding loader for SetItems.txt
* added loader for automagic.txt
* entity debug rendering, with command
needed to add getter method to MapEntity interface, so that's the reasoning for changing objects/npcs/player/etc
this currently brings allocs/s up to 10 (you can check by running `fps` command, se we need to look into d2debugutils and how it handles drawing text
* reverting velocity copy, broke the map entity tests. debug display wont show velocity currently.
* adding velocity debug
* Reorganize MapEngine
This is already turning into a mess...
* Map engine selects tile index to use
Still very ugly
* Fix subtile flag combination
* Prepare randomly generated base tiles
* Restore collision viewer
* Movement works again, searches for straight paths
Paths are now d2vector slices
* Fix LOS calculation
* Fix test (I think)
* Unnecessary constructor assignments removed.
* Position implemented in d2common.Path
* Position implemented in mapEntity.Step.
* Position implemented in d2common.PathTile.
- made an enum for NPCActionType to get rid of magic numbers
- moved the enum to d2enum
- fixed lint errors in npc.go
- fixed lint errors in mapstamp.go (because it was using npc.go)
* adding ranged number type, for use in stats
* Loaded Skills.txt
* asset manager only binds terminal commands if terminal != nil
* WIP stats
* cache getter and clear methods were not implemented
* asset manager handles a nil terminal pointer
* adding skilldesc.txt loader (needs work)
* ctc stat descriptions functions working
* moving description functionality out of itemstatcost loader and into stats
* stats seem like a central part of diablo, moving into d2core.
* stats seem like a central part of diablo, moving into d2core.
* delint
* adding statlist, statlist reduction, unit tests
* minor edits to stat.go
* lint error in statlist.go
* Remove dependency on actual data from mpq files
stats unit tests now use mock data
* fixing some lint errors, formatting
Co-authored-by: Maxime Lavigne (malavv) <duguigne@gmail.com>
* Reflect and ReflectSurface benchmark.
* Rotate, NinetyAnti and NinetyClock benchmark.
* Equals, EqualsApprox, CompareApprox and IsZero benchmark.
* Benchmarks for everything else.
Also removing dead functions and commented out code and correcting typos.
* Initial test and benchmark for mapEntity.Step().
* Removed `&& !m.hasPath()` from mapEntity.atTarget
* Direction is now updated when the path node changes mid-step and target is updated when path is set.
* Test improvements.
* Deleted old benchmark function and tidying.
* d2math.Abs added.
* Abs benchmark and optimisation.
* Negate and Distance benchmark.
* Length and SetLength benchmark.
* Lerp and Dot benchmark.
* Cross and Normalize benchmark.
* Angle and SignedAngle benchmark.
* Trivial change to Vector.Abs()
* Fixed NaN on normalize 0 vector.
* Tentative implementation in getStepLength.
* mapEntity.TileX/Y removed.
* Fixed Position and Target not being initialised in createMapEntity.
* mapEntity.Position is no longer embedded.
* mapEntity.LocationX/Y no longer used outside map_entity.go.
* mapEntity.subCellX/Y removed.
* mapEntity.LocationX/Y removed.
* mapEntity.OffsetX/Y and TargetX/Y removed.
* Direction method added to Vector, returns 0-64 direction.
* Moved Vector.Direction() to Position.DirectionTo and refactored.
* Renamed RenderOffset from SubCell and tested IsZero.
* d2math.WrapInt added for use with directions.
* Tidied up position and tests.
* Refactored d2common.AdjustWithRemainder into d2mapEntity.
* Tidying up d2mapEntity.
* Final cleanup.
* Lint warnings.
* Spelling correction.
* lint updates for /d2astar
* png issue
* debug package
* load bmp properly
* debug draft
* Vector float64 (#565)
* Fixed nil pointer in Copy()
* Position added
Added Floor() and String() methods to Vector.
Also added Position which declares an embedded Vector2 and returns various forms of it.
* d2vector.Vector2 renamed to d2vector.BigFloat
* vector.go renamed to big_float.go
* Float64 stub and more renaming
* Vector value getters
* Separate vector types with initial methods.
* Divide and lint warnings.
* Distance and Length.
* Scale, Abs and Negate.
* CompareFloat64Fuzzy delta direction reversed.
* Refactor vector_test.go.
* Renamed Approx methods.
* Distance and Length.
* Distance and Length.
* Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests.
* Angle, SignedAngle and other small functions.
* Receiver rename.
* SingedAngle and test fixed
* Rotate.
* SetLength.
* Cross.
* NinetyAnti and NinetyClock.
* Lerp and Clamp.
* Reflect and ReflectSurface.
* Cardinal convenience functions.
* Comments.
* Panic on NaN and Inf in Position.
* Lint warnings and comments.
* D2map lint warnings (#566)
* Comments and newlines in engine.go
* Comments and newlines in object.go
* Comments and newlines in animated_entity.go
* Comments and newlines in missile.go
* Comments and newlines in npc.go
* Comments and newlines in player.go
* Removed object.go (incorrectly merged it in during rebase).
* Comments and newlines in renderer.go.
* Comments and newlines in map_entity.go.
* Comments and newlines in walk_mesh.go.
* Comments and newlines in viewport.go and tile_cache.go.
* Comments and newlines in stamp.go and wilderness_tile_types.go.
* Comments and newlines in everything else.
* removing inventory grid test for now because it causes builds to fail on github (#570)
* Refactored d2enum (#567)
* Refactored animation mode enum
* More d2enum changes
* Refactored tile enum
* Refactored weapon class enum
* Refactored more enums
* Refactored item event enum
* Fixed init_functions animation mode
* Removed string2enum from MonsterAnimationMode
* Refactored ItemStatCost description
* Last enum lint errors
* Regenerated monster stringer file
* compressed image
* Replaced restruct with StreamReader (#574)
* Fixed bug in palette.go (#575)
* Javascript console commands (#572)
* Allow the execution of JS from the terminal when hosting a local game or playing a single game
Signed-off-by: William Claude <w.claude@thebeat.co>
* Reorganise imports on edited files
Signed-off-by: William Claude <w.claude@thebeat.co>
* Remove Reset
Signed-off-by: William Claude <w.claude@thebeat.co>
* Add inventory.txt loader, use the records (#573)
* adding resource entry for inventory.txt
* adding loader for inventory.txt
* adding call to inventory.txt loader in d2app
* d2game now uses the inventory.txt records for making the inventory panel
* removed comments
* remove unused files
* update go.mod
* lint updates for /d2astar
* png issue
* update go.mod
Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com>
Co-authored-by: dk <dknuth0101@gmail.com>
Co-authored-by: Intyre <Intyre@gmail.com>
Co-authored-by: William <1004323+aziule@users.noreply.github.com>
* adding resource entry for inventory.txt
* adding loader for inventory.txt
* adding call to inventory.txt loader in d2app
* d2game now uses the inventory.txt records for making the inventory panel
* Fixed nil pointer in Copy()
* Position added
Added Floor() and String() methods to Vector.
Also added Position which declares an embedded Vector2 and returns various forms of it.
* d2vector.Vector2 renamed to d2vector.BigFloat
* vector.go renamed to big_float.go
* Float64 stub and more renaming
* Vector value getters
* Separate vector types with initial methods.
* Divide and lint warnings.
* Distance and Length.
* Scale, Abs and Negate.
* CompareFloat64Fuzzy delta direction reversed.
* Refactor vector_test.go.
* Renamed Approx methods.
* Distance and Length.
* Distance and Length.
* Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests.
* Angle, SignedAngle and other small functions.
* Receiver rename.
* SingedAngle and test fixed
* Rotate.
* SetLength.
* Cross.
* NinetyAnti and NinetyClock.
* Lerp and Clamp.
* Reflect and ReflectSurface.
* Cardinal convenience functions.
* Comments.
* Panic on NaN and Inf in Position.
* Lint warnings and comments.
* Add PushEffect, handle effects in renderer
* Set effects instead of blend
* Stop using PushCompositeMode, use PushEffect
* Remove remaining composite mode things