mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-18 16:10:51 +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,24 @@
|
||||
package emu.grasscutter.game.props.ItemUseAction;
|
||||
|
||||
import emu.grasscutter.game.props.ItemUseOp;
|
||||
|
||||
public class ItemUseAddItem extends ItemUseInt {
|
||||
private int count = 0;
|
||||
|
||||
@Override
|
||||
public ItemUseOp getItemUseOp() {
|
||||
return ItemUseOp.ITEM_USE_ADD_ITEM;
|
||||
}
|
||||
|
||||
public ItemUseAddItem(String[] useParam) {
|
||||
super(useParam);
|
||||
try {
|
||||
this.count = Integer.parseInt(useParam[1]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useItem(UseItemParams params) {
|
||||
return params.player.getInventory().addItem(this.i, this.count * params.count);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user