Commit Graph

850 Commits

Author SHA1 Message Date
Collin Smith
907688a1d2 Improved support for picking up and dropping items
ItemController interface changed to be an engine-operable interface
Removed ItemController interface from CharData
Changed ItemController#groundToCursor(Item) to #groundToCursor(int) to pick up an item wrapper entity
ItemManager now handles item entity creation/deletion (may change)
ClientItemManager changed to operate upon Riiablo.charData and is for clients
CursorMovementSystem now uses ItemController instead of handling item drop and packeting directly
Item wrapper entity deletion remains unhandled in multiplayer until support for networking entity deletion is added
2020-06-02 20:55:03 -07:00
Collin Smith
edb6de8df9 Added support to D2GS for a majority of ItemManager functions
Added support to D2GS for a majority of ItemManager functions
GroundToCursor remains unimplemented in this commit due to entity creation
2020-06-02 15:30:18 -07:00
Collin Smith
8f437ab037 Added ItemManager system to D2GS engine 2020-06-01 17:47:37 -07:00
Collin Smith
829eb608a7 Workaround for #75 2020-06-01 17:24:44 -07:00
Collin Smith
970073296c Created NetworkedClientItemManager subclass of ClientItemManager
Changed ClientItemManager to delegate to Riiablo.charData
NetworkedClientItemManager posts item management requests to the client's socket
2020-05-31 23:55:33 -07:00
Collin Smith
be70756aeb Added prototypes for item management packets 2020-05-31 21:30:53 -07:00
Collin Smith
3723e4dc2e Created packets for item management (DropItem and PickupItem are now deprecated and will be removed eventually) 2020-05-31 03:49:00 -07:00
Collin Smith
921fdfd2e2 Changed ClientItemManager to delegate to a certain ItemController 2020-05-31 03:22:39 -07:00
Collin Smith
206875d2a0 Introduced ItemController interface and ClientItemManager
ItemController created to allow swappable interfacing between CharData and ClientItemManager
ClientItemManager engine system added (defers to Riiablo.charData temporarily)
Added dependency injection for ItemController to allow wiring
Changed item management panels to use ItemController injection instead of Riiablo.charData directly
2020-05-31 01:00:46 -07:00
Collin Smith
94e2b379e7 Removed unneeded annotation 2020-05-30 20:36:39 -07:00
Collin Smith
2cecdccdd9 Added additional debug logging for CharData item management calls 2020-05-30 20:21:35 -07:00
Collin Smith
b798645f02 Fixed issue where dropping an item wasn't removing it from ItemData 2020-05-30 20:15:08 -07:00
Collin Smith
46581d11e1 Renamed item pickup and drop functions to more closely match other item functions
pickup -> groundToCursor
drop -> cursorToGround
2020-05-30 16:49:40 -07:00
Collin Smith
24d0a07cea Added support for picking up items from ground 2020-05-30 16:46:49 -07:00
Collin Smith
7336c2a3b0 Moved ItemData#drop and added ItemManager#dropCursor 2020-05-30 16:35:37 -07:00
Collin Smith
6280e89d8b Added support for dropping cursor item to ground 2020-05-30 16:30:02 -07:00
Collin Smith
d910a6026a Removed qualification from INVALID_ITEM within ItemData 2020-05-30 16:22:01 -07:00
Collin Smith
c6468eb788 Created ItemManager system to interface char data item events with engine 2020-05-30 16:17:50 -07:00
Collin Smith
e1443d0acf Renamed ItemManager to ItemEffectManager 2020-05-30 16:16:51 -07:00
Collin Smith
6860d8cba1 Implemented improved CharData class
CharData has been fully replaced with a version that doesn't just wrap a D2S file
Added support for a more event-based action approach with the UI
Event systems still need to be added to engine to perform CharData item operations
Decoupled com.riiablo.Cursor from D2S cursor item management -- defers to Riiablo.charData instance
2020-05-28 13:07:24 -07:00
Collin Smith
c4d2bc58a5 Extended new char data API
Added some additional load methods and util functions
Added some backwards compat functions to grab item index, etc
D2S#copyTo(CharData) calls D2S#loadRemaining automatically
Added CharData#obtain to return an uninitialized (possibly dirty) CharData
Added CharData#preloadItems which loads player and merc items
CharData#load(D2S) will set CharData to managed
2020-02-03 15:25:00 -08:00
Collin Smith
63c46de6bf Added notification to subscribers when skills changed via item update 2020-01-18 19:19:15 -08:00
Collin Smith
caef08f56a Refactored line order 2020-01-18 19:15:41 -08:00
Collin Smith
2d4b2a72a9 Added support for updating stats
Implemented support for updating items, item stats, and applying stats to ItemData attributes field
Added reference to CharStats.Entry to ItemData -- this may be removed when hireling stats are implemented more thoroughly
Added clear method in CharData to support chaining CharData reset methods clear().load(D2S)
Added empty base stats for hireling -- fixes issues with applying hireling stats to their own Attributes
2020-01-18 15:10:44 -08:00
Collin Smith
f5552947dc Added sets parameter to Item#update
Passed sets map should correspond to any set-counting entity (player or hireling)
Added fix to ignore CharStats.Entry field in Attributes#op if null (for hirelings)
2020-01-18 15:03:54 -08:00
Collin Smith
b5303828a9 Changed Item#update(CharData) to Item#update(Attributes,CharStats.Entry)
This is intended to decouple CharData from Attributes application for hirelings
2020-01-18 02:54:24 -08:00
Collin Smith
a8999db873 Fixes crash when opening HirelingPanel before items have finished loading 2020-01-18 02:52:39 -08:00
Collin Smith
d8ff97e4a5 Added LocationListener to subscribe to item location changes (specifically for belt and possibly cursor as well) 2020-01-17 03:16:35 -08:00
Collin Smith
1465af857c Set compileOptions compat for android build to java 1.8 to support flatbuffers 1.11 bytecode 2020-01-16 16:34:36 -08:00
Collin Smith
57589f7312 Moved pickup and store methods to ItemData
Added support for store listeners
CharData store methods are now simple calls up to player ItemData reference
2020-01-16 16:17:54 -08:00
Collin Smith
d20f8fcab4 Renamed location methods to store since they are placing items in store locations 2020-01-16 15:58:45 -08:00
Collin Smith
3055ccccd5 Added update listener
CharData now implemented Pool.Poolable interface for future Pooling support
Changed CharData to implement factory pattern for pooling
2020-01-16 02:04:11 -08:00
Collin Smith
1666c528e7 Moved AlternateListener to ItemData 2020-01-11 17:15:40 -08:00
Collin Smith
0c48569120 Moved alternate field to ItemData
Removed some ItemData related methods from CharData for the time being
Moved initial stat assignments to reset method since only set at initialize
Started implementing stat tracking in ItemData instead of CharData
Above change needed because merc stats should track differently than player
Changed initial value for cursor field to INVALID_ITEM for consistency
2020-01-11 15:10:17 -08:00
Collin Smith
62bee72c93 Added equip and unequip support to ItemData
Equip and unequip manage equipped enum map and set counter updates
Changed EquipListener onChanged to onEquip and onUnequip
Removed support for swapping equip items within a single call (swapping is an aggregate now)
UpdateSets changed to updateSet that will add or remove item based on add parameter
Added Attributes field to ItemData constructor -- items will apply attrs to this field
2020-01-11 02:03:39 -08:00
Collin Smith
6cbea53c19 Moved alternate listener to separate CharData.AlternateListener class
This change removed need for EquipAdapter
2020-01-10 19:22:39 -08:00
Collin Smith
997c57ad5e Committing first iteration of CharData redesign
Changed API to work with item indexes (should simplify networking code)
Created ItemData abstraction to separate player and merc items
Moved set item fields to ItemData since they should eventually be distinct
Created EnumIntMap as a better primitive container for enum ordinals
D2S is now a container for saves, not the operational data itself
D2S CharData changes are intended to decouple them both and make D2S specifically to serialize and deserialize the data
2020-01-10 17:48:58 -08:00
Collin Smith
9b78c010e9 Added CharData to Item#update() parameters -- cannot rely on Riiablo.charData in multiplayer cases 2020-01-07 14:07:59 -08:00
Collin Smith
23376c4bdc Closes #72 2020-01-07 02:22:36 -08:00
Collin Smith
f685184c3c Changed some method names
Renamed getEquipped to getSlot since this returns the equipped item at the specified slot
Renamed getEquipped2 to getEquipped since this will return the item at the properly alternated slot (the equipped item)
2020-01-07 01:09:27 -08:00
Collin Smith
ec63e6806d Added constants for difficulties 2020-01-07 00:46:20 -08:00
Collin Smith
1cb5e160d2 Resolved todo -- replaced static NUM_DIFFS field with pointer to Riiablo.MAX_DIFFS 2020-01-06 17:25:22 -08:00
Collin Smith
f78a3a2d08 Moved D2S to com.riiablo.save 2020-01-06 15:26:00 -08:00
Collin Smith
361158a481 Moved some engine consts to Riiablo class 2020-01-06 15:18:28 -08:00
Collin Smith
b534fed719 Created engine consts for acts and diffs 2020-01-06 14:09:31 -08:00
Collin Smith
c9a5e50a1c Renamed charClass to classId 2020-01-06 01:35:05 -08:00
Collin Smith
0768b5b8cc Renamed getSkill to getAction 2020-01-04 14:54:48 -08:00
Collin Smith
dc1aff5b4a Fixed log tag error 2020-01-04 02:10:56 -08:00
Collin Smith
a1bca12d62 Defer item inv file finish loading to future frame 2020-01-01 03:20:44 -08:00
Collin Smith
ff7a27d334 Added support for serializing and synchronizing dropped items
Added support for serializing and synchronizing dropped items
Picking up items not supported yet -- requires API change
Added packet types for DropItem and PickupItem
Added ItemP component table and ItemSerializer
Added EntityFactory#createItem(Item,float,float)
Removed CharStats.BlockFactor from Stat.toblock item property -- should be applied on view stats and base character properties list
2019-12-31 02:46:34 -08:00