-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from fmasa/construct
Use SB instead off WPB when determining max Wounds for Construct
- Loading branch information
Showing
6 changed files
with
64 additions
and
11 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...tlin/cz/frantisekmasa/wfrp_master/common/character/effects/ConstructWoundsModification.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package cz.frantisekmasa.wfrp_master.common.character.effects | ||
|
||
import cz.frantisekmasa.wfrp_master.common.core.domain.character.Character | ||
|
||
class ConstructWoundsModification : CharacterEffect { | ||
override fun apply(character: Character, otherEffects: List<CharacterEffect>): Character { | ||
if (otherEffects.any { it is ConstructWoundsModification }) { | ||
return character // This effect does not stack | ||
} | ||
|
||
return character.modifyWounds( | ||
character.woundsModifiers.copy(isConstruct = true) | ||
) | ||
} | ||
|
||
override fun revert(character: Character, otherEffects: List<CharacterEffect>): Character { | ||
if (otherEffects.any { it is ConstructWoundsModification }) { | ||
return character // This effect does not stack | ||
} | ||
|
||
return character.modifyWounds( | ||
character.woundsModifiers.copy(isConstruct = false) | ||
) | ||
} | ||
|
||
companion object { | ||
fun fromTraitNameOrNull(name: String): ConstructWoundsModification? { | ||
if (name.equals("construct", ignoreCase = true)) { | ||
return ConstructWoundsModification() | ||
} | ||
|
||
return null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters