mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-20 14:49:50 +08: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:
@@ -0,0 +1,37 @@
|
||||
package emu.grasscutter.game.props.ItemUseAction;
|
||||
|
||||
import emu.grasscutter.game.props.ItemUseOp;
|
||||
|
||||
public class ItemUseChestSelectItem extends ItemUseSelectItems {
|
||||
private int[] optionItemCounts;
|
||||
|
||||
@Override
|
||||
public ItemUseOp getItemUseOp() {
|
||||
return ItemUseOp.ITEM_USE_CHEST_SELECT_ITEM;
|
||||
}
|
||||
|
||||
public ItemUseChestSelectItem(String[] useParam) {
|
||||
String[] options = useParam[0].split(",");
|
||||
this.optionItemIds = new int[options.length];
|
||||
this.optionItemCounts = new int[options.length];
|
||||
for (int i = 0; i < options.length; i++) {
|
||||
String[] optionParts = options[i].split(":");
|
||||
try {
|
||||
this.optionItemIds[i] = Integer.parseInt(optionParts[0]);
|
||||
} catch (NumberFormatException ignored) {
|
||||
this.optionItemIds[i] = INVALID;
|
||||
}
|
||||
try {
|
||||
this.optionItemCounts[i] = Integer.parseInt(optionParts[1]);
|
||||
} catch (NumberFormatException ignored) {
|
||||
this.optionItemCounts[i] = INVALID;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getItemCount(int index) {
|
||||
if ((optionItemCounts == null) || (index < 0) || (index > optionItemCounts.length)) return INVALID;
|
||||
return this.optionItemCounts[index];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user