@arcadia-eternity/data-pack-base 4.8.2 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.json +1 -1
- package/dist/environment/test-120-rules.json +1 -1
- package/dist/environment-build.json +2 -2
- package/dist/environment-runtime.mjs +47 -7
- package/dist/native-build.mjs +1 -1
- package/dist/pack-lock.yaml +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -6509,6 +6509,7 @@ var dist_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
6509
6509
|
TransformType: () => TransformType,
|
|
6510
6510
|
allowsEnhancementRecord: () => allowsEnhancementRecord,
|
|
6511
6511
|
assertSkillSlots: () => assertSkillSlots,
|
|
6512
|
+
canUseEnhancementStage: () => canUseEnhancementStage,
|
|
6512
6513
|
constraintEditsSchema: () => constraintEditsSchema,
|
|
6513
6514
|
declaredConstraintsSchema: () => declaredConstraintsSchema,
|
|
6514
6515
|
defaultEditorSkillSlots: () => defaultEditorSkillSlots,
|
|
@@ -6516,6 +6517,7 @@ var dist_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
6516
6517
|
elementMultiplier: () => elementMultiplier,
|
|
6517
6518
|
eligibilitySchema: () => eligibilitySchema,
|
|
6518
6519
|
enhancementSchema: () => enhancementSchema,
|
|
6520
|
+
individualValueSpread: () => individualValueSpread,
|
|
6519
6521
|
inheritanceSchema: () => inheritanceSchema,
|
|
6520
6522
|
learnsetAdjustmentsSchema: () => learnsetAdjustmentsSchema,
|
|
6521
6523
|
legacyElements: () => legacyElements,
|
|
@@ -6537,6 +6539,7 @@ var dist_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
6537
6539
|
resolveSkillGroupValue: () => resolveSkillGroupValue,
|
|
6538
6540
|
resolveSkillParameters: () => resolveSkillParameters,
|
|
6539
6541
|
ruleCollectionsSchema: () => ruleCollectionsSchema,
|
|
6542
|
+
scaledIndividualValues: () => scaledIndividualValues,
|
|
6540
6543
|
sha256Bytes: () => sha256Bytes,
|
|
6541
6544
|
sha256Hex: () => sha256Hex,
|
|
6542
6545
|
sha256StreamHex: () => sha256StreamHex,
|
|
@@ -6545,6 +6548,7 @@ var dist_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
6545
6548
|
skillParameterPolicySchema: () => skillParameterPolicySchema,
|
|
6546
6549
|
skillSlotsSchema: () => skillSlotsSchema,
|
|
6547
6550
|
splitRuleDeclaration: () => splitRuleDeclaration,
|
|
6551
|
+
supportsEnhancementBranch: () => supportsEnhancementBranch,
|
|
6548
6552
|
teamConstraintIssues: () => teamConstraintIssues,
|
|
6549
6553
|
teamConstraintsSchema: () => teamConstraintsSchema,
|
|
6550
6554
|
trainingStat: () => trainingStat,
|
|
@@ -7795,6 +7799,26 @@ let TimerEventType = /* @__PURE__ */ function(TimerEventType) {
|
|
|
7795
7799
|
TimerEventType["StateChange"] = "stateChange";
|
|
7796
7800
|
return TimerEventType;
|
|
7797
7801
|
}({});
|
|
7802
|
+
function individualValueSpread(value) {
|
|
7803
|
+
return {
|
|
7804
|
+
hp: value,
|
|
7805
|
+
atk: value,
|
|
7806
|
+
def: value,
|
|
7807
|
+
spa: value,
|
|
7808
|
+
spd: value,
|
|
7809
|
+
spe: value
|
|
7810
|
+
};
|
|
7811
|
+
}
|
|
7812
|
+
/** Each stat keeps the scale on which it was entered. Unannotated team files use literal IVs. */
|
|
7813
|
+
function scaleIndividualValue(value, sourceMax, targetMax) {
|
|
7814
|
+
if (sourceMax === void 0 || sourceMax === targetMax || value > sourceMax) return value;
|
|
7815
|
+
return sourceMax === 0 ? 0 : Math.round(value * targetMax / sourceMax);
|
|
7816
|
+
}
|
|
7817
|
+
function scaledIndividualValues(pet, targetMax) {
|
|
7818
|
+
const values = { ...pet.ivs };
|
|
7819
|
+
for (const stat of Object.values(StatType)) values[stat] = scaleIndividualValue(pet.ivs[stat], pet.ivMax?.[stat], targetMax);
|
|
7820
|
+
return values;
|
|
7821
|
+
}
|
|
7798
7822
|
/** Unmodified training stat. Nature is applied after the level step, preserving the engine's fractional values. */
|
|
7799
7823
|
function trainingStat(stat, base, level, iv, ev, natureMultiplier, stageBonus = 0) {
|
|
7800
7824
|
return trainingStatSteps(stat, base, level, iv, ev, natureMultiplier, stageBonus).total;
|
|
@@ -8325,6 +8349,8 @@ const enhancementSchema = object({
|
|
|
8325
8349
|
"suppressed",
|
|
8326
8350
|
"active"
|
|
8327
8351
|
]),
|
|
8352
|
+
minLevel: number$1().int().min(1).max(100).optional(),
|
|
8353
|
+
defaultBranches: ids.optional(),
|
|
8328
8354
|
stages: ids.optional(),
|
|
8329
8355
|
species: ids.optional()
|
|
8330
8356
|
}).strict();
|
|
@@ -8405,8 +8431,14 @@ function resolveEnhancement(policy) {
|
|
|
8405
8431
|
mode
|
|
8406
8432
|
};
|
|
8407
8433
|
}
|
|
8408
|
-
function allowsEnhancementRecord(policy, species, stage) {
|
|
8409
|
-
return policy?.mode !== "active" || (!policy.species || policy.species.includes(species)) && (!policy.stages || policy.stages.includes(stage));
|
|
8434
|
+
function allowsEnhancementRecord(policy, species, stage, level) {
|
|
8435
|
+
return policy?.mode !== "active" || (policy.minLevel === void 0 || level !== void 0 && level >= policy.minLevel) && (!policy.species || policy.species.includes(species)) && (!policy.stages || policy.stages.includes(stage));
|
|
8436
|
+
}
|
|
8437
|
+
function supportsEnhancementBranch(policy, species, branch) {
|
|
8438
|
+
return (species.enhancementBranches ?? policy?.defaultBranches)?.includes(branch) ?? false;
|
|
8439
|
+
}
|
|
8440
|
+
function canUseEnhancementStage(policy, species, level, stage) {
|
|
8441
|
+
return policy?.mode === "active" && supportsEnhancementBranch(policy, species, stage.branch) && allowsEnhancementRecord(policy, species.id, stage.id, level);
|
|
8410
8442
|
}
|
|
8411
8443
|
function resolveEnvironmentMechanics(rules) {
|
|
8412
8444
|
const mechanics = rules?.mechanics;
|
|
@@ -24677,6 +24709,7 @@ var authoring_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
24677
24709
|
assertSkillSlots: () => assertSkillSlots,
|
|
24678
24710
|
bindings: () => bindings,
|
|
24679
24711
|
booleanParam: () => booleanParam,
|
|
24712
|
+
canUseEnhancementStage: () => canUseEnhancementStage,
|
|
24680
24713
|
checkConfigRead: () => checkConfigRead,
|
|
24681
24714
|
checkValueRead: () => checkValueRead,
|
|
24682
24715
|
checks: () => checks,
|
|
@@ -24732,6 +24765,7 @@ var authoring_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
24732
24765
|
getLogger: () => getLogger,
|
|
24733
24766
|
getValueRecipe: () => getValueRecipe,
|
|
24734
24767
|
hasAuthoredParameters: () => hasAuthoredParameters,
|
|
24768
|
+
individualValueSpread: () => individualValueSpread,
|
|
24735
24769
|
inheritanceSchema: () => inheritanceSchema,
|
|
24736
24770
|
isReactiveValue: () => isReactiveValue,
|
|
24737
24771
|
isStrictValueRead: () => isStrictValueRead,
|
|
@@ -24762,6 +24796,7 @@ var authoring_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
24762
24796
|
resolveSkillGroupValue: () => resolveSkillGroupValue,
|
|
24763
24797
|
resolveSkillParameters: () => resolveSkillParameters,
|
|
24764
24798
|
ruleCollectionsSchema: () => ruleCollectionsSchema,
|
|
24799
|
+
scaledIndividualValues: () => scaledIndividualValues,
|
|
24765
24800
|
selectFrom: () => selectFrom,
|
|
24766
24801
|
setEffectState: () => setEffectState,
|
|
24767
24802
|
setGlobalLogger: () => setGlobalLogger,
|
|
@@ -24774,6 +24809,7 @@ var authoring_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
24774
24809
|
skillSlotsSchema: () => skillSlotsSchema,
|
|
24775
24810
|
splitRuleDeclaration: () => splitRuleDeclaration,
|
|
24776
24811
|
stringParam: () => stringParam,
|
|
24812
|
+
supportsEnhancementBranch: () => supportsEnhancementBranch,
|
|
24777
24813
|
targets: () => targets,
|
|
24778
24814
|
teamConstraintIssues: () => teamConstraintIssues,
|
|
24779
24815
|
teamConstraintsSchema: () => teamConstraintsSchema,
|
|
@@ -25732,7 +25768,7 @@ function fromError(err, options = {}) {
|
|
|
25732
25768
|
return toValidationError(options)(err);
|
|
25733
25769
|
}
|
|
25734
25770
|
|
|
25735
|
-
// packages/battle/dist/definition-catalog-
|
|
25771
|
+
// packages/battle/dist/definition-catalog-Bxu70Vmk.js
|
|
25736
25772
|
/** Construct the original V1 Battle; lifecycle and rules remain on that class. */
|
|
25737
25773
|
function createBattle(playerA, playerB, options, configSystem) {
|
|
25738
25774
|
return new Battle(playerA, playerB, options, configSystem);
|
|
@@ -26600,6 +26636,7 @@ const PetSchema = object({
|
|
|
26600
26636
|
level: number$1().int().min(1).max(100),
|
|
26601
26637
|
evs: StatOutBattleEVSSchema.refine((evs) => Object.values(evs).reduce((a, b) => a + b, 0) <= 510, "学习力总和不能超过510"),
|
|
26602
26638
|
ivs: StatOutBattleIVSSchema,
|
|
26639
|
+
ivMax: StatOutBattleIVSSchema.optional(),
|
|
26603
26640
|
nature: string().min(1).max(256),
|
|
26604
26641
|
gender: nativeEnum(Gender).optional(),
|
|
26605
26642
|
height: number$1().optional(),
|
|
@@ -26696,7 +26733,7 @@ var SpeciesParser = class {
|
|
|
26696
26733
|
}
|
|
26697
26734
|
};
|
|
26698
26735
|
var PetParser = class {
|
|
26699
|
-
static parse(rawData, repository) {
|
|
26736
|
+
static parse(rawData, repository, individualValueMax = 31) {
|
|
26700
26737
|
let validated;
|
|
26701
26738
|
try {
|
|
26702
26739
|
validated = PetSchema.parse(rawData);
|
|
@@ -26744,7 +26781,7 @@ var PetParser = class {
|
|
|
26744
26781
|
else gender = Gender.Male;
|
|
26745
26782
|
const stage = validated.enhancement ? repository.getEnhancement?.(validated.enhancement) : void 0;
|
|
26746
26783
|
if (validated.enhancement && !stage) throw new Error("Unknown enhancement: " + validated.enhancement);
|
|
26747
|
-
return new Pet(validated.name, uid, species, validated.level, validated.evs, validated
|
|
26784
|
+
return new Pet(validated.name, uid, species, validated.level, validated.evs, scaledIndividualValues(validated, individualValueMax), validated.nature, skills, ability, emblem, validated.weight ?? species.weightRange[1], validated.height ?? species.heightRange[1], validated.gender ?? gender, validated.maxHp, repository.getNature?.(validated.nature).multipliers, stage?.bonus);
|
|
26748
26785
|
}
|
|
26749
26786
|
};
|
|
26750
26787
|
var PlayerParser = class {
|
|
@@ -26766,7 +26803,7 @@ var PlayerParser = class {
|
|
|
26766
26803
|
const id = validated.id ?? nanoid$1();
|
|
26767
26804
|
const pets = validated.team.map((pet, index) => {
|
|
26768
26805
|
try {
|
|
26769
|
-
return PetParser.parse(pet, repository);
|
|
26806
|
+
return PetParser.parse(pet, repository, options.individualValueMax);
|
|
26770
26807
|
} catch (e) {
|
|
26771
26808
|
throw new Error(`[PlayerParser] 玩家 '${validated.name}' 的第 ${index + 1} 只精灵解析失败: ${e.message}`, { cause: e });
|
|
26772
26809
|
}
|
|
@@ -26980,7 +27017,10 @@ function createContentCatalog(data, revision, createEffects = emptyFactory, beha
|
|
|
26980
27017
|
if (pet.ability) lookup.getMark(pet.ability);
|
|
26981
27018
|
if (pet.emblem) lookup.getMark(pet.emblem);
|
|
26982
27019
|
}
|
|
26983
|
-
return players.map((player) => PlayerParser.parse(player, lookup, {
|
|
27020
|
+
return players.map((player) => PlayerParser.parse(player, lookup, {
|
|
27021
|
+
ai: ai.has(player.id),
|
|
27022
|
+
individualValueMax: options.individualValueMax
|
|
27023
|
+
}));
|
|
26984
27024
|
},
|
|
26985
27025
|
createBattle(playerA, playerB, options) {
|
|
26986
27026
|
for (const player of [playerA, playerB]) for (const pet of player.team) {
|
package/dist/native-build.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const nativeBuildIdentity = Object.freeze({"formatVersion":1,"coreBuildId":"
|
|
1
|
+
export const nativeBuildIdentity = Object.freeze({"formatVersion":1,"coreBuildId":"683246c3a6815217da6c0808333f9d838f05e24d029e74e8a72f0bf2b894299a","registryBuildId":"dbd084a712ade23a5d17f7cfd35e8dff11410e10ccb58f4ce6e69e261639d1bb"});
|
package/dist/pack-lock.yaml
CHANGED