diff options
Diffstat (limited to 'web/web_control.c')
-rw-r--r-- | web/web_control.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/web/web_control.c b/web/web_control.c index 4f78d67..6c51167 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -2,6 +2,7 @@ #include "web_match.h" #include "web_opts.h" #include "web_prompt.h" +#include "web_svg.h" #include "web_ui.h" #include "comp.h" @@ -50,6 +51,25 @@ void end_boat_visit(int rem, double avg) } EMSCRIPTEN_KEEPALIVE +void draw_boat_throwing(int pts, char *str, double x, double y) +{ + char pts_str[10]; + sprintf(pts_str, "%d", pts); + + int rem = state->legs[1]->n_visits > 1 ? + state->legs[1]->visits[state->legs[1]->n_visits-2].rem : + state->legs[1]->start; + + svg_draw_point(x, y); + update_player_rem(2, rem - pts); + EM_ASM({setPromptInput($0)}, pts_str); + EM_ASM({promptMsgR($0)}, str); + free(str); + + ui_flush_player_info(2); // FIXME bot hard-coded as player 2 +} + +EMSCRIPTEN_KEEPALIVE void boat_visit() { struct leg *l = state->legs[1]; |