studio/CB-Action.cbp
library CB-Library;
fn CB-Action.ready(u256 frame, u256 cooldownFrames, u256 lastFrame) -> bool {
return frame >= lastFrame + cooldownFrames;
}
fn CB-Action.force_passes(f64 incomingForce, f64 threshold) -> bool {
return incomingForce >= threshold;
}
fn CB-Action.triggered(bool input, f64 incomingForce, f64 threshold, i256 health) -> bool {
if (input) { return true; }
if (incomingForce >= threshold) { return true; }
return health <= 0;
}