* added highlight to animated entity
* moving provider functions for item, missile, npc, player into package export file d2mapentity.go
* changed `Create` to `New` in map entity provider functions
* add item highlight on hover
* add Name method to item entity
* wip d2items system and item properties
* added loader for TreasureClassEx.txt
* wip item spawn from treasure class records
* wip items
* add call to init item equivalencies, remove treasure class test from d2app
* made item affix records global var a map of affix codes to the records
* changed how item to item common record equivalency is determined
* changed set items records export to a map of their codes to the records, grouped property params into a struct
* changed property parameter field from calcstring to string
* fixed bug in stat value clone
* adding equipper interface as part of stat context, eventually to be used to resolve set bonus (among other things)
* made the item interface simpler, only needs name and description methods
* adding equipper interface, for anything that will equip or have active items
* handle case where min and max are swapped, removed commented code
* added property/stat resolution for magic, rare, set, and unique items
* adding item generator which can roll for items using treasure class records
* fixed item equivalency func being called in the wrong spot
* added item spawning
- added packet type for spawning items
- added client/server handlers for SpawnItem packets
- added map entity for items
- added simpler item provider function in diablo2item package
- added debug terminal command for spawning items
* 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)
* delint_d2networking
not sure what to do about lint error G110 on calls to `io.Copy`, warns
about gzip compression bomb possibility, leaving those.
all todo's have been left.
* removed duplicate const
* 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.
* 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>
* Added automap.go stub
* Fixed bad error handling
* Handle header error from io.Copy()
* d2client.ClientConnection renamed to ServerConnection
Having two interfaces named ClientConnection in adjacent packages was a point of confusion for me. Renamed the client ClientConnection to ServerConnection since clients connect to servers and servers to clients.
* Fix lint warnings in remote_client_connection.go
* Tidying and lint warnings in remote_client_connection.go
* Switch statement in remote_client_connection.go now has matching blocks.
* RemoteClientConnection.serverListener refactor.
The switch statement is still repetitive but now it's separate. I think we would need generics to make it smaller.
* Receiver name change from l to r.
* Comments and other adjustments.
* Old commits
* Fixed bad error handling
* Cleaned up remote_client_connection.go
* SendPacketToClient removed.
* Added automap.go stub
* Handle errors in original AutoMap.txt file
* Completed AutoMapRecord struct and comments
* AutoMap loader implemented
* Update from base repo
* Comments added to d2netpacket and d2netpackettype.
Note, the Overview for d2netpacket is in net_packet.go. It could be placed in a doc.go file but net_packet.go seemed appropriate in this case.
* Comments added to d2server
* client_connection.go missed from previous commit
* Comments added to d2client
* Doc.go added to d2networking and other corrections
* Unused parameter present to satisfy interface, named it '_'
* Unhandled errors and other issues resolved in d2networking.
This commit adds simple error reporting and creates a lot of mess. I will be doing one more pass to tidy things up a bit before I move on.
* Commented out continue on RemoteClientConnection error and implemented stringer in message type
* NetPacketType.String uses map instead of switch.
* Map moved into String method
* Added automap.go stub
* Handle errors in original AutoMap.txt file
* Completed AutoMapRecord struct and comments
* AutoMap loader implemented
* Update from base repo
* Comments added to d2netpacket and d2netpackettype.
Note, the Overview for d2netpacket is in net_packet.go. It could be placed in a doc.go file but net_packet.go seemed appropriate in this case.
* Comments added to d2server
* client_connection.go missed from previous commit
* Comments added to d2client
* Doc.go added to d2networking and other corrections
* 412 - move missle code to game_client and add animation, still buggy
* mostly working casting animation that cancels path
Co-authored-by: carrelda@Davids-MacBook-Pro.local <carrelda@Davids-MacBook-Pro.local>
* WIP refactor of d2map stuff
* more d2map refactor
adding realm init to game client
passing map engine from client and server into realm at init
change `generate map packet` to have act and level index as data
* client explodes, but getting there
* realm now initializes, networking works, but map generators dont currently do anything
* changed the way that level type records are loaded
* fixed funcs for level data lookups
* started implementing level generator, currently crashing
* client no longer exploding
* d2networking refactor
put exports into d2client.go and d2server.go
kept GameClient and GameServer methods into their respective files
made methods for packet handlers instead of the giant switch statements
* bugfix: getting first level id by act
* minor refactor of gamescreen for readability
* towns now generate on server start, create player takes act and level id as args, levels have their own map engine
* Save/load hero stats and display them in stats panel.
* Load default hero state for characters created before saving stats was introduced
Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>
* Use integer directions for rotating map entities
* Manage composite directly in npc
* Player manages its own composite
* Split up animation mode types
Players, monsters, objects all have their own types
* Clean up AnimatedEntity
* Rename AnimatedEntity -> Object
* Keep the object txt record on hand in Object
When clicking on the other side of a wall or in an an inaccessible area,
route the player the closest possible node. This allows running along
walls and matches the original closely.
Co-authored-by: Nicholas Eden <neden@zigzagame.com>
* Improve run/walk/neutral animation handling. Initial parsing of LevelDetail records. Support for holding mouse buttons.
- Run/walk/neutral positions now map to a different animation mode(and speed) depending if in or out of town.
- Run/walk toggle which can be activated/deactivated with R key.
- Temporary(and incorrect) loading and mapping for LevelDetails records.
- Zone change label which shows the level name from LevelDetailsRecord when the player enters a different zone.
- Allow holding mouse left/right button to repeatedly generate an action.
* Remove duplicate load of LevelDetails. Replace numbers in zone change logic with their corresponding RegionIdType
* Move zone change check at the correct place
Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>
* camera offset for ui panels :
added maprenderer viewport to be aligned left or right
calling alignement on keyPress in game_controls
* check if already aligned
* fix bugs
-forgot to assign alignement
-defaultScreenRect instead of screenRect because of issue mentionned in original comment
* remove config.json and replace go.mod line
* removing duplicate import of d2common
replacing all dh to d2common
* remove useless breaks from switch statement
* better range when value unused + prettying import
* item_affix rewrite
using return values instead of pointer references in arguments
* ebiten deprecated calls
* small fixes
* Switched to json formatted characters
* Added infrastructure for networking
* Minor updates.
* more updates for map engine/rendering
* More map engine changes and fixes