Compare commits

280 Commits
Author SHA1 Message Date
zephyr 2a34b5aef4 cmd/factorfactor: initial work 2026-09-20 11:42:56 -04:00
zephyr 0ffd2c099a horse, mdb: include id in lobby conversations
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-09-17 12:59:28 -04:00
zephyr 6828b1bd88 horse, mdb: put skill groups in skills
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
Fixes #13.
2026-09-15 11:00:10 -04:00
zephyr 78aee43e5f zenno: format
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
why the h*ck does vscode not format my .ts files on save even though i
have it configured to always format on save!!!!!!
2026-09-14 17:21:51 -04:00
zephyr 745c9d01dd zenno/doc/frbm: delete jbc sprint
Fixes #46.
2026-09-14 17:20:40 -04:00
zephyr e00fe0965a zenno/doc/mdb: emphasize that support card event outcomes are not in the mdb
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-09-14 17:07:25 -04:00
zephyr caa19dd85a zenno/doc/mdb: document races
ci/woodpecker/push/horsebot Pipeline failed
ci/woodpecker/push/zenno Pipeline failed
2026-09-11 18:14:14 -04:00
zephyr 3bf17944b3 horse, mdb, cmd/horsebot: racecourses
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-09-08 15:56:01 -04:00
zephyr 30f89e86f0 doc: add a recent dump 2026-09-08 15:56:01 -04:00
zephyr 8850dd4a08 zenno/doc/mdb: document skills
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-09-07 16:12:32 -04:00
zephyr 8946091b93 zenno: add ability type for all stats up 2026-09-07 16:08:52 -04:00
zephyr 9e3e06f0a0 zenno: rename missed Greate Escape -> Runaway 2026-09-07 12:28:49 -04:00
zephyr 12fea4c37e zenno/doc/tagged-skills: tag 403 is lane movement too 2026-09-06 22:08:37 -04:00
zephyr ad02e0711d zenno/chara/convo: include character icons
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-09-06 14:21:09 -04:00
zephyr 869235a8c2 zenno/chara/convo: use condition_type
Fixes #8.
2026-09-06 11:56:50 -04:00
zephyr 15f6d2c59a zenno/doc/frbm: update for GL
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-09-04 21:47:32 -04:00
zephyr d0c11aa527 zenno: section speed does not use base wit
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
Per analysis by Aya, only final wit is used for section speed.

Fixes #40.
2026-09-03 15:30:29 -04:00
zephyr c7a847f677 zenno/race/stam: add disclaimers
Also minor adjustments to chart size and how effective HP is calculated.
2026-09-03 15:10:47 -04:00
zephyr 0791fdd3d4 zenno: stamina calculator first pass
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-09-03 06:51:47 -04:00
zephyr e5f18d3c78 zenno/race/stam: remove the hard parts for now 2026-08-30 16:08:58 -04:00
zephyr 0d3cf24714 zenno: rebase stamina calculator & format 2026-08-30 15:45:42 -04:00
zephyr a8ed0dbbe0 zenno/race/stam: start showing outputs 2026-08-30 15:45:42 -04:00
zephyr 84f4f8e358 zenno/race/stam: beginning of stamina calculator 2026-08-30 15:45:42 -04:00
zephyr 7085fea1b7 umadump/replay: implement race sim decoding
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-08-30 01:56:43 -04:00
zephyr 1f195024e1 umadump/ism: idle single mode model 2026-08-26 21:08:46 -04:00
zephyr a91980e603 doc: mention race_course_set
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-08-26 20:29:14 -04:00
zephyr 8de957b59b zenno: allow both stats in threshold modifier to be null
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-08-26 18:57:31 -04:00
zephyr 206fee797c zenno/race/carryover: stat threshold modifier 2026-08-26 18:54:25 -04:00
zephyr 6ef2a190cd zenno: format
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-08-26 18:22:03 -04:00
zephyr 9a7028a44f zenno/race/carryover: add tables and disclaimers
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-08-26 18:01:10 -04:00
zephyr a7218c68ed zenno/race/carryover: calculator for late race carrover and accel
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-08-26 17:46:14 -04:00
zephyr 1f31ef223d zenno/racelib: allow accel skills to be delayed 2026-08-26 17:12:56 -04:00
zephyr 444fea85f0 zenno: lint fixes
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-08-21 15:45:53 -04:00
zephyr e92ce64b17 zenno: fix aptitude level type for umas
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-08-21 15:34:39 -04:00
zephyr 8d2a0e6c0d zenno/doc/mdb: include succession_initial_factor 2026-08-21 15:31:22 -04:00
zephyr 6b8b494739 zenno/doc/mdb: divide support card docs into sections 2026-08-21 15:12:42 -04:00
zephyr d8d9ec6543 zenno/doc/mdb: document sparks 2026-08-21 15:02:57 -04:00
zephyr cb48e238a8 zenno: account for ism data with no start stats
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-08-19 16:30:49 -04:00
zephyr 2bf229b5da zenno/career/ismdata: start visualization
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-08-19 16:10:54 -04:00
zephyr bde080eadd zenno: add support card level and effect functonality
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-08-13 17:39:23 -04:00
zephyr 1fe397ca81 zenno/career/ismdata: start of auto career analysis
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-08-07 17:01:33 -04:00
zephyr 5a13519189 zenno: scenario data 2026-08-05 16:00:59 -04:00
zephyr 9f4574e176 cmd/horsebot: also download support type icons 2026-08-04 17:14:57 -04:00
zephyr eaee64dca4 cmd/horsebot: download support card icons
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-08-02 23:36:32 -04:00
zephyr a232f78ac7 zenno: support card type definitions 2026-08-02 23:27:43 -04:00
zephyr 061fe89b7f remove vestiges of an ancient past 2026-08-02 22:48:02 -04:00
zephyr c0ddc32997 horse, mdb, cmd/horsebot: support cards
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
Fixes #37.
2026-08-02 22:45:34 -04:00
zephyr 9521b5e7c5 horse: go generate 2026-08-02 02:37:24 -04:00
zephyr efcdf5d525 zenno/doc/mdb: document support card hints 2026-08-02 02:37:10 -04:00
zephyr 8faf5cadc7 horse: improve single target ahead/behind skills wording
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
Fixes #28.
2026-07-31 22:33:59 -04:00
zephyr 656e155625 zenno: improve single target ahead/behind skills wording
For #28.
2026-07-31 22:30:44 -04:00
zephyr ff07b90c73 horse, zenno: fans ability value scaling
Fixes #30.
2026-07-31 22:27:52 -04:00
zephyr d265c81735 horse: add 564 ability type
While we're here adding the formatting, also adjust DD's wording and fix
the units on lane change speed skills.

Fixes #25.
2026-07-31 22:24:03 -04:00
zephyr 998156d345 zenno: gl skills are tag 803
Fixes #32.
2026-07-31 22:14:25 -04:00
zephyr aaa7c6d5b5 zenno/doc/mdb: start the mdb doc
For #12.
2026-07-31 22:12:38 -04:00
zephyr 48118efeeb doc: document grand live mechanics
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-07-28 00:19:14 -04:00
zephyr 79d4e76090 mdb: sort scenarios by sort id
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
Fixes #33.
2026-07-25 11:57:24 -04:00
zephyr ea39be0510 zenno: include character icons in character picks
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-07-24 23:09:24 -04:00
zephyr 7bac55ca43 zenno: show icons on skills 2026-07-24 22:56:31 -04:00
zephyr 435da61405 cmd: move toradl into horsebot
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
Fixes #31.
2026-07-24 17:18:44 -04:00
zephyr f3e7c7b43b all: update deps
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-07-23 22:55:17 -04:00
zephyr eded415df4 cmd/toradl: program for downloading icons from gametora 2026-07-23 22:48:12 -04:00
zephyr 34029fe001 zenno/doc/tagged-skills: more skill info
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-07-21 17:01:23 -04:00
zephyr ffb700545f zenno/doc/tagged-skills: new page
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-07-19 22:29:15 -04:00
zephyr 70ad09a13e zenno/chara/convo: list characters in convos even when they don't have their own
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
Fixes #24.
2026-07-19 15:46:41 -04:00
zephyr 74c22c7313 zenno: rename Great Escape -> Runaway everywhere
Fixes #26.
2026-07-19 15:38:01 -04:00
zephyr 2c1b4b9261 zenno/doc/race: lint fix
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-07-18 16:58:20 -04:00
zephyr e5128b6783 zenno/race/spurt: add dueling info 2026-07-18 16:58:12 -04:00
zephyr b22c8307fd zenno/race: common component for calculator outputs 2026-07-18 16:38:07 -04:00
zephyr cb54bbe414 zenno/doc/frbm: add doccy references to some sections
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-07-13 18:59:52 -04:00
zephyr 096cff28b6 zenno/doc/frbm: change of cm16 plans 2026-07-13 18:45:51 -04:00
zephyr 197df8f022 zenno/doc/race: add reference links to doccy 2026-07-13 18:41:18 -04:00
zephyr 009dd1d695 zenno: add page titles and descriptions
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-07-12 14:37:43 -04:00
zephyr bdafc93315 zenno: lint fix
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful
2026-07-10 20:01:20 -04:00
zephyr ef5b06d66e zenno: pull vite config from stam calc branch
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
ci/woodpecker/manual/horsebot Pipeline was successful
ci/woodpecker/manual/zenno Pipeline failed
2026-07-10 17:34:02 -04:00
zephyr 65b81612bc ci: allow running manually
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed
2026-07-10 17:29:35 -04:00
zephyr 6269665e79 ci: always run zenno workflow 2026-07-10 16:20:02 -04:00
zephyr cae7d5b8f4 zenno: format 2026-07-10 15:37:29 -04:00
zephyr fca43e64b5 zenno/doc/spark: make spark select searchable 2026-07-09 15:40:07 -04:00
zephyr bc395a0788 zenno: refactor CharaPick to generic component 2026-07-09 14:54:03 -04:00
zephyr 1d879cbf9f zenno/race/gate: add velocity/time chart 2026-07-07 20:47:20 -04:00
zephyr 240a3d9a73 zenno/doc/spark: decribe & clarify 2026-07-07 16:23:15 -04:00
zephyr 3d73460934 zenno: link up doc/spark 2026-07-07 15:55:31 -04:00
zephyr 0c518a9ce2 zenno/doc/spark: spark explorer 2026-07-07 15:51:28 -04:00
zephyr 5cbb6d7b1d zenno/doc/frbm: updates for 7-1 patch 2026-07-07 11:16:09 -04:00
zephyr b0bd16fd04 zenno/index: move discord bot to its own section 2026-07-06 09:45:07 -04:00
zephyr 55175c9c40 zenno: format & lint 2026-07-06 09:41:11 -04:00
zephyr 06e5a06680 zenno/race/gate: caveats 2026-07-06 09:39:36 -04:00
zephyr dbb0dcd2dc zenno: link up race/gate 2026-07-06 09:23:37 -04:00
zephyr 02f723b83a zenno/race/gate: new calculator 2026-07-06 09:01:11 -04:00
zephyr 1f58dec491 zenno/doc/race: conserve power 2026-07-01 23:39:31 -04:00
zephyr a6d264c79d zenno: pull race mechanics lib update from stam-calc 2026-07-01 22:40:11 -04:00
zephyr d62e729052 zenno: update stat charts for new limits 2026-07-01 22:12:10 -04:00
zephyr 9ce665865e zenno/doc/race: fix 4 skill activation chance chart 2026-06-26 13:13:30 -04:00
zephyr 7d395b2cc7 ci: set up
ci/woodpecker/push/horsebot Pipeline was successful
2026-06-17 10:50:04 -04:00
zephyr 2b69211a6c horse: update deps 2026-06-17 09:58:02 -04:00
zephyr 67377c4690 zenno: format 2026-06-16 14:20:03 -04:00
zephyr 1d65a0ec14 zenno/doc/race: add missing chart controls
Fixes #21.
2026-06-16 13:40:16 -04:00
zephyr ad58edbfe1 zenno: make character selects searchable
Fixes #20.
2026-06-16 13:37:59 -04:00
zephyr f8e7bfbec6 zenno/doc/race: skill activation chance is not integer percent 2026-06-14 20:00:27 -04:00
zephyr 2e618b613f zenno/lib/race: constrain poskeep chances to hundredths 2026-06-14 19:05:52 -04:00
zephyr cc2b5fcfcb zenno: make stat chart tooltips attach vertically 2026-06-14 18:59:33 -04:00
zephyr 8ef3936be5 zenno/doc/race: fix mobile 2026-06-14 18:57:43 -04:00
zephyr b06e4b537b zenno: link up doc/race
Fixes #16.
2026-06-14 17:55:21 -04:00
zephyr 7b4cd41d3b zenno/doc/frbm: remove stat summaries
For #16.
2026-06-14 17:45:29 -04:00
zephyr 2c9434729a zenno/doc/race: interactive graphs for race mechanics
For #16.
2026-06-14 17:36:00 -04:00
zephyr 7f02925ff7 horse: define rushed chance mod and current speed up ability types
Fixes #17.
2026-06-14 12:04:07 -04:00
zephyr b217691c8a zenno/doc/lanecalc: lint fixes 2026-06-14 10:45:39 -04:00
zephyr 4bce196c09 zenno/doc/frbm: effects on other styles in cm comps
Fixes #18.
2026-06-14 10:34:34 -04:00
zephyr aa17d8ccf3 zenno: beg
Fixes #15.
2026-06-13 22:59:49 -04:00
zephyr 26a5ca4496 zenno/doc/lanecalc: typo 2026-06-13 22:12:59 -04:00
zephyr 51f942ee18 zenno: mention doc/lanecalc as appropriate
Fixes #14.
2026-06-13 22:09:09 -04:00
zephyr 2c773391f0 zenno: link up doc/lanecalc 2026-06-13 22:04:49 -04:00
zephyr c66d969c82 zenno/doc/lanecalc: english manual for lanecalc
For #14.
2026-06-13 22:02:16 -04:00
zephyr bc9d722ee0 zenno/doc/frbm: cm14 results and cm15 plans 2026-06-13 13:20:54 -04:00
zephyr 6482f11620 zenno/doc/frbm: rename chariot -> rabbit
jern on the Hakuraku discord informs me that chariot is a different
style of build.

Fixes #19.
2026-06-13 12:35:07 -04:00
zephyr 75024c7c11 zenno: categorize tools 2026-06-10 14:03:42 -04:00
zephyr dc78d51def zenno: link up affinity tool 2026-06-08 16:45:12 -04:00
zephyr 5f0ad1b0e0 zenno/affinity: new tool 2026-06-08 16:42:04 -04:00
zephyr 6db0ca5230 mdb, cmd/horsebot: affinity details 2026-06-07 15:58:29 -04:00
zephyr 049617c22e zenno/doc/frbm: cm14 round 1 win rates 2026-06-07 15:04:29 -04:00
zephyr d431d3382a global, cmd/horsegen: don't generate json anymore
Everything gets the data from the mdb directly instead now.
2026-06-05 15:13:36 -04:00
zephyr a848c8eb72 zenno: use data from api 2026-06-05 15:13:11 -04:00
zephyr 871fd5fdcc cmd/horsebot: allow acting only as api server 2026-06-05 15:13:11 -04:00
zephyr e3dd37f515 cmd/horsebot: serve data under /api/global 2026-06-05 15:13:11 -04:00
zephyr 3557b32298 cmd/horsebot: serve data from mdb instead of json 2026-06-05 15:13:11 -04:00
zephyr 20db674d25 cmd/horsegen: generate using package mdb 2026-06-05 15:13:11 -04:00
zephyr 2a4da0a73e mdb: don't list carnival bonus sparks to exclude them 2026-06-05 15:13:11 -04:00
zephyr e6335c1d6e global: generate with deleted lobby location names 2026-06-05 15:13:11 -04:00
zephyr f40fea0ec5 mdb: package for interacting with game's local database 2026-06-05 15:13:10 -04:00
zephyr 96503e40f6 doc: add query to get skill condition types 2026-06-05 15:13:10 -04:00
zephyr c95e9bb4cc global: generate with 2026-06-04 db 2026-06-04 14:53:28 -04:00
zephyr 825fe0f2fb zenno: make article toc only render upon first view 2026-05-31 20:35:02 -04:00
zephyr 4ea689f426 zenno/doc/frbm: mention 1.5anni solo front adjustment 2026-05-31 16:55:59 -04:00
zephyr f0bb6d1926 zenno/doc/frbm: include cm14 falco stats 2026-05-31 16:52:07 -04:00
zephyr 13436abd1a zenno/doc/frbm: add section on parenting 2026-05-31 16:49:42 -04:00
zephyr bed60a8a67 zenno/doc/frbm: no zone -> no-overtake zone 2026-05-29 16:41:41 -04:00
zephyr 2b8ef759df zenno/doc/frbm: explicitly compare pp and ignited wit for lane combo 2026-05-29 16:38:28 -04:00
zephyr 9318bb9091 zenno/doc: auto-toc 2026-05-29 16:32:35 -04:00
zephyr 847f2eb8ca zenno: link up doc/frbm 2026-05-29 15:09:10 -04:00
zephyr 0b7201779c zenno: use spans for skill tooltips 2026-05-29 14:57:48 -04:00
zephyr 2b37c00ed0 zenno/doc/frbm: stat reference 2026-05-29 13:59:35 -04:00
zephyr 2e5a78e1d8 zenno/doc/frbm: implement additional feedback 2026-05-29 01:33:16 -04:00
zephyr 277c904bc5 zenno/doc/frbm: some feedback edits & more past cm teams 2026-05-28 19:26:50 -04:00
zephyr 8945a3943b global: generate with 2026-05-28 db 2026-05-28 15:43:35 -04:00
zephyr 1cfd80ac3d zenno/doc/frbm: add some support cards to career 2026-05-28 15:35:48 -04:00
zephyr b4e6a34aca zenno/doc/frbm: cm teams 2026-05-27 20:36:18 -04:00
zephyr b3c8699635 zenno/doc/frbm: reorganize as positioning -> skills -> builds 2026-05-27 13:05:57 -04:00
zephyr 223495a04a zenno: fix margins on skill tips with multiple activations 2026-05-27 02:26:49 -04:00
zephyr 40a015363c zenno/doc/frbm: precise example for uphill power diff 2026-05-26 17:30:30 -04:00
zephyr 2869e7c160 zenno: format and lint fixes 2026-05-26 00:30:28 -04:00
zephyr 30a72d91b8 zenno/mspeed: also show base acceleration 2026-05-26 00:29:11 -04:00
zephyr efb36f705c zenno/mspeed: fix display on mobile, maybe 2026-05-25 22:59:16 -04:00
zephyr 6a30b1d6f0 zenno/doc/frbm: mention gold skills bad for lane combo 2026-05-25 22:02:01 -04:00
zephyr 7b45b8761b zenno: tooltips on skills 2026-05-25 15:36:25 -04:00
zephyr a89ef8fc4c zenno/doc/frbm: lucky 7 is not a gate skill 2026-05-24 18:21:35 -04:00
zephyr bae79a5320 zenno: format & lint fixes 2026-05-24 18:06:51 -04:00
zephyr 0f14ece4da zenno: include rightmost endpoint in stat charts 2026-05-24 18:06:40 -04:00
zephyr b1c6850ce1 zenno/doc/frbm: chart and calcs for section speed 2026-05-24 17:55:57 -04:00
zephyr bd99cfaa6d zenno/doc/frbm: update with charts &c. 2026-05-23 16:18:24 -04:00
zephyr 3ab17cf9b0 zenno: clip marks in charts by default 2026-05-23 00:15:46 -04:00
zephyr 4bd7962182 zenno/mspeed: show spot struggle and lane combo on each others' charts 2026-05-23 00:13:21 -04:00
zephyr 09f099171b zenno/mspeed: wording improvements 2026-05-23 00:01:19 -04:00
zephyr 4fff7069a8 zenno/mspeed, zenno/spurt: step race length inputs by 100 2026-05-22 23:56:30 -04:00
zephyr 3e2153b39c zenno/lib: rearrange parameters in race.speedGain 2026-05-22 23:52:21 -04:00
zephyr d0fa6ab15c zenno/mspeed: account for accelTime >= dur 2026-05-22 23:39:17 -04:00
zephyr 9f8024d488 zenno/lib: style 2026-05-22 23:22:28 -04:00
zephyr 1df3bc1db9 zenno/spurt: take adjusted speed, not raw speed 2026-05-22 23:19:23 -04:00
zephyr a8c1b9c754 zenno: remove the expand button from stat charts 2026-05-22 23:16:09 -04:00
zephyr 7600c48cc7 zenno: lint fixes 2026-05-22 20:25:22 -04:00
zephyr 2e31560d6c zenno/mspeed: fix mobile layout 2026-05-22 19:41:10 -04:00
zephyr 2a07f193ec zenno/mspeed: calculator for front runner mechanical speed bonuses 2026-05-22 19:22:17 -04:00
zephyr b720b325b3 zenno: add stat charts 2026-05-19 19:45:02 -04:00
zephyr 80573a84ea zenno: update dependencies 2026-05-18 11:21:47 -04:00
zephyr bc94d66002 zenno/lib/race: add stat type 2026-05-18 11:20:59 -04:00
zephyr aca5fccaa7 global: generate with 2026-05-18 db 2026-05-18 10:30:30 -04:00
zephyr ee6ced1390 global: generate with 2026-05-08 db 2026-05-08 09:30:03 -04:00
zephyr af8e5907b9 cmd/horsebot: serve data json on http
For #7.
2026-05-07 19:40:25 -04:00
zephyr 9cf9fd198f horse, cmd/horsegen: include tags in generated skills
Fixes #6.
2026-05-04 16:46:24 -04:00
zephyr 0c2db10082 horse, cmd/horsebot: various fixes for skill formatting 2026-05-04 15:35:54 -04:00
zephyr fae9c38098 zenno/doc/frbm: mechanics and cm13 2026-05-03 18:44:25 -04:00
zephyr 0799bf658f all: remove koka code, move go to repo root 2026-04-29 23:28:13 -04:00
zephyr 2cec7c5699 cmd/horsebot: use purple circles for negative skills in related menu 2026-04-29 23:17:19 -04:00
zephyr b10a2572ec horse: add flat gate delay ability type 2026-04-29 23:08:09 -04:00
zephyr 657cf22f71 zenno/doc/frbm: initial draft of most mechanics sections 2026-04-27 18:03:24 -04:00
zephyr dce58357ae zenno/doc: initial work on front runner black magic 2026-04-27 03:25:53 -04:00
zephyr 7abe427c03 zenno: runner model 2026-04-26 22:01:22 -04:00
zephyr 1a55150ddd global: generate with 2026-04-24 db 2026-04-24 10:29:11 -04:00
zephyr 3e879f3687 zenno: lint fixes 2026-04-20 11:57:15 -04:00
zephyr 0eb932dc3c zenno: remove inheritance and spark pages
uma.moe and chronogenesis both have this now, at least in progress.
2026-04-20 11:38:31 -04:00
zephyr eb26b42543 global: generate with 2026-04-20 db 2026-04-20 10:19:36 -04:00
zephyr d082ce3374 zenno/spurt: compare speed skills 2026-04-15 13:32:43 -04:00
zephyr faccc3e912 global: generate with 2026-04-10 db 2026-04-11 15:24:16 -04:00
zephyr af8edb8999 cmd/horsebot: don't state instantaneous for recoveries 2026-04-07 19:25:28 -04:00
zephyr 0abe5fc3e4 zenno: npm up --save 2026-04-06 16:51:31 -04:00
zephyr 5a444ea08c horsegen, zenno/convo: get all character names 2026-04-06 16:46:37 -04:00
zephyr dfb2ad2950 zenno/convo: refactor name logic 2026-04-06 16:09:46 -04:00
zephyr 256e11d320 zenno/spurt: calculator for last spurt speed 2026-04-04 01:45:14 -04:00
zephyr 467098a9e4 zenno/lib: spark component 2026-04-03 18:01:00 -04:00
zephyr 9532e0ec89 zenno/lib: legacy and affinity stuff 2026-04-03 11:42:13 -04:00
zephyr c14850a048 global: generate with 2026-04-03 db 2026-04-03 11:10:56 -04:00
zephyr d0aec5c501 cmd/horsebot: compress served files 2026-04-02 10:45:30 -04:00
zephyr ccef87f0a3 zenno: resolve lint errors 2026-04-02 10:45:30 -04:00
zephyr 34140c0bba cmd/horsebot: fix autocomplete for uniques 2026-04-01 18:48:04 -04:00
zephyr 0ad064725f zenno: link to discord bot 2026-03-31 23:21:29 -04:00
zephyr 886dccb6b8 zenno: title and favicon 2026-03-31 19:33:24 -04:00
zephyr 57e8a06383 zenno: generate pages as directory/index.html 2026-03-31 19:23:10 -04:00
zephyr ab14f58079 cmd/horsebot: fix http server in http interactions mode 2026-03-31 19:03:51 -04:00
zephyr 4106215180 zenno, cmd/horsebot: host website in horsebot 2026-03-31 18:43:17 -04:00
zephyr cdea376f94 zenno: make footer links open new tabs 2026-03-31 17:27:45 -04:00
zephyr d157dfc9b6 zenno: don't use sakura 2026-03-31 16:54:51 -04:00
zephyr 773625b842 zenno: allow styling CharaPick 2026-03-31 12:32:04 -04:00
zephyr 22ca5c98f3 zenno: format 2026-03-31 12:08:36 -04:00
zephyr 08deedea8f zenno: nicer lobby conversation page 2026-03-31 01:19:13 -04:00
zephyr 86b769d7ed zenno: lobby conversation page 2026-03-30 23:22:43 -04:00
zephyr e139eae06d zenno: start conversations tool 2026-03-30 21:53:03 -04:00
zephyr 34e8c1f812 zenno: implement character picker 2026-03-30 12:13:20 -04:00
zephyr cc3128d65a zenno: better mobile nav 2026-03-30 10:13:17 -04:00
zephyr d04544030a zenno: create sveltekit website 2026-03-29 23:14:55 -04:00
zephyr e13c435afa global: generate with 2026-03-26 db 2026-03-26 04:05:39 -04:00
zephyr 4429bbecd1 global: generate with 2026-03-19 db 2026-03-19 11:29:46 -04:00
zephyr 2099eeb97e schema: describe json schemas in typescript 2026-03-18 00:43:51 -04:00
zephyr c22ed0dc83 horse: adjust fields omitted from skill json 2026-03-18 00:42:08 -04:00
zephyr 494aeeb401 doc: document skill tag meanings 2026-03-17 19:09:04 -04:00
zephyr 298b1368e8 horse, horsegen: generate lobby conversation data 2026-03-17 17:15:07 -04:00
zephyr b20a1a5964 doc: add mant db dump, document epithet text_data 2026-03-17 17:08:06 -04:00
zephyr af8e04473a horsebot: shrink skill displays 2026-03-12 18:35:51 -04:00
zephyr 351f606d29 global: generate with 2026-03-12 db adding mant 2026-03-12 10:42:14 -04:00
zephyr da376647af horsebot: restore inherit indicators on skill names 2026-03-09 13:48:28 -04:00
zephyr 2ec8d9cfdb horsegen: include uniques and inherits in each others' skill groups 2026-03-09 13:00:29 -04:00
zephyr 2dd75edc03 horsebot: use a command option to decide whether ephemeral 2026-03-09 12:35:39 -04:00
zephyr e08580925d horsebot: make skill responses ephemeral with share button 2026-03-09 11:17:59 -04:00
zephyr 63659a4934 horsebot: refactor skill server 2026-03-09 10:05:07 -04:00
zephyr af4e06411d horsebot: take horsegen output directory instead of each json file 2026-03-09 09:04:02 -04:00
zephyr 4426925ebb horsegen: output to ./global instead of horse/global 2026-03-09 08:58:49 -04:00
zephyr 8632bb8c3c all: generate json, not code
This includes modifying horsebot to use the generated JSON, as well as
moving the generator to another cmd/ directory.

