From c12dc3125cda5599fcbadfe2492ef0015e8093f2 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 31 Mar 2020 18:45:25 +0200 Subject: Better sound balance, now hardgimping --- src/ft_bad_boy_actions.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/ft_bad_boy_actions.c') diff --git a/src/ft_bad_boy_actions.c b/src/ft_bad_boy_actions.c index 49f5a26..92fe3fa 100644 --- a/src/ft_bad_boy_actions.c +++ b/src/ft_bad_boy_actions.c @@ -61,22 +61,34 @@ void bl->does = 1; } +/* +** skelton misses one random +** shot out of four +*/ + void ft_check_bad_boy_shoot(t_cub *cl) { int8_t i; + int8_t r; i = 0; while (i < cl->mlist.sprite_nbr[13]) { + if (FT_OS == 1) + r = rand() % 4; + else + r = random() % 4; if (cl->bad_boy[i].does == 2 && cl->bad_boy[i].sleep == 0) { cl->sfx[15].sfx_play(cl->sfx); - /* TODO: random shot */ - if (FT_OS == 1) - ft_macos_suffer_animation(FT_ENMY_DAMAGE_AMOUNT, cl); - else - ft_linux_suffer_animation(FT_ENMY_DAMAGE_AMOUNT, cl); + if (r != 3) + { + if (FT_OS == 1) + ft_macos_suffer_animation(FT_ENMY_DAMAGE_AMOUNT, cl); + else + ft_linux_suffer_animation(FT_ENMY_DAMAGE_AMOUNT, cl); + } } i++; } -- cgit v1.2.3