diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-17 22:32:25 +0200 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-17 22:32:25 +0200 |
commit | a98f089035dbcc94c14c9cd6246c3150bee84241 (patch) | |
tree | 228ffa0d5e4a3e86c454cd297644c97abc994ef3 /src/scalevalapokalypsi/Model/SingEffects.scala | |
parent | c954ca4d1ec677a34a6d787a23f9d01396f7e585 (diff) | |
download | scalevalapokalypsi-a98f089035dbcc94c14c9cd6246c3150bee84241.tar.gz scalevalapokalypsi-a98f089035dbcc94c14c9cd6246c3150bee84241.zip |
Improved client recovery from singing & added better logic for observations
The logic should still be implemented for all observations
Diffstat (limited to 'src/scalevalapokalypsi/Model/SingEffects.scala')
-rw-r--r-- | src/scalevalapokalypsi/Model/SingEffects.scala | 14 |
1 files changed, 12 insertions, 2 deletions
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)) |