aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_bad_boy_actions.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_bad_boy_actions.c22
1 files changed, 17 insertions, 5 deletions
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++;
}