Posted August 07, 2022 by Another RPG Enthusiast
This update contains a massive change to inventory structure, and as such will be incompatible with previous versions of the engine.
Arrays
rather than Maps
. This allows multiple instances of the same item to appear in an Inventory. This change is incompatible with earlier versions of the engine.Inventory
property: size
. Determines the maximum number of stacks an Inventory can hold. If 0 or less, the Inventory is considered limitless.Inventory
method: clearItems
. Removes all instances of the named item and returns them as an array.addItem
and decItem
to work with multiple item instances.maxstock
property and restock
widget, because they were confusing and not how most RPGs handle items. (In the default engine, item restocking is now handled by cloning the inventory before battle and replacing player inventory with the clone after battle.)stock
that guards against non-integer values, negative values, and values exceeding the item's stackSize
.Item
property: uses
. This works the same way it does for Actions.setup
variables:DUPLICATE_ITEMS
: Boolean that determines if multiple stacks of the same item are allowed in Inventories.REMOVE_ITEMS
: Boolean that determines if items falling to 0 stock are removed from Inventories.locked
property, which prevents them from being unequipped without an unlock
argument passed to unequip
.slot
property of Items
has been renamed to slots
, and can now be an array naming multiple valid slots. A getter for slots
has been added to access this property easily and guard against invalid data types.multislot
property in equippable
.Actor
method: hasSlot
. Checks if the named slot is present.Actor
method: getEquipment
. Returns the equipment in the named slot.Map
. This will make it easier to access and modify them.Action
and Item
classes: tags
. This is an array that can be used to store any additional metadata you desire.Actor
property: threatMod
. This is a Stat
against which a characters' chances of being targeted by attacks will be multiplied. (This replaces the old code for Firefly and Wallflower.)Item
and Inventory
classes.unequip
now returns a value if the unequip failed due to sticky equipment.core-enemies.js
into database-enemies.js
and core-effects.js
into database-effects.js
.Actors
rather than the minimum defined Evasion.StoryInit
to move most variables into the custom version of the file, and rearranged them into a more logical order. You should no longer have to jump back and forth between two files to figure out what has and hasn't been defined.B.targeting
variable and replaced it with the action.target
property.