import 'package:flutter/material.dart';
import '../enums.dart';

class BattleConfig {
  // Icons
  static const IconData attackIcon = Icons.flash_on;
  static const IconData defendIcon = Icons.shield;

  // Colors
  static const Color riskyColor = Colors.orangeAccent;
  static const Color normalColor = Colors.white;
  static const Color safeColor = Colors.grey;

  static const Color defendRiskyColor = Colors.deepPurpleAccent;
  static const Color defendNormalColor = Colors.blueAccent;
  static const Color defendSafeColor = Colors.greenAccent;

  // Sizes
  static const double sizeRisky = 80.0; // User increased this in previous edit
  static const double sizeNormal = 60.0;
  static const double sizeSafe = 40.0;

  // Logic Constants
  // Safe
  static const double safeBaseChance = 1.0; // 100%
  static const double safeEfficiency = 0.5; // 50%
  // Normal
  static const double normalBaseChance = 0.8; // 80%
  static const double normalEfficiency = 1.0; // 100%
  // Risky
  static const double riskyBaseChance = 0.4; // 40%
  static const double riskyEfficiency = 2.0; // 200%

  // Enemy Logic
  static const double enemyAttackChance = 0.7; // 70% Attack, 30% Defend

  static IconData getIcon(ActionType type) {
    switch (type) {
      case ActionType.attack:
        return attackIcon;
      case ActionType.defend:
        return defendIcon;
    }
  }

  static Color getColor(ActionType type, RiskLevel risk) {
    if (type == ActionType.attack) {
      switch (risk) {
        case RiskLevel.risky:
          return riskyColor;
        case RiskLevel.normal:
          return normalColor;
        case RiskLevel.safe:
          return safeColor;
      }
    } else {
      switch (risk) {
        case RiskLevel.risky:
          return defendRiskyColor;
        case RiskLevel.normal:
          return defendNormalColor;
        case RiskLevel.safe:
          return defendSafeColor;
      }
    }
  }

  static double getSize(RiskLevel risk) {
    switch (risk) {
      case RiskLevel.risky:
        return sizeRisky;
      case RiskLevel.normal:
        return sizeNormal;
      case RiskLevel.safe:
        return sizeSafe;
    }
  }
}
