mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 08:56:04 +01:00
[BREAKING] Item Usage Overhaul
-De-hardcode elemental orb values -De-hardcode exp items -Change ShopChest format (temporary, drop system overhaul will replace it entirely) -Food healing actually uses Ability data for real HP amounts
This commit is contained in:
@@ -9,7 +9,9 @@ import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.ItemUseData;
|
||||
import emu.grasscutter.game.inventory.*;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.game.props.ItemUseOp;
|
||||
import emu.grasscutter.game.props.ItemUseTarget;
|
||||
import emu.grasscutter.game.props.ItemUseAction.ItemUseAction;
|
||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import lombok.Getter;
|
||||
@@ -46,8 +48,10 @@ public class ItemData extends GameResource {
|
||||
private int[] satiationParams;
|
||||
|
||||
// Usable item
|
||||
private ItemUseTarget useTarget;
|
||||
private ItemUseTarget useTarget = ItemUseTarget.ITEM_USE_TARGET_NONE;
|
||||
private List<ItemUseData> itemUse;
|
||||
private List<ItemUseAction> itemUseActions;
|
||||
private boolean useOnGain = false;
|
||||
|
||||
// Relic
|
||||
private int mainPropDepotId;
|
||||
@@ -124,8 +128,16 @@ public class ItemData extends GameResource {
|
||||
|
||||
// Prevent material type from being null
|
||||
this.materialType = this.materialType == null ? MaterialType.MATERIAL_NONE : this.materialType;
|
||||
|
||||
if (this.itemUse != null && !this.itemUse.isEmpty()) {
|
||||
this.itemUseActions = this.itemUse.stream()
|
||||
.filter(x -> x.getUseOp() != ItemUseOp.ITEM_USE_NONE)
|
||||
.map(ItemUseAction::fromItemUseData)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Getter
|
||||
public static class WeaponProperty {
|
||||
private FightProperty propType;
|
||||
|
||||
Reference in New Issue
Block a user