@vibemancer/core 0.1.4 → 0.1.6

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.
Files changed (76) hide show
  1. package/README.md +2 -2
  2. package/dist/chunk-G5T65F3W.js +10617 -0
  3. package/dist/chunk-G5T65F3W.js.map +1 -0
  4. package/dist/index-browser.d.ts +1328 -1051
  5. package/dist/index-browser.js +59 -17
  6. package/dist/index.d.ts +53 -3
  7. package/dist/index.js +204 -54
  8. package/dist/index.js.map +1 -1
  9. package/package.json +21 -15
  10. package/src/banned-bot-names.ts +53 -0
  11. package/src/bots/Hero.ts +867 -0
  12. package/src/bots/berserker/01_Stormchaser.ts +162 -120
  13. package/src/bots/berserker/02_Stormcaller.ts +160 -116
  14. package/src/bots/berserker/03_Stormforger.ts +162 -129
  15. package/src/bots/caster/01_Flamecaller.ts +126 -84
  16. package/src/bots/caster/02_Pyromancer.ts +148 -101
  17. package/src/bots/caster/03_Infernalist.ts +180 -160
  18. package/src/bots/defensive/01_Turtle.ts +48 -44
  19. package/src/bots/defensive/02_Sentinel.ts +57 -53
  20. package/src/bots/defensive/03_Golem.ts +85 -97
  21. package/src/bots/duelist/01_Battlemage.ts +157 -122
  22. package/src/bots/duelist/02_Warmage.ts +166 -121
  23. package/src/bots/duelist/03_Archmage.ts +198 -178
  24. package/src/bots/homing/01_Bonemancer.ts +20 -32
  25. package/src/bots/homing/02_Lich.ts +145 -93
  26. package/src/bots/homing/03_Archlich.ts +129 -60
  27. package/src/bots/kiter/01_Spellspinner.ts +145 -107
  28. package/src/bots/kiter/02_Spellweaver.ts +153 -105
  29. package/src/bots/kiter/03_Spellbinder.ts +168 -123
  30. package/src/bots/melee/01_Shadowblade.ts +131 -75
  31. package/src/bots/melee/02_Nightblade.ts +174 -130
  32. package/src/bots/melee/03_Voidblade.ts +266 -168
  33. package/src/bots/registry.ts +44 -37
  34. package/src/bots/shared.ts +185 -25
  35. package/src/bots/sniper/01_Spellshot.ts +151 -98
  36. package/src/bots/sniper/02_Spelltracer.ts +173 -128
  37. package/src/bots/sniper/03_Spellseeker.ts +177 -152
  38. package/src/bots/standalone/Critter.ts +46 -52
  39. package/src/bots/standalone/Doombringer.ts +36 -40
  40. package/src/bots/standalone/Hogger.ts +120 -89
  41. package/src/bots/standalone/Rookie.ts +21 -23
  42. package/src/bots/standalone/TargetDummy.ts +5 -6
  43. package/src/bots/test/cheater.ts +91 -85
  44. package/src/bots/test/crasher.ts +26 -28
  45. package/src/engine/bundle-fight.ts +242 -0
  46. package/src/engine/hooks-runtime.ts +58 -18
  47. package/src/engine/manual-match.ts +33 -25
  48. package/src/engine/missile-templates.ts +25 -43
  49. package/src/engine/optimizer.ts +7 -7
  50. package/src/engine/params-runtime.ts +3 -3
  51. package/src/engine/physics.ts +33 -23
  52. package/src/engine/sandbox-browser.ts +8 -7
  53. package/src/engine/sandbox-compile.ts +1 -1
  54. package/src/engine/sandbox-harness.ts +299 -367
  55. package/src/engine/sandbox.ts +3 -3
  56. package/src/engine/simulation.ts +291 -76
  57. package/src/engine/spells.ts +9 -12
  58. package/src/engine-version.ts +1 -1
  59. package/src/hooks/action-builders.ts +76 -21
  60. package/src/hooks/index.ts +17 -9
  61. package/src/hooks/state-hooks.ts +61 -25
  62. package/src/hooks/threat-analysis.ts +44 -20
  63. package/src/hooks/types.ts +62 -5
  64. package/src/index-browser.ts +1 -0
  65. package/src/index.ts +3 -0
  66. package/src/rules.ts +209 -63
  67. package/src/stats.ts +2 -2
  68. package/src/testing.ts +6 -30
  69. package/src/trace.ts +63 -3
  70. package/src/types.ts +127 -14
  71. package/src/utils/angles.ts +1 -0
  72. package/src/utils/combat.ts +98 -6
  73. package/src/utils/spatial.ts +3 -3
  74. package/dist/chunk-74FFJCFF.js +0 -9140
  75. package/dist/chunk-74FFJCFF.js.map +0 -1
  76. package/src/hooks/bot-wrapper.ts +0 -84
