mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 17:05:20 +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:
@@ -8,7 +8,6 @@ import emu.grasscutter.data.excels.CombineData;
|
||||
import emu.grasscutter.game.inventory.GameItem;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.props.ActionReason;
|
||||
import emu.grasscutter.game.props.ItemUseOp;
|
||||
import emu.grasscutter.net.proto.RetcodeOuterClass;
|
||||
import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
|
||||
import emu.grasscutter.server.game.BaseGameSystem;
|
||||
@@ -43,24 +42,12 @@ public class CombineManger extends BaseGameSystem {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean unlockCombineDiagram(Player player, GameItem diagramItem) {
|
||||
// Make sure this is actually a diagram.
|
||||
if (diagramItem.getItemData().getItemUse().get(0).getUseOp() != ItemUseOp.ITEM_USE_UNLOCK_COMBINE) {
|
||||
return false;
|
||||
public boolean unlockCombineDiagram(Player player, int combineId) {
|
||||
if (!player.getUnlockedCombines().add(combineId)) {
|
||||
return false; // Already unlocked
|
||||
}
|
||||
|
||||
// Determine the combine item we should unlock.
|
||||
int combineId = Integer.parseInt(diagramItem.getItemData().getItemUse().get(0).getUseParam()[0]);
|
||||
|
||||
// Remove the diagram from the player's inventory.
|
||||
// We need to do this here, before sending CombineFormulaDataNotify, or the the combine UI won't correctly
|
||||
// update when unlocking the diagram.
|
||||
player.getInventory().removeItem(diagramItem, 1);
|
||||
|
||||
// Tell the client that this diagram is now unlocked and add the unlocked item to the player.
|
||||
player.getUnlockedCombines().add(combineId);
|
||||
player.sendPacket(new PacketCombineFormulaDataNotify(combineId));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user