added Pocket
This commit is contained in:
parent
4836cae3fa
commit
86f6dbf302
34
src/kernel/pocket/Pocket.hx
Normal file
34
src/kernel/pocket/Pocket.hx
Normal file
@ -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<Noise, String> {
|
||||||
|
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<Noise, String> {
|
||||||
|
var r = cc.Pocket.unequipBack();
|
||||||
|
if (r.successful) {
|
||||||
|
return Success(Noise);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Failure(r.error);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user