12 lines
381 B
JavaScript
12 lines
381 B
JavaScript
const playerEntity = ecs.lookupPlayerEntity(entity.Owned.owner);
|
|
if (playerEntity !== other && other.Vulnerable) {
|
|
const magnitude = Math.floor(Math.random() * 3)
|
|
other.Vulnerable.damage({
|
|
amount: Math.floor(
|
|
Math.pow(10, magnitude)
|
|
+ Math.random() * (Math.pow(10, magnitude + 1) - Math.pow(10, magnitude)),
|
|
),
|
|
position: other.Position.toJSON(),
|
|
})
|
|
}
|