1
2
3
4
5
6
7
8
9
10
# Maybe helper
def maybe(likelyhood=0.9)
  yield if rand > likelyhood
end

# Example of its use
results = perform_battle_action
maybe do
  log_results(results)
end