diff --git a/src/kernel/pocket/Pocket.hx b/src/kernel/pocket/Pocket.hx new file mode 100644 index 0000000..c2d63e7 --- /dev/null +++ b/src/kernel/pocket/Pocket.hx @@ -0,0 +1,34 @@ +package kernel.pocket; + +using tink.CoreApi; + +class Pocket { + public static function isPocket():Bool { + return cc.Pocket != null; + } + + /** + Search the player's inventory for another upgrade, replacing the existing one with that item if found. + This inventory search starts from the player's currently selected slot, allowing you to prioritise upgrades. + **/ + public static function equipBack():Outcome { + var r = cc.Pocket.equipBack(); + if (r.successful) { + return Success(Noise); + } + + return Failure(r.error); + } + + /** + Remove the pocket computer's current upgrade. + **/ + public static function unequipBack():Outcome { + var r = cc.Pocket.unequipBack(); + if (r.successful) { + return Success(Noise); + } + + return Failure(r.error); + } +}