final POC
This commit is contained in:
@@ -120,12 +120,14 @@ export class BoardGenerationService {
|
||||
|
||||
// Generate appropriate step value for field type
|
||||
if (specialField.type === 'positive') {
|
||||
// Positive fields: use positive step values (3-8 range for good gameplay)
|
||||
const stepValue = Math.floor(Math.random() * 6) + 3; // 3-8
|
||||
// Positive fields: use positive step values (1-3 range for balanced gameplay)
|
||||
// Max movement: 3 × 6 (dice) = 18 steps
|
||||
const stepValue = Math.floor(Math.random() * 3) + 1; // 1-3
|
||||
fields[fieldIndex].stepValue = Math.min(stepValue, maxStepValue);
|
||||
} else {
|
||||
// Negative fields: use negative step values (-3 to -8 range)
|
||||
const stepValue = -(Math.floor(Math.random() * 6) + 3); // -3 to -8
|
||||
// Negative fields: use negative step values (-1 to -3 range)
|
||||
// Max backward: -3 × 6 (dice) = -18 steps
|
||||
const stepValue = -(Math.floor(Math.random() * 3) + 1); // -1 to -3
|
||||
fields[fieldIndex].stepValue = Math.max(stepValue, minStepValue);
|
||||
}
|
||||
});
|
||||
@@ -156,25 +158,33 @@ export class BoardGenerationService {
|
||||
return finalPosition;
|
||||
}
|
||||
|
||||
private getPatternModifier(position: number, positiveField: boolean): number {
|
||||
// Pattern modifiers for strategic complexity:
|
||||
public getPatternModifier(position: number, positiveField: boolean): number {
|
||||
// Pattern modifiers STACK for strategic complexity:
|
||||
// - Positions ending in 0 (10, 20, 30...): No modifier
|
||||
// - Positions ending in 5 (15, 25, 35...): ±3 modifier
|
||||
// - Positions divisible by 3 (9, 12, 21...): ±2 modifier
|
||||
// - Odd positions (1, 7, 11...): ±1 modifier
|
||||
// - Other even positions: No modifier
|
||||
// Multiple conditions can apply and stack
|
||||
|
||||
if (position % 10 === 0) {
|
||||
return 0; // Positions ending in 0
|
||||
} else if (position % 10 === 5) {
|
||||
return positiveField ? 3 : -3; // Positions ending in 5
|
||||
} else if (position % 3 === 0) {
|
||||
return positiveField ? 2 : -2; // Divisible by 3
|
||||
} else if (position % 2 === 1) {
|
||||
return positiveField ? 1 : -1; // Odd positions
|
||||
} else {
|
||||
return 0; // Other even positions
|
||||
return 0; // Positions ending in 0 - no modifier
|
||||
}
|
||||
|
||||
let modifier = 0;
|
||||
const direction = positiveField ? 1 : -1;
|
||||
|
||||
// Check each condition and stack modifiers
|
||||
if (position % 10 === 5) {
|
||||
modifier += 3 * direction; // Positions ending in 5
|
||||
}
|
||||
if (position % 3 === 0) {
|
||||
modifier += 2 * direction; // Divisible by 3
|
||||
}
|
||||
if (position % 2 === 1) {
|
||||
modifier += 1 * direction; // Odd positions
|
||||
}
|
||||
|
||||
return modifier;
|
||||
}
|
||||
|
||||
private validate20_30Rule(currentPosition: number, targetPosition: number, distance: number): boolean {
|
||||
|
||||
Reference in New Issue
Block a user