Split custom world generation into staged lightweight batches
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
StoryOption,
|
||||
WorldType,
|
||||
} from '../types';
|
||||
import { resolveRoleCombatStats } from './attributeCombat';
|
||||
import { resolveRuleWorldType } from './customWorldRuntime';
|
||||
import { getHostileNpcPresetById, getHostileNpcPresetsByWorld, HOSTILE_NPC_PRESETS_BY_WORLD } from './hostileNpcPresets';
|
||||
|
||||
@@ -193,6 +194,10 @@ export function createSceneHostileNpc(
|
||||
): SceneHostileNpc | null {
|
||||
const preset = getHostileNpcPresetById(worldType, monsterId);
|
||||
if (!preset) return null;
|
||||
const combatStats = resolveRoleCombatStats(preset.attributeProfile, {
|
||||
baseSpeed: preset.baseStats.speed,
|
||||
});
|
||||
const maxHp = preset.baseStats.maxHp + combatStats.maxHpBonus;
|
||||
|
||||
const formationSlots = getHostileNpcFormationSlots(
|
||||
worldType,
|
||||
@@ -213,9 +218,9 @@ export function createSceneHostileNpc(
|
||||
yOffset: position.yOffset,
|
||||
facing: getFacingTowardPlayer(position.xMeters, playerX),
|
||||
attackRange: preset.baseStats.attackRange,
|
||||
speed: preset.baseStats.speed,
|
||||
hp: preset.baseStats.hp,
|
||||
maxHp: preset.baseStats.maxHp,
|
||||
speed: combatStats.turnSpeed,
|
||||
hp: maxHp,
|
||||
maxHp,
|
||||
renderKind: 'npc',
|
||||
combatTags: preset.combatTags,
|
||||
attributeProfile: preset.attributeProfile,
|
||||
|
||||
Reference in New Issue
Block a user