Files
2026-09-13 18:08:11 -05:00

50 lines
1.5 KiB
Swift

//
// InfoAreaView.swift
// Bunch O' Dice
//
import SwiftUI
struct InfoAreaView: View {
@EnvironmentObject var current: Roll
var body: some View {
HStack() {
switch current.state {
case .hit:
if current.lethalHits || current.sustainedHits {
Text("Crits (6s): \(current.critHitCount)")
.fontWeight(.semibold)
.foregroundColor(.red)
}
if current.antiX {
Text("Anti-X (\(current.antiXThreshold)+): \(current.antiXCount)")
.fontWeight(.semibold)
.foregroundColor(.red)
}
case .wound:
if current.autoWoundsCarried > 0 {
Text("Auto-wounds carried: \(current.autoWoundsCarried) (skip wound roll)")
.fontWeight(.semibold)
.foregroundColor(.red)
}
if current.devastatingWounds {
Text("Mortal wounds: \(current.critWoundCount)")
.fontWeight(.semibold)
.foregroundColor(.red)
}
case .armour:
EmptyView()
}
}
.font(.system(size: 18))
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal)
}
}
#Preview {
InfoAreaView()
.environmentObject(Roll())
}