From 57b67ce952b8884c4358106d4cdcbe05d8498ffc Mon Sep 17 00:00:00 2001 From: kts of kettek Date: Sun, 30 Jan 2022 15:20:31 -0800 Subject: [PATCH] Add blood splats --- Engine/src/live/AnimalEntity.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Engine/src/live/AnimalEntity.ts b/Engine/src/live/AnimalEntity.ts index 32b66dd..93ca3b5 100644 --- a/Engine/src/live/AnimalEntity.ts +++ b/Engine/src/live/AnimalEntity.ts @@ -372,6 +372,14 @@ export class AnimalEntity extends Entity { this.dead = true let force = -1 + Math.random() * 2 let dir = Math.random() * 320 + + // 100% random blood splat + ctx.addEntity(new GibletEntity(`giblets.any.blood${Math.floor(1+Math.random()*4)}.default.0`, dir+Math.random()*10, force+Math.random()*2, 30000), 'gibs', p[0], p[1]) + // 50% extra blood change + if (Math.random() > 0.5) { + ctx.addEntity(new GibletEntity(`giblets.any.blood${Math.floor(1+Math.random()*4)}.default.0`, dir+Math.random()*10, force+Math.random()*2, 20000), 'gibs', p[0], p[1]) + } + // 50% head gib if (Math.random() > 0.5) { ctx.addEntity(new GibletEntity(`giblets.${this.sprite.spriteKey}.head.default.0`, dir+Math.random()*40, force+Math.random()*10), 'gibs', p[0], p[1])