From a98f089035dbcc94c14c9cd6246c3150bee84241 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sun, 17 Nov 2024 22:32:25 +0200 Subject: Improved client recovery from singing & added better logic for observations The logic should still be implemented for all observations --- src/scalevalapokalypsi/Model/SingEffects.scala | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/scalevalapokalypsi/Model/SingEffects.scala') diff --git a/src/scalevalapokalypsi/Model/SingEffects.scala b/src/scalevalapokalypsi/Model/SingEffects.scala index 247d672..6702df5 100644 --- a/src/scalevalapokalypsi/Model/SingEffects.scala +++ b/src/scalevalapokalypsi/Model/SingEffects.scala @@ -2,6 +2,16 @@ package scalevalapokalypsi.Model import scalevalapokalypsi.Model.Entities.Entity -def defaultSingAttack(targetEntity: Entity)(singQuality: Float): String = +def defaultSingAttack(targetEntity: Entity)(singQuality: Float): Event = targetEntity.takeDamage((singQuality * 30).toInt) - targetEntity.condition \ No newline at end of file + val condition = targetEntity.condition + Event(targetEntity, condition(0), condition(1)) + +trait SingEffect(val target: Entity): + def apply(singQuality: Float): Event + +class DefaultSingAttack(target: Entity) extends SingEffect(target): + def apply(singQuality: Float): Event = + this.target.takeDamage((singQuality * 50).toInt) // TODO: remove magic value + val condition = this.target.condition + Event(target, condition(0), condition(1)) -- cgit v1.2.3