From c6c0c1a5a553c66796418b07077465c0c7a89069 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 25 Feb 2021 14:37:37 -0500 Subject: Ionia randomly appears in the water --- src/script_system.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/script_system.cpp') diff --git a/src/script_system.cpp b/src/script_system.cpp index d700738..e890dfc 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp @@ -187,6 +187,12 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { return game_.getMap().getWarpPoint(warp); }); + engine_.set_function( + "randomChance", + [&] (double p) { + return std::bernoulli_distribution(p)(game_.getRng()); + }); + engine_.script_file("../res/scripts/common.lua"); } -- cgit 1.4.1