commit
6890d068bc
|
|
@ -0,0 +1,44 @@
|
||||||
|
/**
|
||||||
|
* Diablo II: Lord of Destruction v1.13c — Skill #265: Cobra Strike (ASS)
|
||||||
|
*
|
||||||
|
* Authoritative 1.13c Ground Truth (`Patch_D2.mpq` -> `data\\global\\excel\\Skills.txt`):
|
||||||
|
* - Skill ID: 265 ("Cobra Strike")
|
||||||
|
* - Class: "ass"
|
||||||
|
* - Required Level: 12
|
||||||
|
* - Server Functions: srvstfunc=23, srvdofunc=34, srvprgfunc1=0, srvprgfunc2=0, srvprgfunc3=0
|
||||||
|
* - Associated Missile / State / Summon: missile="", state="progressive_steal", summon=""
|
||||||
|
* - 1.13c Synergy Formulas: EDmgSymPerCalc="", DmgSymPerCalc="", ELenSymPerCalc=""
|
||||||
|
*/
|
||||||
|
import type {
|
||||||
|
SkillEvalContext,
|
||||||
|
SkillEvalResult,
|
||||||
|
SkillExecContext,
|
||||||
|
SkillExecOutcome,
|
||||||
|
SkillModule,
|
||||||
|
} from '../../types.ts'
|
||||||
|
import { evaluateSkillCore113c, executeSkillCore113c } from '../../registry.ts'
|
||||||
|
|
||||||
|
export const skillModule: SkillModule = {
|
||||||
|
skillId: 265,
|
||||||
|
name: "Cobra Strike",
|
||||||
|
charClass: "ass",
|
||||||
|
srvStFunc: 23,
|
||||||
|
srvDoFunc: 34,
|
||||||
|
|
||||||
|
evaluate(ctx: SkillEvalContext): SkillEvalResult {
|
||||||
|
return evaluateSkillCore113c(ctx)
|
||||||
|
},
|
||||||
|
|
||||||
|
executeDo(ctx: SkillExecContext): SkillExecOutcome {
|
||||||
|
const outcome = executeSkillCore113c(ctx)
|
||||||
|
return {
|
||||||
|
...outcome,
|
||||||
|
notes: [
|
||||||
|
...outcome.notes,
|
||||||
|
'skill_module:skill-265-cobra-strike',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default skillModule
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
/**
|
||||||
|
* 1.13c Numerical & Runtime Verification Suite — Skill #265: Cobra Strike (ASS)
|
||||||
|
* Gitea Tracking Issue: #358
|
||||||
|
*/
|
||||||
|
import { describe, expect, it } from 'vitest'
|
||||||
|
import { getSharedDataRegistry } from '../../../src/game/engine/data-registry.ts'
|
||||||
|
import { UnitStatList } from '../../../src/game/engine/stat-list.ts'
|
||||||
|
import { WorldArena } from '../../../src/game/engine/world-arena.ts'
|
||||||
|
import { skillModule } from '../../../src/game/skills/impl/ass/skill-265-cobra-strike.ts'
|
||||||
|
|
||||||
|
describe('[Skill #265] Cobra Strike (ASS) — 1.13c Parity (Issue #358)', () => {
|
||||||
|
it('evaluates exact 1.13c Skills.txt / Missiles.txt formulas at slvl 1, 10, and 20', async () => {
|
||||||
|
const registry = await getSharedDataRegistry()
|
||||||
|
const skillRec = registry.getSkillById(265)!
|
||||||
|
expect(skillRec).toBeDefined()
|
||||||
|
expect(skillModule.skillId).toBe(265)
|
||||||
|
expect(skillModule.name).toBe("Cobra Strike")
|
||||||
|
expect(skillModule.charClass).toBe("ass")
|
||||||
|
|
||||||
|
const stats1 = new UnitStatList()
|
||||||
|
stats1.setBaseSkillLevel(265, 1)
|
||||||
|
const r1 = skillModule.evaluate!({ registry, skill: skillRec, slvl: 1, blvl: 1, statList: stats1 })
|
||||||
|
expect(r1.manaCost).toBe(2)
|
||||||
|
expect(r1.manaCost256).toBe(512)
|
||||||
|
expect(r1.minPhysDmg).toBe(0)
|
||||||
|
expect(r1.maxPhysDmg).toBe(0)
|
||||||
|
expect(r1.minElemDmg256).toBe(0)
|
||||||
|
expect(r1.maxElemDmg256).toBe(0)
|
||||||
|
|
||||||
|
const stats10 = new UnitStatList()
|
||||||
|
stats10.setBaseSkillLevel(265, 10)
|
||||||
|
const r10 = skillModule.evaluate!({ registry, skill: skillRec, slvl: 10, blvl: 10, statList: stats10 })
|
||||||
|
expect(r10.manaCost).toBe(2)
|
||||||
|
expect(r10.manaCost256).toBe(512)
|
||||||
|
expect(r10.minPhysDmg).toBe(0)
|
||||||
|
expect(r10.maxPhysDmg).toBe(0)
|
||||||
|
expect(r10.minElemDmg256).toBe(0)
|
||||||
|
expect(r10.maxElemDmg256).toBe(0)
|
||||||
|
|
||||||
|
const stats20 = new UnitStatList()
|
||||||
|
stats20.setBaseSkillLevel(265, 20)
|
||||||
|
const r20 = skillModule.evaluate!({ registry, skill: skillRec, slvl: 20, blvl: 20, statList: stats20 })
|
||||||
|
expect(r20.manaCost).toBe(2)
|
||||||
|
expect(r20.manaCost256).toBe(512)
|
||||||
|
expect(r20.minPhysDmg).toBe(0)
|
||||||
|
expect(r20.maxPhysDmg).toBe(0)
|
||||||
|
expect(r20.minElemDmg256).toBe(0)
|
||||||
|
expect(r20.maxElemDmg256).toBe(0)
|
||||||
|
expect(r20.durationFrames).toBe(375)
|
||||||
|
expect(r20.radiusSubtiles).toBe(135)
|
||||||
|
expect(r20.petMax).toBe(0)
|
||||||
|
expect(r20.cooldownFrames).toBe(0)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('enforces 1.13c blvl synergy rule (hard points boost synergy; +skills and item charges do NOT)', async () => {
|
||||||
|
const registry = await getSharedDataRegistry()
|
||||||
|
const skillRec = registry.getSkillById(265)!
|
||||||
|
const synId = null
|
||||||
|
|
||||||
|
const statsBase = new UnitStatList()
|
||||||
|
statsBase.setBaseSkillLevel(265, 20)
|
||||||
|
if (synId !== null) {
|
||||||
|
statsBase.setBaseSkillLevel(synId, 20)
|
||||||
|
}
|
||||||
|
const withHardPoints = skillModule.evaluate!({
|
||||||
|
registry,
|
||||||
|
skill: skillRec,
|
||||||
|
slvl: 20,
|
||||||
|
blvl: 20,
|
||||||
|
statList: statsBase,
|
||||||
|
})
|
||||||
|
expect(withHardPoints.synergyBonusPct).toBe(0)
|
||||||
|
|
||||||
|
// +20 allskills and +33 Marrowwalk charges without hard points must yield 0 synergy
|
||||||
|
const statsSoftOnly = new UnitStatList()
|
||||||
|
statsSoftOnly.setBaseSkillLevel(265, 20)
|
||||||
|
statsSoftOnly.addStat('item_allskills', 20)
|
||||||
|
if (synId !== null) {
|
||||||
|
statsSoftOnly.setChargedSkillLevel(synId, 33)
|
||||||
|
}
|
||||||
|
const withSoftOnly = skillModule.evaluate!({
|
||||||
|
registry,
|
||||||
|
skill: skillRec,
|
||||||
|
slvl: 20,
|
||||||
|
blvl: 20,
|
||||||
|
statList: statsSoftOnly,
|
||||||
|
})
|
||||||
|
expect(withSoftOnly.synergyBonusPct).toBe(0)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('executes runtime skill effect in WorldArena (castCount, action frame, and combat/state/missile/summon outcome)', async () => {
|
||||||
|
const registry = await getSharedDataRegistry()
|
||||||
|
const arena = new WorldArena({
|
||||||
|
registry,
|
||||||
|
classCode: "ass",
|
||||||
|
skillId: 265,
|
||||||
|
slvl: 20,
|
||||||
|
})
|
||||||
|
const outcome = arena.triggerCast()
|
||||||
|
arena.stepTicks(15)
|
||||||
|
const dbg = arena.getDebugState()
|
||||||
|
|
||||||
|
expect(dbg.ready).toBe(true)
|
||||||
|
expect(dbg.skillId).toBe(265)
|
||||||
|
expect(dbg.castCount).toBeGreaterThanOrEqual(1)
|
||||||
|
expect(dbg.actionFrameTriggered).toBe(true)
|
||||||
|
expect(outcome?.executed).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
Reference in New Issue