aboutsummaryrefslogtreecommitdiff
path: root/plugins/fireball/fireball.c
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-06-09 19:48:18 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-06-09 19:48:18 +0200
commit3dcf2f7307837abaff862042aede312fff9ac905 (patch)
treeca0b1f31a98d39db9b07ea7e5bf4f3104d191d89 /plugins/fireball/fireball.c
parent043c0a4c0ef016e3b49816d582cdf7227f6d3450 (diff)
downloaddungeon_game-3dcf2f7307837abaff862042aede312fff9ac905.tar.xz
Slightly randomize fireball color
Diffstat (limited to 'plugins/fireball/fireball.c')
-rw-r--r--plugins/fireball/fireball.c4
1 files changed, 4 insertions, 0 deletions
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)