Remove the generated code while we're here.
Koka tests still have to be updated, but it requires a JSON parser.
2026-03-08 21:33:46 -04:00
zephyr 7ff271ff2d horse: generate json 2026-03-08 14:04:28 -04:00
zephyr 5540bb2c4e horse: generate with 2026-03-05 global db 2026-03-05 10:27:47 -05:00
zephyr 9a73f2147b test: change example to my current labor 2026-03-04 21:15:54 -05:00
zephyr 01b88994f3 horse/prob: remove stray trace 2026-03-04 13:35:41 -05:00
zephyr 424f65dc8a horse: implement inheritance 2026-03-04 13:34:10 -05:00
zephyr cf814c6c72 horsegen: generate koka id lists as public 2026-02-26 19:15:43 -05:00
zephyr 7972bab46c horsegen: generate umas 2026-02-26 19:02:49 -05:00
zephyr 3fa30903cd horse: generate with 2026-02-25 global db 2026-02-25 13:36:22 -05:00
zephyr 9ef568202c horse: generate with 2026-02-18 global db 2026-02-18 13:01:53 -05:00
zephyr b0e422ac01 horsegen: spam vectors to try to limit type check time 2026-02-16 14:06:51 -05:00
zephyr 2184515938 horse: finish rename of trainee -> uma in koka 2026-02-16 12:14:32 -05:00
zephyr 489457c63c horse: rename level -> aptitude-level in koka 2026-02-16 12:03:04 -05:00
zephyr 9b3c9b22aa doc: also add a query to get all conversation data very important 2026-02-15 12:57:08 -05:00
zephyr 1f2824246f doc: document lobby conversation structure very important 2026-02-15 12:18:56 -05:00
zephyr 63e8327125 horsebot: format duration scaling 2026-02-15 10:46:08 -05:00
zephyr e608363a24 horsegen: skill activation duration scaling 2026-02-15 10:39:03 -05:00
zephyr e3903e5312 meta: update community std submodule 2026-02-15 10:00:14 -05:00
zephyr 5e7103befd test: add program that just imports stuff 2026-02-14 09:44:08 -05:00
zephyr 0723fe0c6a horsegen: fix missing blanket case in spark effects 2026-02-13 16:28:37 -05:00
zephyr cbe08cd8a7 horse: make game-id type public 2026-02-13 14:16:43 -05:00
zephyr db3e18e586 horsegen: generate sparks 2026-02-13 13:41:04 -05:00
zephyr 8fb29a953c horsegen: generate scenarios since sparks use them 2026-02-13 13:40:51 -05:00
zephyr c00d3d0186 cmd/horsebot: move to here 2026-02-10 14:03:41 -05:00
zephyr a534975601 horsegen: generate alternate races/saddles with ids 2026-02-10 13:55:47 -05:00
zephyr b55e1bc200 horse: generate with 2026-02-10 global db 2026-02-10 07:58:22 -05:00
zephyr c58dbd19b0 horsegen: generate saddles 2026-02-09 20:56:01 -05:00
zephyr 2fcd608102 horse: rework for saddles 2026-02-07 09:34:19 -05:00
zephyr 546f2db327 horse: generate with 2026-02-05 global db 2026-02-05 15:55:09 -05:00
zephyr 856c94723f doc: some more notes on races 2026-02-04 22:53:21 -05:00
zephyr 2393bf2fa5 horse: fix formatting of abilities that target styles 2026-02-01 15:33:04 -05:00
zephyr bf06de0f5e horse: rearrange career race results 2026-02-01 15:31:46 -05:00
zephyr f3f070ca2b horse: add canned functions for race grades 2026-01-31 13:44:06 -05:00
zephyr 34edcf97a7 horsegen: generate races 2026-01-30 23:25:44 -05:00
zephyr 9dd18ed972 doc: add diff of db changes for ny haru urara and opera added 2026-01-30 10:30:44 -05:00
zephyr 332cf3f13a horse: regenerate with 2026-01-29 global db 2026-01-30 10:22:02 -05:00
zephyr c5a1cdea5f horsegen: don't discard errors 2026-01-30 10:19:22 -05:00
zephyr 542d4198e7 horsegen: generate enumerations and lists 2026-01-27 21:50:57 -05:00
zephyr 98afe7384a horsegen: redesign character template 2026-01-27 21:33:26 -05:00
zephyr e890108591 horse, horsegen: redesign approach for koka 2026-01-27 16:49:55 -05:00
zephyr 0126101b1b meta: add shell script to generate while on linux 2026-01-24 09:37:41 -05:00
zephyr 5bf2588d41 horsegen: include unique owner in skill info 2026-01-23 23:37:36 -05:00
zephyr a5f84754ea doc: add updated sql dump and notes about consistent table changes 2026-01-23 22:46:05 -05:00
zephyr 4bfb06b682 horse: fix units in skill ability strings 2026-01-22 23:05:53 -05:00
zephyr 72b8bc9c6c doc: add diff of db changes for tamamo cross added 2026-01-22 22:25:28 -05:00
334 changed files with 510508 additions and 20435 deletions
-3
View File
@@ -1,3 +0,0 @@
[submodule "std"]
path = std
url = git@github.com:koka-community/std.git
+12
View File
@@ -0,0 +1,12 @@
when:
- event: push
branch: main
- event: pull_request
- event: manual
steps:
- name: test
image: golang:1.26-alpine
commands:
- go vet ./...
- go test ./...
+15
View File
@@ -0,0 +1,15 @@
when:
- event: push
branch: main
- event: pull_request
- event: manual
steps:
- name: test
image: node:24-alpine
commands:
- cd zenno
- npm ci
- npm run check
- npm run lint
- npm run test
@@ -27,13 +27,13 @@ const (
_AbilityTarget_name_0 = "selfothers with Sympathy"
_AbilityTarget_name_1 = "others in view"
_AbilityTarget_name_2 = "frontmost"
_AbilityTarget_name_3 = "others aheadothers behindall teammates"
_AbilityTarget_name_3 = "aheadbehindall teammates"
_AbilityTarget_name_4 = "using stylerushing others aheadrushing others behindrushing using stylespecific characterwhosoever triggered this skill"
)
var (
_AbilityTarget_index_0 = [...]uint8{0, 4, 24}
_AbilityTarget_index_3 = [...]uint8{0, 12, 25, 38}
_AbilityTarget_index_3 = [...]uint8{0, 5, 11, 24}
_AbilityTarget_index_4 = [...]uint8{0, 11, 31, 52, 71, 89, 119}
)
@@ -18,27 +18,34 @@ func _() {
_ = x[AbilityHP-9]
_ = x[AbilityGateDelay-10]
_ = x[AbilityFrenzy-13]
_ = x[AbilityAddGateDelay-14]
_ = x[AbilityCurrentSpeed-21]
_ = x[AbilityCurrentSpeedUp-22]
_ = x[AbilityTargetSpeed-27]
_ = x[AbilityLaneSpeed-28]
_ = x[AbilityRushedChance-29]
_ = x[AbilityAccel-31]
_ = x[AbilityLaneChange-35]
_ = x[AbilityActivateRare-37]
}
const (
_AbilityType_name_0 = "SpeedStaminaPowerGutsWitEnable Great Escape"
_AbilityType_name_1 = "VisionHPGate delay multiplier"
_AbilityType_name_2 = "Frenzy"
_AbilityType_name_3 = "Current speed"
_AbilityType_name_4 = "Target speedLane change speed"
_AbilityType_name_2 = "FrenzyAdded gate delay"
_AbilityType_name_3 = "Current speedCurrent speed"
_AbilityType_name_4 = "Target speedLane change speedRushed chance"
_AbilityType_name_5 = "Acceleration"
_AbilityType_name_6 = "Forced lane change"
_AbilityType_name_6 = "Set target lane"
_AbilityType_name_7 = "Activate rare skills"
)
var (
_AbilityType_index_0 = [...]uint8{0, 5, 12, 17, 21, 24, 43}
_AbilityType_index_1 = [...]uint8{0, 6, 8, 29}
_AbilityType_index_4 = [...]uint8{0, 12, 29}
_AbilityType_index_2 = [...]uint8{0, 6, 22}
_AbilityType_index_3 = [...]uint8{0, 13, 26}
_AbilityType_index_4 = [...]uint8{0, 12, 29, 42}
)
func (i AbilityType) String() string {
@@ -49,17 +56,21 @@ func (i AbilityType) String() string {
case 8 <= i && i <= 10:
i -= 8
return _AbilityType_name_1[_AbilityType_index_1[i]:_AbilityType_index_1[i+1]]
case i == 13:
return _AbilityType_name_2
case i == 21:
return _AbilityType_name_3
case 27 <= i && i <= 28:
case 13 <= i && i <= 14:
i -= 13
return _AbilityType_name_2[_AbilityType_index_2[i]:_AbilityType_index_2[i+1]]
case 21 <= i && i <= 22:
i -= 21
return _AbilityType_name_3[_AbilityType_index_3[i]:_AbilityType_index_3[i+1]]
case 27 <= i && i <= 29:
i -= 27
return _AbilityType_name_4[_AbilityType_index_4[i]:_AbilityType_index_4[i+1]]
case i == 31:
return _AbilityType_name_5
case i == 35:
return _AbilityType_name_6
case i == 37:
return _AbilityType_name_7
default:
return "AbilityType(" + strconv.FormatInt(int64(i), 10) + ")"
}
@@ -18,6 +18,7 @@ func _() {
_ = x[ValueUsageRandom-8]
_ = x[ValueUsageRandom2-9]
_ = x[ValueUsageClimax-10]
_ = x[ValueUsageFans-12]
_ = x[ValueUsageMaxStat-13]
_ = x[ValueUsageGreenCount-14]
_ = x[ValueUsageDistAdd-19]
@@ -29,15 +30,15 @@ func _() {
}
const (
_AbilityValueUsage_name_0 = "directlyscaling with the number of skillsscaling with team Speedscaling with team Staminascaling with team Powerscaling with team Gutsscaling with team Witwith a random 0× to 0.04× multiplierwith a random 0× to 0.04× multiplierscaling with the number of races won in training"
_AbilityValueUsage_name_1 = "scaling with the highest raw statscaling with the number of Passive skills activated"
_AbilityValueUsage_name_0 = "directlyscaling with the number of skillsscaling with team Speedscaling with team Staminascaling with team Powerscaling with team Gutsscaling with team Witwith a random 0× to 0.04× multiplierwith a random 0× to 0.04× multiplierscaling with the number of races won in the career"
_AbilityValueUsage_name_1 = "scaling with the number of fans earned in the careerscaling with the highest raw statscaling with the number of Passive skills activated"
_AbilityValueUsage_name_2 = "plus extra when far from the leadscaling with mid-race phase blocked side time"
_AbilityValueUsage_name_3 = "scaling with overall speedscaling with overall speedscaling with L'Arc global potentialscaling with the longest lead obtained in the first ⅔"
)
var (
_AbilityValueUsage_index_0 = [...]uint16{0, 8, 41, 64, 89, 112, 134, 155, 193, 231, 279}
_AbilityValueUsage_index_1 = [...]uint8{0, 33, 84}
_AbilityValueUsage_index_0 = [...]uint16{0, 8, 41, 64, 89, 112, 134, 155, 193, 231, 281}
_AbilityValueUsage_index_1 = [...]uint8{0, 52, 85, 136}
_AbilityValueUsage_index_2 = [...]uint8{0, 33, 78}
_AbilityValueUsage_index_3 = [...]uint8{0, 26, 52, 87, 142}
)
@@ -47,8 +48,8 @@ func (i AbilityValueUsage) String() string {
case 1 <= i && i <= 10:
i -= 1
return _AbilityValueUsage_name_0[_AbilityValueUsage_index_0[i]:_AbilityValueUsage_index_0[i+1]]
case 13 <= i && i <= 14:
i -= 13
case 12 <= i && i <= 14:
i -= 12
return _AbilityValueUsage_name_1[_AbilityValueUsage_index_1[i]:_AbilityValueUsage_index_1[i+1]]
case 19 <= i && i <= 20:
i -= 19
+31
View File
@@ -0,0 +1,31 @@
// Code generated by "stringer -type AptitudeLevel -trimprefix AptitudeLv"; DO NOT EDIT.
package horse
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[AptitudeLvG-1]
_ = x[AptitudeLvF-2]
_ = x[AptitudeLvE-3]
_ = x[AptitudeLvD-4]
_ = x[AptitudeLvC-5]
_ = x[AptitudeLvB-6]
_ = x[AptitudeLvA-7]
_ = x[AptitudeLvS-8]
}
const _AptitudeLevel_name = "GFEDCBAS"
var _AptitudeLevel_index = [...]uint8{0, 1, 2, 3, 4, 5, 6, 7, 8}
func (i AptitudeLevel) String() string {
idx := int(i) - 1
if i < 1 || idx >= len(_AptitudeLevel_index)-1 {
return "AptitudeLevel(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _AptitudeLevel_name[_AptitudeLevel_index[idx]:_AptitudeLevel_index[idx+1]]
}
+67
View File
@@ -0,0 +1,67 @@
package horse
type CharacterID int16
type Character struct {
ID CharacterID `json:"chara_id"`
Name string `json:"name"`
}
func (c Character) String() string {
return c.Name
}
// AffinityRelation holds precomputed affinity values for a pair or trio.
type AffinityRelation struct {
IDA CharacterID `json:"chara_a"`
IDB CharacterID `json:"chara_b"`
IDC CharacterID `json:"chara_c,omitzero"`
Affinity int `json:"affinity"`
}
// AffinityDetail holds a single affinity entry.
type AffinityDetail struct {
CharaID CharacterID `json:"chara_id"`
Relation uint16 `json:"relation"`
Affinity uint16 `json:"affinity"`
}
// Conversation describes a lobby conversation.
type Conversation struct {
// ID is the conversation ID.
ID int32 `json:"id"`
// CharacterID is the ID of the character who has the conversation as
// a gallery entry.
CharacterID CharacterID `json:"chara_id"`
// Number is the conversation number within the character's gallery.
Number int `json:"number"`
// Location is the ID of the location the conversation occurs in the lobby.
Location LobbyConversationLocationID `json:"location"`
// Chara1 is the first conversation participant ID.
// It does not necessarily match CharacterID.
Chara1 CharacterID `json:"chara_1"`
// Chara2 is the second conversation participant ID.
Chara2 CharacterID `json:"chara_2,omitzero"`
// Chara3 is the third conversation participant ID.
Chara3 CharacterID `json:"chara_3,omitzero"`
// ConditionType is a complete mystery to me.
ConditionType int `json:"condition_type"`
}
type LobbyConversationLocationID int
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type LobbyConversationLocationID -trimprefix Lobby -linecomment
const (
LobbyRightFront1 LobbyConversationLocationID = 110 // right side front
LobbyRightFront2 LobbyConversationLocationID = 120 // right side front
LobbyRightFront3 LobbyConversationLocationID = 130 // right side front
LobbyLeftTable1 LobbyConversationLocationID = 210 // left side table
LobbyLeftTable2 LobbyConversationLocationID = 220 // left side table
LobbyBackSeat LobbyConversationLocationID = 310 // center back seat
LobbyPosters1 LobbyConversationLocationID = 410 // center posters
LobbyPosters2 LobbyConversationLocationID = 420 // center posters
LobbyPosters3 LobbyConversationLocationID = 430 // center posters
LobbySchoolMap1 LobbyConversationLocationID = 510 // left side school map
LobbySchoolMap2 LobbyConversationLocationID = 520 // left side school map
LobbySchoolMap3 LobbyConversationLocationID = 530 // left side school map
)
+77
View File
@@ -0,0 +1,77 @@
package main
import (
"log/slog"
"git.sunturtle.xyz/zephyr/horse"
"git.sunturtle.xyz/zephyr/horse/umadump/ism"
)
// For each gain type from inspiration (stats, caps, aptitudes, skills):
// find all activated sparks that can give that gain type.
// Then, find all subsets of effect groups among those sparks
// that have effects summing to those observed
// (or more if the .end_info result is maxed),
// with the restriction that one comes from each spark.
// Deduplicate permutations.
// Lastly, find the intersection of possible effects from sparks that appear
// multiple times.
//
// To some extent, we rely on there being no sparks with the random stats effect type,
// although we also don't know the distribution of stats from overcapped skill hints.
type target struct {
spark *horse.Spark
group int
effect horse.SparkEffect
}
func skilltargets(sparks []horse.Spark) map[horse.SkillID]map[horse.SparkID][]target {
r := make(map[horse.SkillID]map[horse.SparkID][]target)
for i, sp := range sparks {
for j, g := range sp.Effects {
for _, e := range g {
if e.Target != horse.SparkSkillHint {
continue
}
if r[horse.SkillID(e.Value1)] == nil {
r[horse.SkillID(e.Value1)] = make(map[horse.SparkID][]target)
}
r[horse.SkillID(e.Value1)][sp.ID] = append(r[horse.SkillID(e.Value1)][sp.ID], target{&sparks[i], j, e})
}
}
}
return r
}
func resolveSkills(tab tables, career *ism.WorkIdleSingleMode)
// skillsparks appends all activated sparks that can yield a given skill to r.
// It assumes that no spark can give multiple skills.
func skillsparks(tab tables, sparks []ism.Factor, id horse.SkillID, r []*horse.Spark) []*horse.Spark {
for _, f := range sparks {
sp := tab.sparks[f.FactorID]
if sp == nil {
// ATM we do generally exclude Carnival Bonus from spark info.
// Better to check.
slog.Warn("skipped spark", slog.Int("id", int(f.FactorID)))
continue
}
if sparkHasSkill(sp, id) {
r = append(r, sp)
}
}
return r
}
func sparkHasSkill(sp *horse.Spark, id horse.SkillID) bool {
for _, g := range sp.Effects {
for _, e := range g {
if e.Target != horse.SparkSkillHint {
continue
}
return id == horse.SkillID(e.Value1)
}
}
return false
}
+111
View File
@@ -0,0 +1,111 @@
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"log/slog"
"os"
"os/signal"
"path/filepath"
"slices"
"git.sunturtle.xyz/zephyr/horse/mdb"
"git.sunturtle.xyz/zephyr/horse/umadump/ism"
"golang.org/x/sync/errgroup"
"zombiezen.com/go/sqlite"
"zombiezen.com/go/sqlite/sqlitex"
)
func main() {
var (
mdbf string
dirs []string
files []string
)
flag.StringVar(&mdbf, "-mdb", "", "`path` to master.mdb")
flag.Func("d", "idle_single_mode `dir`ectory (may be specified multiple times)", func(s string) error {
dirs = append(dirs, s)
return nil
})
flag.Parse()
files = slices.Clone(flag.Args())
for _, dir := range dirs {
ds, err := os.ReadDir(dir)
if err != nil {
slog.Error("getting files in directory", slog.String("dir", dir), slog.Any("err", err))
os.Exit(1)
}
for _, d := range ds {
if d.IsDir() {
continue
}
files = append(files, filepath.Join(dir, d.Name()))
}
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
go func() {
<-ctx.Done()
stop()
}()
db, err := sqlitex.NewPool(mdbf, sqlitex.PoolOptions{Flags: sqlite.OpenReadOnly})
if err != nil {
slog.Error("mdb", slog.Any("err", err))
os.Exit(1)
}
slog.Info("load skills")
skills, err := mdb.Skills(ctx, db)
if err != nil {
slog.Error("skills", slog.Any("err", err))
os.Exit(1)
}
slog.Info("load sparks")
sparks, err := mdb.Sparks(ctx, db)
if err != nil {
slog.Error("sparks", slog.Any("err", err))
os.Exit(1)
}
slog.Info("load umas")
umas, err := mdb.Umas(ctx, db)
if err != nil {
slog.Error("umas", slog.Any("err", err))
os.Exit(1)
}
slog.Info("mdb",
slog.Int("sparks", len(sparks)),
slog.Int("skills", len(skills)),
slog.Int("umas", len(umas)),
)
tab := makeTables(skills, sparks, umas)
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(64)
for _, file := range files {
g.Go(func() error {
return dofile(ctx, file)
})
}
if err := g.Wait(); err != nil {
slog.Error("process", slog.Any("err", err))
os.Exit(1)
}
}
func dofile(ctx context.Context, file string) error {
f, err := os.Open(file)
if err != nil {
return err
}
var career ism.WorkIdleSingleMode
d := json.NewDecoder(f)
d.DisallowUnknownFields()
if err := d.Decode(&career); err != nil {
return fmt.Errorf("%s: %w", file, err)
}
}
+37
View File
@@ -0,0 +1,37 @@
package main
import "git.sunturtle.xyz/zephyr/horse"
type tables struct {
skills map[horse.SkillID]*horse.Skill
groups map[horse.SkillGroupID]map[int8]*horse.Skill
sparks map[horse.SparkID]*horse.Spark
umas map[horse.UmaID]*horse.Uma
}
func makeTables(skills []horse.Skill, sparks []horse.Spark, umas []horse.Uma) tables {
tab := tables{
skills: make(map[horse.SkillID]*horse.Skill, len(skills)),
groups: make(map[horse.SkillGroupID]map[int8]*horse.Skill, len(skills)/2),
sparks: make(map[horse.SparkID]*horse.Spark, len(sparks)),
umas: make(map[horse.UmaID]*horse.Uma, len(umas)),
}
for i, sk := range skills {
tab.skills[sk.ID] = &skills[i]
if tab.groups[sk.Group] == nil {
tab.groups[sk.Group] = make(map[int8]*horse.Skill, 4)
}
// Only add the skill to the groups table if they're rare, the base
// version of the common skill, or there isn't anything else there.
if sk.Rarity == 2 || sk.GroupRate == 1 || tab.groups[sk.Group][sk.Rarity] == nil {
tab.groups[sk.Group][sk.Rarity] = &skills[i]
}
}
for i, sp := range sparks {
tab.sparks[sp.ID] = &sparks[i]
}
for i, u := range umas {
tab.umas[u.ID] = &umas[i]
}
return tab
}
+1
View File
@@ -0,0 +1 @@
token
+20
View File
@@ -0,0 +1,20 @@
# horsebot
Website and Discord bot serving horse game data.
Production instance is named Zenno Rob Roy, because she has read all about Umamusume and is always happy to share her knowledge and give recommendations.
The `-mdb` flag is mandatory for both website and Discord bot modes.
It provides data for both the horsebot API and the discord bot.
## Running the Website
If the `-public` flag is provided, its value gives the directory to serve at `/`.
The `-img` flag gives a separate directory into which images are synced from GameTora; obtain permission from Gertas prior to using it.
The images are served on `/img/`.
## Running the Discord Bot
Provide the `-token` flag pointing to a file containing the token.
The bot always uses the Gateway API.
If the `-http` argument is provided, it will also use the HTTP API, and `-key` must also be provided.
+56
View File
@@ -0,0 +1,56 @@
package autocomplete
import (
"bytes"
"cmp"
"slices"
"sync"
"github.com/junegunn/fzf/src/algo"
"github.com/junegunn/fzf/src/util"
)
// Set is an autocomplete set.
type Set[V any] struct {
keys []util.Chars
vals []V
}
// Add associates a value with a key in the autocomplete set.
// The behavior is undefined if the key already has a value.
func (s *Set[V]) Add(key string, val V) {
k := util.ToChars([]byte(key))
i, _ := slices.BinarySearchFunc(s.keys, k, func(a, b util.Chars) int {
return bytes.Compare(a.Bytes(), b.Bytes())
})
s.keys = slices.Insert(s.keys, i, k)
s.vals = slices.Insert(s.vals, i, val)
}
// Find appends to r all values in the set with keys that key matches.
func (s *Set[V]) Find(r []V, key string) []V {
initFzf()
var (
p = []rune(key)
got []V
t []algo.Result
slab util.Slab
)
for i := range s.keys {
res, _ := algo.FuzzyMatchV2(false, true, true, &s.keys[i], p, false, &slab)
if res.Score <= 0 {
continue
}
j, _ := slices.BinarySearchFunc(t, res, func(a, b algo.Result) int { return -cmp.Compare(a.Score, b.Score) })
// Insert after all other matches with the same score for stability.
for j < len(t) && t[j].Score == res.Score {
j++
}
t = slices.Insert(t, j, res)
got = slices.Insert(got, j, s.vals[i])
}
return append(r, got...)
}
var initFzf = sync.OnceFunc(func() { algo.Init("default") })
@@ -0,0 +1,70 @@
package autocomplete_test
import (
"slices"
"testing"
"git.sunturtle.xyz/zephyr/horse/cmd/horsebot/autocomplete"
)
func these(s ...string) []string { return s }
func TestAutocomplete(t *testing.T) {
cases := []struct {
name string
add []string
search string
want []string
}{
{
name: "empty",
add: nil,
search: "",
want: nil,
},
{
name: "exact",
add: these("bocchi"),
search: "bocchi",
want: these("bocchi"),
},
{
name: "extra",
add: these("bocchi", "ryo", "nijika", "kita"),
search: "bocchi",
want: these("bocchi"),
},
{
name: "short",
add: these("bocchi", "ryo", "nijika", "kita"),
search: "o",
want: these("bocchi", "ryo"),
},
{
name: "unrelated",
add: these("bocchi", "ryo", "nijika", "kita"),
search: "x",
want: nil,
},
{
name: "map",
add: these("Corazón ☆ Ardiente"),
search: "corazo",
want: these("Corazón ☆ Ardiente"),
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
var set autocomplete.Set[string]
for _, s := range c.add {
set.Add(s, s)
}
got := set.Find(nil, c.search)
slices.Sort(c.want)
slices.Sort(got)
if !slices.Equal(c.want, got) {
t.Errorf("wrong results: want %q, got %q", c.want, got)
}
})
}
}
+55
View File
@@ -0,0 +1,55 @@
package main
import (
"log/slog"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/handler"
)
func logMiddleware(next handler.Handler) handler.Handler {
return func(e *handler.InteractionEvent) error {
var msg string
attrs := make([]slog.Attr, 0, 8)
attrs = append(attrs,
slog.Uint64("interaction", uint64(e.Interaction.ID())),
slog.Uint64("user", uint64(e.Interaction.User().ID)),
)
if guild := e.Interaction.GuildID(); guild != nil {
attrs = append(attrs, slog.String("guild", guild.String()))
}
switch i := e.Interaction.(type) {
case discord.ApplicationCommandInteraction:
msg = "command"
attrs = append(attrs,
slog.String("name", i.Data.CommandName()),
slog.Int("type", int(i.Data.Type())),
)
switch data := i.Data.(type) {
case discord.SlashCommandInteractionData:
attrs = append(attrs, slog.String("path", data.CommandPath()))
}
case discord.AutocompleteInteraction:
msg = "autocomplete"
attrs = append(attrs,
slog.String("name", i.Data.CommandName),
slog.String("path", i.Data.CommandPath()),
slog.String("focus", i.Data.Focused().Name),
)
case discord.ComponentInteraction:
msg = "component"
attrs = append(attrs,
slog.Int("type", int(i.Data.Type())),
slog.String("custom", i.Data.CustomID()),
)
default:
slog.WarnContext(e.Ctx, "unknown interaction", slog.Any("event", e))
return nil
}
slog.LogAttrs(e.Ctx, slog.LevelInfo, msg, attrs...)
return next(e)
}
}
+255
View File
@@ -0,0 +1,255 @@
package main
import (
"bytes"
"context"
"encoding/hex"
"encoding/json"
"errors"
"flag"
"fmt"
"log/slog"
"net"
"net/http"
"os"
"os/signal"
"strconv"
"time"
"github.com/disgoorg/disgo"
"github.com/disgoorg/disgo/bot"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/handler"
"github.com/disgoorg/disgo/handler/middleware"
"github.com/disgoorg/disgo/httpserver"
"github.com/disgoorg/disgo/rest"
httpmiddle "github.com/go-chi/chi/v5/middleware"
"zombiezen.com/go/sqlite"
"zombiezen.com/go/sqlite/sqlitex"
"git.sunturtle.xyz/zephyr/horse/mdb"
)
func main() {
var (
// public site
addr string
mdbf string
public string
img string
// discord
tokenFile string
apiRoute string
pubkey string
// logging
level slog.Level
textfmt string
)
flag.StringVar(&addr, "http", ":13669", "`address` to bind HTTP server")
flag.StringVar(&mdbf, "mdb", "", "`path` to master.mdb")
flag.StringVar(&public, "public", "", "`dir`ectory containing the website to serve")
flag.StringVar(&img, "img", "", "`dir`ectory to save and serve images")
flag.StringVar(&tokenFile, "token", "", "`file` containing the Discord bot token")
flag.StringVar(&apiRoute, "route", "/interactions/callback", "`path` to serve Discord HTTP API calls")
flag.StringVar(&pubkey, "key", "", "Discord public key")
flag.TextVar(&level, "log", slog.LevelInfo, "slog logging `level`")
flag.StringVar(&textfmt, "log-format", "text", "slog logging `format`, text or json")
flag.Parse()
var lh slog.Handler
switch textfmt {
case "text":
lh = slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: level})
case "json":
lh = slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: level})
default:
fmt.Fprintf(os.Stderr, "invalid log format %q, must be text or json", textfmt)
os.Exit(1)
}
slog.SetDefault(slog.New(lh))
if public != "" {
stat, err := os.Stat(public)
if err != nil {
slog.Error("public", slog.Any("err", err))
os.Exit(1)
}
if !stat.IsDir() {
slog.Error("public", slog.String("err", "not a directory"))
os.Exit(1)
}
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
db, err := sqlitex.NewPool(mdbf, sqlitex.PoolOptions{Flags: sqlite.OpenReadOnly})
if err != nil {
slog.Error("mdb", slog.Any("err", err))
os.Exit(1)
}
if img != "" {
// Ensure the img directory is in fact a directory
// before we start trying to fill it out.
err := os.MkdirAll(img, 0777)
if err != nil {
slog.Error("img", slog.Any("err", err))
os.Exit(1)
}
go saveImgs(ctx, db, img)
}
var client *bot.Client
if tokenFile != "" {
skills, err := mdb.Skills(ctx, db)
slog.Info("loaded skills", slog.Int("count", len(skills)))
groups, err2 := mdb.SkillGroups(ctx, db)
slog.Info("loaded skill groups", slog.Int("count", len(groups)))
if err = errors.Join(err, err2); err != nil {
slog.Error("loading data", slog.Any("err", err))
os.Exit(1)
}
skillSrv := newSkillServer(skills, groups)
slog.Info("skill server ready")
r := handler.New()
r.DefaultContext(func() context.Context { return ctx })
r.Use(middleware.Go)
r.Use(logMiddleware)
r.Route("/skill", func(r handler.Router) {
r.SlashCommand("/", skillSrv.slash)
r.Autocomplete("/", skillSrv.autocomplete)
r.SelectMenuComponent("/swap", skillSrv.menu)
r.ButtonComponent("/swap/{id}", skillSrv.button)
})
slog.Info("connect", slog.String("disgo", disgo.Version))
token, err := os.ReadFile(tokenFile)
if err != nil {
slog.Error("reading token", slog.Any("err", err))
os.Exit(1)
}
token = bytes.TrimSuffix(token, []byte{'\n'})
client, err = disgo.New(string(token), bot.WithDefaultGateway(), bot.WithEventListeners(r))
if err != nil {
slog.Error("building bot", slog.Any("err", err))
os.Exit(1)
}
}
mux := http.NewServeMux()
if public != "" {
mux.Handle("GET /", httpmiddle.Compress(5)(http.FileServerFS(os.DirFS(public))))
}
if img != "" {
mux.Handle("GET /img/", http.StripPrefix("/img", http.FileServerFS(os.DirFS(img))))
}
mux.Handle("GET /api/global/affinity", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.AffinitySummary)))
mux.Handle("GET /api/global/affinity-detail", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.AffinityDetail)))
mux.Handle("GET /api/global/character", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.Characters)))
mux.Handle("GET /api/global/conversation", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.Conversations)))
mux.Handle("GET /api/global/race", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.Races)))
mux.Handle("GET /api/global/racecourse", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.Racecourses)))
mux.Handle("GET /api/global/saddle", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.Saddles)))
mux.Handle("GET /api/global/scenario", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.Scenarios)))
mux.Handle("GET /api/global/skill", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.Skills)))
mux.Handle("GET /api/global/skill-group", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.SkillGroups)))
mux.Handle("GET /api/global/spark", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.Sparks)))
mux.Handle("GET /api/global/support", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.SupportCards)))
mux.Handle("GET /api/global/uma", httpmiddle.Compress(5)(dataroute(ctx, db, mdb.Umas)))
if pubkey != "" {
pk, err := hex.DecodeString(pubkey)
if err != nil {
slog.Error("pubkey", slog.Any("err", err))
os.Exit(1)
}
mux.Handle("POST "+apiRoute, httpserver.HandleInteraction(httpserver.DefaultVerifier{}, pk, slog.Default(), client.EventManager.HandleHTTPEvent))
slog.Info("Discord HTTP API enabled", slog.String("pubkey", pubkey))
}
l, err := net.Listen("tcp", addr)
if err != nil {
slog.Error("listen", slog.String("addr", addr), slog.Any("err", err))
os.Exit(1)
}
srv := http.Server{
Addr: addr,
Handler: httpmiddle.Logger(mux),
ReadTimeout: 15 * time.Second,
WriteTimeout: 15 * time.Second,
BaseContext: func(l net.Listener) context.Context { return ctx },
}
go func() {
slog.Info("HTTP", slog.Any("addr", l.Addr()))
err := srv.Serve(l)
if err == http.ErrServerClosed {
return
}
slog.Error("HTTP server closed", slog.Any("err", err))
}()
if client != nil {
if err := handler.SyncCommands(client, commands, nil, rest.WithCtx(ctx)); err != nil {
slog.Error("syncing commands", slog.Any("err", err))
os.Exit(1)
}
slog.Info("start gateway")
if err := client.OpenGateway(ctx); err != nil {
slog.Error("starting gateway", slog.Any("err", err))
stop()
}
}
slog.Info("ready")
<-ctx.Done()
stop()
ctx, stop = context.WithTimeout(context.Background(), 5*time.Second)
defer stop()
if client != nil {
client.Close(ctx)
}
if err := srv.Shutdown(ctx); err != nil {
slog.Error("HTTP API shutdown", slog.Any("err", err))
os.Exit(1)
}
}
var commands = []discord.ApplicationCommandCreate{
discord.SlashCommandCreate{
Name: "skill",
Description: "Umamusume skill data",
Options: []discord.ApplicationCommandOption{
discord.ApplicationCommandOptionString{
Name: "query",
Description: "Skill name or ID",
Required: true,
Autocomplete: true,
},
discord.ApplicationCommandOptionBool{
Name: "share",
Description: "Share the skill info",
},
},
},
}
func dataroute[T any](ctx context.Context, db *sqlitex.Pool, f func(context.Context, *sqlitex.Pool) ([]T, error)) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
data, err := f(ctx, db)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
b, err := json.Marshal(data)
if err != nil {
panic(err)
}
w.Header().Set("Content-Type", "application/json")
w.Header().Set("Content-Length", strconv.Itoa(len(b)))
if _, err := w.Write(b); err != nil {
slog.Error("writing response", slog.Any("err", err))
return
}
}
}
+250
View File
@@ -0,0 +1,250 @@
package main
import (
"fmt"
"log/slog"
"strconv"
"strings"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/handler"
"git.sunturtle.xyz/zephyr/horse"
"git.sunturtle.xyz/zephyr/horse/cmd/horsebot/autocomplete"
)
type skillServer struct {
skills map[horse.SkillID]horse.Skill
byName map[string]horse.SkillID
groups map[horse.SkillGroupID]horse.SkillGroup
autocom autocomplete.Set[discord.AutocompleteChoice]
}
func newSkillServer(skills []horse.Skill, groups []horse.SkillGroup) *skillServer {
s := skillServer{
skills: make(map[horse.SkillID]horse.Skill, len(skills)),
byName: make(map[string]horse.SkillID, len(skills)),
groups: make(map[horse.SkillGroupID]horse.SkillGroup, len(groups)),
}
for _, skill := range skills {
s.skills[skill.ID] = skill
id := strconv.Itoa(int(skill.ID))
switch {
case skill.UniqueOwner == "":
s.byName[skill.Name] = skill.ID
s.autocom.Add(skill.Name, discord.AutocompleteChoiceString{Name: skill.Name, Value: id})
case skill.Rarity >= 3:
s.byName[skill.Name] = skill.ID
s.autocom.Add(skill.Name, discord.AutocompleteChoiceString{Name: skill.Name, Value: id})
s.autocom.Add(skill.UniqueOwner, discord.AutocompleteChoiceString{Name: "Unique: " + skill.UniqueOwner, Value: id})
default:
name := skill.Name + " (Inherited)"
s.byName[name] = skill.ID
s.autocom.Add(name, discord.AutocompleteChoiceString{Name: name, Value: id})
s.autocom.Add(skill.UniqueOwner, discord.AutocompleteChoiceString{Name: "Inherited unique: " + skill.UniqueOwner, Value: id})
}
}
for _, g := range groups {
s.groups[g.ID] = g
}
return &s
}
func (s *skillServer) slash(data discord.SlashCommandInteractionData, e *handler.CommandEvent) error {
q := data.String("query")
id, err := strconv.ParseInt(q, 10, 32)
if err == nil {
// note inverted condition; this is when we have an id
id = int64(s.skills[horse.SkillID(id)].ID)
}
if id == 0 {
// Either we weren't given a number or the number doesn't match any skill ID.
v := s.byName[q]
if v == 0 {
// No such skill.
m := discord.MessageCreate{
Content: "No such skill.",
Flags: discord.MessageFlagEphemeral,
}
return e.CreateMessage(m)
}
id = int64(v)
}
m := discord.MessageCreate{
Components: []discord.LayoutComponent{s.render(horse.SkillID(id))},
Flags: discord.MessageFlagIsComponentsV2,
}
if !data.Bool("share") {
m.Flags |= discord.MessageFlagEphemeral
}
return e.CreateMessage(m)
}
func (s *skillServer) autocomplete(e *handler.AutocompleteEvent) error {
q := e.Data.String("query")
opts := s.autocom.Find(nil, q)
return e.AutocompleteResult(opts[:min(len(opts), 25)])
}
func (s *skillServer) button(data discord.ButtonInteractionData, e *handler.ComponentEvent) error {
id, err := strconv.ParseInt(e.Vars["id"], 10, 32)
if err != nil {
m := discord.MessageCreate{
Content: "That button produced an invalid skill ID. That's not supposed to happen.",
Flags: discord.MessageFlagEphemeral,
}
return e.CreateMessage(m)
}
m := discord.MessageUpdate{
Components: &[]discord.LayoutComponent{s.render(horse.SkillID(id))},
}
return e.UpdateMessage(m)
}
func (s *skillServer) menu(data discord.SelectMenuInteractionData, e *handler.ComponentEvent) error {
d, ok := data.(discord.StringSelectMenuInteractionData)
if !ok {
return fmt.Errorf("wrong select menu type %T", data)
}
if len(d.Values) != 1 {
return fmt.Errorf("wrong number of values: %q", d.Values)
}
id, err := strconv.ParseInt(d.Values[0], 10, 32)
if err != nil {
return err
}
m := discord.MessageUpdate{
Components: &[]discord.LayoutComponent{s.render(horse.SkillID(id))},
}
return e.UpdateMessage(m)
}
func (s *skillServer) render(id horse.SkillID) discord.ContainerComponent {
skill, ok := s.skills[id]
if !ok {
slog.Error("invalid skill id", slog.Int("id", int(id)))
return discord.NewContainer(discord.NewTextDisplayf("invalid skill ID %v made it to render", id))
}
top := "### " + skill.Name
if skill.UniqueOwner != "" {
top += "\n-# " + skill.UniqueOwner
}
r := discord.NewContainer(
discord.NewTextDisplay(top),
discord.NewSmallSeparator(),
)
var skilltype string
switch {
case skill.Rarity == 3, skill.Rarity == 4, skill.Rarity == 5:
// unique of various star levels
r.AccentColor = 0xaca4d4
skilltype = "Unique Skill"
case skill.UniqueOwner != "":
r.AccentColor = 0xcccccc
skilltype = "Inherited Unique"
case skill.Rarity == 2:
// rare (gold)
r.AccentColor = 0xd7c25b
skilltype = "Rare Skill"
case skill.GroupRate == -1:
// negative (purple) skill
r.AccentColor = 0x9151d4
skilltype = "Negative Skill"
case !skill.WitCheck:
// should be passive (green)
r.AccentColor = 0x66ae1c
skilltype = "Passive Skill"
case isDebuff(skill):
// debuff (red)
r.AccentColor = 0xe34747
skilltype = "Debuff Skill"
case skill.Rarity == 1:
// common (white)
r.AccentColor = 0xcccccc
skilltype = "Common Skill"
}
text := make([]string, 0, 3)
abils := make([]string, 0, 3)
for _, act := range skill.Activations {
text, abils = text[:0], abils[:0]
if act.Precondition != "" {
text = append(text, "Precondition: "+formatCondition(act.Precondition))
}
text = append(text, "Condition: "+formatCondition(act.Condition))
var t string
switch {
case act.Duration <= 0:
// passive or instantaneous, e.g. recoveries; do nothing
case act.Duration >= 500e4:
t = "Permanent "
case act.DurScale == horse.DurationDirect:
t = "For " + act.Duration.String() + "s, "
default:
t = "For " + act.Duration.String() + "s " + act.DurScale.String() + ", "
}
for _, a := range act.Abilities {
abils = append(abils, a.String())
}
t += strings.Join(abils, ", ")
if act.Cooldown > 0 && act.Cooldown < 500e4 {
t += " on " + act.Cooldown.String() + "s cooldown"
}
text = append(text, t)
r.Components = append(r.Components, discord.NewTextDisplay(strings.Join(text, "\n")))
}
l := discord.NewTextDisplayf("%s ・ SP cost %d ・ Grade value %d ・ [Conditions on GameTora](https://gametora.com/umamusume/skill-condition-viewer?skill=%d)", skilltype, skill.SPCost, skill.GradeValue, skill.ID)
r.Components = append(r.Components, discord.NewSmallSeparator(), l)
rel := make([]horse.Skill, 0, 4)
group := s.groups[skill.Group]
for _, id := range [...]horse.SkillID{group.Skill1, group.Skill2, group.Skill3, group.SkillBad} {
if id != 0 {
rel = append(rel, s.skills[id])
}
}
if len(rel) > 1 {
opts := make([]discord.StringSelectMenuOption, 0, 4)
for _, rs := range rel {
name := rs.Name
emoji := "⚪"
switch {
case rs.Rarity == 3, rs.Rarity == 4, rs.Rarity == 5:
emoji = "🟠"
case rs.UniqueOwner != "":
name += " (Inherited)"
case rs.Rarity == 2:
emoji = "🟡"
case rs.GroupRate == -1:
emoji = "🟣"
}
b := discord.NewStringSelectMenuOption(name, strconv.Itoa(int(rs.ID))).WithEmoji(discord.NewComponentEmoji(emoji))
if rs.ID == skill.ID {
b = b.WithDefault(true)
}
opts = append(opts, b)
}
row := discord.NewActionRow(discord.NewStringSelectMenu("/skill/swap", "Related skills", opts...))
r.Components = append(r.Components, row)
}
return r
}
func formatCondition(s string) string {
s = strings.ReplaceAll(s, "&", " & ")
if strings.ContainsRune(s, '@') {
return "```\n" + strings.ReplaceAll(s, "@", "\n@\n") + "```"
}
return "`" + s + "`"
}
func isDebuff(s horse.Skill) bool {
for _, act := range s.Activations {
for _, a := range act.Abilities {
if a.Value < 0 {
return true
}
}
}
return false
}
+185
View File
@@ -0,0 +1,185 @@
package main
import (
"context"
"errors"
"fmt"
"image"
"image/png"
"log/slog"
"net/http"
"os"
"path/filepath"
"strconv"
"time"
"github.com/gen2brain/avif"
"golang.org/x/image/draw"
"golang.org/x/sync/errgroup"
"zombiezen.com/go/sqlite"
"zombiezen.com/go/sqlite/sqlitex"
)
func saveImgs(ctx context.Context, db *sqlitex.Pool, out string) {
skill, err := skillIconIDs(ctx, db)
if err != nil {
slog.Error("skills", slog.Any("err", err))
}
chara, err := charaIDs(ctx, db)
if err != nil {
slog.Error("characters", slog.Any("err", err))
}
rank, err := rankIDs(ctx, db)
if err != nil {
slog.Error("ranks", slog.Any("err", err))
}
supps, err := suppIDs(ctx, db)
if err != nil {
slog.Error("supports", slog.Any("err", err))
}
g, ctx := errgroup.WithContext(ctx)
tick := time.NewTicker(250 * time.Millisecond)
idouts(ctx, g, tick, skill, filepath.Join(out, "skill"), "https://media.gametora.com/umamusume/skills/icon/%d.png", image.Pt(64, 64), image.Pt(32, 32), image.Pt(16, 16))
idouts(ctx, g, tick, chara, filepath.Join(out, "chara"), "https://gametora.com/images/umamusume/characters/icons/chr_icon_%d.png", image.Pt(256, 256), image.Pt(64, 64), image.Pt(32, 32), image.Pt(16, 16))
idouts(ctx, g, tick, rank, filepath.Join(out, "rank"), "https://media.gametora.com/umamusume/ui/rank/%02d.png", image.Pt(128, 128), image.Pt(64, 64), image.Pt(32, 32), image.Pt(16, 16))
idouts(ctx, g, tick, rank, filepath.Join(out, "rank", "simple"), "https://media.gametora.com/umamusume/ui/rank/simple/%02d.png", image.Pt(50, 50), image.Pt(32, 32), image.Pt(16, 16))
idouts(ctx, g, tick, supps, filepath.Join(out, "support"), "https://gametora.com/images/umamusume/supports/support_card_s_%d.png", image.Pt(128, 128), image.Pt(64, 64), image.Pt(32, 32))
idouts(ctx, g, tick, []int32{0, 1, 2, 3, 4, 5, 6}, filepath.Join(out, "support", "type"), "https://gametora.com/images/umamusume/icons/utx_ico_obtain_%02d.png", image.Pt(70, 70), image.Pt(35, 35), image.Pt(16, 16))
if err := g.Wait(); err != nil {
slog.Error("output", slog.Any("err", err))
}
}
// load scans all results of sql and appends them to r.
func load[T any](ctx context.Context, db *sqlitex.Pool, r []T, sql string, row func(*sqlite.Stmt) T) ([]T, error) {
conn, err := db.Take(ctx)
defer db.Put(conn)
if err != nil {
return nil, err
}
stmt, err := conn.Prepare(sql)
if err != nil {
return nil, err
}
for {
ok, err := stmt.Step()
if err != nil {
return r, err
}
if !ok {
break
}
r = append(r, row(stmt))
}
return r, err
}
func skillIconIDs(ctx context.Context, db *sqlitex.Pool) ([]int32, error) {
return load(ctx, db, nil, "SELECT DISTINCT icon_id FROM skill_data", func(s *sqlite.Stmt) int32 {
return s.ColumnInt32(0)
})
}
func charaIDs(ctx context.Context, db *sqlitex.Pool) ([]int32, error) {
return load(ctx, db, nil, "SELECT id FROM chara_data", func(s *sqlite.Stmt) int32 {
return s.ColumnInt32(0)
})
}
func rankIDs(ctx context.Context, db *sqlitex.Pool) ([]int32, error) {
return load(ctx, db, nil, "SELECT id-1 FROM single_mode_rank", func(s *sqlite.Stmt) int32 {
return s.ColumnInt32(0)
})
}
func suppIDs(ctx context.Context, db *sqlitex.Pool) ([]int32, error) {
return load(ctx, db, nil, "SELECT id FROM support_card_data", func(s *sqlite.Stmt) int32 {
return s.ColumnInt32(0)
})
}
var pngenc = &png.Encoder{CompressionLevel: png.BestCompression}
func idouts(ctx context.Context, g *errgroup.Group, tick *time.Ticker, ids []int32, p, urlf string, sizes ...image.Point) {
for _, id := range ids {
g.Go(func() error {
n := strconv.Itoa(int(id))
p := filepath.Join(p, n)
_, err := os.Stat(p)
if !errors.Is(err, os.ErrNotExist) {
slog.DebugContext(ctx, "exists", slog.String("path", p))
return nil
}
if err := os.MkdirAll(p, 0777); err != nil {
return err
}
url := fmt.Sprintf(urlf, id)
select {
case <-ctx.Done():
return ctx.Err()
case <-tick.C: // continue on
}
img, err := dlimg(ctx, url)
if err != nil {
return err
}
slog.InfoContext(ctx, "resize", slog.String("url", url))
rs := resize(img, sizes...)
for _, r := range rs {
g.Go(func() error {
m := r.Bounds().Max
o := filepath.Join(p, fmt.Sprintf("%dx%d.png", m.X, m.Y))
slog.InfoContext(ctx, "write", slog.String("path", o))
f, err := os.Create(o)
if err != nil {
return err
}
defer f.Close()
return pngenc.Encode(f, r)
})
g.Go(func() error {
m := r.Bounds().Max
o := filepath.Join(p, fmt.Sprintf("%dx%d.avif", m.X, m.Y))
slog.InfoContext(ctx, "write", slog.String("path", o))
f, err := os.Create(o)
if err != nil {
return err
}
defer f.Close()
return avif.Encode(f, r)
})
}
return nil
})
}
}
func dlimg(ctx context.Context, url string) (image.Image, error) {
slog.InfoContext(ctx, "download", slog.String("url", url))
ctx, stop := context.WithTimeout(ctx, 5*time.Second)
defer stop()
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
if err != nil {
return nil, err
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
slog.InfoContext(ctx, "decode", slog.String("url", url))
img, _, err := image.Decode(resp.Body)
return img, err
}
func resize(img image.Image, sizes ...image.Point) []image.Image {
rs := make([]image.Image, 0, len(sizes))
for _, sz := range sizes {
d := image.NewNRGBA(image.Rectangle{Min: image.Point{}, Max: sz})
draw.CatmullRom.Scale(d, d.Bounds(), img, img.Bounds(), draw.Src, nil)
rs = append(rs, d)
}
return rs
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+293 -12
View File
@@ -6,12 +6,17 @@ This file is my notes from exploring the database.
# text_data categories
- 6 is character names, 4 is [variant] character name, 5 is [variant], 14 is variant
- 6 is character names, 4 is [variant] character name, 5 is [variant], 14 is clothing names
- 47 is skill names, 48 is skill descriptions
- 75 is support card names incl. variant, 76 is support card variant, 77 is support card character
- 147 is spark names, 172 is spark descriptions
- 33 is race names by race id, 28 is race names by race instance id, 31 is race courses
- 33 is race names by race id, 28 is race names by race instance id, 31 is race courses, 111 is saddle names
- 65 is player titles, 66 is title descriptions - ties with honor_data?
- 119 is scenario full titles (e.g. The Beginning: URA Finale), 120 is scenario descriptions, 237 is scenario names (e.g. URA Finale)
- 130 is epithet names, 131 is epithet descriptions
in the decomp, text data categories are named in `public enum MasterString.Category`.
some categories seem to be missing, though.
# succession factor (sparks)
@@ -23,6 +28,11 @@ factor_type:
- 5 race
- 4 skill
- 6 scenario
- 7 carnival bonus
- 10 surface gene (white, on jp)
- 8 distance gene (white)
- 11 style gene (white)
- 9 hidden (white, for things like many wins in west japan, summer sprint series, &c.)
- 3 unique
target_type:
@@ -31,6 +41,8 @@ target_type:
- 3 power
- 4 guts
- 5 wit
- 6 skill points
- 7 random stat; value 1 is amount, value 2 is always 1?
- 11 turf; value 1 is number of levels (1 or 2), value 2 is 0
- 12 dirt
- 21 front
@@ -41,16 +53,21 @@ target_type:
- 32 mile
- 33 medium
- 34 long
- 41 is skill; value 1 is skill id, value 2 is hint level (1-5)
- 41 skill; value 1 is skill id, value 2 is hint level (1-5)
- 51 carnival bonus; value 1 is skill id, value 2 is 1
- 61 speed cap; value 1 is presumably amount but the numbers are very small, 1-4; value 2 is 0
- 62 stam cap
- 63 power cap
- 64 guts cap
- 65 wit cap
grade is 2 for unique sparks and 1 otherwise.
every possible result has a row in succession_factor_effect.
effect_id distinguishes possibilities; factors with multiple effects (race and scenario sparks) have multiple rows with equal effect_id.
effect_group_id determines the pmf, but no tables have non-empty joins with the same column name, so the distribution values are mystery.
even searching for 51 and 52 (effect group ids for 1\* and 2\* race and scenario sparks) on consecutive lines gives nothing.
sf.grade = 1 unless it is a unique (green) spark, then sf.grade = 2.
=> sf.grade = 2 iff sf.factor_type = 3
getting all interesting spark data, fully expanded with all effects:
```sql
WITH spark AS (
@@ -128,8 +145,8 @@ race sparks with skills always give +1, skill sparks always give +1-5, unique sp
- single_mode_skill_need_point is base number of skill points to buy each skill
- support card skill hints are defined in single_mode_hint_gain
- skill_set is NOT trainee skills, seems to be npcs
- available_skill_set has trainee starting skills
- skill_set includes trainee unique starting skills, among many other things
- available_skill_set has trainee starting skills other than their uniques
skill categories:
- 0 passive
@@ -179,12 +196,98 @@ target types:
- 22 specific character, target value is character id
- 23 other who triggered the skill
TODO target types only in jp: 2, 7, 11, 22, 23
ability_value_usage can be 1 for plain or 2-6 for aoharu stat skill stat scaling
seems to be activate_lot = 1 means wit check, 0 means guaranteed
tag_id is a slash-separated list of numeric IDs that roughly describe all effects relevant to the skill.
- 101..104 style front, pace, late, end
- 201..204 distance sprint, mile, medium, long
- 301..303 timing early, mid, late race
- 401 affects speed stat or target speed
- 402 affects stamina stat or hp
- 403 affects power stat or acceleration
- 404 affects guts stat
- 405 affects wit stat or vision
- 406 is a debuff of any type, or is a main story self-debuff (creeping anxiety, blatant fear), or is Behold Thine Emperor's Divine Might (both own unique and inherited versions are tagged only 406??)
- 407 modifies gate delay
- 501..502 turf/dirt
- 801..812 scenario skill
600 series applies to skills available in global but are only used in jp.
- 601 ground condition passive
- 602 weather passive
- 603 season passive
- 604 race track passive
- 605 time of day passive
- 606 exchange race passive (kawasaki, funabashi, morioka, ooi)
- 607 distance passive (non/standard)
- 608 track direction or corner count passive
- 609 gate position passive
- 610 ground type passive
- 611 popularity passive
- 612 running style passive
- 613 passive depending on other horses' styles or skills
- 614 base stat threshold passive
- 615 mood passive
unrelated, query to get all condition types:
```sql
WITH RECURSIVE condition AS (
SELECT DISTINCT precondition_1 AS c FROM skill_data
UNION
SELECT DISTINCT condition_1 AS c FROM skill_data
UNION
SELECT DISTINCT precondition_2 AS c FROM skill_data
UNION
SELECT DISTINCT condition_2 AS c FROM skill_data
), disj AS (
SELECT
IIF(INSTR(c, '@') != 0, SUBSTR(c, 1, INSTR(c, '@')-1), c) AS c,
IIF(INSTR(c, '@') != 0, SUBSTR(c, 1 + INSTR(c, '@')), '') AS rest
FROM condition
UNION
SELECT
IIF(INSTR(rest, '@') != 0, SUBSTR(rest, 1, INSTR(rest, '@')-1), rest) AS c,
IIF(INSTR(rest, '@') != 0, SUBSTR(rest, 1 + INSTR(rest, '@')), '') AS rest
FROM disj
WHERE rest != ''
), term AS (
SELECT
IIF(INSTR(c, '&') != 0, SUBSTR(c, 1, INSTR(c, '&')-1), c) AS term,
IIF(INSTR(c, '&') != 0, SUBSTR(c, 1 + INSTR(c, '&')), '') AS rest
FROM disj
UNION
SELECT
IIF(INSTR(rest, '&') != 0, SUBSTR(rest, 1, INSTR(rest, '&')-1), rest) AS term,
IIF(INSTR(rest, '&') != 0, SUBSTR(rest, 1 + INSTR(rest, '&')), '') AS rest
FROM term
WHERE rest != ''
), op AS (
SELECT
term,
CASE
WHEN INSTR(term, '==') != 0 THEN '=='
WHEN INSTR(term, '!=') != 0 THEN '!='
WHEN INSTR(term, '<=') != 0 THEN '<='
WHEN INSTR(term, '>=') != 0 THEN '>='
WHEN INSTR(term, '<') != 0 THEN '<'
WHEN INSTR(term, '>') != 0 THEN '>'
END AS op
FROM term WHERE term != ''
), type_op_arg AS (
SELECT DISTINCT
term,
SUBSTR(term, 1, INSTR(term, op) - 1) AS "type",
op,
CAST(SUBSTR(term, INSTR(term, op) + LENGTH(op)) AS INTEGER) AS arg
FROM op
)
SELECT DISTINCT CONCAT(type, op), arg FROM type_op_arg
```
final select can be adjusted to get different info, but type+op together seems most useful
# races
- group 1, grade: g1 100, g2 200, g3 300, op 400, pre-op 700
@@ -193,6 +296,25 @@ seems to be activate_lot = 1 means wit check, 0 means guaranteed
single_mode_wins_saddle defines titles (classic triple crown, tenno sweep, &c.) using win_saddle_type = 0
race_instance is a combination of race, npc group, race date (month*100 + day), and time of day.
it isn't actually anything i care about.
which is to say, what i do care about is mapping races to each turn they're offered, and having a "race instance" enum like Hopeful-Stakes-Junior, Yasuda-Kinen-Classic, &c.
single_mode_program defines the race instances available for each turn, but the year is expressed a bit weirdly in the race_permission column:
- 1 = junior year
- 2 = classic year
- 3 = classic and senior year
- 4 = senior year
- 5 = ura finale
grade_rate_id appears to be consistently 800 iff maiden race and 900 iff debut race, but the values particularly for g1s are all over the place.
recommend_class_id appears to be consistently 1 iff maiden race or debut race, 2 iff pre-op, 3 iff op; but other values are confusing.
so, it doesn't seem like there's a particular flag that identifies maiden races, despite the restrictions on when they appear in the ui.
race_course_set defines the racecourse, e.g. hanshin 1600 turf, that a given race occurs on.
notably, stat thresholds are defined here via join to race_course_set_status, rather than in course event data.
# trainee definitions
- card_data has universal trainee stats: base skill set, stat growth bonuses ("talent"), default running style
@@ -200,7 +322,166 @@ single_mode_wins_saddle defines titles (classic triple crown, tenno sweep, &c.)
- card_talent_upgrade has costs to increase potential level, but it doesn't seem to have skill sets
- card_talent_hint_upgrade has costs to raise hint levels, but it's actually universal, only six rows
- single_mode_route_race is career goals (not only races)
- available_skill_set has starting skills including those unlocked by potential level given under need_rank (0 for pl1, 2 for pl2)
- single_mode_special_chara is scenario links
# unrelated to everything
# gl
try doober with E long, all-seeing eyes, gold recovery, and lots of stamina running in g3 diamond stakes senior year late february
single_mode_live_song_list has the song list for lives ha ha.
this is defined from the perspective of bonuses they grant when you have them, not the shop per se.
- text_data category for song names is 210, look up by live_id; for post-concert effect text, category 208 indexed by song list id
- command_id and live_id are always equal
- level is 1 for all songs except the two instances of girls' legend u
- master_bonus_content_text_id corresponds to text_data categories 207 for pickup effect text and 209 for song name
- live_bonus_type is 1 for specialty prio, 2 for chain frequency, 3 for fb
- girls' legend u is defined twice as ids 22 and 24
costs are in single_mode_live_square.
- square_type is 1 for stat up, 2 for skill up, 3 for energy up, 4 for live
- perf_type_n is token type: 1 for dance, 2 for passion, 3 for vocals, 4 for visuals, 5 for composure
- perf_value_n is number of tokens
immediate bonuses are in single_mode_live_master_bonus.
- master_bonus_type is 1 for stat up, 2 for skill hint, 3 for energy up, 4 for song
- master_bonus_type_value is 1 for type 1, live id for type 4, 0 otherwise
- master_bonus_gain_type_n is 1 for stat, 2 for skill hint, 3 for energy, 5 for permanent training bonus
+ 1 for stat: then master_bonus_gain_value_n_1 is 1-5 for stat id or 6 for sp, n_2 is 1 for fixed or 2 for random (not actually in the game), n_3 is lower bound on gain, n_4 is 0 for fixed or upper bound for random
+ 2 for skill hint: then gain_value_n_1 is 3(*), n_2 is skill tag, n_3 is hint level
+ 3 for energy: then gain_value_n_1 is amount
+ 5 for permanent training bonus: then gain_value_n_1 is stat id (6 for sp), n_2 is amount
(*) MasterSingleModeLiveMasterBonus.SingleModeLiveMasterBonus.GainSkillHintTypeEnum defines values of Random = 1 and SkillId = 2, but they are unused in the db.
there is some ostensibly unused data.
- master bonus ids 12001-12206 grant random amounts of stats
- id 20000 corresponds to "Group Lesson" "Skill hint appropriate for aptitude"
# lobby conversations!!!
table is home_story_trigger.
pos_id values:
- 110 right side, toward the front
- 120 same, but two characters
- 130 same, but three characters
- 210 left side table
- 220
- 310 center back seat
- 410 center posters
- 420
- 430
- 510 left school map
- 520
- 530
num is how many characters are involved, but also can just check chara_id_{1,2,3} for nonzero.
unsure what condition_type is.
values of 2 and 3 always have two or three characters, and values of 4 (jp only) always have three, but 0 and 1 can have any number.
there's no requirement for stories like having a horse at all, much less an affinity level.
gallery_chara_id is the character whose conversation it is; chara_id_{1,2,3} are the characters involved.
gallery_chara_id is always one of the three, but it can be any one of the three.
disp_order then is the conversation number within their gallery.
getting all conversation data:
```sql
WITH chara_name AS (
SELECT "index" AS id, "text" AS name
FROM text_data
WHERE category = 6
), convo_loc_names AS (
SELECT 110 AS pos_id, 'right side front' AS name UNION ALL
SELECT 120 AS pos_id, 'right side front' AS name UNION ALL
SELECT 130 AS pos_id, 'right side front' AS name UNION ALL
SELECT 210 AS pos_id, 'left side table' AS name UNION ALL
SELECT 220 AS pos_id, 'left side table' AS name UNION ALL
SELECT 310 AS pos_id, 'center back seat' AS name UNION ALL
SELECT 410 AS pos_id, 'center posters' AS name UNION ALL
SELECT 420 AS pos_id, 'center posters' AS name UNION ALL
SELECT 430 AS pos_id, 'center posters' AS name UNION ALL
SELECT 510 AS pos_id, 'left side school map' AS name UNION ALL
SELECT 520 AS pos_id, 'left side school map' AS name UNION ALL
SELECT 530 AS pos_id, 'left side school map' AS name
)
SELECT
n.name,
s.disp_order,
l.name,
c1.name,
c2.name,
c3.name,
s.condition_type
FROM home_story_trigger s
LEFT JOIN chara_name n ON s.gallery_chara_id = n.id
LEFT JOIN chara_name c1 ON s.chara_id_1 = c1.id
LEFT JOIN chara_name c2 ON s.chara_id_2 = c2.id
LEFT JOIN chara_name c3 ON s.chara_id_3 = c3.id
LEFT JOIN convo_loc_names l ON s.pos_id = l.pos_id
ORDER BY s.gallery_chara_id, s.disp_order
```
# update diffs
complete list of tables with inserts in both the 2026-01-15 update adding fine motion, manhattan cafe ssr, inari one sr and the 2026-01-22 update adding tamamo cross and main story 5:
- announce_character
- announce_data
- available_skill_set
- background_data
- banner_data
- campaign_chara_story_schedule
- campaign_data
- campaign_single_race_add_data
- campaign_single_race_add_reward
- card_data
- card_rarity_data
- card_talent_upgrade
- champions_news_chara_comment
- chara_category_motion
- character_system_lottery
- character_system_text
- chara_motion_set
- chara_story_data
- dress_data
- gacha_available
- gacha_data
- gacha_exchange
- gacha_top_bg
- home_story_trigger
- home_walk_group
- honor_data
- item_exchange
- item_place
- jukebox_chara_tag_data
- jukebox_comment
- jukebox_reaction_data
- mission_data
- nickname
- piece_data
- race
- race_bgm_cutin_extension_time
- race_instance
- race_jikkyo_base
- race_jikkyo_race
- race_jikkyo_trigger
- single_mode_chara_program
- single_mode_conclusion_set
- single_mode_event_production
- single_mode_hint_gain
- single_mode_npc
- single_mode_rival
- single_mode_route
- single_mode_route_race
- single_mode_scout_chara
- single_mode_skill_need_point
- single_mode_story_data
- single_mode_tag_card_pos
- skill_data
- skill_set
- succession_factor
- succession_factor_effect
- succession_relation_member
- support_card_data
- support_card_effect_table
- support_card_unique_effect
- text_data
+38
View File
@@ -0,0 +1,38 @@
// Code generated by "stringer -type DurScale -trimprefix Duration -linecomment"; DO NOT EDIT.
package horse
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[DurationDirect-1]
_ = x[DurationFrontDistance-2]
_ = x[DurationRemainingHP-3]
_ = x[DurationIncrementPass-4]
_ = x[DurationMidSideBlock-5]
_ = x[DurationRemainingHP2-7]
}
const (
_DurScale_name_0 = "directlyscaling with distance from the frontscaling with remaining HPincreasing with each pass while activescaling with mid-race phase blocked side time"
_DurScale_name_1 = "scaling with remaining HP"
)
var (
_DurScale_index_0 = [...]uint8{0, 8, 44, 69, 107, 152}
)
func (i DurScale) String() string {
switch {
case 1 <= i && i <= 5:
i -= 1
return _DurScale_name_0[_DurScale_index_0[i]:_DurScale_index_0[i+1]]
case i == 7:
return _DurScale_name_1
default:
return "DurScale(" + strconv.FormatInt(int64(i), 10) + ")"
}
}
-13
View File
@@ -1,13 +0,0 @@
package main
import "os"
//go:generate go run ./horsegen
//go:generate go generate ./horse/...
//go:generate go fmt ./...
//go:generate go test ./...
func main() {
os.Stderr.WriteString("go generate, not go run\n")
os.Exit(2)
}
+26 -8
View File
@@ -1,22 +1,40 @@
module git.sunturtle.xyz/zephyr/horse
go 1.24.1
go 1.25.5
require (
golang.org/x/sync v0.14.0
github.com/disgoorg/disgo v0.19.6
github.com/gen2brain/avif v0.6.0
github.com/go-chi/chi/v5 v5.3.1
github.com/google/go-cmp v0.7.0
github.com/junegunn/fzf v0.74.1
golang.org/x/image v0.44.0
golang.org/x/sync v0.22.0
zombiezen.com/go/sqlite v1.4.2
)
require (
github.com/disgoorg/godave v0.3.0 // indirect
github.com/disgoorg/json/v2 v2.0.0 // indirect
github.com/disgoorg/omit v1.0.0 // indirect
github.com/disgoorg/snowflake/v2 v2.0.3 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ebitengine/purego v0.10.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/junegunn/go-shellwords v0.0.0-20250127100254-2aa3b3277741 // indirect
github.com/klauspost/compress v1.19.1 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
golang.org/x/sys v0.33.0 // indirect
modernc.org/libc v1.65.7 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sasha-s/go-csync v0.0.0-20240107134140-fcbab37b09ad // indirect
github.com/tetratelabs/wazero v1.12.0 // indirect
golang.org/x/crypto v0.54.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/tools v0.48.0 // indirect
modernc.org/libc v1.74.3 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.37.1 // indirect
modernc.org/sqlite v1.54.0 // indirect
)
+76 -31
View File
@@ -1,48 +1,93 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/disgoorg/disgo v0.19.6 h1:1xJQt6KZgiqvBOnjuziG1gE4Iqd0aJn8DNfE6eE+0qw=
github.com/disgoorg/disgo v0.19.6/go.mod h1:NnV63iw4lJdF1fnV0gX27XR43ZgRGqnL122svRMTgTE=
github.com/disgoorg/godave v0.3.0 h1:37F3ZuiMd8/EXeoCtTeE8iP2eT2nWsfEa4/ITwoKfe4=
github.com/disgoorg/godave v0.3.0/go.mod h1:OreAC3hpabr39bMVA+jwOVDq1EUPXH5A0XUBiZaDI1Y=
github.com/disgoorg/json/v2 v2.0.0 h1:U16yy/ARK7/aEpzjjqK1b/KaqqGHozUdeVw/DViEzQI=
github.com/disgoorg/json/v2 v2.0.0/go.mod h1:jZTBC0nIE1WeetSEI3/Dka8g+qglb4FPVmp5I5HpEfI=
github.com/disgoorg/omit v1.0.0 h1:y0LkVUOyUHT8ZlnhIAeOZEA22UYykeysK8bLJ0SfT78=
github.com/disgoorg/omit v1.0.0/go.mod h1:RTmSARkf6PWT/UckwI0bV8XgWkWQoPppaT01rYKLcFQ=
github.com/disgoorg/snowflake/v2 v2.0.3 h1:3B+PpFjr7j4ad7oeJu4RlQ+nYOTadsKapJIzgvSI2Ro=
github.com/disgoorg/snowflake/v2 v2.0.3/go.mod h1:W6r7NUA7DwfZLwr00km6G4UnZ0zcoLBRufhkFWgAc4c=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/ebitengine/purego v0.10.2 h1:W809HbnvzAxgdm+aOvlSekrM16wGCdT/e76+9tS7gzE=
github.com/ebitengine/purego v0.10.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/gen2brain/avif v0.6.0 h1:/8WSgcU+IEF0jhKYsUZ/mzlziFuTeJFpIKBj2siTQps=
github.com/gen2brain/avif v0.6.0/go.mod h1:QgrYqdVE9y40PCfArK9VakcMIpYeDYpZmCSLkW6C1n8=
github.com/go-chi/chi/v5 v5.3.1 h1:3j4HZLGZQ3JpMCrPJF/Jl3mYJfWLKBfNJ6quurUGCf8=
github.com/go-chi/chi/v5 v5.3.1/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/junegunn/fzf v0.74.1 h1:rCGVdCSoOkfcfTxtxCO/vG2yceDjRlKSlv7IfCGkc/Y=
github.com/junegunn/fzf v0.74.1/go.mod h1:hKDkO8orBWT5VLIZOL8oyhxn7mRLXdGyu+gz1Ss58pU=
github.com/junegunn/go-shellwords v0.0.0-20250127100254-2aa3b3277741 h1:7dYDtfMDfKzjT+DVfIS4iqknSEKtZpEcXtu6vuaasHs=
github.com/junegunn/go-shellwords v0.0.0-20250127100254-2aa3b3277741/go.mod h1:6EILKtGpo5t+KLb85LNZLAF6P9LKp78hJI80PXMcn3c=
github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk=
github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI=
github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM=
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
modernc.org/cc/v4 v4.26.1 h1:+X5NtzVBn0KgsBCBe+xkDC7twLb/jNVj9FPgiwSQO3s=
modernc.org/cc/v4 v4.26.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
modernc.org/ccgo/v4 v4.28.0 h1:rjznn6WWehKq7dG4JtLRKxb52Ecv8OUGah8+Z/SfpNU=
modernc.org/ccgo/v4 v4.28.0/go.mod h1:JygV3+9AV6SmPhDasu4JgquwU81XAKLd3OKTUDNOiKE=
modernc.org/fileutil v1.3.1 h1:8vq5fe7jdtEvoCf3Zf9Nm0Q05sH6kGx0Op2CPx1wTC8=
modernc.org/fileutil v1.3.1/go.mod h1:HxmghZSZVAz/LXcMNwZPA/DRrQZEVP9VX0V4LQGQFOc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/sasha-s/go-csync v0.0.0-20240107134140-fcbab37b09ad h1:qIQkSlF5vAUHxEmTbaqt1hkJ/t6skqEGYiMag343ucI=
github.com/sasha-s/go-csync v0.0.0-20240107134140-fcbab37b09ad/go.mod h1:/pA7k3zsXKdjjAiUhB5CjuKib9KJGCaLvZwtxGC8U0s=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tetratelabs/wazero v1.12.0 h1:DuWcpNu/FzgEXgGBDp8J1Spc+CWOvvtvVyjKlaZopYU=
github.com/tetratelabs/wazero v1.12.0/go.mod h1:LvKtzl2RqO4gyF27BiXU+nKAjcV8f38U+kP/q2vgxh0=
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
golang.org/x/image v0.44.0 h1:+tDekMZED9+LrtB3G5xzRggpVh9CARjZqROla3R3R+I=
golang.org/x/image v0.44.0/go.mod h1:V8K3KE9KKKE+pLpQDOeN18w9oacNSvy1tDOirTu4xtY=
golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk=
golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40=
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE=
golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/cc/v4 v4.29.1 h1:MKgdCV3WykTSPqpVrnxdEDS0HEd2FHpKZDzxzU5LyeI=
modernc.org/cc/v4 v4.29.1/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI=
modernc.org/ccgo/v4 v4.34.6 h1:sBgfIwyN0TQ9C5hwIeuqyeAKyMWnbvj2fvpF4L11uzU=
modernc.org/ccgo/v4 v4.34.6/go.mod h1:SZ8YcN9NG7XVsQYdm6jYBvi8PQP1qi+kqB6OhjqI3Fk=
modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
modernc.org/libc v1.65.7 h1:Ia9Z4yzZtWNtUIuiPuQ7Qf7kxYrxP1/jeHZzG8bFu00=
modernc.org/libc v1.65.7/go.mod h1:011EQibzzio/VX3ygj1qGFt5kMjP0lHb0qCW5/D/pQU=
modernc.org/gc/v3 v3.1.4 h1:2g65LGVSmFQrXeITAw97x7hCRvZFcyE1uDP+7Vng7JI=
modernc.org/gc/v3 v3.1.4/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
modernc.org/libc v1.74.3 h1:a4J+Z8aVaxPyjyxRAdJzw246PqpcFGvVPnfT/AuM5Ws=
modernc.org/libc v1.74.3/go.mod h1:4H7h/MJ8wnjL8RAbp9v3OXgnk22X7MouHIhDbvP3gj4=
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg=
modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
modernc.org/sqlite v1.37.1 h1:EgHJK/FPoqC+q2YBXg7fUmES37pCHFc97sI7zSayBEs=
modernc.org/sqlite v1.37.1/go.mod h1:XwdRtsE1MpiBcL54+MbKcaDvcuej+IYSMfLN6gSKV8g=
modernc.org/sqlite v1.54.0 h1:JCxR4qwkJvOaqAoYcgDoO25Nc+ROg6EJ2LfBVzdrgog=
modernc.org/sqlite v1.54.0/go.mod h1:4ntCLuNmnH8+GNqjka1wNg7KJd5/Hi5FYp8K+XQ7GZw=
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
-6
View File
@@ -1,6 +0,0 @@
# horse
This directory contains manually written code and types on which the generated code depends.
The generated code is in ./global; other regions will follow the same convention once they are supported.
It is always safe to delete the entire directories and regenerate them.
-12
View File
@@ -1,12 +0,0 @@
package horse
type CharacterID int16
type Character struct {
ID CharacterID
Name string
}
func (c Character) String() string {
return c.Name
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
-12516
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-17
View File
@@ -1,17 +0,0 @@
module horse/legacy
import horse/character
import horse/race
import horse/spark
pub struct legacy
uma: veteran
parents: (veteran, veteran)
pub struct veteran
character: character
stat: spark<stat>
aptitude: spark<aptitude>
unique: maybe<spark<unique>>
generic: list<spark<generic>>
results: list<race-result>
-158
View File
@@ -1,158 +0,0 @@
module horse/prob/kfl
// kfl is a semiring of probabilities formed by vibes.
pub type kfl
// Effectively if not literally impossible events.
Impossible
// Not worth aiming for, but can technically still happen.
Probably-Not
// You expect it not to happen most of the time, but it might still be worth
// trying for it if you're being forced to play to your outs.
Doubtful
// More likely that it won't happen, but a success isn't surprising.
Unlikely
// Either it does or it doesn't.
Mayhapsibly
// Decent chance it doesn't happen, but you still expect it to.
Probably
// You expect it to happen most of the time, but accept that there will be failures.
Most-Likely
// Very close to guaranteed, but technically with a small chance to fail.
Cry-If-Not
// Absolutely guaranteed events.
Guaranteed
// Automatically generated.
// Comparison of the `kfl` type.
pub fun cmp(this : kfl, other : kfl) : e order
match (this, other)
(Impossible, Impossible) -> Eq
(Impossible, _) -> Lt
(_, Impossible) -> Gt
(Probably-Not, Probably-Not) -> Eq
(Probably-Not, _) -> Lt
(_, Probably-Not) -> Gt
(Doubtful, Doubtful) -> Eq
(Doubtful, _) -> Lt
(_, Doubtful) -> Gt
(Unlikely, Unlikely) -> Eq
(Unlikely, _) -> Lt
(_, Unlikely) -> Gt
(Mayhapsibly, Mayhapsibly) -> Eq
(Mayhapsibly, _) -> Lt
(_, Mayhapsibly) -> Gt
(Probably, Probably) -> Eq
(Probably, _) -> Lt
(_, Probably) -> Gt
(Most-Likely, Most-Likely) -> Eq
(Most-Likely, _) -> Lt
(_, Most-Likely) -> Gt
(Cry-If-Not, Cry-If-Not) -> Eq
(Cry-If-Not, _) -> Lt
(_, Cry-If-Not) -> Gt
(Guaranteed, Guaranteed) -> Eq
// Shows a string representation of the `kfl` type.
pub fun show(this : kfl) : e string
match this
Impossible -> "impossible"
Probably-Not -> "probably not"
Doubtful -> "doubtful"
Unlikely -> "unlikely"
Mayhapsibly -> "mayhapsibly"
Probably -> "probably"
Most-Likely -> "most likely"
Cry-If-Not -> "cry if not"
Guaranteed -> "guaranteed"
// KFL multiplication, or the probability of cooccurrence of two independent events.
pub fun (*)(a: kfl, b: kfl): e kfl
val (l, h) = match a.cmp(b) // this operation is commutative
Gt -> (b, a)
_ -> (a, b)
match (l, h)
(r, Guaranteed) -> r // factor out Guaranteed cases
(Impossible, _) -> Impossible
(Probably-Not, _) -> Impossible
(r, Cry-If-Not) -> r // factor out further Cry-If-Not cases
(Doubtful, Most-Likely) -> Probably-Not
(Doubtful, _) -> Impossible
(Unlikely, Most-Likely) -> Doubtful
(Unlikely, Probably) -> Doubtful
(Unlikely, Mayhapsibly) -> Probably-Not
(Unlikely, _) -> Probably-Not // (Unlikely, Unlikely) because commutative
(Mayhapsibly, Most-Likely) -> Unlikely
(Mayhapsibly, Probably) -> Unlikely
(Mayhapsibly, _) -> Unlikely
(Probably, Most-Likely) -> Mayhapsibly
(Probably, _) -> Unlikely
(Most-Likely, _) -> Probably
// These two are only needed because the type system doesn't understand commutativity.
(Cry-If-Not, _) -> Cry-If-Not
(Guaranteed, _) -> Guaranteed
// KFL addition, or the probability of occurrence of at least one of two independent events.
pub fun (+)(a: kfl, b: kfl): e kfl
val (l, h) = match a.cmp(b) // this operation is commutative
Gt -> (b, a)
_ -> (a, b)
match (l, h)
// Cases with _ on the right are (a, a) due to commutativity.
// Cases with _ on the left simplify later cases that all absorb to the right.
(Guaranteed, _) -> Guaranteed
(_, Guaranteed) -> Guaranteed
(Cry-If-Not, _) -> Guaranteed
(Most-Likely, Cry-If-Not) -> Cry-If-Not
(Most-Likely, _) -> Cry-If-Not
(_, Cry-If-Not) -> Cry-If-Not
(Probably, Most-Likely) -> Cry-If-Not
(Probably, _) -> Most-Likely
(_, Most-Likely) -> Most-Likely
(Mayhapsibly, Probably) -> Most-Likely
(Mayhapsibly, _) -> Probably
(Unlikely, Probably) -> Most-Likely
(Unlikely, Mayhapsibly) -> Probably
(Unlikely, _) -> Mayhapsibly
(_, Probably) -> Probably
(Doubtful, Mayhapsibly) -> Probably
(Doubtful, Unlikely) -> Mayhapsibly
(Doubtful, _) -> Unlikely
(_, Mayhapsibly) -> Mayhapsibly
(_, Unlikely) -> Unlikely
(Probably-Not, Doubtful) -> Unlikely
(Probably-Not, _) -> Probably-Not
(_, Doubtful) -> Doubtful
(_, Probably-Not) -> Probably-Not
(_, Impossible) -> Impossible
// KFL union, or the probability of occurrence of exactly one of two independent events.
pub fun either(a: kfl, b: kfl): e kfl
val (l, h) = match a.cmp(b) // this operation is commutative
Gt -> (b, a)
_ -> (a, b)
match (l, h)
(Impossible, r) -> r
(Probably-Not, Guaranteed) -> Cry-If-Not
(Probably-Not, r) -> r
(Doubtful, Guaranteed) -> Most-Likely
(Doubtful, Cry-If-Not) -> Most-Likely
(Doubtful, Most-Likely) -> Probably
(Doubtful, Probably) -> Mayhapsibly
(Doubtful, Mayhapsibly) -> Mayhapsibly
(Doubtful, Unlikely) -> Mayhapsibly
(Doubtful, _) -> Unlikely
(Unlikely, Guaranteed) -> Probably
(Unlikely, Cry-If-Not) -> Mayhapsibly
(Unlikely, Most-Likely) -> Mayhapsibly
(Unlikely, _) -> Probably
(Mayhapsibly, Guaranteed) -> Mayhapsibly
(Mayhapsibly, Cry-If-Not) -> Mayhapsibly
(Mayhapsibly, Most-Likely) -> Mayhapsibly
(Mayhapsibly, _) -> Probably
(Probably, Guaranteed) -> Unlikely
(Probably, Cry-If-Not) -> Unlikely
(Probably, Most-Likely) -> Unlikely
(Probably, _) -> Mayhapsibly
(Most-Likely, _) -> Doubtful
(Cry-If-Not, _) -> Probably-Not
(Guaranteed, _) -> Impossible
-58
View File
@@ -1,58 +0,0 @@
module horse/prob/pmf
import std/core/list
// Discrete-support probability distribution implemented as a list with the invariant
// that support is always given in increasing order.
pub type pmf<s, v>
Event(s: s, v: v, next: pmf<s, v>)
End
// Add an independent event to the distribution.
pub fun add(p: pmf<s, v>, s: s, v: v, ?s/cmp: (a: s, b: s) -> order, ?v/(+): (new: v, old: v) -> e v): e pmf<s, v>
match p
End -> Event(s, v, End)
Event(s', v', next) -> match s.cmp(s')
Lt -> Event(s, v, Event(s', v', next))
Eq -> Event(s, v + v', next)
Gt -> Event(s', v', add(next, s, v))
// Replace an event in the distribution.
pub inline fun set(p: pmf<s, v>, s: s, v: v, ?s/cmp: (a: s, b: s) -> order): e pmf<s, v>
p.add(s, v, cmp, fn(new, old) new)
// Construct a pmf from a list of (support, value) entries.
pub fun list/pmf(l: list<(s, v)>, ?s/cmp: (a: s, b: s) -> order, ?v/(+): (new: v, old: v) -> e v): e pmf<s, v>
l.foldl(End) fn(p, (s, v)) p.add(s, v)
// Fold over the entries of the distribution.
pub tail fun foldl(p: pmf<s, v>, init: a, f: (a, s, v) -> e a): e a
match p
End -> init
Event(s, v, next) -> foldl(next, f(init, s, v), f)
// Convert the distribution to a list of entries.
pub fun pmf/list(p: pmf<s, v>): list<(s, v)>
p.foldl(Nil) fn(l, s, v) Cons((s, v), l)
// Distribution of cooccurrence of two events described by their distributions.
pub fun (*)(a: pmf<s, v>, b: pmf<s, v>, ?s/cmp: (a: s, b: s) -> order, ?v/(*): (a: v, b: v) -> e v): e pmf<s, v>
match a
End -> End
Event(sa, va, nexta) -> match b
End -> End
Event(sb, vb, nextb) -> match sa.cmp(sb)
Lt -> nexta * b
Eq -> Event(sa, va * vb, nexta * nextb)
Gt -> a * nextb
// Distribution of occurrence of at least one of two events described by their distributions.
pub fun (+)(a: pmf<s, v>, b: pmf<s, v>, ?s/cmp: (a: s, b: s) -> order, ?v/(+): (a: v, b: v) -> e v): e pmf<s, v>
match a
End -> b
Event(sa, va, nexta) -> match b
End -> a
Event(sb, vb, nextb) -> match sa.cmp(sb)
Lt -> Event(sa, va, nexta + b)
Eq -> Event(sa, va + vb, nexta + nextb)
Gt -> Event(sb, vb, a + nextb)
-861
View File
@@ -1,861 +0,0 @@
module horse/race
import std/data/linearset
// Exhaustive enumeration of graded races that can be run in career.
// Races that can be run in multiple years are listed only once.
pub type career-race
February-Stakes
Takamatsunomiya-Kinen
Osaka-Hai
Oka-Sho
Satsuki-Sho
Tenno-Sho-Spring
NHK-Mile-Cup
Victoria-Mile
Japanese-Oaks
Japanese-Derby
Yasuda-Kinen
Takarazuka-Kinen
Sprinters-Stakes
Shuka-Sho
Kikuka-Sho
Tenno-Sho-Autumn
Queen-Elizabeth-II-Cup
Mile-Championship
Japan-Cup
Champions-Cup
Hanshin-Juvenile-Fillies
Asahi-Hai-Futurity-Stakes
Arima-Kinen
Hopeful-Stakes
Tokyo-Daishoten
JBC-Classic
JBC-Sprint
JBC-Ladies-Classic
Japan-Dirt-Derby
Teio-Sho
Nikkei-Shinshun-Hai
Tokai-Stakes
American-Jockey-Club-Cup
Kyoto-Kinen
Nakayama-Kinen
Tulip-Sho
Yayoi-Sho
Kinko-Sho
Fillies-Revue
Hanshin-Daishoten
Spring-Stakes
Nikkei-Sho
Hanshin-Umamusume-Stakes
New-Zealand-Trophy
Yomiuri-Milers-Cup
Flora-Stakes
Aoba-Sho
Kyoto-Shimbun-Hai
Keio-Hai-Spring-Cup
Meguro-Kinen
Sapporo-Kinen
Centaur-Stakes
Rose-Stakes
St-Lite-Kinen
Kobe-Shimbun-Hai
All-Comers
Mainichi-Okan
Kyoto-Daishoten
Fuchu-Umamusume-Stakes
Fuji-Stakes
Swan-Stakes
Keio-Hai-Junior-Stakes
Copa-Republica-Argentina
Daily-Hai-Junior-Stakes
Stayers-Stakes
Hanshin-Cup
Kyoto-Kimpai
Nakayama-Kimpai
Shinzan-Kinen
Fairy-Stakes
Aichi-Hai
Keisei-Hai
Silk-Road-Stakes
Negishi-Stakes
Kisaragi-Sho
Tokyo-Shimbun-Hai
Queen-Cup
Kyodo-News-Hai
Kyoto-Umamusume-Stakes
Diamond-Stakes
Kokura-Daishoten
Arlington-Cup
Hankyu-Hai
Ocean-Stakes
Nakayama-Umamusume-Stakes
Falcon-Stakes
Flower-Cup
Mainichi-Hai
March-Stakes
Lord-Derby-Challenge-Trophy
Antares-Stakes
Fukushima-Umamusume-Stakes
Niigata-Daishoten
Heian-Stakes
Aoi-Stakes
Naruo-Kinen
Mermaid-Stakes
Epsom-Cup
Unicorn-Stakes
Hakodate-Sprint-Stakes
CBC-Sho
Radio-Nikkei-Sho
Procyon-Stakes
Tanabata-Sho
Hakodate-Kinen
Chukyo-Kinen
Hakodate-Junior-Stakes
Ibis-Summer-Dash
Queen-Stakes
Kokura-Kinen
Leopard-Stakes
Sekiya-Kinen
Elm-Stakes
Kitakyushu-Kinen
Niigata-Junior-Stakes
Keeneland-Cup
Sapporo-Junior-Stakes
Kokura-Junior-Stakes
Niigata-Kinen
Shion-Stakes
Keisei-Hai-Autumn-Handicap
Sirius-Stakes
Saudi-Arabia-Royal-Cup
Artemis-Stakes
Fantasy-Stakes
Miyako-Stakes
Musashino-Stakes
Fukushima-Kinen
Tokyo-Sports-Hai-Junior-Stakes
Kyoto-Junior-Stakes
Keihan-Hai
Challenge-Cup
Chunichi-Shimbun-Hai
Capella-Stakes
Turquoise-Stakes
// Automatically generated.
// Shows a string representation of the `career-race` type.
pub fun career-race/show(this : career-race) : e string
match this
February-Stakes -> "February Stakes"
Takamatsunomiya-Kinen -> "Takamatsunomiya Kinen"
Osaka-Hai -> "Osaka Hai"
Oka-Sho -> "Oka Sho"
Satsuki-Sho -> "Satsuki Sho"
Tenno-Sho-Spring -> "Tenno Sho Spring"
NHK-Mile-Cup -> "NHK Mile Cup"
Victoria-Mile -> "Victoria Mile"
Japanese-Oaks -> "Japanese Oaks"
Japanese-Derby -> "Japanese Derby"
Yasuda-Kinen -> "Yasuda Kinen"
Takarazuka-Kinen -> "Takarazuka Kinen"
Sprinters-Stakes -> "Sprinters Stakes"
Shuka-Sho -> "Shuka Sho"
Kikuka-Sho -> "Kikuka Sho"
Tenno-Sho-Autumn -> "Tenno Sho Autumn"
Queen-Elizabeth-II-Cup -> "Queen Elizabeth II Cup"
Mile-Championship -> "Mile Championship"
Japan-Cup -> "Japan Cup"
Champions-Cup -> "Champions Cup"
Hanshin-Juvenile-Fillies -> "Hanshin Juvenile Fillies"
Asahi-Hai-Futurity-Stakes -> "Asahi Hai Futurity Stakes"
Arima-Kinen -> "Arima Kinen"
Hopeful-Stakes -> "Hopeful Stakes"
Tokyo-Daishoten -> "Tokyo Daishoten"
JBC-Classic -> "JBC Classic"
JBC-Sprint -> "JBC Sprint"
JBC-Ladies-Classic -> "JBC Ladies Classic"
Japan-Dirt-Derby -> "Japan Dirt Derby"
Teio-Sho -> "Teio Sho"
Nikkei-Shinshun-Hai -> "Nikkei Shinshun Hai"
Tokai-Stakes -> "Tokai Stakes"
American-Jockey-Club-Cup -> "American Jockey Club Cup"
Kyoto-Kinen -> "Kyoto Kinen"
Nakayama-Kinen -> "Nakayama Kinen"
Tulip-Sho -> "Tulip Sho"
Yayoi-Sho -> "Yayoi Sho"
Kinko-Sho -> "Kinko Sho"
Fillies-Revue -> "Fillies Revue"
Hanshin-Daishoten -> "Hanshin Daishoten"
Spring-Stakes -> "Spring Stakes"
Nikkei-Sho -> "Nikkei Sho"
Hanshin-Umamusume-Stakes -> "Hanshin Umamusume Stakes"
New-Zealand-Trophy -> "New Zealand Trophy"
Yomiuri-Milers-Cup -> "Yomiuri Milers Cup"
Flora-Stakes -> "Flora Stakes"
Aoba-Sho -> "Aoba Sho"
Kyoto-Shimbun-Hai -> "Kyoto Shimbun Hai"
Keio-Hai-Spring-Cup -> "Keio Hai Spring Cup"
Meguro-Kinen -> "Meguro Kinen"
Sapporo-Kinen -> "Sapporo Kinen"
Centaur-Stakes -> "Centaur Stakes"
Rose-Stakes -> "Rose Stakes"
St-Lite-Kinen -> "St Lite Kinen"
Kobe-Shimbun-Hai -> "Kobe Shimbun Hai"
All-Comers -> "All Comers"
Mainichi-Okan -> "Mainichi Okan"
Kyoto-Daishoten -> "Kyoto Daishoten"
Fuchu-Umamusume-Stakes -> "Fuchu Umamusume Stakes"
Fuji-Stakes -> "Fuji Stakes"
Swan-Stakes -> "Swan Stakes"
Keio-Hai-Junior-Stakes -> "Keio Hai Junior Stakes"
Copa-Republica-Argentina -> "Copa Republica Argentina"
Daily-Hai-Junior-Stakes -> "Daily Hai Junior Stakes"
Stayers-Stakes -> "Stayers Stakes"
Hanshin-Cup -> "Hanshin Cup"
Kyoto-Kimpai -> "Kyoto Kimpai"
Nakayama-Kimpai -> "Nakayama Kimpai"
Shinzan-Kinen -> "Shinzan Kinen"
Fairy-Stakes -> "Fairy Stakes"
Aichi-Hai -> "Aichi Hai"
Keisei-Hai -> "Keisei Hai"
Silk-Road-Stakes -> "Silk Road Stakes"
Negishi-Stakes -> "Negishi Stakes"
Kisaragi-Sho -> "Kisaragi Sho"
Tokyo-Shimbun-Hai -> "Tokyo Shimbun Hai"
Queen-Cup -> "Queen Cup"
Kyodo-News-Hai -> "Kyodo News Hai"
Kyoto-Umamusume-Stakes -> "Kyoto Umamusume Stakes"
Diamond-Stakes -> "Diamond Stakes"
Kokura-Daishoten -> "Kokura Daishoten"
Arlington-Cup -> "Arlington Cup"
Hankyu-Hai -> "Hankyu Hai"
Ocean-Stakes -> "Ocean Stakes"
Nakayama-Umamusume-Stakes -> "Nakayama Umamusume Stakes"
Falcon-Stakes -> "Falcon Stakes"
Flower-Cup -> "Flower Cup"
Mainichi-Hai -> "Mainichi Hai"
March-Stakes -> "March Stakes"
Lord-Derby-Challenge-Trophy -> "Lord Derby Challenge Trophy"
Antares-Stakes -> "Antares Stakes"
Fukushima-Umamusume-Stakes -> "Fukushima Umamusume Stakes"
Niigata-Daishoten -> "Niigata Daishoten"
Heian-Stakes -> "Heian Stakes"
Aoi-Stakes -> "Aoi Stakes"
Naruo-Kinen -> "Naruo Kinen"
Mermaid-Stakes -> "Mermaid Stakes"
Epsom-Cup -> "Epsom Cup"
Unicorn-Stakes -> "Unicorn Stakes"
Hakodate-Sprint-Stakes -> "Hakodate Sprint Stakes"
CBC-Sho -> "CBC Sho"
Radio-Nikkei-Sho -> "Radio Nikkei Sho"
Procyon-Stakes -> "Procyon Stakes"
Tanabata-Sho -> "Tanabata Sho"
Hakodate-Kinen -> "Hakodate Kinen"
Chukyo-Kinen -> "Chukyo Kinen"
Hakodate-Junior-Stakes -> "Hakodate Junior Stakes"
Ibis-Summer-Dash -> "Ibis Summer Dash"
Queen-Stakes -> "Queen Stakes"
Kokura-Kinen -> "Kokura Kinen"
Leopard-Stakes -> "Leopard Stakes"
Sekiya-Kinen -> "Sekiya Kinen"
Elm-Stakes -> "Elm Stakes"
Kitakyushu-Kinen -> "Kitakyushu Kinen"
Niigata-Junior-Stakes -> "Niigata Junior Stakes"
Keeneland-Cup -> "Keeneland Cup"
Sapporo-Junior-Stakes -> "Sapporo Junior Stakes"
Kokura-Junior-Stakes -> "Kokura Junior Stakes"
Niigata-Kinen -> "Niigata Kinen"
Shion-Stakes -> "Shion Stakes"
Keisei-Hai-Autumn-Handicap -> "Keisei Hai Autumn Handicap"
Sirius-Stakes -> "Sirius Stakes"
Saudi-Arabia-Royal-Cup -> "Saudi Arabia Royal Cup"
Artemis-Stakes -> "Artemis Stakes"
Fantasy-Stakes -> "Fantasy Stakes"
Miyako-Stakes -> "Miyako Stakes"
Musashino-Stakes -> "Musashino Stakes"
Fukushima-Kinen -> "Fukushima Kinen"
Tokyo-Sports-Hai-Junior-Stakes -> "Tokyo Sports Hai Junior Stakes"
Kyoto-Junior-Stakes -> "Kyoto Junior Stakes"
Keihan-Hai -> "Keihan Hai"
Challenge-Cup -> "Challenge Cup"
Chunichi-Shimbun-Hai -> "Chunichi Shimbun Hai"
Capella-Stakes -> "Capella Stakes"
Turquoise-Stakes -> "Turquoise Stakes"
// Automatically generated.
// Equality comparison of the `career-race` type.
pub fun career-race/(==)(this : career-race, other : career-race) : e bool
match (this, other)
(February-Stakes, February-Stakes) -> True
(Takamatsunomiya-Kinen, Takamatsunomiya-Kinen) -> True
(Osaka-Hai, Osaka-Hai) -> True
(Oka-Sho, Oka-Sho) -> True
(Satsuki-Sho, Satsuki-Sho) -> True
(Tenno-Sho-Spring, Tenno-Sho-Spring) -> True
(NHK-Mile-Cup, NHK-Mile-Cup) -> True
(Victoria-Mile, Victoria-Mile) -> True
(Japanese-Oaks, Japanese-Oaks) -> True
(Japanese-Derby, Japanese-Derby) -> True
(Yasuda-Kinen, Yasuda-Kinen) -> True
(Takarazuka-Kinen, Takarazuka-Kinen) -> True
(Sprinters-Stakes, Sprinters-Stakes) -> True
(Shuka-Sho, Shuka-Sho) -> True
(Kikuka-Sho, Kikuka-Sho) -> True
(Tenno-Sho-Autumn, Tenno-Sho-Autumn) -> True
(Queen-Elizabeth-II-Cup, Queen-Elizabeth-II-Cup) -> True
(Mile-Championship, Mile-Championship) -> True
(Japan-Cup, Japan-Cup) -> True
(Champions-Cup, Champions-Cup) -> True
(Hanshin-Juvenile-Fillies, Hanshin-Juvenile-Fillies) -> True
(Asahi-Hai-Futurity-Stakes, Asahi-Hai-Futurity-Stakes) -> True
(Arima-Kinen, Arima-Kinen) -> True
(Hopeful-Stakes, Hopeful-Stakes) -> True
(Tokyo-Daishoten, Tokyo-Daishoten) -> True
(JBC-Classic, JBC-Classic) -> True
(JBC-Sprint, JBC-Sprint) -> True
(JBC-Ladies-Classic, JBC-Ladies-Classic) -> True
(Japan-Dirt-Derby, Japan-Dirt-Derby) -> True
(Teio-Sho, Teio-Sho) -> True
(Nikkei-Shinshun-Hai, Nikkei-Shinshun-Hai) -> True
(Tokai-Stakes, Tokai-Stakes) -> True
(American-Jockey-Club-Cup, American-Jockey-Club-Cup) -> True
(Kyoto-Kinen, Kyoto-Kinen) -> True
(Nakayama-Kinen, Nakayama-Kinen) -> True
(Tulip-Sho, Tulip-Sho) -> True
(Yayoi-Sho, Yayoi-Sho) -> True
(Kinko-Sho, Kinko-Sho) -> True
(Fillies-Revue, Fillies-Revue) -> True
(Hanshin-Daishoten, Hanshin-Daishoten) -> True
(Spring-Stakes, Spring-Stakes) -> True
(Nikkei-Sho, Nikkei-Sho) -> True
(Hanshin-Umamusume-Stakes, Hanshin-Umamusume-Stakes) -> True
(New-Zealand-Trophy, New-Zealand-Trophy) -> True
(Yomiuri-Milers-Cup, Yomiuri-Milers-Cup) -> True
(Flora-Stakes, Flora-Stakes) -> True
(Aoba-Sho, Aoba-Sho) -> True
(Kyoto-Shimbun-Hai, Kyoto-Shimbun-Hai) -> True
(Keio-Hai-Spring-Cup, Keio-Hai-Spring-Cup) -> True
(Meguro-Kinen, Meguro-Kinen) -> True
(Sapporo-Kinen, Sapporo-Kinen) -> True
(Centaur-Stakes, Centaur-Stakes) -> True
(Rose-Stakes, Rose-Stakes) -> True
(St-Lite-Kinen, St-Lite-Kinen) -> True
(Kobe-Shimbun-Hai, Kobe-Shimbun-Hai) -> True
(All-Comers, All-Comers) -> True
(Mainichi-Okan, Mainichi-Okan) -> True
(Kyoto-Daishoten, Kyoto-Daishoten) -> True
(Fuchu-Umamusume-Stakes, Fuchu-Umamusume-Stakes) -> True
(Fuji-Stakes, Fuji-Stakes) -> True
(Swan-Stakes, Swan-Stakes) -> True
(Keio-Hai-Junior-Stakes, Keio-Hai-Junior-Stakes) -> True
(Copa-Republica-Argentina, Copa-Republica-Argentina) -> True
(Daily-Hai-Junior-Stakes, Daily-Hai-Junior-Stakes) -> True
(Stayers-Stakes, Stayers-Stakes) -> True
(Hanshin-Cup, Hanshin-Cup) -> True
(Kyoto-Kimpai, Kyoto-Kimpai) -> True
(Nakayama-Kimpai, Nakayama-Kimpai) -> True
(Shinzan-Kinen, Shinzan-Kinen) -> True
(Fairy-Stakes, Fairy-Stakes) -> True
(Aichi-Hai, Aichi-Hai) -> True
(Keisei-Hai, Keisei-Hai) -> True
(Silk-Road-Stakes, Silk-Road-Stakes) -> True
(Negishi-Stakes, Negishi-Stakes) -> True
(Kisaragi-Sho, Kisaragi-Sho) -> True
(Tokyo-Shimbun-Hai, Tokyo-Shimbun-Hai) -> True
(Queen-Cup, Queen-Cup) -> True
(Kyodo-News-Hai, Kyodo-News-Hai) -> True
(Kyoto-Umamusume-Stakes, Kyoto-Umamusume-Stakes) -> True
(Diamond-Stakes, Diamond-Stakes) -> True
(Kokura-Daishoten, Kokura-Daishoten) -> True
(Arlington-Cup, Arlington-Cup) -> True
(Hankyu-Hai, Hankyu-Hai) -> True
(Ocean-Stakes, Ocean-Stakes) -> True
(Nakayama-Umamusume-Stakes, Nakayama-Umamusume-Stakes) -> True
(Falcon-Stakes, Falcon-Stakes) -> True
(Flower-Cup, Flower-Cup) -> True
(Mainichi-Hai, Mainichi-Hai) -> True
(March-Stakes, March-Stakes) -> True
(Lord-Derby-Challenge-Trophy, Lord-Derby-Challenge-Trophy) -> True
(Antares-Stakes, Antares-Stakes) -> True
(Fukushima-Umamusume-Stakes, Fukushima-Umamusume-Stakes) -> True
(Niigata-Daishoten, Niigata-Daishoten) -> True
(Heian-Stakes, Heian-Stakes) -> True
(Aoi-Stakes, Aoi-Stakes) -> True
(Naruo-Kinen, Naruo-Kinen) -> True
(Mermaid-Stakes, Mermaid-Stakes) -> True
(Epsom-Cup, Epsom-Cup) -> True
(Unicorn-Stakes, Unicorn-Stakes) -> True
(Hakodate-Sprint-Stakes, Hakodate-Sprint-Stakes) -> True
(CBC-Sho, CBC-Sho) -> True
(Radio-Nikkei-Sho, Radio-Nikkei-Sho) -> True
(Procyon-Stakes, Procyon-Stakes) -> True
(Tanabata-Sho, Tanabata-Sho) -> True
(Hakodate-Kinen, Hakodate-Kinen) -> True
(Chukyo-Kinen, Chukyo-Kinen) -> True
(Hakodate-Junior-Stakes, Hakodate-Junior-Stakes) -> True
(Ibis-Summer-Dash, Ibis-Summer-Dash) -> True
(Queen-Stakes, Queen-Stakes) -> True
(Kokura-Kinen, Kokura-Kinen) -> True
(Leopard-Stakes, Leopard-Stakes) -> True
(Sekiya-Kinen, Sekiya-Kinen) -> True
(Elm-Stakes, Elm-Stakes) -> True
(Kitakyushu-Kinen, Kitakyushu-Kinen) -> True
(Niigata-Junior-Stakes, Niigata-Junior-Stakes) -> True
(Keeneland-Cup, Keeneland-Cup) -> True
(Sapporo-Junior-Stakes, Sapporo-Junior-Stakes) -> True
(Kokura-Junior-Stakes, Kokura-Junior-Stakes) -> True
(Niigata-Kinen, Niigata-Kinen) -> True
(Shion-Stakes, Shion-Stakes) -> True
(Keisei-Hai-Autumn-Handicap, Keisei-Hai-Autumn-Handicap) -> True
(Sirius-Stakes, Sirius-Stakes) -> True
(Saudi-Arabia-Royal-Cup, Saudi-Arabia-Royal-Cup) -> True
(Artemis-Stakes, Artemis-Stakes) -> True
(Fantasy-Stakes, Fantasy-Stakes) -> True
(Miyako-Stakes, Miyako-Stakes) -> True
(Musashino-Stakes, Musashino-Stakes) -> True
(Fukushima-Kinen, Fukushima-Kinen) -> True
(Tokyo-Sports-Hai-Junior-Stakes, Tokyo-Sports-Hai-Junior-Stakes) -> True
(Kyoto-Junior-Stakes, Kyoto-Junior-Stakes) -> True
(Keihan-Hai, Keihan-Hai) -> True
(Challenge-Cup, Challenge-Cup) -> True
(Chunichi-Shimbun-Hai, Chunichi-Shimbun-Hai) -> True
(Capella-Stakes, Capella-Stakes) -> True
(Turquoise-Stakes, Turquoise-Stakes) -> True
(_, _) -> False
// Race grades.
pub type grade
Pre-OP
OP
G3
G2
G1
EX
pub fun career-race/grade(r: career-race): grade
match r
February-Stakes -> G1
Takamatsunomiya-Kinen -> G1
Osaka-Hai -> G1
Oka-Sho -> G1
Satsuki-Sho -> G1
Tenno-Sho-Spring -> G1
NHK-Mile-Cup -> G1
Victoria-Mile -> G1
Japanese-Oaks -> G1
Japanese-Derby -> G1
Yasuda-Kinen -> G1
Takarazuka-Kinen -> G1
Sprinters-Stakes -> G1
Shuka-Sho -> G1
Kikuka-Sho -> G1
Tenno-Sho-Autumn -> G1
Queen-Elizabeth-II-Cup -> G1
Mile-Championship -> G1
Japan-Cup -> G1
Champions-Cup -> G1
Hanshin-Juvenile-Fillies -> G1
Asahi-Hai-Futurity-Stakes -> G1
Arima-Kinen -> G1
Hopeful-Stakes -> G1
Tokyo-Daishoten -> G1
JBC-Classic -> G1
JBC-Sprint -> G1
JBC-Ladies-Classic -> G1
Japan-Dirt-Derby -> G1
Teio-Sho -> G1
Nikkei-Shinshun-Hai -> G2
Tokai-Stakes -> G2
American-Jockey-Club-Cup -> G2
Kyoto-Kinen -> G2
Nakayama-Kinen -> G2
Tulip-Sho -> G2
Yayoi-Sho -> G2
Kinko-Sho -> G2
Fillies-Revue -> G2
Hanshin-Daishoten -> G2
Spring-Stakes -> G2
Nikkei-Sho -> G2
Hanshin-Umamusume-Stakes -> G2
New-Zealand-Trophy -> G2
Yomiuri-Milers-Cup -> G2
Flora-Stakes -> G2
Aoba-Sho -> G2
Kyoto-Shimbun-Hai -> G2
Keio-Hai-Spring-Cup -> G2
Meguro-Kinen -> G2
Sapporo-Kinen -> G2
Centaur-Stakes -> G2
Rose-Stakes -> G2
St-Lite-Kinen -> G2
Kobe-Shimbun-Hai -> G2
All-Comers -> G2
Mainichi-Okan -> G2
Kyoto-Daishoten -> G2
Fuchu-Umamusume-Stakes -> G2
Fuji-Stakes -> G2
Swan-Stakes -> G2
Keio-Hai-Junior-Stakes -> G2
Copa-Republica-Argentina -> G2
Daily-Hai-Junior-Stakes -> G2
Stayers-Stakes -> G2
Hanshin-Cup -> G2
Kyoto-Kimpai -> G3
Nakayama-Kimpai -> G3
Shinzan-Kinen -> G3
Fairy-Stakes -> G3
Aichi-Hai -> G3
Keisei-Hai -> G3
Silk-Road-Stakes -> G3
Negishi-Stakes -> G3
Kisaragi-Sho -> G3
Tokyo-Shimbun-Hai -> G3
Queen-Cup -> G3
Kyodo-News-Hai -> G3
Kyoto-Umamusume-Stakes -> G3
Diamond-Stakes -> G3
Kokura-Daishoten -> G3
Arlington-Cup -> G3
Hankyu-Hai -> G3
Ocean-Stakes -> G3
Nakayama-Umamusume-Stakes -> G3
Falcon-Stakes -> G3
Flower-Cup -> G3
Mainichi-Hai -> G3
March-Stakes -> G3
Lord-Derby-Challenge-Trophy -> G3
Antares-Stakes -> G3
Fukushima-Umamusume-Stakes -> G3
Niigata-Daishoten -> G3
Heian-Stakes -> G3
Aoi-Stakes -> G3
Naruo-Kinen -> G3
Mermaid-Stakes -> G3
Epsom-Cup -> G3
Unicorn-Stakes -> G3
Hakodate-Sprint-Stakes -> G3
CBC-Sho -> G3
Radio-Nikkei-Sho -> G3
Procyon-Stakes -> G3
Tanabata-Sho -> G3
Hakodate-Kinen -> G3
Chukyo-Kinen -> G3
Hakodate-Junior-Stakes -> G3
Ibis-Summer-Dash -> G3
Queen-Stakes -> G3
Kokura-Kinen -> G3
Leopard-Stakes -> G3
Sekiya-Kinen -> G3
Elm-Stakes -> G3
Kitakyushu-Kinen -> G3
Niigata-Junior-Stakes -> G3
Keeneland-Cup -> G3
Sapporo-Junior-Stakes -> G3
Kokura-Junior-Stakes -> G3
Niigata-Kinen -> G3
Shion-Stakes -> G3
Keisei-Hai-Autumn-Handicap -> G3
Sirius-Stakes -> G3
Saudi-Arabia-Royal-Cup -> G3
Artemis-Stakes -> G3
Fantasy-Stakes -> G3
Miyako-Stakes -> G3
Musashino-Stakes -> G3
Fukushima-Kinen -> G3
Tokyo-Sports-Hai-Junior-Stakes -> G3
Kyoto-Junior-Stakes -> G3
Keihan-Hai -> G3
Challenge-Cup -> G3
Chunichi-Shimbun-Hai -> G3
Capella-Stakes -> G3
Turquoise-Stakes -> G3
pub type title
Classic-Triple-Crown
Triple-Tiara
Senior-Spring-Triple-Crown
Senior-Autumn-Triple-Crown
Tenno-Sweep
Dual-Grand-Prix
Dual-Miles
Dual-Sprints
Dual-Dirts
// Get the titles that a race contributes to.
inline fun career-race/titles(r: career-race): list<title>
match r
Satsuki-Sho -> [Classic-Triple-Crown]
Japanese-Derby -> [Classic-Triple-Crown]
Kikuka-Sho -> [Classic-Triple-Crown]
Oka-Sho -> [Triple-Tiara]
Japanese-Oaks -> [Triple-Tiara]
Shuka-Sho -> [Triple-Tiara]
Osaka-Hai -> [Senior-Spring-Triple-Crown]
Tenno-Sho-Spring -> [Senior-Spring-Triple-Crown, Tenno-Sweep]
Takarazuka-Kinen -> [Senior-Spring-Triple-Crown, Dual-Grand-Prix]
Tenno-Sho-Autumn -> [Senior-Autumn-Triple-Crown, Tenno-Sweep]
Japan-Cup -> [Senior-Autumn-Triple-Crown]
Arima-Kinen -> [Senior-Autumn-Triple-Crown, Dual-Grand-Prix]
Yasuda-Kinen -> [Dual-Miles]
Mile-Championship -> [Dual-Miles]
Takamatsunomiya-Kinen -> [Dual-Sprints]
Sprinters-Stakes -> [Dual-Sprints]
February-Stakes -> [Dual-Dirts]
Champions-Cup -> [Dual-Dirts]
_ -> []
// Get the races that a title requires.
inline fun title/races(t: title): list<career-race>
match t
Classic-Triple-Crown -> [Satsuki-Sho, Japanese-Derby, Kikuka-Sho]
Triple-Tiara -> [Oka-Sho, Japanese-Oaks, Shuka-Sho]
Senior-Spring-Triple-Crown -> [Osaka-Hai, Tenno-Sho-Spring, Takarazuka-Kinen]
Senior-Autumn-Triple-Crown -> [Tenno-Sho-Autumn, Japan-Cup, Arima-Kinen]
Tenno-Sweep -> [Tenno-Sho-Spring, Tenno-Sho-Autumn]
Dual-Grand-Prix -> [Takarazuka-Kinen, Arima-Kinen]
Dual-Miles -> [Yasuda-Kinen, Mile-Championship]
Dual-Sprints -> [Takamatsunomiya-Kinen, Sprinters-Stakes]
Dual-Dirts -> [February-Stakes, Champions-Cup]
// Get all titles earned by an uma.
pub fun career/titles(results: list<race-result>): list<title>
val wins = results.flatmap-maybe() fn(r) (if r.place == 1 then Just(r.race) else Nothing)
val title-wins = wins.filter(_.titles.is-cons).linear-set
val titles = title-wins.list.flatmap(_.titles).linear-set.list
titles.filter(_.races.linear-set.is-subset-of(title-wins))
// Automatically generated.
// Equality comparison of the `title` type.
pub fun title/(==)(this : title, other : title) : e bool
match (this, other)
(Classic-Triple-Crown, Classic-Triple-Crown) -> True
(Triple-Tiara, Triple-Tiara) -> True
(Senior-Spring-Triple-Crown, Senior-Spring-Triple-Crown) -> True
(Senior-Autumn-Triple-Crown, Senior-Autumn-Triple-Crown) -> True
(Tenno-Sweep, Tenno-Sweep) -> True
(Dual-Grand-Prix, Dual-Grand-Prix) -> True
(Dual-Miles, Dual-Miles) -> True
(Dual-Sprints, Dual-Sprints) -> True
(Dual-Dirts, Dual-Dirts) -> True
(_, _) -> False
// Automatically generated.
// Shows a string representation of the `title` type.
pub fun title/show(this : title) : e string
match this
Classic-Triple-Crown -> "Classic Triple Crown"
Triple-Tiara -> "Triple Tiara"
Senior-Spring-Triple-Crown -> "Senior Spring Triple Crown"
Senior-Autumn-Triple-Crown -> "Senior Autumn Triple Crown"
Tenno-Sweep -> "Tenno Sweep"
Dual-Grand-Prix -> "Dual Grand Prix"
Dual-Miles -> "Dual Miles"
Dual-Sprints -> "Dual Sprints"
Dual-Dirts -> "Dual Dirts"
// Graded race that a veteran ran.
pub struct race-result
race: career-race
place: int
turn: turn
// Automatically generated.
// Equality comparison of the `race-result` type.
pub fun race-result/(==)(this : race-result, other : race-result) : e bool
match (this, other)
(Race-result(race, place, turn), Race-result(race', place', turn')) -> race == race' && place == place' && turn == turn'
// Automatically generated.
// Shows a string representation of the `race-result` type.
pub fun race-result/show(this : race-result) : e string
match this
Race-result(race, place, turn) -> turn.show ++ " " ++ race.show ++ ": " ++ place.show
// Determine whether two race results are for the same race.
// This differs from (==) which also requires the race to be on the same turn.
pub fun race-result/same(a: race-result, b: race-result): bool
a.race == b.race
// Turn that a race occurred.
pub struct turn
year: turn-year
month: turn-month
half: turn-half
// Automatically generated.
// Equality comparison of the `turn` type.
pub fun turn/(==)(this : turn, other : turn) : e bool
match (this, other)
(Turn(year, month, half), Turn(year', month', half')) -> year == year' && month == month' && half == half'
// Automatically generated.
// Fip comparison of the `turn` type.
pub fun turn/order2(this : turn, other : turn) : e order2<turn>
match (this, other)
(Turn(year, month, half), Turn(year', month', half')) ->
match year.order2(year')
Eq2(year_eq) ->
match month.order2(month')
Eq2(month_eq) ->
match half.order2(half')
Eq2(half_eq) -> Eq2(Turn(year_eq, month_eq, half_eq))
Lt2(half_lt, half_gt) -> Lt2(Turn(year_eq, month_eq, half_lt), Turn(year_eq, month_eq, half_gt))
Gt2(half_lt, half_gt) -> Gt2(Turn(year_eq, month_eq, half_lt), Turn(year_eq, month_eq, half_gt))
Lt2(month_lt, month_gt) -> Lt2(Turn(year_eq, month_lt, half), Turn(year_eq, month_gt, half'))
Gt2(month_lt, month_gt) -> Gt2(Turn(year_eq, month_lt, half'), Turn(year_eq, month_gt, half))
Lt2(year_lt, year_gt) -> Lt2(Turn(year_lt, month, half), Turn(year_gt, month', half'))
Gt2(year_lt, year_gt) -> Gt2(Turn(year_lt, month', half'), Turn(year_gt, month, half))
// Automatically generated.
// Shows a string representation of the `turn` type.
pub fun turn/show(this : turn) : e string
this.year.show ++ " " ++ this.half.show ++ " " ++ this.month.show
pub type turn-year
Junior
Classic
Senior
Finale
// Automatically generated.
// Equality comparison of the `turn-year` type.
pub fun turn-year/(==)(this : turn-year, other : turn-year) : e bool
match (this, other)
(Junior, Junior) -> True
(Classic, Classic) -> True
(Senior, Senior) -> True
(Finale, Finale) -> True
(_, _) -> False
// Automatically generated.
// Fip comparison of the `turn-year` type.
pub fun turn-year/order2(this : turn-year, other : turn-year) : e order2<turn-year>
match (this, other)
(Junior, Junior) -> Eq2(Junior)
(Junior, other') -> Lt2(Junior, other')
(this', Junior) -> Gt2(Junior, this')
(Classic, Classic) -> Eq2(Classic)
(Classic, other') -> Lt2(Classic, other')
(this', Classic) -> Gt2(Classic, this')
(Senior, Senior) -> Eq2(Senior)
(Senior, other') -> Lt2(Senior, other')
(this', Senior) -> Gt2(Senior, this')
(Finale, Finale) -> Eq2(Finale)
// Automatically generated.
// Shows a string representation of the `turn-year` type.
pub fun turn-year/show(this : turn-year) : e string
match this
Junior -> "Junior Year"
Classic -> "Classic Year"
Senior -> "Senior Year"
Finale -> "Finale 1" // the 1 is in the game
pub type turn-month
January
February
March
April
May
June
July
August
September
November
December
// Automatically generated.
// Equality comparison of the `turn-month` type.
pub fun turn-month/(==)(this : turn-month, other : turn-month) : e bool
match (this, other)
(January, January) -> True
(February, February) -> True
(March, March) -> True
(April, April) -> True
(May, May) -> True
(June, June) -> True
(July, July) -> True
(August, August) -> True
(September, September) -> True
(November, November) -> True
(December, December) -> True
(_, _) -> False
// Automatically generated.
// Fip comparison of the `turn-month` type.
pub fun turn-month/order2(this : turn-month, other : turn-month) : e order2<turn-month>
match (this, other)
(January, January) -> Eq2(January)
(January, other') -> Lt2(January, other')
(this', January) -> Gt2(January, this')
(February, February) -> Eq2(February)
(February, other') -> Lt2(February, other')
(this', February) -> Gt2(February, this')
(March, March) -> Eq2(March)
(March, other') -> Lt2(March, other')
(this', March) -> Gt2(March, this')
(April, April) -> Eq2(April)
(April, other') -> Lt2(April, other')
(this', April) -> Gt2(April, this')
(May, May) -> Eq2(May)
(May, other') -> Lt2(May, other')
(this', May) -> Gt2(May, this')
(June, June) -> Eq2(June)
(June, other') -> Lt2(June, other')
(this', June) -> Gt2(June, this')
(July, July) -> Eq2(July)
(July, other') -> Lt2(July, other')
(this', July) -> Gt2(July, this')
(August, August) -> Eq2(August)
(August, other') -> Lt2(August, other')
(this', August) -> Gt2(August, this')
(September, September) -> Eq2(September)
(September, other') -> Lt2(September, other')
(this', September) -> Gt2(September, this')
(November, November) -> Eq2(November)
(November, other') -> Lt2(November, other')
(this', November) -> Gt2(November, this')
(December, December) -> Eq2(December)
// Automatically generated.
// Shows a string representation of the `turn-month` type.
pub fun turn-month/show(this : turn-month) : e string
match this
January -> "January"
February -> "February"
March -> "March"
April -> "April"
May -> "May"
June -> "June"
July -> "July"
August -> "August"
September -> "September"
November -> "November"
December -> "December"
pub type turn-half
Early
Late
// Automatically generated.
// Equality comparison of the `turn-half` type.
pub fun turn-half/(==)(this : turn-half, other : turn-half) : e bool
match (this, other)
(Early, Early) -> True
(Late, Late) -> True
(_, _) -> False
// Automatically generated.
// Fip comparison of the `turn-half` type.
pub fun turn-half/order2(this : turn-half, other : turn-half) : e order2<turn-half>
match (this, other)
(Early, Early) -> Eq2(Early)
(Early, other') -> Lt2(Early, other')
(this', Early) -> Gt2(Early, this')
(Late, Late) -> Eq2(Late)
// Automatically generated.
// Shows a string representation of the `turn-half` type.
pub fun turn-half/show(this : turn-half) : e string
match this
Early -> "Early"
Late -> "Late"
-166
View File
@@ -1,166 +0,0 @@
package horse
import (
"bytes"
"fmt"
"strconv"
)
type SkillID int32
type TenThousandths int32
func (x TenThousandths) String() string {
b := make([]byte, 0, 12)
if x < 0 {
x = -x
b = append(b, '-')
}
b = strconv.AppendInt(b, int64(x/1e4), 10)
if x%1e4 != 0 {
b = append(b, '.')
b = fmt.Appendf(b, "%04d", x%1e4)
b = bytes.TrimRight(b, "0")
}
return string(b)
}
// Skill is the internal data about a skill.
type Skill struct {
ID SkillID
Name string
Description string
Group int32
Rarity int8
GroupRate int8
GradeValue int32
WitCheck bool
Activations []Activation
SPCost int
IconID int
}
// Activation is the parameters controlling when a skill activates.
type Activation struct {
Precondition string
Condition string
Duration TenThousandths
Cooldown TenThousandths
Abilities []Ability
}
// Ability is an individual effect applied by a skill.
type Ability struct {
Type AbilityType
ValueUsage AbilityValueUsage
Value TenThousandths
Target AbilityTarget
TargetValue int32
}
func (a Ability) String() string {
r := make([]byte, 0, 64)
r = append(r, a.Type.String()...)
if a.Value != 0 {
r = append(r, ' ')
if a.Value > 0 {
r = append(r, '+')
}
switch a.Type {
case AbilityPassiveSpeed, AbilityPassiveStamina, AbilityPassivePower, AbilityPassiveGuts, AbilityPassiveWit:
r = append(r, a.Value.String()...)
case AbilityVision:
r = append(r, a.Value.String()...)
r = append(r, 'm')
case AbilityHP, AbilityCurrentSpeed, AbilityTargetSpeed, AbilityLaneSpeed, AbilityAccel:
r = append(r, (a.Value * 100).String()...)
r = append(r, '%')
case AbilityGateDelay:
r = append(r, a.Value.String()...)
r = append(r, "×"...)
case AbilityFrenzy:
r = append(r, a.Value.String()...)
r = append(r, 's')
case AbilityLaneChange:
r = append(r, (a.Value * 100).String()...)
r = append(r, "% of track width"...)
}
}
if a.Target != TargetSelf {
r = append(r, " to "...)
if a.TargetValue > 1 && a.TargetValue < 18 {
r = strconv.AppendInt(r, int64(a.TargetValue), 10)
r = append(r, ' ')
}
r = append(r, a.Target.String()...)
}
if a.ValueUsage != ValueUsageDirect {
r = append(r, ' ')
r = append(r, a.ValueUsage.String()...)
}
return string(r)
}
type AbilityType int8
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type AbilityType -trimprefix Ability -linecomment
const (
AbilityPassiveSpeed AbilityType = 1 // Speed
AbilityPassiveStamina AbilityType = 2 // Stamina
AbilityPassivePower AbilityType = 3 // Power
AbilityPassiveGuts AbilityType = 4 // Guts
AbilityPassiveWit AbilityType = 5 // Wit
AbilityGreatEscape AbilityType = 6 // Enable Great Escape
AbilityVision AbilityType = 8 // Vision
AbilityHP AbilityType = 9 // HP
AbilityGateDelay AbilityType = 10 // Gate delay multiplier
AbilityFrenzy AbilityType = 13 // Frenzy
AbilityCurrentSpeed AbilityType = 21 // Current speed
AbilityTargetSpeed AbilityType = 27 // Target speed
AbilityLaneSpeed AbilityType = 28 // Lane change speed
AbilityAccel AbilityType = 31 // Acceleration
AbilityLaneChange AbilityType = 35 // Forced lane change
)
type AbilityValueUsage int8
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type AbilityValueUsage -trimprefix ValueUsage -linecomment
const (
ValueUsageDirect AbilityValueUsage = 1 // directly
ValueUsageSkillCount AbilityValueUsage = 2 // scaling with the number of skills
ValueUsageTeamSpeed AbilityValueUsage = 3 // scaling with team Speed
ValueUsageTeamStamina AbilityValueUsage = 4 // scaling with team Stamina
ValueUsageTeamPower AbilityValueUsage = 5 // scaling with team Power
ValueUsageTeamGuts AbilityValueUsage = 6 // scaling with team Guts
ValueUsageTeamWit AbilityValueUsage = 7 // scaling with team Wit
ValueUsageRandom AbilityValueUsage = 8 // with a random 0× to 0.04× multiplier
ValueUsageRandom2 AbilityValueUsage = 9 // with a random 0× to 0.04× multiplier
ValueUsageClimax AbilityValueUsage = 10 // scaling with the number of races won in training
ValueUsageMaxStat AbilityValueUsage = 13 // scaling with the highest raw stat
ValueUsageGreenCount AbilityValueUsage = 14 // scaling with the number of Passive skills activated
ValueUsageDistAdd AbilityValueUsage = 19 // plus extra when far from the lead
ValueUsageMidSideBlock AbilityValueUsage = 20 // scaling with mid-race phase blocked side time
ValueUsageSpeed AbilityValueUsage = 22 // scaling with overall speed
ValueUsageSpeed2 AbilityValueUsage = 23 // scaling with overall speed
ValueUsageArcPotential AbilityValueUsage = 24 // scaling with L'Arc global potential
ValueUsageMaxLead AbilityValueUsage = 25 // scaling with the longest lead obtained in the first ⅔
)
type AbilityTarget int8
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type AbilityTarget -trimprefix Target -linecomment
const (
TargetSelf AbilityTarget = 1 // self
TargetSympathizers AbilityTarget = 2 // others with Sympathy
TargetInView AbilityTarget = 4 // others in view
TargetFrontmost AbilityTarget = 7 // frontmost
TargetAhead AbilityTarget = 9 // others ahead
TargetBehind AbilityTarget = 10 // others behind
TargetAllTeammates AbilityTarget = 11 // all teammates
TargetStyle AbilityTarget = 18 // using style
TargetRushingAhead AbilityTarget = 19 // rushing others ahead
TargetRushingBehind AbilityTarget = 20 // rushing others behind
TargetRushingStyle AbilityTarget = 21 // rushing using style
TargetCharacter AbilityTarget = 22 // specific character
TargetTriggering AbilityTarget = 23 // whosoever triggered this skill
)
-58
View File
@@ -1,58 +0,0 @@
package horse_test
import (
"cmp"
"slices"
"strings"
"sync"
"testing"
"git.sunturtle.xyz/zephyr/horse/horse"
"git.sunturtle.xyz/zephyr/horse/horse/global"
)
var SortedSkills = sync.OnceValue(func() []horse.Skill {
skills := make([]horse.Skill, 0, len(global.AllSkills))
for _, v := range global.AllSkills {
skills = append(skills, v)
}
slices.SortFunc(skills, func(a, b horse.Skill) int { return cmp.Compare(a.ID, b.ID) })
return skills
})
func TestSkillStrings(t *testing.T) {
t.Parallel()
for _, s := range SortedSkills() {
for _, a := range s.Activations {
for _, abil := range a.Abilities {
if n := abil.Type.String(); strings.HasPrefix(n, "AbilityType(") {
t.Errorf("%v %s: %s", s.ID, s.Name, n)
}
}
}
}
}
func TestTenThousandthsString(t *testing.T) {
t.Parallel()
cases := []struct {
val horse.TenThousandths
want string
}{
{0, "0"},
{500, "0.05"},
{-500, "-0.05"},
{10000, "1"},
{-10000, "-1"},
{15000, "1.5"},
{-15000, "-1.5"},
{10001, "1.0001"},
{5000000, "500"},
}
for _, c := range cases {
got := c.val.String()
if got != c.want {
t.Errorf("%d: want %q, got %q", c.val, c.want, got)
}
}
}
-186
View File
@@ -1,186 +0,0 @@
module horse/spark
// A single spark.
// Parameterized by the spark type: stat, aptitude, unique, race, or skill.
pub struct spark<a>
kind: a
level: level
pub fun spark/show(spark: spark<a>, level-fancy: string = "*", ?kind: (a) -> string): string
kind(spark.kind) ++ " " ++ spark.level.show ++ level-fancy
pub type level
One
Two
Three
pub fun level/show(this: level): string
match this
One -> "1"
Two -> "2"
Three -> "3"
// Stat (blue) spark.
pub type stat
Speed
Stamina
Power
Guts
Wit
// Automatically generated.
// Shows a string representation of the `stat` type.
pub fun stat/show(this : stat) : e string
match this
Speed -> "Speed"
Stamina -> "Stamina"
Power -> "Power"
Guts -> "Guts"
Wit -> "Wit"
// Aptitude (red/pink) spark.
pub type aptitude
Turf
Dirt
Sprint
Mile
Medium
Long
Front-Runner
Pace-Chaser
Late-Surger
End-Closer
// Shows a string representation of the `aptitude` type.
pub fun aptitude/show(this : aptitude): string
match this
Turf -> "Turf"
Dirt -> "Dirt"
Sprint -> "Sprint"
Mile -> "Mile"
Medium -> "Medium"
Long -> "Long"
Front-Runner -> "Front Runner"
Pace-Chaser -> "Pace Chaser"
Late-Surger -> "Late Surger"
End-Closer -> "End Closer"
// Unique (green) spark.
// TODO: decide this representation; strings? umas? probably depends on skills generally
pub type unique
pub fun unique/show(this: unique): string
"TODO(zeph): unique skills"
// Race, skill, and scenario (white) sparks.
pub type generic
February-Stakes
Takamatsunomiya-Kinen
Osaka-Hai
Oka-Sho
Satsuki-Sho
Tenno-Sho-Spring
NHK-Mile-Cup
Victoria-Mile
Japanese-Oaks
Japanese-Derby
Yasuda-Kinen
Takarazuka-Kinen
Sprinters-Stakes
Shuka-Sho
Kikuka-Sho
Tenno-Sho-Autumn
Queen-Elizabeth-II-Cup
Mile-Championship
Japan-Cup
Champions-Cup
Hanshin-Juvenile-Fillies
Asahi-Hai-Futurity-Stakes
Arima-Kinen
Hopeful-Stakes
Tokyo-Daishoten
JBC-Classic
JBC-Sprint
JBC-Ladies-Classic
Japan-Dirt-Derby
Teio-Sho
Skill(skill: string)
URA-Finale
Unity-Cup
// Automatically generated.
// Equality comparison of the `generic` type.
pub fun generic/(==)(this : generic, other : generic) : e bool
match (this, other)
(February-Stakes, February-Stakes) -> True
(Takamatsunomiya-Kinen, Takamatsunomiya-Kinen) -> True
(Osaka-Hai, Osaka-Hai) -> True
(Oka-Sho, Oka-Sho) -> True
(Satsuki-Sho, Satsuki-Sho) -> True
(Tenno-Sho-Spring, Tenno-Sho-Spring) -> True
(NHK-Mile-Cup, NHK-Mile-Cup) -> True
(Victoria-Mile, Victoria-Mile) -> True
(Japanese-Oaks, Japanese-Oaks) -> True
(Japanese-Derby, Japanese-Derby) -> True
(Yasuda-Kinen, Yasuda-Kinen) -> True
(Takarazuka-Kinen, Takarazuka-Kinen) -> True
(Sprinters-Stakes, Sprinters-Stakes) -> True
(Shuka-Sho, Shuka-Sho) -> True
(Kikuka-Sho, Kikuka-Sho) -> True
(Tenno-Sho-Autumn, Tenno-Sho-Autumn) -> True
(Queen-Elizabeth-II-Cup, Queen-Elizabeth-II-Cup) -> True
(Mile-Championship, Mile-Championship) -> True
(Japan-Cup, Japan-Cup) -> True
(Champions-Cup, Champions-Cup) -> True
(Hanshin-Juvenile-Fillies, Hanshin-Juvenile-Fillies) -> True
(Asahi-Hai-Futurity-Stakes, Asahi-Hai-Futurity-Stakes) -> True
(Arima-Kinen, Arima-Kinen) -> True
(Hopeful-Stakes, Hopeful-Stakes) -> True
(Tokyo-Daishoten, Tokyo-Daishoten) -> True
(JBC-Classic, JBC-Classic) -> True
(JBC-Sprint, JBC-Sprint) -> True
(JBC-Ladies-Classic, JBC-Ladies-Classic) -> True
(Japan-Dirt-Derby, Japan-Dirt-Derby) -> True
(Teio-Sho, Teio-Sho) -> True
(Skill(skill), Skill(skill')) -> skill == skill'
(URA-Finale, URA-Finale) -> True
(Unity-Cup, Unity-Cup) -> True
(_, _) -> False
// Automatically generated.
// Shows a string representation of the `generic` type.
pub fun generic/show(this : generic) : e string
match this
February-Stakes -> "February Stakes"
Takamatsunomiya-Kinen -> "Takamatsunomiya Kinen"
Osaka-Hai -> "Osaka Hai"
Oka-Sho -> "Oka Sho"
Satsuki-Sho -> "Satsuki Sho"
Tenno-Sho-Spring -> "Tenno Sho Spring"
NHK-Mile-Cup -> "NHK Mile Cup"
Victoria-Mile -> "Victoria Mile"
Japanese-Oaks -> "Japanese Oaks"
Japanese-Derby -> "Japanese Derby"
Yasuda-Kinen -> "Yasuda Kinen"
Takarazuka-Kinen -> "Takarazuka Kinen"
Sprinters-Stakes -> "Sprinters Stakes"
Shuka-Sho -> "Shuka Sho"
Kikuka-Sho -> "Kikuka Sho"
Tenno-Sho-Autumn -> "Tenno Sho Autumn"
Queen-Elizabeth-II-Cup -> "Queen Elizabeth II Cup"
Mile-Championship -> "Mile Championship"
Japan-Cup -> "Japan Cup"
Champions-Cup -> "Champions Cup"
Hanshin-Juvenile-Fillies -> "Hanshin Juvenile Fillies"
Asahi-Hai-Futurity-Stakes -> "Asahi Hai Futurity Stakes"
Arima-Kinen -> "Arima Kinen"
Hopeful-Stakes -> "Hopeful Stakes"
Tokyo-Daishoten -> "Tokyo Daishoten"
JBC-Classic -> "JBC Classic"
JBC-Sprint -> "JBC Sprint"
JBC-Ladies-Classic -> "JBC Ladies Classic"
Japan-Dirt-Derby -> "Japan Dirt Derby"
Teio-Sho -> "Teio Sho"
Skill(skill) -> skill.show
URA-Finale -> "URA Finale"
Unity-Cup -> "Unity Cup"
-70
View File
@@ -1,70 +0,0 @@
module horse/trainee
import std/data/rb-map
// Aptitudes of an umamusume being trained.
pub struct uma
turf: aptitudes
dirt: aptitudes
sprint: aptitudes
mile: aptitudes
medium: aptitudes
long: aptitudes
front-runner: aptitudes
pace-chaser: aptitudes
late-surger: aptitudes
end-closer: aptitudes
// Aptitude level distribution.
pub alias aptitudes = rbmap<level, float64>
// Starting aptitude levels.
pub type level
G
F
E
D
C
B
A
S
// Automatically generated.
// Fip comparison of the `level` type.
pub fun level/order2(this : level, other : level) : order2<level>
match (this, other)
(G, G) -> Eq2(G)
(G, other') -> Lt2(G, other')
(this', G) -> Gt2(G, this')
(F, F) -> Eq2(F)
(F, other') -> Lt2(F, other')
(this', F) -> Gt2(F, this')
(E, E) -> Eq2(E)
(E, other') -> Lt2(E, other')
(this', E) -> Gt2(E, this')
(D, D) -> Eq2(D)
(D, other') -> Lt2(D, other')
(this', D) -> Gt2(D, this')
(C, C) -> Eq2(C)
(C, other') -> Lt2(C, other')
(this', C) -> Gt2(C, this')
(B, B) -> Eq2(B)
(B, other') -> Lt2(B, other')
(this', B) -> Gt2(B, this')
(A, A) -> Eq2(A)
(A, other') -> Lt2(A, other')
(this', A) -> Gt2(A, this')
(S, S) -> Eq2(S)
// Automatically generated.
// Shows a string representation of the `level` type.
pub fun level/show(this : level) : string
match this
G -> "G"
F -> "F"
E -> "E"
D -> "D"
C -> "C"
B -> "B"
A -> "A"
S -> "S"
-6
View File
@@ -1,6 +0,0 @@
# gen
Go tool to generate the Koka source code from the game's SQLite database.
Code is generated using Go templates.
Templates use a `kkenum` function which converts a name `Mr. C.B.` to a Koka enumerant name `Mr-CB`.
-44
View File
@@ -1,44 +0,0 @@
WITH uma_names AS (
SELECT
"index" AS "id",
"text" AS "name"
FROM text_data
WHERE category = 6 AND "index" BETWEEN 1000 AND 1999
-- Exclude characters who have no succession relations defined.
AND "index" IN (SELECT chara_id FROM succession_relation_member)
), pairs AS (
SELECT
a.id AS id_a,
a.name AS name_a,
b.id AS id_b,
b.name AS name_b
FROM uma_names a
JOIN uma_names b ON a.id != b.id -- exclude reflexive cases
), relation_pairs AS (
SELECT
ra.relation_type,
ra.chara_id AS id_a,
rb.chara_id AS id_b
FROM succession_relation_member ra
JOIN succession_relation_member rb ON ra.relation_type = rb.relation_type
), affinity AS (
SELECT
pairs.*,
SUM(IFNULL(relation_point, 0)) AS base_affinity
FROM pairs
LEFT JOIN relation_pairs rp ON pairs.id_a = rp.id_a AND pairs.id_b = rp.id_b
LEFT JOIN succession_relation sr ON rp.relation_type = sr.relation_type
GROUP BY pairs.id_a, pairs.id_b
UNION ALL
-- Reflexive cases.
SELECT
uma_names.id AS id_a,
uma_names.name AS name_a,
uma_names.id AS id_b,
uma_names.name AS name_b,
0 AS base_affinity
FROM uma_names
)
SELECT * FROM affinity
ORDER BY id_a, id_b
-87
View File
@@ -1,87 +0,0 @@
WITH uma_names AS (
SELECT
"index" AS "id",
"text" AS "name"
FROM text_data
WHERE category = 6 AND "index" BETWEEN 1000 AND 1999
-- Exclude characters who have no succession relations defined.
AND "index" IN (SELECT chara_id FROM succession_relation_member)
), trios AS (
SELECT
a.id AS id_a,
a.name AS name_a,
b.id AS id_b,
b.name AS name_b,
c.id AS id_c,
c.name AS name_c
FROM uma_names a
JOIN uma_names b ON a.id != b.id -- exclude pairwise reflexive cases
JOIN uma_names c ON a.id != c.id AND b.id != c.id
), relation_trios AS (
SELECT
ra.relation_type,
ra.chara_id AS id_a,
rb.chara_id AS id_b,
rc.chara_id AS id_c
FROM succession_relation_member ra
JOIN succession_relation_member rb ON ra.relation_type = rb.relation_type
JOIN succession_relation_member rc ON ra.relation_type = rc.relation_type
), affinity AS (
SELECT
trios.*,
SUM(IFNULL(relation_point, 0)) AS base_affinity
FROM trios
LEFT JOIN relation_trios rt ON trios.id_a = rt.id_a AND trios.id_b = rt.id_b AND trios.id_c = rt.id_c
LEFT JOIN succession_relation sr ON rt.relation_type = sr.relation_type
GROUP BY trios.id_a, trios.id_b, trios.id_c
UNION ALL
-- A = B = C
SELECT
n.id AS id_a,
n.name AS name_a,
n.id AS id_b,
n.name AS name_b,
n.id AS id_c,
n.name AS name_c,
0 AS base_affinity
FROM uma_names n
UNION ALL
-- A = B
SELECT
n.id AS id_a,
n.name AS name_a,
n.id AS id_a,
n.name AS id_b,
m.id AS id_c,
m.name AS name_c,
0 AS base_affinity
FROM uma_names n JOIN uma_names m ON n.id != m.id
UNION ALL
-- A = C
SELECT
n.id AS id_a,
n.name AS name_a,
m.id AS id_a,
m.name AS id_b,
n.id AS id_c,
n.name AS name_c,
0 AS base_affinity
FROM uma_names n JOIN uma_names m ON n.id != m.id
UNION ALL
-- B = C
SELECT
m.id AS id_a,
m.name AS name_a,
n.id AS id_a,
n.name AS id_b,
n.id AS id_c,
n.name AS name_c,
0 AS base_affinity
FROM uma_names n JOIN uma_names m ON n.id != m.id
)
SELECT * FROM affinity
ORDER BY id_a, id_b, id_c
-72
View File
@@ -1,72 +0,0 @@
{{ define "go-character" -}}
package {{ $.Region }}
// Automatically generated with horsegen; DO NOT EDIT
import . "git.sunturtle.xyz/zephyr/horse/horse"
const (
{{- range $c := $.Characters }}
Character{{ goenum $c.Name }} CharacterID = {{ $c.ID }} // {{ $c.Name }}
{{- end }}
)
var OrderedCharacters = [...]CharacterID{
{{- range $c := $.Characters }}
Character{{ goenum $c.Name }},
{{- end }}
}
var Characters = map[CharacterID]Character{
{{- range $c := $.Characters }}
Character{{ goenum $c.Name }}: {ID: {{ $c.ID }}, Name: {{ printf "%q" $c.Name -}} },
{{- end }}
}
var CharacterNameToID = map[string]CharacterID{
{{- range $c := $.Characters }}
{{ printf "%q" $c.Name }}: {{ $c.ID }},
{{- end }}
}
var pairAffinity = []int8{
{{- range $a := $.Characters -}}
{{- range $b := $.Characters -}}
{{- index $.PairMaps $a.ID $b.ID -}},
{{- end -}}
{{- end -}}
}
var trioAffinity = []int8{
{{- range $a := $.Characters -}}
{{- range $b := $.Characters -}}
{{- range $c := $.Characters -}}
{{- index $.TrioMaps $a.ID $b.ID $c.ID -}},
{{- end -}}
{{- end -}}
{{- end -}}
}
func PairAffinity(a, b CharacterID) int {
if _, ok := Characters[a]; !ok {
return 0
}
if _, ok := Characters[b]; !ok {
return 0
}
return int(pairAffinity[a*{{ $.Count }} + b])
}
func TrioAffinity(a, b, c CharacterID) int {
if _, ok := Characters[a]; !ok {
return 0
}
if _, ok := Characters[b]; !ok {
return 0
}
if _, ok := Characters[c]; !ok {
return 0
}
return int(trioAffinity[a*{{ $.Count }}*{{ $.Count }} + b*{{ $.Count }} + c])
}
{{ end }}
-120
View File
@@ -1,120 +0,0 @@
{{ define "koka-character" -}}
module horse/{{ $.Region }}/character
// Automatically generated with horsegen; DO NOT EDIT
import std/core/vector
import std/core-extras
// Character identity.
pub type character
{{- range $uma := $.Characters }}
{{ kkenum $uma.Name }}
{{- end }}
// The list of all characters in order by ID, for easy iterating.
pub val character/all = [
{{- range $uma := $.Characters }}
{{ kkenum $uma.Name }},
{{- end }}
]
// Get the character for a character ID.
// Generally, these are four digit numbers in the range 1000-1999.
pub fun character/from-id(id: int): maybe<character>
match id
{{- range $uma := $.Characters }}
{{ $uma.ID }} -> Just( {{- kkenum $uma.Name -}} )
{{- end }}
_ -> Nothing
// Get the ID for a character.
pub fun character/character-id(c: character): int
match c
{{- range $uma := $.Characters }}
{{ kkenum $uma.Name }} -> {{ $uma.ID }}
{{- end }}
// Get the name of a character.
pub fun character/show(c: character): string
match c
{{- range $uma := $.Characters }}
{{ kkenum $uma.Name }} -> {{ printf "%q" $uma.Name }}
{{- end }}
// Compare two characters.
pub fip fun character/order2(a: character, b: character): order2<character>
match (a, b)
{{- range $uma := $.Characters }}{{ $e := kkenum $uma.Name }}
( {{- $e }}, {{ $e -}} ) -> Eq2( {{- $e -}} )
{{- if ne $uma.ID $.MaxID }}
( {{- $e }}, b') -> Lt2( {{- $e }}, b')
(a', {{ $e -}} ) -> Gt2( {{- $e }}, a')
{{- end }}
{{- end }}
// Character equality.
pub fun character/(==)(a: character, b: character): bool
match (a, b)
{{- range $uma := $.Characters }}{{ $e := kkenum $uma.Name }}
( {{- $e }}, {{ $e -}} ) -> True
{{- end }}
_ -> False
fip fun character/index(^c: character): int
match c
{{- range $uma := $.Characters }}
{{ kkenum $uma.Name }} -> {{ $uma.Index }}
{{- end }}
// Create the table of all pair affinities.
// The affinity is the value at a.index*count + b.index.
extern global/create-pair-table(): vector<int>
c inline "kk_intx_t arr[] = {
{{- range $a := $.Characters }}
{{- range $b := $.Characters }}
{{- index $.PairMaps $a.ID $b.ID }},
{{- end }}
{{- end -}}
};\nkk_vector_from_cintarray(arr, (kk_ssize_t){{ $.Count }} * (kk_ssize_t){{ $.Count }}, kk_context())"
js inline "[
{{- range $a := $.Characters }}
{{- range $b := $.Characters }}
{{- index $.PairMaps $a.ID $b.ID }},
{{- end }}
{{- end -}}
]"
val global/pair-table = global/create-pair-table()
// Base affinity between a pair using the global ruleset.
pub fun global/pair-affinity(a: character, b: character): int
global/pair-table.at(a.index * {{ $.Count }} + b.index).default(0)
// Create the table of all trio affinities.
// The affinity is the value at a.index*count*count + b.index*count + c.index.
extern global/create-trio-table(): vector<int>
c inline "kk_intx_t arr[] = {
{{- range $a := $.Characters }}
{{- range $b := $.Characters }}
{{- range $c := $.Characters }}
{{- index $.TrioMaps $a.ID $b.ID $c.ID }},
{{- end }}
{{- end }}
{{- end -}}
};\nkk_vector_from_cintarray(arr, (kk_ssize_t){{ $.Count }} * (kk_ssize_t){{ $.Count }} * (kk_ssize_t){{ $.Count }}, kk_context())"
js inline "[
{{- range $a := $.Characters }}
{{- range $b := $.Characters }}
{{- range $c := $.Characters }}
{{- index $.TrioMaps $a.ID $b.ID $c.ID }},
{{- end }}
{{- end }}
{{- end -}}
]"
val global/trio-table = global/create-trio-table()
// Base affinity for a trio using the global ruleset.
pub fun global/trio-affinity(a: character, b: character, c: character): int
global/trio-table.at(a.index * {{ $.Count }} * {{ $.Count }} + b.index * {{ $.Count }} + c.index).default(0)
{{- end }}
-9
View File
@@ -1,9 +0,0 @@
SELECT
"index" AS "id",
"text" AS "name",
ROW_NUMBER() OVER (ORDER BY "index") - 1 AS "index"
FROM text_data
WHERE category = 6 AND "index" BETWEEN 1000 AND 1999
-- Exclude characters who have no succession relations defined.
AND "index" IN (SELECT chara_id FROM succession_relation_member)
ORDER BY "id"
-186
View File
@@ -1,186 +0,0 @@
package main
import (
"embed"
"errors"
"fmt"
"io"
"regexp"
"strings"
"text/template"
"unicode"
)
//go:embed character.kk.template skill.kk.template character.go.template skill.go.template
var templates embed.FS
// LoadTemplates sets up templates to render game data to source code.
func LoadTemplates() (*template.Template, error) {
t := template.New("root")
t.Funcs(template.FuncMap{
"kkenum": kkenum,
"goenum": goenum,
})
return t.ParseFS(templates, "*")
}
// ExecCharacter renders the Koka character module to kk and the Go character file to g.
// If either is nil, it is skipped.
func ExecCharacter(t *template.Template, region string, kk, g io.Writer, c []NamedID[Character], pairs, trios []AffinityRelation) error {
if len(pairs) != len(c)*len(c) {
return fmt.Errorf("there are %d pairs but there must be %d for %d characters", len(pairs), len(c)*len(c), len(c))
}
if len(trios) != len(c)*len(c)*len(c) {
return fmt.Errorf("there are %d trios but there must be %d for %d characters", len(trios), len(c)*len(c)*len(c), len(c))
}
maxid := 0
pm := make(map[int]map[int]int, len(c))
tm := make(map[int]map[int]map[int]int, len(c))
for _, u := range c {
maxid = max(maxid, u.ID)
pm[u.ID] = make(map[int]int, len(c))
tm[u.ID] = make(map[int]map[int]int, len(c))
for _, v := range c {
tm[u.ID][v.ID] = make(map[int]int, len(c))
}
}
for _, p := range pairs {
pm[p.IDA][p.IDB] = p.Affinity
}
for _, t := range trios {
tm[t.IDA][t.IDB][t.IDC] = t.Affinity
}
data := struct {
Region string
Characters []NamedID[Character]
Pairs []AffinityRelation
Trios []AffinityRelation
PairMaps map[int]map[int]int
TrioMaps map[int]map[int]map[int]int
Count int
MaxID int
}{region, c, pairs, trios, pm, tm, len(c), maxid}
var err error
if kk != nil {
err = errors.Join(t.ExecuteTemplate(kk, "koka-character", &data))
}
if g != nil {
err = errors.Join(t.ExecuteTemplate(g, "go-character", &data))
}
return err
}
func ExecSkill(t *template.Template, region string, kk, g io.Writer, groups []NamedID[SkillGroup], skills []Skill) error {
m := make(map[int][]Skill, len(groups))
for _, t := range skills {
m[t.GroupID] = append(m[t.GroupID], t)
}
data := struct {
Region string
Groups []NamedID[SkillGroup]
Skills []Skill
Related map[int][]Skill
}{region, groups, skills, m}
var err error
if kk != nil {
err = errors.Join(t.ExecuteTemplate(kk, "koka-skill", &data))
}
if g != nil {
err = errors.Join(t.ExecuteTemplate(g, "go-skill-data", &data))
}
return err
}
func ExecSkillGroupKK(t *template.Template, region string, w io.Writer, g []NamedID[SkillGroup], s []Skill) error {
data := struct {
Region string
Groups []NamedID[SkillGroup]
Skills []Skill
}{region, g, s}
return t.ExecuteTemplate(w, "koka-skill-group", &data)
}
const wordSeps = " ,!?/-+();#○☆♡'=♪∀゚∴"
var (
kkReplace = func() *strings.Replacer {
r := []string{
"Triple 7s", "Triple-Sevens", // hard to replace with the right thing automatically
"1,500,000 CC", "One-Million-CC",
"15,000,000 CC", "Fifteen-Million-CC",
"1st", "First",
"♡ 3D Nail Art", "Nail-Art",
".", "",
"&", "-and-",
"'s", "s",
"ó", "o",
"∞", "Infinity",
"×", "x",
"◎", "Lv2",
}
for _, c := range wordSeps {
r = append(r, string(c), "-")
}
return strings.NewReplacer(r...)
}()
kkMultidash = regexp.MustCompile(`-+`)
kkDashNonletter = regexp.MustCompile(`-[^A-Za-z]`)
goReplace = func() *strings.Replacer {
r := []string{
"Triple 7s", "TripleSevens",
"1,500,000 CC", "OneMillionCC",
"15,000,000 CC", "FifteenMillionCC",
"1st", "First",
"♡ 3D Nail Art", "NailArt",
".", "",
"&", "And",
"'s", "s",
"∞", "Infinity",
"×", "X",
"◎", "Lv2",
}
for _, c := range wordSeps {
r = append(r, string(c), "")
}
return strings.NewReplacer(r...)
}()
)
func kkenum(name string) string {
orig := name
name = kkReplace.Replace(name)
name = kkMultidash.ReplaceAllLiteralString(name, "-")
name = strings.Trim(name, "-")
if len(name) == 0 {
panic(fmt.Errorf("%q became empty as Koka enum variant", orig))
}
name = strings.ToUpper(name[:1]) + name[1:]
if !unicode.IsLetter(rune(name[0])) {
panic(fmt.Errorf("Koka enum variant %q (from %q) starts with a non-letter", name, orig))
}
for _, c := range name {
if c > 127 {
// Koka does not allow non-ASCII characters in source code.
// Don't proceed if we've missed one.
panic(fmt.Errorf("non-ASCII character %q (%[1]U) in Koka enum variant %q (from %q)", c, name, orig))
}
}
if kkDashNonletter.MatchString(name) {
panic(fmt.Errorf("non-letter character after a dash in Koka enum variant %q (from %q)", name, orig))
}
return name
}
func goenum(name string) string {
// go names are a bit more lax, so we need fewer checks
orig := name
name = goReplace.Replace(name)
if len(name) == 0 {
panic(fmt.Errorf("%q became empty as Go enum variant", orig))
}
name = strings.ToUpper(name[:1]) + name[1:]
return name
}
-313
View File
@@ -1,313 +0,0 @@
package main
import (
"context"
_ "embed"
"fmt"
"zombiezen.com/go/sqlite/sqlitex"
)
//go:embed character.sql
var characterSQL string
//go:embed character.affinity2.sql
var characterAffinity2SQL string
//go:embed character.affinity3.sql
var characterAffinity3SQL string
//go:embed skill-group.sql
var skillGroupSQL string
//go:embed skill.sql
var skillSQL string
type (
Character struct{}
SkillGroup struct{}
)
type NamedID[T any] struct {
// Disallow conversions between NamedID types.
_ [0]*T
ID int
Name string
// For internal use, the index of the identity, when it's needed.
// We don't show this in public API, but it lets us use vectors for lookups.
Index int
}
func Characters(ctx context.Context, db *sqlitex.Pool) ([]NamedID[Character], error) {
conn, err := db.Take(ctx)
defer db.Put(conn)
if err != nil {
return nil, fmt.Errorf("couldn't get connection for characters: %w", err)
}
stmt, _, err := conn.PrepareTransient(characterSQL)
if err != nil {
return nil, fmt.Errorf("couldn't prepare statement for characters: %w", err)
}
defer stmt.Finalize()
var r []NamedID[Character]
for {
ok, err := stmt.Step()
if err != nil {
return nil, fmt.Errorf("error stepping characters: %w", err)
}
if !ok {
break
}
c := NamedID[Character]{
ID: stmt.ColumnInt(0),
Name: stmt.ColumnText(1),
Index: stmt.ColumnInt(2),
}
r = append(r, c)
}
return r, nil
}
type AffinityRelation struct {
IDA int
NameA string
IDB int
NameB string
IDC int
NameC string
Affinity int
}
func CharacterPairs(ctx context.Context, db *sqlitex.Pool) ([]AffinityRelation, error) {
conn, err := db.Take(ctx)
defer db.Put(conn)
if err != nil {
return nil, fmt.Errorf("couldn't get connection for character pairs: %w", err)
}
stmt, _, err := conn.PrepareTransient(characterAffinity2SQL)
if err != nil {
return nil, fmt.Errorf("couldn't prepare statement for character pairs: %w", err)
}
defer stmt.Finalize()
var r []AffinityRelation
for {
ok, err := stmt.Step()
if err != nil {
return nil, fmt.Errorf("error stepping character pairs: %w", err)
}
if !ok {
break
}
p := AffinityRelation{
IDA: stmt.ColumnInt(0),
NameA: stmt.ColumnText(1),
IDB: stmt.ColumnInt(2),
NameB: stmt.ColumnText(3),
Affinity: stmt.ColumnInt(4),
}
r = append(r, p)
}
return r, nil
}
func CharacterTrios(ctx context.Context, db *sqlitex.Pool) ([]AffinityRelation, error) {
conn, err := db.Take(ctx)
defer db.Put(conn)
if err != nil {
return nil, fmt.Errorf("couldn't get connection for character trios: %w", err)
}
stmt, _, err := conn.PrepareTransient(characterAffinity3SQL)
if err != nil {
return nil, fmt.Errorf("couldn't prepare statement for character trios: %w", err)
}
defer stmt.Finalize()
var r []AffinityRelation
for {
ok, err := stmt.Step()
if err != nil {
return nil, fmt.Errorf("error stepping character trios: %w", err)
}
if !ok {
break
}
p := AffinityRelation{
IDA: stmt.ColumnInt(0),
NameA: stmt.ColumnText(1),
IDB: stmt.ColumnInt(2),
NameB: stmt.ColumnText(3),
IDC: stmt.ColumnInt(4),
NameC: stmt.ColumnText(5),
Affinity: stmt.ColumnInt(6),
}
r = append(r, p)
}
return r, nil
}
func SkillGroups(ctx context.Context, db *sqlitex.Pool) ([]NamedID[SkillGroup], error) {
conn, err := db.Take(ctx)
defer db.Put(conn)
if err != nil {
return nil, fmt.Errorf("couldn't get connection for skill groups: %w", err)
}
stmt, _, err := conn.PrepareTransient(skillGroupSQL)
if err != nil {
return nil, fmt.Errorf("couldn't prepare statement for skill groups: %w", err)
}
defer stmt.Finalize()
var r []NamedID[SkillGroup]
for {
ok, err := stmt.Step()
if err != nil {
return nil, fmt.Errorf("error stepping skill groups: %w", err)
}
if !ok {
break
}
g := NamedID[SkillGroup]{
ID: stmt.ColumnInt(0),
Name: stmt.ColumnText(1),
}
r = append(r, g)
}
return r, nil
}
type Skill struct {
ID int
Name string
Description string
GroupID int
GroupName string
Rarity int
GroupRate int
GradeValue int
WitCheck bool
Activations [2]SkillActivation
SPCost int
InheritID int
IconID int
Index int
}
type SkillActivation struct {
Precondition string
Condition string
Duration int
Cooldown int
Abilities [3]SkillAbility
}
type SkillAbility struct {
Type int
ValueUsage int
Value int
Target int
TargetValue int
}
func Skills(ctx context.Context, db *sqlitex.Pool) ([]Skill, error) {
conn, err := db.Take(ctx)
defer db.Put(conn)
if err != nil {
return nil, fmt.Errorf("couldn't get connection for skills: %w", err)
}
stmt, _, err := conn.PrepareTransient(skillSQL)
if err != nil {
return nil, fmt.Errorf("couldn't prepare statement for skills: %w", err)
}
defer stmt.Finalize()
var r []Skill
for {
ok, err := stmt.Step()
if err != nil {
return nil, fmt.Errorf("error stepping skills: %w", err)
}
if !ok {
break
}
s := Skill{
ID: stmt.ColumnInt(0),
Name: stmt.ColumnText(1),
Description: stmt.ColumnText(2),
GroupID: stmt.ColumnInt(3),
GroupName: stmt.ColumnText(4),
Rarity: stmt.ColumnInt(5),
GroupRate: stmt.ColumnInt(6),
GradeValue: stmt.ColumnInt(7),
WitCheck: stmt.ColumnInt(8) != 0,
Activations: [2]SkillActivation{
{
Precondition: stmt.ColumnText(9),
Condition: stmt.ColumnText(10),
Duration: stmt.ColumnInt(11),
Cooldown: stmt.ColumnInt(12),
Abilities: [3]SkillAbility{
{
Type: stmt.ColumnInt(13),
ValueUsage: stmt.ColumnInt(14),
Value: stmt.ColumnInt(15),
Target: stmt.ColumnInt(16),
TargetValue: stmt.ColumnInt(17),
},
{
Type: stmt.ColumnInt(18),
ValueUsage: stmt.ColumnInt(19),
Value: stmt.ColumnInt(20),
Target: stmt.ColumnInt(21),
TargetValue: stmt.ColumnInt(22),
},
{
Type: stmt.ColumnInt(23),
ValueUsage: stmt.ColumnInt(24),
Value: stmt.ColumnInt(25),
Target: stmt.ColumnInt(26),
TargetValue: stmt.ColumnInt(27),
},
},
},
{
Precondition: stmt.ColumnText(28),
Condition: stmt.ColumnText(29),
Duration: stmt.ColumnInt(30),
Cooldown: stmt.ColumnInt(31),
Abilities: [3]SkillAbility{
{
Type: stmt.ColumnInt(32),
ValueUsage: stmt.ColumnInt(33),
Value: stmt.ColumnInt(34),
Target: stmt.ColumnInt(35),
TargetValue: stmt.ColumnInt(36),
},
{
Type: stmt.ColumnInt(37),
ValueUsage: stmt.ColumnInt(38),
Value: stmt.ColumnInt(39),
Target: stmt.ColumnInt(40),
TargetValue: stmt.ColumnInt(41),
},
{
Type: stmt.ColumnInt(42),
ValueUsage: stmt.ColumnInt(43),
Value: stmt.ColumnInt(44),
Target: stmt.ColumnInt(45),
TargetValue: stmt.ColumnInt(46),
},
},
},
},
SPCost: stmt.ColumnInt(47),
InheritID: stmt.ColumnInt(48),
IconID: stmt.ColumnInt(49),
Index: stmt.ColumnInt(50),
}
r = append(r, s)
}
return r, nil
}
-129
View File
@@ -1,129 +0,0 @@
package main
import (
"context"
"flag"
"log/slog"
"os"
"os/signal"
"path/filepath"
"golang.org/x/sync/errgroup"
"zombiezen.com/go/sqlite"
"zombiezen.com/go/sqlite/sqlitex"
)
func main() {
var (
mdb string
out string
region string
)
flag.StringVar(&mdb, "mdb", os.ExpandEnv(`$USERPROFILE\AppData\LocalLow\Cygames\Umamusume\master\master.mdb`), "`path` to Umamusume master.mdb")
flag.StringVar(&out, "o", `.\horse`, "`dir`ectory for output files")
flag.StringVar(&region, "region", "global", "region the database is for (global, jp)")
flag.Parse()
pctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
go func() {
<-pctx.Done()
stop()
}()
t, err := LoadTemplates()
if err != nil {
slog.Error("loading templates", slog.Any("err", err))
os.Exit(2)
}
slog.Info("open", slog.String("mdb", mdb))
db, err := sqlitex.NewPool(mdb, sqlitex.PoolOptions{Flags: sqlite.OpenReadOnly})
if err != nil {
slog.Error("opening mdb", slog.String("mdb", mdb), slog.Any("err", err))
os.Exit(1)
}
eg, ctx := errgroup.WithContext(pctx)
var (
charas []NamedID[Character]
pairs []AffinityRelation
trios []AffinityRelation
sg []NamedID[SkillGroup]
skills []Skill
)
eg.Go(func() error {
slog.Info("get characters")
r, err := Characters(ctx, db)
charas = r
return err
})
eg.Go(func() error {
slog.Info("get pairs")
r, err := CharacterPairs(ctx, db)
pairs = r
return err
})
eg.Go(func() error {
slog.Info("get trios")
r, err := CharacterTrios(ctx, db)
trios = r
return err
})
eg.Go(func() error {
slog.Info("get skill groups")
r, err := SkillGroups(ctx, db)
sg = r
return err
})
eg.Go(func() error {
slog.Info("get skills")
r, err := Skills(ctx, db)
skills = r
return err
})
if err := eg.Wait(); err != nil {
slog.Error("load", slog.Any("err", err))
os.Exit(1)
}
if err := os.MkdirAll(filepath.Join(out, region), 0775); err != nil {
slog.Error("create output dir", slog.Any("err", err))
os.Exit(1)
}
eg, ctx = errgroup.WithContext(pctx)
eg.Go(func() error {
cf, err := os.Create(filepath.Join(out, region, "character.kk"))
if err != nil {
return err
}
gf, err := os.Create(filepath.Join(out, region, "character.go"))
if err != nil {
return err
}
slog.Info("write characters")
return ExecCharacter(t, region, cf, gf, charas, pairs, trios)
})
eg.Go(func() error {
sf, err := os.Create(filepath.Join(out, region, "skill.kk"))
if err != nil {
return err
}
gf, err := os.Create(filepath.Join(out, region, "skill.go"))
slog.Info("write skills")
return ExecSkill(t, region, sf, gf, sg, skills)
})
eg.Go(func() error {
sf, err := os.Create(filepath.Join(out, region, "skill-group.kk"))
if err != nil {
return err
}
slog.Info("write skill groups")
return ExecSkillGroupKK(t, region, sf, sg, skills)
})
if err := eg.Wait(); err != nil {
slog.Error("generate", slog.Any("err", err))
} else {
slog.Info("done")
}
}
-14
View File
@@ -1,14 +0,0 @@
WITH skill_names AS (
SELECT
"index" AS "id",
"text" AS "name"
FROM text_data
WHERE category = 47
)
SELECT
group_id,
name
FROM skill_data d
JOIN skill_names n ON d.id = n.id
WHERE d.group_rate = 1
ORDER BY group_id
-75
View File
@@ -1,75 +0,0 @@
{{- define "go-skill-data" -}}
package {{ $.Region }}
// Automatically generated with horsegen; DO NOT EDIT
import . "git.sunturtle.xyz/zephyr/horse/horse"
const (
{{- range $s := $.Skills }}
Skill{{ goenum $s.Name }}{{ if ne $s.InheritID 0 }}Inherit{{ end }} SkillID = {{ $s.ID }} // {{ $s.Name }}
{{- end }}
)
var OrderedSkills = [...]SkillID{
{{- range $s := $.Skills }}
Skill{{ goenum $s.Name }}{{ if ne $s.InheritID 0 }}Inherit{{ end }},
{{- end }}
}
var AllSkills = map[SkillID]Skill{
{{- range $s := $.Skills }}
Skill{{ goenum $s.Name }}{{ if ne $s.InheritID 0 }}Inherit{{ end }}: {
ID: {{ $s.ID }},
Name: {{ printf "%q" $s.Name }}{{ if ne $s.InheritID 0 }} + " (Inherited)"{{ end }},
Description: {{ printf "%q" $s.Description }},
Group: {{ $s.GroupID }},
Rarity: {{ $s.Rarity }},
GroupRate: {{ $s.GroupRate }},
GradeValue: {{ $s.GradeValue }},
{{- if $s.WitCheck }}
WitCheck: {{ $s.WitCheck }},
{{- end }}
Activations: []Activation{
{{- range $a := $s.Activations }}
{{- if ne $a.Condition "" }}
{
{{- if $a.Precondition }}
Precondition: {{ printf "%q" $a.Precondition }},
{{- end }}
Condition: {{ printf "%q" $a.Condition }},
Duration: {{ $a.Duration }},
{{- if $a.Cooldown }}
Cooldown: {{ $a.Cooldown }},
{{- end }}
Abilities: []Ability{
{{- range $abil := $a.Abilities }}
{{- if ne $abil.Type 0 }}
{Type: {{ $abil.Type }}, ValueUsage: {{ $abil.ValueUsage }}, Value: {{ $abil.Value }}, Target: {{ $abil.Target }}, TargetValue: {{ $abil.TargetValue -}} },
{{- end }}
{{- end }}
},
},
{{- end }}
{{- end }}
},
{{- if $s.SPCost }}
SPCost: {{ $s.SPCost }},
{{- end }}
IconID: {{ $s.IconID }},
},
{{- end }}
}
var SkillNameToID = map[string]SkillID{
{{- range $s := $.Skills }}
{{ printf "%q" $s.Name }}{{ if ne $s.InheritID 0 }} + " (Inherited)"{{ end }}: {{ $s.ID }},
{{- end }}
}
var SkillGroups = map[int32][4]SkillID{
{{- range $g := $.Groups }}
{{ $g.ID }}: { {{- range $s := index $.Related $g.ID }}Skill{{ goenum $s.Name }}{{ if ne $s.InheritID 0 }}Inherit{{ end }}, {{ end -}} },
{{- end }}
}
{{ end }}
-347
View File
@@ -1,347 +0,0 @@
{{- define "koka-skill-group" -}}
module horse/{{ $.Region }}/skill-group
// Automatically generated with horsegen; DO NOT EDIT
// Skill groups.
// A skill group may contain white, circle, double-circle, gold, and purple skills
// for the same effect.
// Sparks that grant skills refer to a skill group.
pub type skill-group
{{- range $g := $.Groups }}
{{ kkenum $g.Name }}
{{- end }}
// Map a skill group to its ID.
pub fip fun skill-group/group-id(^sg: skill-group): int
match sg
{{- range $g := $.Groups }}
{{ kkenum $g.Name }} -> {{ $g.ID }}
{{- end }}
// Get the skill group for an ID.
pub fip(1) fun skill-group/from-id(^id: int): maybe<skill-group>
match id
{{- range $g := $.Groups }}
{{ $g.ID }} -> Just( {{- kkenum $g.Name -}} )
{{- end }}
_ -> Nothing
// Get the name for a skill group.
// Skill group names are the name of the base skill in the group.
pub fun skill-group/show(sg: skill-group): string
match sg
{{- range $g := $.Groups }}
{{ kkenum $g.Name }} -> {{ printf "%q" $g.Name }}
{{- end }}
// Compare two skill groups by ID order.
pub fip fun skill-group/order2(a: skill-group, b: skill-group): order2<skill-group>
match cmp(a.group-id, b.group-id)
Lt -> Lt2(a, b)
Eq -> Eq2(a)
Gt -> Gt2(a, b)
pub fun skill-group/(==)(a: skill-group, b: skill-group): bool
a.group-id == b.group-id
{{- end -}}
{{- define "koka-skill" -}}
module horse/{{ $.Region }}/skill
// Automatically generated with horsegen; DO NOT EDIT
import std/num/decimal
pub import horse/{{ $.Region }}/skill-group
// Skill instances.
pub type skill
{{- range $s := $.Skills }}
{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end -}}
{{- end }}
// Map a skill to its ID.
pub fip fun skill/skill-id(^s: skill): int
match s
{{- range $s := $.Skills }}
{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end }} -> {{ $s.ID }}
{{- end }}
// Get the skill for an ID.
pub fip(1) fun skill/from-id(^id: int): maybe<skill>
match id
{{- range $s := $.Skills }}
{{ $s.ID }} -> Just( {{- kkenum $s.Name -}}{{ if ne $s.InheritID 0 }}-Inherit{{ end -}} )
{{- end }}
_ -> Nothing
// Get the name of a skill.
// Inherited skills have the same names as their original counterparts.
pub fun skill/show(s: skill): string
match s
{{- range $s := $.Skills }}
{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end }} -> {{ printf "%q" $s.Name }}
{{- end }}
// Compare two skills by ID order.
pub fip fun skill/order2(a: skill, b: skill): order2<skill>
match cmp(a.skill-id, b.skill-id)
Lt -> Lt2(a, b)
Eq -> Eq2(a)
Gt -> Gt2(a, b)
pub fun skill/(==)(a: skill, b: skill): bool
a.skill-id == b.skill-id
// Get the skills in a skill group.
pub fun skill-group/skills(g: skill-group): list<skill>
match g
{{- range $g := $.Groups }}
{{ kkenum $g.Name }} -> [ {{- range $s := index $.Related $g.ID }}{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end }}, {{ end }}]
{{- end }}
// Get complete skill info.
pub fun skill/detail(^s: skill): skill-detail
match s
{{- range $s := $.Skills }}
{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end }} -> {{ template "kk-render-skill-detail" $s }}
{{- end }}
// Details about a skill.
pub struct skill-detail
skill-id: int
name: string
description: string
group: maybe<skill-group>
rarity: rarity
group-rate: int
grade-value: int
wit-check: bool
activations: list<activation>
sp-cost: int
icon-id: int
// Automatically generated.
// Shows a string representation of the `skill-detail` type.
pub fun skill-detail/show(this : skill-detail) : e string
match this
Skill-detail(skill-id, name, description, group, rarity, group-rate, grade-value, wit-check, activations, sp-cost, icon-id) -> "Skill-detail(skill-id: " ++ skill-id.show ++ ", name: " ++ name.show ++ ", description: " ++ description.show ++ ", group: " ++ group.show ++ ", rarity: " ++ rarity.show ++ ", group-rate: " ++ group-rate.show ++ ", grade-value: " ++ grade-value.show ++ ", wit-check: " ++ wit-check.show ++ ", activations: " ++ activations.show ++ ", sp-cost: " ++ sp-cost.show ++ ", icon-id: " ++ icon-id.show ++ ")"
// Skill rarity.
pub type rarity
Common // white
Rare // gold
Unique-Low // 1*/2* unique
Unique-Upgraded // 3*+ unique on a trainee upgraded from 1*/2*
Unique // base 3* unique
pub fun rarity/show(r: rarity): string
match r
Common -> "Common"
Rare -> "Rare"
Unique-Low -> "Unique (1\u2606/2\u2606)"
Unique-Upgraded -> "Unique (3\u2606+ from 1\u2606/2\u2606 upgraded)"
Unique -> "Unique (3\u2606+)"
// Condition and precondition logic.
pub alias condition = string
// Activation conditions and effects.
// A skill has one or two activations.
pub struct activation
precondition: condition
condition: condition
duration: decimal // seconds
cooldown: decimal // seconds
abilities: list<ability> // one to three elements
pub fun activation/show(a: activation): string
match a
Activation("", condition, duration, _, abilities) | duration <= 0.decimal -> condition ++ " -> " ++ abilities.show
Activation("", condition, duration, cooldown, abilities) | cooldown >= 500.decimal -> condition ++ " -> " ++ abilities.show ++ " for " ++ duration.show ++ "s"
Activation("", condition, duration, cooldown, abilities) -> condition ++ " -> " ++ abilities.show ++ " for " ++ duration.show ++ "s on " ++ cooldown.show ++ "s cooldown"
Activation(precondition, condition, duration, _, abilities) | duration <= 0.decimal -> precondition ++ " -> " ++ condition ++ " -> " ++ abilities.show
Activation(precondition, condition, duration, cooldown, abilities) | cooldown >= 500.decimal -> precondition ++ " -> " ++ condition ++ " -> " ++ abilities.show ++ " for " ++ duration.show ++ "s"
Activation(precondition, condition, duration, cooldown, abilities) -> precondition ++ "-> " ++ condition ++ " -> " ++ abilities.show ++ " for " ++ duration.show ++ "s on " ++ cooldown.show ++ "s cooldown"
// Effects of activating a skill.
pub struct ability
ability-type: ability-type
value-usage: value-usage
target: target
pub fun ability/show(a: ability): string
match a
Ability(t, Direct, Self) -> t.show
Ability(t, Direct, target) -> t.show ++ " " ++ target.show
Ability(t, v, Self) -> t.show ++ " scaling by " ++ v.show
Ability(t, v, target) -> t.show ++ " " ++ target.show ++ " scaling by " ++ v.show
// Target of a skill activation effect.
pub type ability-type
Passive-Speed(bonus: decimal)
Passive-Stamina(bonus: decimal)
Passive-Power(bonus: decimal)
Passive-Guts(bonus: decimal)
Passive-Wit(bonus: decimal)
Great-Escape
Vision(bonus: decimal)
HP(rate: decimal)
Gate-Delay(rate: decimal)
Frenzy(add: decimal)
Current-Speed(rate: decimal)
Target-Speed(rate: decimal)
Lane-Speed(rate: decimal)
Accel(rate: decimal)
Lane-Change(rate: decimal)
pub fun ability-type/show(a: ability-type): string
match a
Passive-Speed(bonus) -> "passive " ++ bonus.show ++ " Speed"
Passive-Stamina(bonus) -> "passive " ++ bonus.show ++ " Stamina"
Passive-Power(bonus) -> "passive " ++ bonus.show ++ " Power"
Passive-Guts(bonus) -> "passive " ++ bonus.show ++ " Guts"
Passive-Wit(bonus) -> "passive " ++ bonus.show ++ " Wit"
Great-Escape -> "enable Great Escape style"
Vision(bonus) -> bonus.show ++ " vision"
HP(rate) | rate >= 0.decimal -> show(rate * 100.decimal) ++ "% HP recovery"
HP(rate) -> show(rate * 100.decimal) ++ "% HP loss"
Gate-Delay(rate) -> rate.show ++ "× gate delay"
Frenzy(add) -> add.show ++ "s longer Rushed"
Current-Speed(rate) -> show(rate * 100.decimal) ++ "% current speed"
Target-Speed(rate) -> show(rate * 100.decimal) ++ "% target speed"
Lane-Speed(rate) -> show(rate * 100.decimal) ++ "% lane speed"
Accel(rate) -> show(rate * 100.decimal) ++ "% acceleration"
Lane-Change(rate) -> rate.show ++ " course width movement"
// Special scaling for skill activation effects.
pub type value-usage
Direct
Team-Speed
Team-Stamina
Team-Power
Team-Guts
Team-Wit
Multiply-Random
pub fun value-usage/show(v: value-usage): string
match v
Direct -> "no scaling"
Team-Speed -> "team's Speed"
Team-Stamina -> "team's Stamina"
Team-Power -> "team's Power"
Team-Guts -> "team's Guts"
Team-Wit -> "team's Wit"
Multiply-Random -> "random multiplier (0×, 0.02×, or 0.04×)"
// Who a skill activation targets.
pub type target
Self
In-View
Ahead(limit: int)
Behind(limit: int)
Style(style: style)
Rushing-Ahead(limit: int)
Rushing-Behind(limit: int)
Rushing-Style(style: style)
pub fun target/show(t: target): string
match t
Self -> "self"
In-View -> "others in field of view"
Ahead(limit) | limit >= 18 -> "others ahead"
Ahead(limit) -> "next " ++ limit.show ++ " others ahead"
Behind(limit) | limit >= 18 -> "others behind"
Behind(limit) -> "next " ++ limit.show ++ " others behind"
Style(Front-Runner) -> "other Front Runners"
Style(Pace-Chaser) -> "other Pace Chasers"
Style(Late-Surger) -> "other Late Surgers"
Style(End-Closer) -> "other End Closers"
Rushing-Ahead(limit) | limit >= 18 -> "others rushing ahead"
Rushing-Ahead(limit) -> "next " ++ limit.show ++ " others rushing ahead"
Rushing-Behind(limit) | limit >= 18 -> "others rushing behind"
Rushing-Behind(limit) -> "next " ++ limit.show ++ " others rushing behind"
Rushing-Style(Front-Runner) -> "rushing Front Runners"
Rushing-Style(Pace-Chaser) -> "rushing Pace Chasers"
Rushing-Style(Late-Surger) -> "rushing Late Surgers"
Rushing-Style(End-Closer) -> "rushing End Closers"
// Running style for skill targets.
{{- /* TODO(zeph): there is definitely a better place for this to live */}}
pub type style
Front-Runner
Pace-Chaser
Late-Surger
End-Closer
{{- end -}}
{{ define "kk-render-skill-detail" }}
{{- /* Call with Skill structure as argument. */ -}}
Skill-detail(skill-id = {{ $.ID -}}
, name = {{ printf "%q" $.Name -}}
, description = {{ printf "%q" $.Description -}}
, group = {{ if ne $.GroupName "" }}Just({{ kkenum $.GroupName }}){{ else }}Nothing{{ end -}}
, rarity = {{ if eq $.Rarity 1 }}Common{{ else if eq $.Rarity 2 }}Rare{{ else if eq $.Rarity 3 }}Unique-Low{{ else if eq $.Rarity 4 }}Unique-Upgraded{{ else if eq $.Rarity 5 }}Unique{{ else }}??? $.Rarity={{ $.Rarity }}{{ end -}}
, group-rate = {{ $.GroupRate -}}
, grade-value = {{ $.GradeValue -}}
, wit-check = {{ if $.WitCheck }}True{{ else }}False{{ end -}}
, activations = [
{{- range $a := $.Activations -}}
{{- if ne $a.Condition "" -}}
Activation(precondition = {{ printf "%q" $a.Precondition -}}
, condition = {{ printf "%q" $a.Condition -}}
, duration = {{ $a.Duration -}}{{ if gt $a.Duration 0 }}.decimal(-4){{ else }}.decimal{{ end -}}
, cooldown = {{ $a.Cooldown -}}{{ if gt $a.Cooldown 0 }}.decimal(-4){{ else }}.decimal{{ end -}}
, abilities = [
{{- range $abil := $a.Abilities -}}
{{- if ne $abil.Type 0 -}}
Ability(ability-type =
{{- if eq $abil.Type 1 -}}Passive-Speed({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 2 -}}Passive-Stamina({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 3 -}}Passive-Power({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 4 -}}Passive-Guts({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 5 -}}Passive-Wit({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 6 -}}Great-Escape
{{- else if eq $abil.Type 8 -}}Vision({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 9 -}}HP({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 10 -}}Gate-Delay({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 13 -}}Frenzy({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 21 -}}Current-Speed({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 27 -}}Target-Speed({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 28 -}}Lane-Speed({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 31 -}}Accel({{ $abil.Value }}.decimal(-4))
{{- else if eq $abil.Type 35 -}}Lane-Change({{ $abil.Value }}.decimal(-4))
{{- else -}}??? $abil.Type={{$abil.Type}}
{{- end -}}
, value-usage =
{{- if eq $abil.ValueUsage 1 -}}Direct
{{- else if eq $abil.ValueUsage 3 -}}Team-Speed
{{- else if eq $abil.ValueUsage 4 -}}Team-Stamina
{{- else if eq $abil.ValueUsage 5 -}}Team-Power
{{- else if eq $abil.ValueUsage 6 -}}Team-Guts
{{- else if eq $abil.ValueUsage 7 -}}Team-Wit
{{- else if eq $abil.ValueUsage 8 -}}Multiply-Random
{{- else -}}??? $abil.ValueUsage={{ $abil.ValueUsage }}
{{- end -}}
, target =
{{- if eq $abil.Target 1 -}}Self
{{- else if eq $abil.Target 4 -}}In-View
{{- else if eq $abil.Target 9 -}}Ahead({{ $abil.TargetValue }})
{{- else if eq $abil.Target 10 -}}Behind({{ $abil.TargetValue }})
{{- else if eq $abil.Target 18 -}}Style({{ if eq $abil.TargetValue 1 }}Front-Runner{{ else if eq $abil.TargetValue 2 }}Pace-Chaser{{ else if eq $abil.TargetValue 3 }}Late-Surger{{ else if eq $abil.TargetValue 4 }}End-Closer{{ else }}??? $abil.TargetValue={{ $abil.TargetValue }}{{ end }})
{{- else if eq $abil.Target 19 -}}Rushing-Ahead({{ $abil.TargetValue }})
{{- else if eq $abil.Target 20 -}}Rushing-Behind({{ $abil.TargetValue }})
{{- else if eq $abil.Target 21 -}}Rushing-Style({{ if eq $abil.TargetValue 1 }}Front-Runner{{ else if eq $abil.TargetValue 2 }}Pace-Chaser{{ else if eq $abil.TargetValue 3 }}Late-Surger{{ else if eq $abil.TargetValue 4 }}End-Closer{{ else }}??? $abil.TargetValue={{ $abil.TargetValue }}{{ end }})
{{- end -}}
),
{{- end -}}
{{- end -}}
]),
{{- end -}}
{{- end -}}
], sp-cost = {{ $.SPCost -}}
, icon-id = {{ $.IconID -}}
)
{{- end -}}
+47
View File
@@ -0,0 +1,47 @@
// Code generated by "stringer -type LobbyConversationLocationID -trimprefix Lobby -linecomment"; DO NOT EDIT.
package horse
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[LobbyRightFront1-110]
_ = x[LobbyRightFront2-120]
_ = x[LobbyRightFront3-130]
_ = x[LobbyLeftTable1-210]
_ = x[LobbyLeftTable2-220]
_ = x[LobbyBackSeat-310]
_ = x[LobbyPosters1-410]
_ = x[LobbyPosters2-420]
_ = x[LobbyPosters3-430]
_ = x[LobbySchoolMap1-510]
_ = x[LobbySchoolMap2-520]
_ = x[LobbySchoolMap3-530]
}
const _LobbyConversationLocationID_name = "right side frontright side frontright side frontleft side tableleft side tablecenter back seatcenter posterscenter posterscenter postersleft side school mapleft side school mapleft side school map"
var _LobbyConversationLocationID_map = map[LobbyConversationLocationID]string{
110: _LobbyConversationLocationID_name[0:16],
120: _LobbyConversationLocationID_name[16:32],
130: _LobbyConversationLocationID_name[32:48],
210: _LobbyConversationLocationID_name[48:63],
220: _LobbyConversationLocationID_name[63:78],
310: _LobbyConversationLocationID_name[78:94],
410: _LobbyConversationLocationID_name[94:108],
420: _LobbyConversationLocationID_name[108:122],
430: _LobbyConversationLocationID_name[122:136],
510: _LobbyConversationLocationID_name[136:156],
520: _LobbyConversationLocationID_name[156:176],
530: _LobbyConversationLocationID_name[176:196],
}
func (i LobbyConversationLocationID) String() string {
if str, ok := _LobbyConversationLocationID_map[i]; ok {
return str
}
return "LobbyConversationLocationID(" + strconv.FormatInt(int64(i), 10) + ")"
}
+102
View File
@@ -0,0 +1,102 @@
package mdb
import (
"context"
_ "embed"
"zombiezen.com/go/sqlite"
"zombiezen.com/go/sqlite/sqlitex"
"git.sunturtle.xyz/zephyr/horse"
)
var (
//go:embed sql/character.sql
characterSQL string
//go:embed sql/affinity.sql
affinitySQL string
//go:embed sql/affinity-detail.sql
affinityDetailSQL string
//go:embed sql/uma.sql
umaSQL string
//go:embed sql/conversation.sql
conversationSQL string
)
// Characters retrieves all named characters.
func Characters(ctx context.Context, db *sqlitex.Pool) ([]horse.Character, error) {
return load(ctx, db, make([]horse.Character, 0, 128), characterSQL, func(s *sqlite.Stmt) horse.Character {
return horse.Character{
ID: horse.CharacterID(s.ColumnInt(0)),
Name: s.ColumnText(1),
}
})
}
// AffinitySummary gets precomputed base affinity for all pairs and trios of characters.
func AffinitySummary(ctx context.Context, db *sqlitex.Pool) ([]horse.AffinityRelation, error) {
return load(ctx, db, nil, affinitySQL, func(s *sqlite.Stmt) horse.AffinityRelation {
return horse.AffinityRelation{
IDA: horse.CharacterID(s.ColumnInt(0)),
IDB: horse.CharacterID(s.ColumnInt(1)),
IDC: horse.CharacterID(s.ColumnInt(2)),
Affinity: s.ColumnInt(3),
}
})
}
// AffinityDetail gets all individual affinity group entries.
func AffinityDetail(ctx context.Context, db *sqlitex.Pool) ([]horse.AffinityDetail, error) {
return load(ctx, db, nil, affinityDetailSQL, func(s *sqlite.Stmt) horse.AffinityDetail {
return horse.AffinityDetail{
CharaID: horse.CharacterID(s.ColumnInt(0)),
Relation: uint16(s.ColumnInt(1)),
Affinity: uint16(s.ColumnInt(2)),
}
})
}
// Umas retrieves all trainable Uma variants.
func Umas(ctx context.Context, db *sqlitex.Pool) ([]horse.Uma, error) {
return load(ctx, db, make([]horse.Uma, 0, 128), umaSQL, func(s *sqlite.Stmt) horse.Uma {
return horse.Uma{
ID: horse.UmaID(s.ColumnInt(0)),
CharacterID: horse.CharacterID(s.ColumnInt(1)),
Name: s.ColumnText(2),
Variant: s.ColumnText(3),
Sprint: horse.AptitudeLevel(s.ColumnInt(5)),
Mile: horse.AptitudeLevel(s.ColumnInt(6)),
Medium: horse.AptitudeLevel(s.ColumnInt(7)),
Long: horse.AptitudeLevel(s.ColumnInt(8)),
Front: horse.AptitudeLevel(s.ColumnInt(9)),
Pace: horse.AptitudeLevel(s.ColumnInt(10)),
Late: horse.AptitudeLevel(s.ColumnInt(11)),
End: horse.AptitudeLevel(s.ColumnInt(12)),
Turf: horse.AptitudeLevel(s.ColumnInt(13)),
Dirt: horse.AptitudeLevel(s.ColumnInt(14)),
Unique: horse.SkillID(s.ColumnInt(15)),
Skill1: horse.SkillID(s.ColumnInt(16)),
Skill2: horse.SkillID(s.ColumnInt(17)),
Skill3: horse.SkillID(s.ColumnInt(18)),
SkillPL2: horse.SkillID(s.ColumnInt(19)),
SkillPL3: horse.SkillID(s.ColumnInt(20)),
SkillPL4: horse.SkillID(s.ColumnInt(21)),
SkillPL5: horse.SkillID(s.ColumnInt(22)),
}
})
}
func Conversations(ctx context.Context, db *sqlitex.Pool) ([]horse.Conversation, error) {
return load(ctx, db, make([]horse.Conversation, 0, 1024), conversationSQL, func(s *sqlite.Stmt) horse.Conversation {
return horse.Conversation{
ID: s.ColumnInt32(0),
CharacterID: horse.CharacterID(s.ColumnInt(1)),
Number: s.ColumnInt(2),
Location: horse.LobbyConversationLocationID(s.ColumnInt(3)),
Chara1: horse.CharacterID(s.ColumnInt(4)),
Chara2: horse.CharacterID(s.ColumnInt(5)),
Chara3: horse.CharacterID(s.ColumnInt(6)),
ConditionType: s.ColumnInt(7),
}
})
}
+336
View File
@@ -0,0 +1,336 @@
package mdb_test
import (
_ "embed"
"testing"
"git.sunturtle.xyz/zephyr/horse"
"git.sunturtle.xyz/zephyr/horse/mdb"
"github.com/google/go-cmp/cmp"
)
//go:embed testdata/character.sql
var characterSQL string
func TestCharacters(t *testing.T) {
db := testdb(t.Context(), "file:TestCharacters?mode=memory&cache=shared", characterSQL)
got, err := mdb.Characters(t.Context(), db)
if err != nil {
t.Error(err)
}
want := []horse.Character{
{ID: 1001, Name: "Special Week"},
{ID: 1002, Name: "Silence Suzuka"},
{ID: 1078, Name: "Yamanin Zephyr"},
{ID: 2001, Name: "Happy Meek"},
{ID: 9001, Name: "Tazuna Hayakawa"},
}
if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("wrong characters (+got/-want):\n%s", diff)
}
}
func TestAffinitySummary(t *testing.T) {
db := testdb(t.Context(), "file:TestAffinitySummary?mode=memory&cache=shared", characterSQL)
got, err := mdb.AffinitySummary(t.Context(), db)
if err != nil {
t.Error(err)
}
want := []horse.AffinityRelation{
{IDA: 1001, IDB: 1002, Affinity: 23},
}
if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("wrong affinity (+got/-want):\n%s", diff)
}
}
func TestAffinityDetail(t *testing.T) {
db := testdb(t.Context(), "file:TestAffinityDetail?mode=memory&cache=shared", characterSQL)
got, err := mdb.AffinityDetail(t.Context(), db)
if err != nil {
t.Error(err)
}
want := []horse.AffinityDetail{
{CharaID: 1001, Relation: 103, Affinity: 2},
{CharaID: 1001, Relation: 202, Affinity: 2},
{CharaID: 1001, Relation: 301, Affinity: 2},
{CharaID: 1001, Relation: 401, Affinity: 2},
{CharaID: 1001, Relation: 502, Affinity: 2},
{CharaID: 1001, Relation: 510, Affinity: 2},
{CharaID: 1001, Relation: 2001, Affinity: 1},
{CharaID: 1001, Relation: 2102, Affinity: 1},
{CharaID: 1001, Relation: 2301, Affinity: 1},
{CharaID: 1001, Relation: 2406, Affinity: 1},
{CharaID: 1001, Relation: 2506, Affinity: 1},
{CharaID: 1001, Relation: 2510, Affinity: 1},
{CharaID: 1001, Relation: 2516, Affinity: 1},
{CharaID: 1001, Relation: 2519, Affinity: 1},
{CharaID: 1001, Relation: 2601, Affinity: 1},
{CharaID: 1001, Relation: 2603, Affinity: 1},
{CharaID: 1001, Relation: 2811, Affinity: 1},
{CharaID: 1001, Relation: 2903, Affinity: 7},
{CharaID: 1001, Relation: 3003, Affinity: 7},
{CharaID: 1001, Relation: 3004, Affinity: 7},
{CharaID: 1001, Relation: 3101, Affinity: 7},
{CharaID: 1001, Relation: 3205, Affinity: 1},
{CharaID: 1001, Relation: 7003, Affinity: 1},
{CharaID: 1001, Relation: 7004, Affinity: 1},
{CharaID: 1001, Relation: 7005, Affinity: 1},
{CharaID: 1001, Relation: 7006, Affinity: 1},
{CharaID: 1001, Relation: 7007, Affinity: 1},
{CharaID: 1001, Relation: 8001, Affinity: 1},
{CharaID: 1001, Relation: 8002, Affinity: 1},
{CharaID: 1001, Relation: 8003, Affinity: 1},
{CharaID: 1001, Relation: 8004, Affinity: 1},
{CharaID: 1001, Relation: 8005, Affinity: 1},
{CharaID: 1001, Relation: 8006, Affinity: 1},
{CharaID: 1001, Relation: 8007, Affinity: 1},
{CharaID: 1001, Relation: 8008, Affinity: 1},
{CharaID: 1001, Relation: 8009, Affinity: 1},
{CharaID: 1001, Relation: 8010, Affinity: 1},
{CharaID: 1001, Relation: 8011, Affinity: 1},
{CharaID: 1001, Relation: 8012, Affinity: 1},
{CharaID: 1001, Relation: 8013, Affinity: 1},
{CharaID: 1001, Relation: 8014, Affinity: 1},
{CharaID: 1001, Relation: 8015, Affinity: 1},
{CharaID: 1001, Relation: 8016, Affinity: 1},
{CharaID: 1001, Relation: 8443, Affinity: 1},
{CharaID: 1001, Relation: 8479, Affinity: 1},
{CharaID: 1001, Relation: 8511, Affinity: 1},
{CharaID: 1001, Relation: 8536, Affinity: 1},
{CharaID: 1001, Relation: 8640, Affinity: 1},
{CharaID: 1002, Relation: 104, Affinity: 2},
{CharaID: 1002, Relation: 202, Affinity: 2},
{CharaID: 1002, Relation: 301, Affinity: 2},
{CharaID: 1002, Relation: 402, Affinity: 2},
{CharaID: 1002, Relation: 2001, Affinity: 1},
{CharaID: 1002, Relation: 2406, Affinity: 1},
{CharaID: 1002, Relation: 2512, Affinity: 1},
{CharaID: 1002, Relation: 2601, Affinity: 1},
{CharaID: 1002, Relation: 2603, Affinity: 1},
{CharaID: 1002, Relation: 2810, Affinity: 1},
{CharaID: 1002, Relation: 2901, Affinity: 7},
{CharaID: 1002, Relation: 3003, Affinity: 7},
{CharaID: 1002, Relation: 3101, Affinity: 7},
{CharaID: 1002, Relation: 3205, Affinity: 1},
{CharaID: 1002, Relation: 7000, Affinity: 1},
{CharaID: 1002, Relation: 7001, Affinity: 1},
{CharaID: 1002, Relation: 7002, Affinity: 1},
{CharaID: 1002, Relation: 7013, Affinity: 1},
{CharaID: 1002, Relation: 7015, Affinity: 1},
{CharaID: 1002, Relation: 8017, Affinity: 1},
{CharaID: 1002, Relation: 8018, Affinity: 1},
{CharaID: 1002, Relation: 8019, Affinity: 1},
{CharaID: 1002, Relation: 8020, Affinity: 1},
{CharaID: 1002, Relation: 8021, Affinity: 1},
{CharaID: 1002, Relation: 8022, Affinity: 1},
{CharaID: 1002, Relation: 8023, Affinity: 1},
{CharaID: 1002, Relation: 8024, Affinity: 1},
{CharaID: 1002, Relation: 8025, Affinity: 1},
{CharaID: 1002, Relation: 8026, Affinity: 1},
{CharaID: 1002, Relation: 8027, Affinity: 1},
{CharaID: 1002, Relation: 8028, Affinity: 1},
{CharaID: 1002, Relation: 8029, Affinity: 1},
{CharaID: 1002, Relation: 8030, Affinity: 1},
{CharaID: 1002, Relation: 8031, Affinity: 1},
{CharaID: 1002, Relation: 8032, Affinity: 1},
{CharaID: 1002, Relation: 8444, Affinity: 1},
{CharaID: 1002, Relation: 8480, Affinity: 1},
{CharaID: 1002, Relation: 8512, Affinity: 1},
{CharaID: 1002, Relation: 8537, Affinity: 1},
{CharaID: 1002, Relation: 8641, Affinity: 1},
}
if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("wrong affinity details (+got/-want):\n%s", diff)
}
}
func TestUmas(t *testing.T) {
db := testdb(t.Context(), "file:TestUmas?mode=memory&cache=shared", characterSQL)
got, err := mdb.Umas(t.Context(), db)
if err != nil {
t.Error(err)
}
want := []horse.Uma{
{
ID: 100101,
CharacterID: 1001,
Name: `[Special Dreamer] Special Week`,
Variant: `[Special Dreamer]`,
Sprint: 2,
Mile: 5,
Medium: 7,
Long: 7,
Front: 1,
Pace: 7,
Late: 7,
End: 5,
Turf: 7,
Dirt: 1,
Unique: 100011,
Skill1: 200512,
Skill2: 201352,
Skill3: 200732,
SkillPL2: 200162,
SkillPL3: 201351,
SkillPL4: 200612,
SkillPL5: 200511,
},
{
ID: 100102,
CharacterID: 1001,
Name: `[Hopp'n♪Happy Heart] Special Week`,
Variant: `[Hopp'n♪Happy Heart]`,
Sprint: 2,
Mile: 5,
Medium: 7,
Long: 7,
Front: 1,
Pace: 7,
Late: 7,
End: 5,
Turf: 7,
Dirt: 1,
Unique: 110011,
Skill1: 200462,
Skill2: 200592,
Skill3: 201132,
SkillPL2: 200212,
SkillPL3: 200591,
SkillPL4: 201611,
SkillPL5: 200461,
},
{
ID: 100201,
CharacterID: 1002,
Name: `[Innocent Silence] Silence Suzuka`,
Variant: `[Innocent Silence]`,
Sprint: 4,
Mile: 7,
Medium: 7,
Long: 3,
Front: 7,
Pace: 5,
Late: 3,
End: 1,
Turf: 7,
Dirt: 1,
Unique: 100021,
Skill1: 200432,
Skill2: 200552,
Skill3: 200712,
SkillPL2: 200022,
SkillPL3: 200431,
SkillPL4: 200542,
SkillPL5: 200551,
},
}
if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("wrong umas (+got/-want):\n%s", diff)
}
}
func TestConversations(t *testing.T) {
db := testdb(t.Context(), "file:TestConversations?mode=memory&cache=shared", characterSQL)
got, err := mdb.Conversations(t.Context(), db)
if err != nil {
t.Error(err)
}
want := []horse.Conversation{
{
ID: 1,
CharacterID: 1001,
Number: 1,
Location: 410,
Chara1: 1001,
},
{
ID: 2,
CharacterID: 1001,
Number: 2,
Location: 510,
Chara1: 1001,
ConditionType: 1,
},
{
ID: 3,
CharacterID: 1001,
Number: 3,
Location: 310,
Chara1: 1001,
ConditionType: 1,
},
{
ID: 76,
CharacterID: 1001,
Number: 4,
Location: 120,
Chara1: 1001,
Chara2: 1002,
ConditionType: 2,
},
{
ID: 77,
CharacterID: 1001,
Number: 5,
Location: 520,
Chara1: 1003,
Chara2: 1001,
ConditionType: 3,
},
{
ID: 126,
CharacterID: 1001,
Number: 6,
Location: 430,
Chara1: 1001,
Chara2: 1014,
Chara3: 1011,
ConditionType: 1,
},
{
ID: 4,
CharacterID: 1002,
Number: 1,
Location: 310,
Chara1: 1002,
},
{
ID: 5,
CharacterID: 1002,
Number: 2,
Location: 210,
Chara1: 1002,
ConditionType: 1,
},
{
ID: 6,
CharacterID: 1002,
Number: 3,
Location: 110,
Chara1: 1002,
ConditionType: 1,
},
{
ID: 78,
CharacterID: 1002,
Number: 4,
Location: 520,
Chara1: 1010,
Chara2: 1002,
ConditionType: 3,
},
{
ID: 79,
CharacterID: 1002,
Number: 5,
Location: 220,
Chara1: 1002,
Chara2: 1018,
ConditionType: 2,
},
}
if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("wrong conversations (+got/-want):\n%s", diff)
}
}
+72
View File
@@ -0,0 +1,72 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
275
],
"_distance": 400.0
},
{
"_paramType": 0,
"_values": [
4,
259
],
"_distance": 675.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 400.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 934.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1200.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 725.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 735.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 725.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 735.0
}
]
}
+80
View File
@@ -0,0 +1,80 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
2,
275
],
"_distance": 150.0
},
{
"_paramType": 0,
"_values": [
3,
275
],
"_distance": 700.0
},
{
"_paramType": 0,
"_values": [
4,
259
],
"_distance": 975.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 425.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 700.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1234.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1500.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1025.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1035.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1025.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1035.0
}
]
}
+104
View File
@@ -0,0 +1,104 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
275
],
"_distance": 175.0
},
{
"_paramType": 0,
"_values": [
2,
275
],
"_distance": 450.0
},
{
"_paramType": 0,
"_values": [
3,
275
],
"_distance": 1000.0
},
{
"_paramType": 0,
"_values": [
4,
259
],
"_distance": 1275.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 175.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 725.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1000.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1534.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1800.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1325.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1335.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1325.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1335.0
}
]
}
+104
View File
@@ -0,0 +1,104 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
275
],
"_distance": 375.0
},
{
"_paramType": 0,
"_values": [
2,
275
],
"_distance": 650.0
},
{
"_paramType": 0,
"_values": [
3,
275
],
"_distance": 1200.0
},
{
"_paramType": 0,
"_values": [
4,
259
],
"_distance": 1475.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 375.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 925.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1200.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1734.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2000.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1525.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1535.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1525.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1535.0
}
]
}
+136
View File
@@ -0,0 +1,136 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
275
],
"_distance": 175.0
},
{
"_paramType": 0,
"_values": [
4,
275
],
"_distance": 450.0
},
{
"_paramType": 0,
"_values": [
1,
275
],
"_distance": 975.0
},
{
"_paramType": 0,
"_values": [
2,
275
],
"_distance": 1250.0
},
{
"_paramType": 0,
"_values": [
3,
275
],
"_distance": 1800.0
},
{
"_paramType": 0,
"_values": [
4,
259
],
"_distance": 2075.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 175.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 725.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 975.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1525.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1800.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 2334.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2600.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 2125.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 2135.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 2125.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 2135.0
}
]
}
+72
View File
@@ -0,0 +1,72 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
230
],
"_distance": 280.0
},
{
"_paramType": 0,
"_values": [
4,
226
],
"_distance": 510.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 280.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 736.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1000.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 550.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 560.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 550.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 560.0
}
]
}
+104
View File
@@ -0,0 +1,104 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
230
],
"_distance": 240.0
},
{
"_paramType": 0,
"_values": [
2,
230
],
"_distance": 470.0
},
{
"_paramType": 0,
"_values": [
3,
230
],
"_distance": 980.0
},
{
"_paramType": 0,
"_values": [
4,
226
],
"_distance": 1210.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 240.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 700.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 980.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1436.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1700.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1250.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1260.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1250.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1260.0
}
]
}
+136
View File
@@ -0,0 +1,136 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
230
],
"_distance": 200.0
},
{
"_paramType": 0,
"_values": [
4,
230
],
"_distance": 430.0
},
{
"_paramType": 0,
"_values": [
1,
230
],
"_distance": 940.0
},
{
"_paramType": 0,
"_values": [
2,
230
],
"_distance": 1170.0
},
{
"_paramType": 0,
"_values": [
3,
230
],
"_distance": 1680.0
},
{
"_paramType": 0,
"_values": [
4,
226
],
"_distance": 1910.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 200.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 660.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 940.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1408.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1680.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 2136.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2400.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1950.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1960.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1950.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1960.0
}
]
}
+80
View File
@@ -0,0 +1,80 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
220
],
"_distance": 310.0
},
{
"_paramType": 0,
"_values": [
4,
208
],
"_distance": 530.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 310.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 738.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1000.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 600.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 610.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 600.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 610.0
},
{
"_paramType": 11,
"_values": [
10000,
555
],
"_distance": 0.0
}
]
}
+80
View File
@@ -0,0 +1,80 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
220
],
"_distance": 510.0
},
{
"_paramType": 0,
"_values": [
4,
208
],
"_distance": 730.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 510.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 938.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1200.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 800.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 810.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 800.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 810.0
},
{
"_paramType": 11,
"_values": [
10000,
755
],
"_distance": 0.0
}
]
}
+120
View File
@@ -0,0 +1,120 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
220
],
"_distance": 320.0
},
{
"_paramType": 0,
"_values": [
2,
220
],
"_distance": 540.0
},
{
"_paramType": 0,
"_values": [
3,
220
],
"_distance": 1110.0
},
{
"_paramType": 0,
"_values": [
4,
208
],
"_distance": 1330.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 320.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 760.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1110.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1538.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1800.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1400.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1410.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1400.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1410.0
},
{
"_paramType": 11,
"_values": [
-10000,
200
],
"_distance": 220.0
},
{
"_paramType": 11,
"_values": [
10000,
720
],
"_distance": 665.0
}
]
}
+120
View File
@@ -0,0 +1,120 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
220
],
"_distance": 520.0
},
{
"_paramType": 0,
"_values": [
2,
220
],
"_distance": 740.0
},
{
"_paramType": 0,
"_values": [
3,
220
],
"_distance": 1310.0
},
{
"_paramType": 0,
"_values": [
4,
208
],
"_distance": 1530.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 520.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 960.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1310.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1738.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2000.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1600.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1610.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1600.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1610.0
},
{
"_paramType": 11,
"_values": [
-10000,
200
],
"_distance": 420.0
},
{
"_paramType": 11,
"_values": [
10000,
720
],
"_distance": 865.0
}
]
}
+160
View File
@@ -0,0 +1,160 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
240
],
"_distance": 260.0
},
{
"_paramType": 0,
"_values": [
4,
230
],
"_distance": 500.0
},
{
"_paramType": 0,
"_values": [
1,
220
],
"_distance": 1120.0
},
{
"_paramType": 0,
"_values": [
2,
220
],
"_distance": 1340.0
},
{
"_paramType": 0,
"_values": [
3,
220
],
"_distance": 1910.0
},
{
"_paramType": 0,
"_values": [
4,
208
],
"_distance": 2130.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 260.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 730.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1120.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1560.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1910.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 2338.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2600.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 2200.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 2210.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 2200.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 2210.0
},
{
"_paramType": 11,
"_values": [
10000,
495
],
"_distance": 0.0
},
{
"_paramType": 11,
"_values": [
-10000,
200
],
"_distance": 970.0
},
{
"_paramType": 11,
"_values": [
10000,
720
],
"_distance": 1425.0
}
]
}
+72
View File
@@ -0,0 +1,72 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
190
],
"_distance": 370.0
},
{
"_paramType": 0,
"_values": [
4,
180
],
"_distance": 560.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 370.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 740.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1000.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 600.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 610.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 600.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 610.0
}
]
}
+120
View File
@@ -0,0 +1,120 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
190
],
"_distance": 350.0
},
{
"_paramType": 0,
"_values": [
2,
190
],
"_distance": 540.0
},
{
"_paramType": 0,
"_values": [
3,
190
],
"_distance": 1070.0
},
{
"_paramType": 0,
"_values": [
4,
180
],
"_distance": 1260.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 350.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 730.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1070.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1440.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1700.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1300.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1310.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1300.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1310.0
},
{
"_paramType": 11,
"_values": [
-10000,
340
],
"_distance": 275.0
},
{
"_paramType": 11,
"_values": [
10000,
670
],
"_distance": 615.0
}
]
}
+136
View File
@@ -0,0 +1,136 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
190
],
"_distance": 292.0
},
{
"_paramType": 0,
"_values": [
4,
190
],
"_distance": 482.0
},
{
"_paramType": 0,
"_values": [
1,
190
],
"_distance": 1040.0
},
{
"_paramType": 0,
"_values": [
2,
190
],
"_distance": 1230.0
},
{
"_paramType": 0,
"_values": [
3,
190
],
"_distance": 1770.0
},
{
"_paramType": 0,
"_values": [
4,
180
],
"_distance": 1960.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 292.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 672.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1040.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1420.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1770.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 2140.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2400.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 2000.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 2010.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 2000.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 2010.0
}
]
}
+63
View File
@@ -0,0 +1,63 @@
{
"courseParams": [
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 649.9000244140625
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 650.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1000.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 690.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 700.0
},
{
"_paramType": 7,
"_values": [
2
],
"_distance": 30.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 696.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 706.0
}
]
}
+72
View File
@@ -0,0 +1,72 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
200
],
"_distance": 450.0
},
{
"_paramType": 0,
"_values": [
4,
192
],
"_distance": 650.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 450.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 842.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1200.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 725.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 735.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 750.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 760.0
}
]
}
+72
View File
@@ -0,0 +1,72 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
200
],
"_distance": 650.0
},
{
"_paramType": 0,
"_values": [
4,
192
],
"_distance": 850.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 650.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1042.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1400.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 925.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 935.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 950.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 960.0
}
]
}
+88
View File
@@ -0,0 +1,88 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
200
],
"_distance": 550.0
},
{
"_paramType": 0,
"_values": [
4,
192
],
"_distance": 750.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 550.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 942.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1600.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 800.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 810.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 800.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 810.0
},
{
"_paramType": 11,
"_values": [
10000,
350
],
"_distance": 250.0
},
{
"_paramType": 11,
"_values": [
-15000,
300
],
"_distance": 600.0
}
]
}
+88
View File
@@ -0,0 +1,88 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
200
],
"_distance": 750.0
},
{
"_paramType": 0,
"_values": [
4,
192
],
"_distance": 950.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 750.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1142.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1800.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1000.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1010.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1000.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1010.0
},
{
"_paramType": 11,
"_values": [
10000,
350
],
"_distance": 450.0
},
{
"_paramType": 11,
"_values": [
-15000,
300
],
"_distance": 800.0
}
]
}
+104
View File
@@ -0,0 +1,104 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
200
],
"_distance": 420.0
},
{
"_paramType": 0,
"_values": [
2,
200
],
"_distance": 620.0
},
{
"_paramType": 0,
"_values": [
3,
200
],
"_distance": 1250.0
},
{
"_paramType": 0,
"_values": [
4,
192
],
"_distance": 1450.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 420.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 820.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1250.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1642.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2000.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1525.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1535.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1525.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1535.0
}
]
}
+88
View File
@@ -0,0 +1,88 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
200
],
"_distance": 950.0
},
{
"_paramType": 0,
"_values": [
4,
192
],
"_distance": 1150.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 950.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1342.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2000.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1200.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1210.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1200.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1210.0
},
{
"_paramType": 11,
"_values": [
-15000,
300
],
"_distance": 1000.0
},
{
"_paramType": 11,
"_values": [
10000,
350
],
"_distance": 650.0
}
]
}
+104
View File
@@ -0,0 +1,104 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
200
],
"_distance": 650.0
},
{
"_paramType": 0,
"_values": [
2,
200
],
"_distance": 850.0
},
{
"_paramType": 0,
"_values": [
3,
200
],
"_distance": 1450.0
},
{
"_paramType": 0,
"_values": [
4,
192
],
"_distance": 1650.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 650.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1050.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1450.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1842.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2200.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1725.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1735.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1725.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1735.0
}
]
}
+104
View File
@@ -0,0 +1,104 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
200
],
"_distance": 810.0
},
{
"_paramType": 0,
"_values": [
2,
200
],
"_distance": 1010.0
},
{
"_paramType": 0,
"_values": [
3,
200
],
"_distance": 1650.0
},
{
"_paramType": 0,
"_values": [
4,
192
],
"_distance": 1850.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 810.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1210.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1650.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 2042.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2400.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1925.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1935.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1925.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1935.0
}
]
}
+86
View File
@@ -0,0 +1,86 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
160
],
"_distance": 540.0
},
{
"_paramType": 0,
"_values": [
4,
147
],
"_distance": 700.0
},
{
"_paramType": 1,
"_values": [
1
],
"_distance": 0.0
},
{
"_paramType": 1,
"_values": [
2
],
"_distance": 80.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 540.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 847.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1200.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 750.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 760.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 815.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 825.0
}
]
}
+104
View File
@@ -0,0 +1,104 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
160
],
"_distance": 400.0
},
{
"_paramType": 0,
"_values": [
2,
160
],
"_distance": 560.0
},
{
"_paramType": 0,
"_values": [
3,
160
],
"_distance": 1140.0
},
{
"_paramType": 0,
"_values": [
4,
147
],
"_distance": 1300.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 400.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 720.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1140.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1447.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1800.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1350.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1360.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1350.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1360.0
}
]
}
+136
View File
@@ -0,0 +1,136 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
160
],
"_distance": 380.0
},
{
"_paramType": 0,
"_values": [
4,
160
],
"_distance": 540.0
},
{
"_paramType": 0,
"_values": [
1,
160
],
"_distance": 1120.0
},
{
"_paramType": 0,
"_values": [
2,
160
],
"_distance": 1280.0
},
{
"_paramType": 0,
"_values": [
3,
160
],
"_distance": 1850.0
},
{
"_paramType": 0,
"_values": [
4,
160
],
"_distance": 2010.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 380.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 700.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1120.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1440.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1850.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 2170.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2500.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 2050.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 2060.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 2050.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 2060.0
}
]
}
+80
View File
@@ -0,0 +1,80 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
300
],
"_distance": 420.0
},
{
"_paramType": 0,
"_values": [
4,
188
],
"_distance": 720.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 420.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 908.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1200.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 750.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 760.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 748.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 758.0
},
{
"_paramType": 11,
"_values": [
15000,
100
],
"_distance": 180.0
}
]
}
+112
View File
@@ -0,0 +1,112 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
200
],
"_distance": 330.0
},
{
"_paramType": 0,
"_values": [
2,
200
],
"_distance": 530.0
},
{
"_paramType": 0,
"_values": [
3,
300
],
"_distance": 1020.0
},
{
"_paramType": 0,
"_values": [
4,
188
],
"_distance": 1320.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 330.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 730.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1020.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1508.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1800.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1350.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1360.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1350.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1360.0
},
{
"_paramType": 11,
"_values": [
15000,
100
],
"_distance": 780.0
}
]
}
+112
View File
@@ -0,0 +1,112 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
200
],
"_distance": 530.0
},
{
"_paramType": 0,
"_values": [
2,
200
],
"_distance": 730.0
},
{
"_paramType": 0,
"_values": [
3,
300
],
"_distance": 1220.0
},
{
"_paramType": 0,
"_values": [
4,
188
],
"_distance": 1520.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 530.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 930.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1220.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1708.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2000.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1550.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1560.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1550.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1560.0
},
{
"_paramType": 11,
"_values": [
15000,
100
],
"_distance": 980.0
}
]
}
+152
View File
@@ -0,0 +1,152 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
300
],
"_distance": 220.0
},
{
"_paramType": 0,
"_values": [
4,
200
],
"_distance": 520.0
},
{
"_paramType": 0,
"_values": [
1,
200
],
"_distance": 1130.0
},
{
"_paramType": 0,
"_values": [
2,
200
],
"_distance": 1330.0
},
{
"_paramType": 0,
"_values": [
3,
300
],
"_distance": 1820.0
},
{
"_paramType": 0,
"_values": [
4,
188
],
"_distance": 2120.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 220.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 720.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1130.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1530.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1820.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 2308.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2600.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 2150.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 2160.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 2150.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 2160.0
},
{
"_paramType": 11,
"_values": [
15000,
80
],
"_distance": 0.0
},
{
"_paramType": 11,
"_values": [
15000,
100
],
"_distance": 1580.0
}
]
}
+86
View File
@@ -0,0 +1,86 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
210
],
"_distance": 500.0
},
{
"_paramType": 0,
"_values": [
4,
145
],
"_distance": 710.0
},
{
"_paramType": 1,
"_values": [
1
],
"_distance": 0.0
},
{
"_paramType": 1,
"_values": [
2
],
"_distance": 110.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 500.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 855.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1150.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 751.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 761.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 751.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 761.0
}
]
}
+132
View File
@@ -0,0 +1,132 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
170
],
"_distance": 360.0
},
{
"_paramType": 0,
"_values": [
2,
170
],
"_distance": 530.0
},
{
"_paramType": 0,
"_values": [
3,
210
],
"_distance": 1050.0
},
{
"_paramType": 0,
"_values": [
4,
145
],
"_distance": 1260.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 360.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 700.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1050.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1405.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1700.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1301.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1311.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1301.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1311.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1301.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1311.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1301.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1311.0
},
{
"_paramType": 11,
"_values": [
-10000,
320
],
"_distance": 285.0
}
]
}
+136
View File
@@ -0,0 +1,136 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
210
],
"_distance": 310.0
},
{
"_paramType": 0,
"_values": [
4,
160
],
"_distance": 520.0
},
{
"_paramType": 0,
"_values": [
1,
170
],
"_distance": 1060.0
},
{
"_paramType": 0,
"_values": [
2,
170
],
"_distance": 1230.0
},
{
"_paramType": 0,
"_values": [
3,
210
],
"_distance": 1750.0
},
{
"_paramType": 0,
"_values": [
4,
145
],
"_distance": 1960.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 310.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 680.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1060.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1400.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1750.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 2105.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2400.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 2001.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 2011.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 2001.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 2011.0
}
]
}
+72
View File
@@ -0,0 +1,72 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
350
],
"_distance": 300.0
},
{
"_paramType": 0,
"_values": [
4,
240
],
"_distance": 650.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 890.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1200.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 700.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 710.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 700.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 710.0
},
{
"_paramType": 11,
"_values": [
-15000,
200
],
"_distance": 0.0
},
{
"_paramType": 11,
"_values": [
20000,
110
],
"_distance": 1025.0
}
]
}
+80
View File
@@ -0,0 +1,80 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
2,
450
],
"_distance": 50.0
},
{
"_paramType": 0,
"_values": [
3,
350
],
"_distance": 700.0
},
{
"_paramType": 0,
"_values": [
4,
240
],
"_distance": 1050.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1290.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1600.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1100.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1110.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1100.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1110.0
},
{
"_paramType": 11,
"_values": [
-15000,
300
],
"_distance": 300.0
},
{
"_paramType": 11,
"_values": [
20000,
110
],
"_distance": 1425.0
}
]
}
+136
View File
@@ -0,0 +1,136 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
250
],
"_distance": 175.0
},
{
"_paramType": 0,
"_values": [
2,
250
],
"_distance": 425.0
},
{
"_paramType": 0,
"_values": [
3,
250
],
"_distance": 1000.0
},
{
"_paramType": 0,
"_values": [
4,
240
],
"_distance": 1250.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 175.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 675.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1000.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1490.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 1800.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1300.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1310.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1300.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1310.0
},
{
"_paramType": 11,
"_values": [
20000,
35
],
"_distance": 1.0
},
{
"_paramType": 11,
"_values": [
15000,
200
],
"_distance": 125.0
},
{
"_paramType": 11,
"_values": [
-15000,
400
],
"_distance": 425.0
},
{
"_paramType": 11,
"_values": [
20000,
110
],
"_distance": 1625.0
}
]
}
+150
View File
@@ -0,0 +1,150 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
250
],
"_distance": 375.0
},
{
"_paramType": 0,
"_values": [
2,
250
],
"_distance": 625.0
},
{
"_paramType": 0,
"_values": [
3,
250
],
"_distance": 1200.0
},
{
"_paramType": 0,
"_values": [
4,
240
],
"_distance": 1450.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 375.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 875.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1200.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1690.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2000.0
},
{
"_paramType": 3,
"_values": [
7000
],
"_distance": 875.0
},
{
"_paramType": 3,
"_values": [
10000
],
"_distance": 1450.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1500.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1510.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1500.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1510.0
},
{
"_paramType": 11,
"_values": [
15000,
200
],
"_distance": 325.0
},
{
"_paramType": 11,
"_values": [
20000,
110
],
"_distance": 125.0
},
{
"_paramType": 11,
"_values": [
-15000,
400
],
"_distance": 625.0
},
{
"_paramType": 11,
"_values": [
20000,
110
],
"_distance": 1825.0
}
]
}
+120
View File
@@ -0,0 +1,120 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
1,
247
],
"_distance": 403.0
},
{
"_paramType": 0,
"_values": [
2,
450
],
"_distance": 650.0
},
{
"_paramType": 0,
"_values": [
3,
350
],
"_distance": 1300.0
},
{
"_paramType": 0,
"_values": [
4,
240
],
"_distance": 1650.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 0.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 403.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 1890.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2200.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 1700.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 1710.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 1700.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 1710.0
},
{
"_paramType": 11,
"_values": [
20000,
110
],
"_distance": 153.0
},
{
"_paramType": 11,
"_values": [
15000,
200
],
"_distance": 353.0
},
{
"_paramType": 11,
"_values": [
-15000,
300
],
"_distance": 900.0
},
{
"_paramType": 11,
"_values": [
20000,
110
],
"_distance": 2025.0
}
]
}
+152
View File
@@ -0,0 +1,152 @@
{
"courseParams": [
{
"_paramType": 0,
"_values": [
3,
146
],
"_distance": 100.0
},
{
"_paramType": 0,
"_values": [
4,
250
],
"_distance": 246.0
},
{
"_paramType": 0,
"_values": [
1,
250
],
"_distance": 875.0
},
{
"_paramType": 0,
"_values": [
2,
250
],
"_distance": 1125.0
},
{
"_paramType": 0,
"_values": [
3,
250
],
"_distance": 1700.0
},
{
"_paramType": 0,
"_values": [
4,
240
],
"_distance": 1950.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 496.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 875.0
},
{
"_paramType": 2,
"_values": [
1,
2
],
"_distance": 1375.0
},
{
"_paramType": 2,
"_values": [
2,
2
],
"_distance": 1700.0
},
{
"_paramType": 2,
"_values": [
1,
1
],
"_distance": 2190.0
},
{
"_paramType": 2,
"_values": [
2,
1
],
"_distance": 2500.0
},
{
"_paramType": 4,
"_values": [],
"_distance": 2000.0
},
{
"_paramType": 5,
"_values": [],
"_distance": 2010.0
},
{
"_paramType": 8,
"_values": [],
"_distance": 2000.0
},
{
"_paramType": 9,
"_values": [],
"_distance": 2010.0
},
{
"_paramType": 11,
"_values": [
20000,
110
],
"_distance": 621.0
},
{
"_paramType": 11,
"_values": [
15000,
200
],
"_distance": 825.0
},
{
"_paramType": 11,
"_values": [
-15000,
400
],
"_distance": 1125.0
},
{
"_paramType": 11,
"_values": [
20000,
110
],
"_distance": 2325.0
}
]
}

Some files were not shown because too many files have changed in this diff Show More