1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-23 15:45:24 +00:00
Commit Graph

70 Commits

Author SHA1 Message Date
Ziemas
02605227c3
Various map entity reworks (#439)
* 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
2020-06-24 13:49:13 -04:00
Tim Sarbin
954670da5f
Fixed linting issues (#438) 2020-06-24 10:13:11 -04:00
nicholas-eden
329e2f0fab
Use closest path if path not found (#431)
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>
2020-06-24 08:09:00 -04:00
Tim Sarbin
a24c05efa9
Map generation and test fixes (#430)
* More mapgen updates

* Added east generation

* Added west town generation

* Fixed test errors
2020-06-24 00:04:27 -04:00
danhale-git
897de61006
Automap corrections (#422)
* Added automap.go stub

* Handle errors in original AutoMap.txt file

* Completed AutoMapRecord struct and comments

* AutoMap loader implemented

* Update from base repo

* Cel1-4 fields replaced with a slice

* Commented out Type fields as they aren't used
2020-06-23 14:51:07 -04:00
Intyre
f119d1197c
Fix mpq wav decompression and profiler (#423)
* Fix for mpq wav decompression

* Fix for profiler
2020-06-23 14:49:46 -04:00
Ripolak
2332bd7b58
Feature/player equipment ui (#419)
* Add basic EquipmentSlot struct

* Add Load function to EquipmentSlot

* Move EquipmentSlot struct to inventory_grid.go

* Add equipmentSlots arg to ItemGrid struct

* Add basic rendering of equipment slots.

* Change rendering of equipment slots to simply use their static x and y

* Add ChangeEquippedSlot function

* Add initialization to all equipped slots types.

* Fix Y locations of equipment slots

* Move default equipment slots to a genEquipmentSlotsMap function.

* Change Item to item

* Fix coordinates

* Change usage of string to EquippedSlotType when dealing with different slots in rendering.

* Fix import error

* Remove neck example

* Add loading sprites of equipped items.

* Clean code in Inventory rendering

* Clean code in Inventory rendering

* Clean code in Inventory rendering

* Change default items that get rendered.

* Change default items that get rendered.

* Add width and height to EquipementSlot struct

* Fill in width and height to current equipment slots.

* Fix Y setting of equipment slots

* Rename variables for clean code.

* Change handling nil itemSprite to condition instead of loop return.

* Split Render function to 2 functions.

* Add TODO

* Change comment to start with capital I
2020-06-23 14:12:30 -04:00
Gürkan Kaymak
7f4db3b874
Added call to loading SuperUniques data dict (#415)
* added SuperUniques data dictionary

* added a call to LoadSuperUniques() method from the main

* added a call to LoadSuperUniques() method from the main
2020-06-23 09:30:39 -04:00
Gürkan Kaymak
1cc5b0bfbd
added SuperUniques data dictionary (#414) 2020-06-23 09:12:35 -04:00
nicholas-eden
dd21809288
Pull go-astar code into the repo, improve perf (#411)
Copied go-astar into d2common/d2astar, made a few optimizations.  Runs
roughly 30% faster according to my benchmarking.

Added a `maxCost` param to prevent searching the entire map for a path.
This probably needs tweaked a bit, but follows the original game more
closely.

Co-authored-by: Nicholas Eden <neden@zigzagame.com>
2020-06-23 02:04:17 -04:00
danhale-git
fe0fa6f14d
Feature/cubemain (#410)
* Added automap.go stub

* Handle errors in original AutoMap.txt file

* Completed AutoMapRecord struct and comments

* AutoMap loader implemented

* Update from base repo

* Added cubemain.go stub

* Input and requirement fields

* Removed CubeRecipeRequirement added CubeRecipeResult

* Comments and some name changes

* Implemented cubemain.go

* Corrected log line
2020-06-23 02:02:35 -04:00
Tim Sarbin
c2db7ede66
Added basic map generation for first area of south town (#408)
* Map engine updates. Limited rendering to specific area.

* Added south town border generation
2020-06-23 01:05:01 -04:00
Intyre
d17db5b1d1
StreamWriter: replaced slice with bytes.Buffer (#402) 2020-06-22 18:56:20 -04:00
dk
953271b8e6
minor edits (#401)
* make game update at 25fps, ui update at max fps

* minor edits to func names, d2resource constants

* renamed `loadDictionary` to `loadTextDictionary` to avoid confusion with `LoadDataDictionary`
* updated line in main.go that calls `loadTextDictionary`
* added tokens as constants inside of `d2resource/resource_paths.go` that are used in font/language paths
* moved locale string handling stuff into it's own func, now uses tokens defined in d2resource

* minor edits to func names, d2resource constants

* renamed `loadDictionary` to `loadTextDictionary` to avoid confusion with `LoadDataDictionary`
* updated line in main.go that calls `loadTextDictionary`
* added tokens as constants inside of `d2resource/resource_paths.go` that are used in font/language paths
* moved locale string handling stuff into it's own func, now uses tokens defined in d2resource

* fix: accidentally renamed func in d2asset

* git is hard

accidentally added changes not meant for this commit
2020-06-22 17:36:45 -04:00
Intyre
0c27ae63e6
MPQ memory improvements (#399) 2020-06-22 16:01:14 -04:00
Haashi
5e1725dd7d
385/lintissues (#391)
* 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
2020-06-22 11:53:44 -04:00
Ziemas
75112ec736
Show special tiles in mapdebug (#386)
More useful than the floor stuff

Also method for testing if special
2020-06-21 22:14:06 -04:00
dk
145aa92d20
hacky bugfix to keep game from crashing tf out with other languages (#383) 2020-06-21 20:45:34 -04:00
dk
3fe57700a5
adding loader for level maze details (#377) 2020-06-21 18:48:53 -04:00
William
485e60683b
Escape menu - Keyboard support and minor improvements (#374)
* Handle up/down/enter keys and reset menu on toggle

Signed-off-by: William Claude <w.claude@thebeat.co>

* Add sound when selecting an item

Signed-off-by: William Claude <w.claude@thebeat.co>

* Reorganise code and remove unused things (YAGNI)

Signed-off-by: William Claude <w.claude@thebeat.co>

* Group properties

Signed-off-by: William Claude <w.claude@thebeat.co>

* Use switch statements instead of IFs

Signed-off-by: William Claude <w.claude@thebeat.co>

* Prevent opening the escape menu over hero stats or inventory

Signed-off-by: William Claude <w.claude@thebeat.co>
2020-06-21 18:44:33 -04:00
Intyre
ec17fcf3e6
Replaced bufio.NewReader with File.Read (#375) 2020-06-21 18:43:30 -04:00
dk
ab9571b8e8
Fix: bad naming in levels.txt loader (#376)
* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions

* mend

* adding datadict loader for levels.txt

* adding comments from PK forums in the added d2enum files

* fixed bad naming. doh!
2020-06-21 18:43:09 -04:00
dk
5260ce3c87
adding loader for LvlSub.txt (level substitution details) (#378) 2020-06-21 18:41:28 -04:00
Tim Sarbin
912aaf044c
Re-tooled rendering engine (#379) 2020-06-21 18:40:37 -04:00
dk
6eb85d673a
Feature d2datadict levels (#373)
* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions

* mend

* adding datadict loader for levels.txt

* adding comments from PK forums in the added d2enum files
2020-06-21 16:45:22 -04:00
Tim Sarbin
b9f17f433f
Performance/Memory Improvements (#365)
* Performance improvements

* fix readbytes variable
2020-06-20 21:07:36 -04:00
danhale-git
99b10b2599
Feature/automap (#364)
* Added automap.go stub

* Handle errors in original AutoMap.txt file

* Completed AutoMapRecord struct and comments

* AutoMap loader implemented
2020-06-20 19:53:29 -04:00
dk
c14f285a21
Feature d2datadict difficultylevels (#363)
* adding rules for swap files to .gitignore

* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions

* adding ItemStatCost data dict loader

* adding data dict loader for difficulty levels
2020-06-20 15:59:20 -04:00
Maxime Lavigne (malavv)
07983469ed
Fixes #360 Language dictionary crash (#362)
Crashes were due to missing translation. This PR temporarily replaces the translateString calls for the default string directly.

in `select_hero_class.go` there is a level of indirection before the call to translateString, and for this reason, its `panic` call got temporarily diverted.
2020-06-20 15:14:52 -04:00
Ripolak
5edf314b48
Feature/gems (#347)
* Add GemsRecord struct

* Implement LoadGems function.

* Add condition for loading gems for excluding a visually separating line.

* Add 'gems.txt' file to resource_paths.go

* Add call for loading gems in main.go

* Remove spaces

* Add logging for gems loading.
2020-06-20 11:54:23 -04:00
Ripolak
2a54ad955b
Feature/hirelings (#348)
* Add basic HirelingRecord struct.

* Add LoadHireling func implementation

* Add call to loading hirelings

* Fix hireling field names
2020-06-20 11:52:55 -04:00
Tim Sarbin
0a206ce024
Fixed issues from last merge (#346) 2020-06-20 01:06:42 -04:00
Tim Sarbin
a8c6bbec9d
Fixed walking animations and pathing bugs. (#345) 2020-06-20 00:40:49 -04:00
dk
dd72dc413b
Feature d2datadict experience (#343)
* adding experience breakpoints data dict loader
2020-06-19 20:56:04 -04:00
dk
983f757db3
Feature d2datadict monstats (#341)
* adding rules for swap files to .gitignore

* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions

* adding ItemStatCost data dict loader

* Adding monstats.txt data dict loader

* adding myself to contributors file
2020-06-19 18:24:03 -04:00
dk
be498ee869
Feature d2datadict charstats (#339)
* main, d2common: load Magic/Rare/Unique Affix
* d2common: item affixes only
removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.
* removed debug print from item_affix.go
* changed item affix type names for clarity, removed debug print from data_dictionary
* d2common: item affix datadict and records
Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.
d2common: item affixes only
removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.
removed debug print from item_affix.go
changed item affix type names for clarity, removed debug print from data_dictionary
* reverting to pre-allocating memory for parsing txt lines
* removing the rest of the rare/unique definitions
* removing the rest of the rare/unique definitions
* adding charstats datadict loader
2020-06-18 22:42:38 -04:00
dk
f06d4b2c68
Feature item stat cost (#338)
* adding rules for swap files to .gitignore
* main, d2common: load Magic/Rare/Unique Affix
* d2common: item affixes only
removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.
* removed debug print from item_affix.go
* changed item affix type names for clarity, removed debug print from data_dictionary
* d2common: item affix datadict and records
Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.
d2common: item affixes only
removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.
removed debug print from item_affix.go
changed item affix type names for clarity, removed debug print from data_dictionary
* adding ItemStatCost data dict loader
* removed call to append, added records to exported array
2020-06-18 22:39:57 -04:00
Tim Sarbin
2da08884c4
Added multiplayer support (#336) 2020-06-18 14:11:04 -04:00
dk
a25e42518d
DataDictionary loader for ItemStatCost (#333)
* adding rules for swap files to .gitignore

* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions

* adding ItemStatCost data dict loader
2020-06-13 19:52:22 -04:00
dk
515b66736d
Item Affixes (#328)
* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions
2020-05-08 12:33:37 -04:00
Robin Eklind
ff4f0b0bfa
all: use goimports to format code and fix two minor typos in comments (#326)
Typos located using misspell: https://github.com/client9/misspell

Formatting done using goimports: https://godoc.org/golang.org/x/tools/cmd/goimports
2020-04-11 14:56:47 -04:00
dk
019bb920c9
Feature pl2 asset manager (#319)
* adding pl2 as a fiel format and an asset manager for pl2 files

* adding pl2 as a file format and an asset manager for pl2 files

* pl2 asset manager and file format

* added call in main.go to load palette transforms
* removed incorrect PaletteTransformType declarations from main.go

* removingn bad resource path for palette transform

* PL2 file format added, added to asset management

PL2 files are beside palette files in the mpq
These files define palette transforms of their respective base palette.

I've bound a command to d2term (in d2asset.go)
	load_pl2 <path>

* Clean up PL2 asset stuff

removed pl2 stuff from d2datadict, didn't belong in there
removed d2term debug binding

* minor cleanup for d2pl2
2020-02-26 22:52:05 -05:00
Alex Yatskov
664b8416f1
Remove global palettes; everything goes through d2asset now (#322)
* Configuration cleanup

* Cleanup

* remove global palettes
2020-02-26 22:46:47 -05:00
Alex Yatskov
a4efd41383
File format cleanup (#320)
* Configuration cleanup

* Cleanup

* cleanup file formats

* make palettes a proper fileformat
2020-02-26 08:39:38 -05:00
nicholas-eden
f6014498ba
Use missile range and subloop (#311)
Turn on blending.  Calculate target using based on range and angle of hero to click.
2020-02-23 03:23:18 -05:00
Ziemas
e4c84c4fb9
Direction changes. (#309)
* Take directions in the range of 0-63

* Shift direction handling in animation further back

* Don't need to get the DCC direction here.

Because it was added to animation.

* Check direction is within range
2020-02-22 22:33:58 -05:00
nicholas-eden
bdfdeda67b
Add support for missiles (#308)
* WIP: Add support for missiles

Break AnimatedEntity into two parts to support single and composite animations.  Summon misssiles on right click.

* Break animated entity down further

Move npc only logic to npc struct, reduce duplication in map entities

* Change a bunch of int32s to int
2020-02-22 20:44:30 -05:00
Alex Yatskov
5e958b9174
Scene and GUI rework (#300) 2020-02-08 21:02:37 -05:00
Ziemas
0b7a433ed2
Fix up subtile flag stuff (#288)
* Switch to a 2d array for looking up subtile flags

Also fix up the walkableArea generation

* Check correct tiletype for walls

And fix the subtile tooltip text.
2020-02-02 17:56:58 -05:00
Tim Sarbin
3412c4338c
Added pathfinding and (buggy) collision data. (#285) 2020-02-02 12:46:19 -05:00