From 3dcf2f7307837abaff862042aede312fff9ac905 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 9 Jun 2021 19:48:18 +0200 Subject: Slightly randomize fireball color --- plugins/fireball/fireball.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins/fireball/fireball.c') diff --git a/plugins/fireball/fireball.c b/plugins/fireball/fireball.c index 1c3eeb6..3da29a4 100644 --- a/plugins/fireball/fireball.c +++ b/plugins/fireball/fireball.c @@ -15,6 +15,10 @@ static void fireball_spawn(struct entity *self, void *data) { self->meta = malloc(sizeof(struct fireball_data)); *((struct fireball_data *) self->meta) = *((struct fireball_data *) data); + + self->color.r = clamp(self->color.r + rand() % 65 - 32, 0, 255); + self->color.g = clamp(self->color.g + rand() % 65 - 32, 0, 255); + self->color.b = clamp(self->color.b + rand() % 65 - 32, 0, 255); } static void fireball_step(struct entity *self, struct entity_step_data stepdata) -- cgit v1.2.3