@@ -1,84 +0,0 @@
1
- /**
2
- * VIBEMANCER - BOT WRAPPER
3
- *
4
- * Utilities to convert between old-style (WizardFunction) and new-style (BotFunction) bots.
5
- */
6
-
7
- import {WizardFunction, WizardActions, GameState, GameConfig} from '../types.js';
8
- import {withBotContext} from '../engine/hooks-runtime.js';
9
- import {extractAction} from './action-builders.js';
10
- import type {BotFunction, BotContext} from './types.js';
11
-
12
- /**
13
- * Convert a new-style bot (using hooks) to an old-style bot (WizardFunction).
14
- *
15
- * This allows new bots to work with the existing simulation.
16
- *
17
- * @example
18
- * const NewBot: BotFunction = () => {
19
- * const health = useHealth();
20
- * return health < 10 ? shield() : idle();
21
- * };
22
- *
23
- * // Convert to work with simulate()
24
- * const oldStyleBot = wrapNewBot(NewBot);
25
- * simulate(oldStyleBot, opponent);
26
- */
27
- export function wrapNewBot(newBot: BotFunction): WizardFunction
28
- {
29
- return ({state, config}: {state: GameState; config: GameConfig; random: () => number}): WizardActions =>
30
- {
31
- // Create the BotContext from GameState
32
- // Note: entityId is inherited from the simulation's outer runWithHooks call
33
- const botContext: BotContext = {
34
- entityId: 'unused', // Not used - entity ID comes from simulation
35
- tick: state.tick,
36
- position: state.position,
37
- velocity: state.velocity,
38
- health: state.health,
39
- maxHealth: state.maxHealth,
40
- state: state.state,
41
- castingSpell: state.castingSpell,
42
- castProgress: state.castProgress,
43
- castDuration: state.castDuration,
44
- channelingSpell: state.channelingSpell,
45
- channelDuration: state.channelDuration,
46
- gcdRemaining: state.gcdRemaining,
47
- blinkCooldown: state.blinkCooldown,
48
- enemies: state.enemies.map((e) => ({
49
- id: e.id,
50
- position: e.position,
51
- velocity: e.velocity,
52
- health: e.health,
53
- state: e.state,
54
- castingSpell: e.castingSpell,
55
- channelingSpell: e.channelingSpell,
56
- channelDuration: e.channelDuration,
57
- })),
58
- projectiles: state.projectiles,
59
- myProjectiles: state.myProjectiles,
60
- arenaWidth: config.arenaSize.width,
61
- arenaHeight: config.arenaSize.height,
62
- damageDealt: state.damageDealt,
63
- damageTaken: state.damageTaken,
64
- lastHitTick: state.lastHitTick,
65
- };
66
-
67
- // Run the new-style bot with context
68
- // Use withBotContext (not runBotWithContext) to preserve the entity ID
69
- // set by the simulation's outer runWithHooks call
70
- const finalAction = withBotContext(botContext, newBot);
71
-
72
- // Extract WizardActions from FinalAction
73
- return extractAction(finalAction);
74
- };
75
- }
76
-
77
- /**
78
- * Type guard to check if a bot is a new-style BotFunction.
79
- * New-style bots have 0 parameters, old-style bots have at least 1.
80
- */
81
- export function isNewStyleBot(bot: WizardFunction | BotFunction): bot is BotFunction
82
- {
83
- return bot.length === 0;
84
- }