public static void SwapDragonBallWithStoneBall(Item[] inventory, int WorldDragonBallKey, int WhichDragonBall) { // this dragon ball was pulled in from another world. Turn it into a rock. int dbKey = WorldDragonBallKey; int dbSlot = ItemHelper.RemoveDragonBall(inventory, WorldDragonBallKey, WhichDragonBall); // something went wrong, abort. if (dbSlot == -1) { return; } var newStoneBall = DBZMOD.instance.GetItem(DragonBallItem.GetStoneBallFromNumber(WhichDragonBall)).item.DeepClone(); var dbData = newStoneBall.modItem as DragonBallItem; dbData.WorldDragonBallKey = dbKey; inventory[dbSlot] = newStoneBall; }
public static void SwapStoneBallWithDragonBall(Item[] inventory, int WorldDragonBallKey, int WhichDragonBall) { // this stone ball was pulled back into its world. Turn it into a dragon ball. int dbKey = WorldDragonBallKey; int dbSlot = ItemHelper.RemoveStoneBall(inventory, WorldDragonBallKey, WhichDragonBall); // something went wrong, abort. if (dbSlot == -1) { return; } var dbType = DragonBallItem.GetDragonBallItemTypeFromNumber(WhichDragonBall); var newDragonBall = DBZMOD.instance.GetItem(DragonBallItem.GetDragonBallItemTypeFromNumber(WhichDragonBall)).item.DeepClone(); var dbData = newDragonBall.modItem as DragonBallItem; dbData.WorldDragonBallKey = dbKey; inventory[dbSlot] = newDragonBall; }