summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--res/scripts/hallucination_hot_spring.lua7
-rw-r--r--src/script_system.cpp6
2 files changed, 12 insertions, 1 deletions
diff --git a/res/scripts/hallucination_hot_spring.lua b/res/scripts/hallucination_hot_spring.lua index 5251ab6..6713e0c 100644 --- a/res/scripts/hallucination_hot_spring.lua +++ b/res/scripts/hallucination_hot_spring.lua
@@ -1,7 +1,12 @@
1hallucination_hot_spring = {} 1hallucination_hot_spring = {}
2 2
3function hallucination_hot_spring.init() 3function hallucination_hot_spring.init()
4 ShowExpression("water_ionia", "surprise") 4 if randomChance(3.0/4.0) then
5 DestroyNamedSprite("water_ionia")
6 gamestate.ionia_in_water = false
7 else
8 gamestate.ionia_in_water = true
9 end
5end 10end
6 11
7function hallucination_hot_spring.off_right() 12function hallucination_hot_spring.off_right()
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) {
187 return game_.getMap().getWarpPoint(warp); 187 return game_.getMap().getWarpPoint(warp);
188 }); 188 });
189 189
190 engine_.set_function(
191 "randomChance",
192 [&] (double p) {
193 return std::bernoulli_distribution(p)(game_.getRng());
194 });
195
190 engine_.script_file("../res/scripts/common.lua"); 196 engine_.script_file("../res/scripts/common.lua");
191} 197}
192 198