aboutsummaryrefslogtreecommitdiff
path: root/src/scalevalapokalypsi/Model/SingEffects.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/scalevalapokalypsi/Model/SingEffects.scala')
-rw-r--r--src/scalevalapokalypsi/Model/SingEffects.scala14
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))