aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-31 15:28:02 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-31 15:28:02 +0200
commitb826970c9c3d8fb890543cabf17b1e7144582e0e (patch)
treec0188f5a63a267c21822ebe866f8c74b741793f6
parentNow that's what I call balance take this SC2 'balance' team haha more like sc... (diff)
download42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.tar.gz
42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.tar.bz2
42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.tar.xz
42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.tar.zst
42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.zip
Good
-rw-r--r--inc/cub3d_defines.h2
-rw-r--r--map/map_seven.cub4
-rw-r--r--src/ft_bad_boy_actions.c1
-rw-r--r--src/ft_damage_bad_boy.c10
4 files changed, 9 insertions, 8 deletions
diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h
index 702b73e..2c586d8 100644
--- a/inc/cub3d_defines.h
+++ b/inc/cub3d_defines.h
@@ -305,7 +305,7 @@ enum
# define FT_WEAP_MAX_AMMO 1000
# define FT_ENMY_STRT_LIFE 10
# define FT_ENMY_SIGHT_RANGE 7.0
-# define FT_ENMY_DAMAGE_AMOUNT 54
+# define FT_ENMY_DAMAGE_AMOUNT 40
# define FT_W_ONE_DANAGE_AMOUNT 5
# define FT_W_TWO_DANAGE_AMOUNT 2
# define FT_W_THREE_DANAGE_AMOUNT 4
diff --git a/map/map_seven.cub b/map/map_seven.cub
index d8677d0..ec26f7e 100644
--- a/map/map_seven.cub
+++ b/map/map_seven.cub
@@ -14,8 +14,8 @@ C 150,150,150
1111111111111111111
1000000000000000001
1000000000000000001
-10000000e0000000001
-1000000000000T00001
+100000e00e00e000001
+1000000000000000001
1000000000000000001
1000000000000000001
1000000000000000001
diff --git a/src/ft_bad_boy_actions.c b/src/ft_bad_boy_actions.c
index c2324bd..d56037e 100644
--- a/src/ft_bad_boy_actions.c
+++ b/src/ft_bad_boy_actions.c
@@ -72,6 +72,7 @@ void
if (cl->bad_boy[i].does == 2 && cl->bad_boy[i].sleep == 0)
{
cl->sfx[11].sfx_play(cl->sfx);
+ /* TODO: true bad boy sfx here */
if (FT_OS == 1)
ft_macos_suffer_animation(FT_ENMY_DAMAGE_AMOUNT, cl);
else
diff --git a/src/ft_damage_bad_boy.c b/src/ft_damage_bad_boy.c
index b6eb7df..c9cb66c 100644
--- a/src/ft_damage_bad_boy.c
+++ b/src/ft_damage_bad_boy.c
@@ -12,6 +12,7 @@
#include <libft.h>
#include <cub3d.h>
+#include <math.h>
static uint8_t
ft_get_bad_boy_id(t_cub *cl)
@@ -21,12 +22,12 @@ static uint8_t
i = 0;
while (i < cl->mlist.sprite_nbr[13])
{
- if (cl->sprites[13][i].s_pos_x == cl->rlist.sqy &&
- cl->sprites[13][i].s_pos_y == cl->rlist.sqx)
- return (i);
+ if (lround(cl->sprites[13][i].s_pos_x) == (long)cl->rlist.sqy &&
+ lround(cl->sprites[13][i].s_pos_y) == (long)cl->rlist.sqx)
+ break ;
i++;
}
- return (0);
+ return (i);
}
void
@@ -41,6 +42,5 @@ void
cl->bad_boy[id].life -= FT_W_TWO_DANAGE_AMOUNT;
else if (cl->plist.handles_weapon == 4)
cl->bad_boy[id].life -= FT_W_THREE_DANAGE_AMOUNT;
- ft_printf("%hhd\n", cl->bad_boy[0].life);
/* TODO: sfx enemy scream and death */
}