ui change
This commit is contained in:
@@ -148,7 +148,7 @@ struct Dice {
|
||||
|
||||
func armour(die: Int, invulnerable: Bool, save: Int, armourPenetration: Int) -> Int {
|
||||
var total = 0
|
||||
switch invulnerable ? save : (save - armourPenetration) {
|
||||
switch invulnerable ? save : (save + armourPenetration) {
|
||||
case 7...:
|
||||
total = six + five + four + three + two + one
|
||||
case 6:
|
||||
|
||||
@@ -152,6 +152,8 @@ class Roll: ObservableObject {
|
||||
@Published var saveHasRerolled = false
|
||||
|
||||
@Published var blowupUsed = false
|
||||
@Published var torrent = false
|
||||
@Published var psychic = false
|
||||
|
||||
// calculated variables
|
||||
var totalDigits: [Int] {
|
||||
@@ -216,7 +218,9 @@ class Roll: ObservableObject {
|
||||
|
||||
var hit: Int {
|
||||
get {
|
||||
return self.dice.hit(die: total, cutoff: self.hitCutoff.rawValue, modifier: self.modifier.rawValue)
|
||||
if torrent { return total }
|
||||
let mod = psychic ? Dice.RollModifiers.none.rawValue : modifier.rawValue
|
||||
return self.dice.hit(die: total, cutoff: self.hitCutoff.rawValue, modifier: mod)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,7 +387,7 @@ class Roll: ObservableObject {
|
||||
cutoff = woundCutoff
|
||||
case .armour:
|
||||
mode = saveRerollMode
|
||||
cutoff = invulnerable ? armourSave : (armourSave - armourPenetration)
|
||||
cutoff = invulnerable ? armourSave : (armourSave + armourPenetration)
|
||||
}
|
||||
|
||||
switch mode {
|
||||
|
||||
Reference in New Issue
Block a user