aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_bad_boy_actions.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-31 18:45:25 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-31 18:45:25 +0200
commitc12dc3125cda5599fcbadfe2492ef0015e8093f2 (patch)
tree90edcf38579ef621f75768c5ffecb4062a28257d /src/ft_bad_boy_actions.c
parentAlright sounds (diff)
download42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.tar.gz
42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.tar.bz2
42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.tar.xz
42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.tar.zst
42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.zip
Better sound balance, now hardgimping
Diffstat (limited to 'src/ft_bad_boy_actions.c')
-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++;
}