import { IsString, IsInt, Min, Max, IsBoolean, IsOptional } from 'class-validator';

export class RecoveryCheckDto {
  @IsString()
  characterId: string;

  @IsInt()
  @Min(1)
  @Max(20)
  dieRoll: number;
}

export class RecoveryCheckResultDto {
  result: 'critical_success' | 'success' | 'failure' | 'critical_failure';
  dieRoll: number;
  dc: number;
  newDyingValue: number;
  stabilized: boolean;
  died: boolean;
  message: string;
  woundedAdded: boolean;
}

export class ApplyDamageDto {
  @IsString()
  characterId: string;

  @IsInt()
  @Min(1)
  damage: number;

  @IsBoolean()
  @IsOptional()
  isCritical?: boolean;
}

export class ApplyDamageResultDto {
  newHp: number;
  dyingValue: number | null;
  died: boolean;
  message: string;
}

export class HealFromDyingDto {
  @IsString()
  characterId: string;

  @IsInt()
  @Min(1)
  healAmount: number;
}

export class HealFromDyingResultDto {
  newHp: number;
  woundedValue: number;
  message: string;
}
