Initial commit; some data and basic code
Getty Ritter
11 years ago
1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
2 | Version 2, December 2004 | |
3 | ||
4 | Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> | |
5 | ||
6 | Everyone is permitted to copy and distribute verbatim or modified | |
7 | copies of this license document, and changing it is allowed as long | |
8 | as the name is changed. | |
9 | ||
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
12 | ||
13 | 0. You just DO WHAT THE FUCK YOU WANT TO. |
1 | -- Initial adriatic.cabal generated by cabal init. For further | |
2 | -- documentation, see http://haskell.org/cabal/users-guide/ | |
3 | ||
4 | name: adriatic | |
5 | version: 0.1.0.0 | |
6 | -- synopsis: | |
7 | -- description: | |
8 | -- license: | |
9 | license-file: LICENSE | |
10 | author: Getty Ritter | |
11 | maintainer: gettylefou@gmail.com | |
12 | -- copyright: | |
13 | -- category: | |
14 | build-type: Simple | |
15 | -- extra-source-files: | |
16 | cabal-version: >=1.10 | |
17 | ||
18 | executable adriatic | |
19 | main-is: Adriatic.hs | |
20 | build-depends: base >=4.6 && <4.7, HaTeX, text | |
21 | hs-source-dirs: src | |
22 | default-language: Haskell2010 |
1 | civil: | |
2 | acrobat: #us 93 | |
3 | basic: | |
4 | - balance | |
5 | - footwork | |
6 | footwork: | |
7 | - break fall | |
8 | - circus | |
9 | - contortion | |
10 | - juggling | |
11 | - leaping | |
12 | - lifting | |
13 | - rolling | |
14 | - stunt | |
15 | - swinging | |
16 | archaeologist: # ah 60 | |
17 | arson: # ri 80 | |
18 | alchemy: # sd 84 | |
19 | artist: | |
20 | basic: | |
21 | - composer | |
22 | - drawing | |
23 | - musician | |
24 | - sculpting | |
25 | - singing | |
26 | - writing | |
27 | bard: # av 95 | |
28 | bomb-making: # ri 83 | |
29 | courtesan: # vo 92 | |
30 | courtier: | |
31 | basic: | |
32 | - dancing | |
33 | - etiquette: "-2u if you're in a place with unfamiliar customs." | |
34 | - fashion | |
35 | - etiquette | |
36 | advanced: | |
37 | - diplomacy | |
38 | - gaming | |
39 | - gossip: "Determine which rumors are true or important." | |
40 | - lip reading | |
41 | - mooch | |
42 | - politics | |
43 | - scheming | |
44 | - seduction | |
45 | - sincerity | |
46 | criminal: | |
47 | basic: | |
48 | - gambling: "See GM's guide, pg. 137" | |
49 | - shadowing: "Often c/W." | |
50 | - stealth: "Often c/W." | |
51 | advanced: | |
52 | - ambush: "" # check page 190 | |
53 | - cheating: "See GM's guide, pg. 137" | |
54 | - lockpicking: "See GM's guide, pg. 183" | |
55 | - pickpocket: "Often c/W." | |
56 | - prestidigitation: "Often c/W" | |
57 | - quack: "Fake cures." | |
58 | - scrounging: "Find items without paying." | |
59 | doctor: | |
60 | basic: | |
61 | - diagnosis: "TN is 5+5×# of dramatic wounds; reduced TN for surgery" | |
62 | - first aid: "TN is # of flesh wounds; one raise if used on self" | |
63 | advanced: | |
64 | - dentist: "Professional knack" | |
65 | - examiner | |
66 | - quack | |
67 | - surgery | |
68 | - veterinarian | |
69 | engineer: # ca 93 | |
70 | falconer: # us 94 | |
71 | fence: # ri 84 | |
72 | forger: # ri 85 | |
73 | fortune telling: # us 94 | |
74 | guide: # vo 93 | |
75 | hunter: | |
76 | basic: | |
77 | - fishing | |
78 | - skinning | |
79 | - stealth | |
80 | - survival | |
81 | - tracking | |
82 | - trail signs | |
83 | - traps | |
84 | advanced: | |
85 | - ambush | |
86 | - animal training | |
87 | merchant: | |
88 | basic: | |
89 | - barber | |
90 | - blacksmith | |
91 | - butcher | |
92 | - calligrapher | |
93 | # finish me! | |
94 | advanced: | |
95 | - accounting | |
96 | - appraising | |
97 | - bartending | |
98 | - haggling | |
99 | missionary: # cp 86 | |
100 | monk: # cp 87 | |
101 | performer: | |
102 | basic: | |
103 | - acting | |
104 | - dancing | |
105 | - oratory | |
106 | - singing | |
107 | advanced: | |
108 | - animal training | |
109 | - circus | |
110 | - cold read | |
111 | - disguise | |
112 | - prestidigitation | |
113 | - storytelling | |
114 | politician: # mr 119 | |
115 | priest: # ca 94; cp 85 | |
116 | professor: # ic 80 | |
117 | rahib (priest): # cd 73 | |
118 | riverboat pilot: # en 83 | |
119 | sailor: | |
120 | basic: | |
121 | - balance | |
122 | - climbing | |
123 | - knotwork | |
124 | - rigging | |
125 | advanced: | |
126 | - cartography | |
127 | - leaping | |
128 | - navigation | |
129 | - pilot | |
130 | - sea lore | |
131 | - swimming | |
132 | - weather | |
133 | scholar: | |
134 | basic: | |
135 | - history | |
136 | - mathematics | |
137 | - philosophy | |
138 | - research | |
139 | advanced: | |
140 | - astronomy | |
141 | - law | |
142 | - natural philosophy | |
143 | - occult | |
144 | - theology | |
145 | servant: | |
146 | basic: | |
147 | - etiquette | |
148 | - fashion | |
149 | - menial tasks | |
150 | - unobtrusive | |
151 | advanced: | |
152 | - accounting | |
153 | - drive carriage | |
154 | - gossip | |
155 | - haggling | |
156 | - seneschal | |
157 | - valet | |
158 | shirbaz (magician): # ce 72 | |
159 | skald: # vv 90 | |
160 | spy: # also us 96 | |
161 | basic: | |
162 | - shadowing | |
163 | - stealth | |
164 | advanced: | |
165 | - bribery | |
166 | - conceal | |
167 | - cryptography | |
168 | - disguise | |
169 | - forgery | |
170 | - hand signs | |
171 | - interrogation | |
172 | - lip reading | |
173 | - poison | |
174 | - sincerity | |
175 | streetwise: # pg 144 | |
176 | teacher: # sg 83 | |
177 | urchin: # en 84 | |
178 | whaler: # pn 100; vv 91; wob 107 | |
179 | martial: | |
180 | archery: | |
181 | basic: | |
182 | - attack (bow) | |
183 | - fletcher | |
184 | advanced: | |
185 | - horse archery | |
186 | - snapshot | |
187 | - trick shot | |
188 | athlete: | |
189 | basic: | |
190 | - climbing | |
191 | - footwork | |
192 | - sprinting | |
193 | - throwing | |
194 | advanced: | |
195 | - break fall | |
196 | - leaping | |
197 | - long distance running | |
198 | - lifting | |
199 | - rolling | |
200 | - swimming | |
201 | - swinging | |
202 | - side-step | |
203 | buckler: | |
204 | basic: | |
205 | - parry (buckler) | |
206 | advanced: | |
207 | - attack (buckler) | |
208 | captain: # PN 99 | |
209 | basic: | |
210 | - strategy | |
211 | - tactics | |
212 | advanced: | |
213 | - ambush | |
214 | - bribery | |
215 | - cartography | |
216 | - diplomacy | |
217 | - gunnery | |
218 | - incitation | |
219 | - leadership | |
220 | - logistics | |
221 | cloak: # 95 | |
222 | basic: | |
223 | - parry (cloack) | |
224 | advanced: | |
225 | - entangle | |
226 | commander: | |
227 | basic: | |
228 | - strategy | |
229 | - tactics | |
230 | advanced: | |
231 | - ambush | |
232 | - artillery | |
233 | - cartography | |
234 | - diplomacy | |
235 | - gunnery | |
236 | - incitation | |
237 | - leadership | |
238 | - logistics | |
239 | crossbow: | |
240 | basic: | |
241 | - attack (crossbow) | |
242 | - fletcher | |
243 | advanced: | |
244 | - reload (crossbow) | |
245 | dirty fighting: | |
246 | basic: | |
247 | - attack (dirty fighting) | |
248 | advanced: | |
249 | - attack (improvised weapon) | |
250 | - eye-gouge | |
251 | - kick | |
252 | - parry (improvised weapon) | |
253 | - throat strike | |
254 | - throw (improvised weapon) | |
255 | fencing: | |
256 | basic: | |
257 | - attack (fencing) | |
258 | - parry (fencing) | |
259 | firearms: | |
260 | basic: | |
261 | - attack (firearm) | |
262 | advanced: | |
263 | - reload (firearm) | |
264 | hand axe: # us 96 | |
265 | basic: | |
266 | - attack (hand axe) | |
267 | - parry (hand axe) | |
268 | heavy weapon: | |
269 | basic: | |
270 | - attack (heavy weapon) | |
271 | - parry (heavy weapon) | |
272 | knife: | |
273 | basic: | |
274 | - attack (knife) | |
275 | - parry (knife) | |
276 | advanced: | |
277 | - throw (knife) | |
278 | panzerhand: | |
279 | basic: | |
280 | - attack (panzerhand) | |
281 | - parry (panzerhand) | |
282 | advanced: | |
283 | - uppercut | |
284 | polearm: | |
285 | basic: | |
286 | - attack (polearm) | |
287 | - parry (polearm) | |
288 | advanced: | |
289 | - set defense | |
290 | pugilism: | |
291 | basic: | |
292 | - attack (pugilism) | |
293 | - footwork | |
294 | - jab | |
295 | advanced: | |
296 | - ear clap | |
297 | - uppercut | |
298 | rider: | |
299 | basic: | |
300 | - ride | |
301 | advanced: | |
302 | - animal training | |
303 | - mounting | |
304 | - trick riding | |
305 | shield: # us 96 | |
306 | basic: | |
307 | - parry (shield) | |
308 | advanced: | |
309 | - attack (shield) | |
310 | sling: # ce 74 | |
311 | basic: | |
312 | - attack (sling) | |
313 | advanced: | |
314 | - snapshot (sling) | |
315 | - trick shooting (sling) | |
316 | staff: #? | |
317 | basic: | |
318 | - attack (staff) | |
319 | - parry (staff) | |
320 | wrestling: | |
321 | basic: | |
322 | - grapple | |
323 | advanced: | |
324 | - bear hug | |
325 | - escape | |
326 | - head butt | |
327 | waylay: # lv 81 | |
328 | basic: | |
329 | - lie in wait | |
330 | - set traps | |
331 | - shadowing | |
332 | advanced: | |
333 | - ambush | |
334 | - camouflage | |
335 | - land on target | |
336 | - snatch and grap | |
337 | whip: # ca 95 | |
338 | basic: | |
339 | - attack (whip) | |
340 | sorcery: | |
341 | glamour: | |
342 | el fuego adentro: | |
343 | duman'kir: | |
344 | zerstorung: | |
345 | porte: | |
346 | pyeryem: | |
347 | laerdom: | |
348 | sorte: | |
349 | nacht: | |
350 | af'a: | |
351 | scrying (female): | |
352 | scrying (male): | |
353 | druid (gesa): | |
354 | opah: | |
355 | combat schools: | |
356 | avalon: | |
357 | Andrews: | |
358 | Donovan: | |
359 | Finnegan: | |
360 | Goodfellow: | |
361 | MacDonald: | |
362 | Robertson: | |
363 | castille: | |
364 | Aldana: | |
365 | Gallegos: | |
366 | Gustavo: | |
367 | Soldano: | |
368 | Torres: | |
369 | Zepeda: | |
370 | crescent empire: | |
371 | Daphan: | |
372 | Marikk: | |
373 | Sersemlik: | |
374 | Vihiy: | |
375 | Yael: | |
376 | eisen: | |
377 | Drexel: | |
378 | Durchsetzungburg: | |
379 | Eisenfaust: | |
380 | Gelingen: | |
381 | Hopken: | |
382 | Loring: | |
383 | Posen: | |
384 | Steil: | |
385 | Unabwendbar: | |
386 | montaigne: | |
387 | Boucher: | |
388 | Gaulle: | |
389 | Rois et Reines: | |
390 | Tout Pres: | |
391 | Valroux: | |
392 | ussura: | |
393 | Bogatyr: | |
394 | Buslayevich: | |
395 | Dobrynya: | |
396 | vendel: | |
397 | Halfdansson: | |
398 | Kjemper: | |
399 | Larsen: | |
400 | Leegstra: | |
401 | Rasmussen: | |
402 | Siggursdottir: | |
403 | Snedig: | |
404 | Swanson: | |
405 | Urosifter: | |
406 | vodacce: | |
407 | Ambrogia: | |
408 | Bernoulli: | |
409 | Capputina: | |
410 | Lucani: | |
411 | Villanova: | |
412 | etc: | |
413 | Rogers: | |
414 | The Friars: | |
415 | Rossini: | |
416 | Sword of Solomon: | |
417 | Mortis: | |
418 | Shield Man: | |
419 | Bonita: | |
420 | El Punal Occulto: | |
421 | Quinn: | |
422 | Qor'qunq: | |
423 | Vipera ex Morsi: | |
424 | Desaix: | |
425 | Necare: | |
426 | equipment: | |
427 | fist: | |
428 | damage: "0k1" | |
429 | adaga: | |
430 | damage: "1k2/2k2" | |
431 | axe, battle: | |
432 | damage: "3k2" | |
433 | bayonet: | |
434 | damage: "3k2" | |
435 | boar spear: | |
436 | damage: "1k2" | |
437 | bow, standard: | |
438 | damage: "2k2" | |
439 | reload: 1 action | |
440 | bow, long: | |
441 | damage: "2k2" | |
442 | reload: 1 action | |
443 | broadsword: | |
444 | damage: "3k2" | |
445 | buckler: | |
446 | damage: "1k1" | |
447 | claymore: | |
448 | damage: "4k2" | |
449 | crossbow: | |
450 | damage: "2k3" | |
451 | reload: 6 actions | |
452 | cutlass: | |
453 | damage: "3k2" | |
454 | dilmekiri: | |
455 | damage: "3k2" | |
456 | fencing sword: | |
457 | damage: "2k2" | |
458 | harpoon: | |
459 | damage: "3k2" | |
460 | heavy weapon: | |
461 | damage: "3k2" | |
462 | hand axe: | |
463 | damage: "2k2" | |
464 | katar: | |
465 | damage: "2k2" | |
466 | knife: | |
467 | damage: "1k2" | |
468 | knife, throwing: | |
469 | damage: "1k1" | |
470 | main-gauche: | |
471 | damage: "1k2" | |
472 | manople: | |
473 | damage: "2k2" | |
474 | musket: | |
475 | damage: "5k3" | |
476 | reload: 30 actions | |
477 | panzerhand: | |
478 | damage: "0k2" | |
479 | pistol: | |
480 | damage: "4k3" | |
481 | reload: 20 actions | |
482 | pole-arm: | |
483 | damage: "2k2" | |
484 | scimitar: | |
485 | damage: "2k2" | |
486 | shield: | |
487 | damage: "1k1" | |
488 | sling: | |
489 | damage: "1k2" | |
490 | reload: 1 action | |
491 | stiletto: | |
492 | damage: "0k2" | |
493 | whip: | |
494 | damage: "0k1" | |
495 | zweihander: | |
496 | damage: "3k3" |
1 | {-# LANGUAGE OverloadedStrings #-} | |
2 | ||
3 | import Data.Monoid | |
4 | import qualified Data.Text as T | |
5 | import qualified Data.Text.IO as T | |
6 | import Text.LaTeX | |
7 | ||
8 | samp :: LaTeX | |
9 | samp = documentclass [] article | |
10 | <> raw "foo " <> textit "bar" <> raw " baz" | |
11 | ||
12 | main :: IO () | |
13 | main = do | |
14 | T.putStrLn (render samp) | |
15 | return () |
1 | {-# LANGUAGE OverloadedStrings #-} | |
2 | {-# LANGUAGE TypeSynonymInstances #-} | |
3 | {-# LANGUAGE FlexibleInstances #-} | |
4 | {-# LANGUAGE RecordWildCards #-} | |
5 | ||
6 | import qualified Data.HashMap.Strict as HM | |
7 | import Data.List (intersperse) | |
8 | import Data.Text (Text) | |
9 | import Data.Yaml | |
10 | import Text.LaTeX | |
11 | ||
12 | class ToTex a where | |
13 | toTex :: a -> LaTeX | |
14 | ||
15 | instance ToTex a => ToTex [a] where | |
16 | toTex = mconcat . map toTex | |
17 | ||
18 | data Skill = Skill | |
19 | { skName :: Text | |
20 | , skBasic :: [Knack] | |
21 | , skAdvanced :: [Knack] | |
22 | } deriving (Eq,Show) | |
23 | ||
24 | data Knack = Knack | |
25 | { knName :: Text | |
26 | , knDescription :: Maybe Text | |
27 | } deriving (Eq,Show) | |
28 | ||
29 | instance FromJSON [Skill] where | |
30 | parseJSON (Object os) = mapM getSkill (HM.toList os) | |
31 | where getSkill :: (Text, Value) -> Parser Skill | |
32 | getSkill (skName, Object os) = do | |
33 | basic <- os .:? "basic" | |
34 | advanced <- os .:? "advanced" | |
35 | skBasic <- maybe (return []) (mapM getKnack) basic | |
36 | skAdvanced <- maybe (return []) (mapM getKnack) advanced | |
37 | return Skill { .. } | |
38 | getSkill (name, Null) = return (Skill name [] []) | |
39 | getSkill _ = return (Skill "???" [] []) | |
40 | getKnack :: Value -> Parser Knack | |
41 | getKnack (String name) = return (Knack name Nothing) | |
42 | getKnack (Object os) = | |
43 | case HM.toList os of | |
44 | [(name, String desc)] -> return (Knack name (Just desc)) | |
45 | _ -> fail "mal-formatted knack" | |
46 | getKnack _ = fail "knack neither string nor object" | |
47 | parseJSON _ = fail "skills not object" | |
48 | ||
49 | instance ToTex Skill where | |
50 | toTex Skill { .. } = tabular Nothing [LeftColumn, LeftColumn] table | |
51 | where table = raw skName & contents | |
52 | contents = mconcat (intersperse newline (map go skBasic)) | |
53 | <> mconcat (intersperse newline (map go skAdvanced)) | |
54 | go (Knack name Nothing) = raw name | |
55 | go (Knack name (Just desc)) = raw name <> textit (raw desc) |