Skip to content

Commit

Permalink
add missing fields to damage sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
12rcu committed Mar 11, 2024
1 parent 0bf2b94 commit c219b00
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/com/lop/devtools/monstera/files/Builder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object MonsteraBuilder {
filename = "$fileName.json"
}

val outputPath = path.resolve(fileName)
val outputPath = path.resolve(filename)
val outputFile = outputPath.toFile()

if (fileName.length > 30) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
@file:Suppress("unused", "MemberVisibilityCanBePrivate")

package com.lop.devtools.monstera.files.beh.entitiy.components.scraped

import com.google.gson.annotations.Expose
import com.google.gson.annotations.SerializedName
import com.lop.devtools.monstera.addon.api.MonsteraBuildSetter
import com.lop.devtools.monstera.files.beh.entitiy.components.Components
import com.lop.devtools.monstera.files.beh.entitiy.data.BehEntityFilter
import com.lop.devtools.monstera.files.beh.entitiy.data.DamageType
import com.lop.devtools.monstera.files.beh.entitiy.data.Subject

class DamageSensor {
@SerializedName("triggers")
@Expose
var triggersData: MutableList<Triggers>? = null
var triggersData: MutableList<Trigger>? = null
@MonsteraBuildSetter set

/**
*
* ```
* triggers {
* trigger {
* dealsDamage = false
* cause =
* }
*```
*/
@OptIn(MonsteraBuildSetter::class)
@Components.VanillaComponentMarker
fun triggers(value: Triggers.() -> Unit) {
triggersData = (triggersData ?: mutableListOf()).also { it.add(Triggers().apply(value)) }
fun trigger(value: Trigger.() -> Unit) {
triggersData = (triggersData ?: mutableListOf()).also { it.add(Trigger().apply(value)) }
}

class Triggers {
class Trigger {
@SerializedName("on_damage")
@Expose
var onDamageData: OnDamage? = null
Expand All @@ -48,7 +53,18 @@ class DamageSensor {
@SerializedName("deals_damage")
@Expose
var dealsDamage: Boolean? = null


@SerializedName("cause")
@Expose
var cause: DamageType? = null

@SerializedName("damage_multiplier")
@Expose
var damageMultiplier: Number? = null

@SerializedName("on_damage_sound_event")
@Expose
var onDamageSoundEvent: String? = null
}

class OnDamage {
Expand All @@ -70,5 +86,9 @@ class DamageSensor {
fun filters(value: BehEntityFilter.() -> Unit) {
filtersData = (filtersData ?: BehEntityFilter()).apply(value)
}

@SerializedName("target")
@Expose
var target: Subject? = null
}
}

0 comments on commit c219b00

Please sign in to comment.