interfaces.d.ts 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  1. declare module "twine-sugarcube" {
  2. export interface SugarCubeSetupObject {
  3. Action: { new(parameter?:any): Action };
  4. Appearance: { new(playerCharacter: PlayerCharacter): Appearance };
  5. BodyDescription: { new(character:Character): BodyDescription };
  6. Consumable: { new(): Consumable };
  7. Drugs: { new(): Drugs };
  8. Events: { new(): Events };
  9. GameTime: { new(): GameTime };
  10. Inventory: { new(): Inventory };
  11. Location:{ new(): GameLocation };
  12. LocationIdentifier:{ new(): LocationIdentifier };
  13. LocationTravelRequest:{ new(destination:LocationIdentifier,from:LocationIdentifier,time:number): LocationTravelRequest };
  14. Mood: { new(): Mood };
  15. Moodlet: { new(): Moodlet };
  16. MoodletGroup: { new(): MoodletGroup };
  17. NPCAccessor:{ new(): NPCAccessor };
  18. OutfitItem: { new(): OutfitItem };
  19. Pain: { new(): Pain };
  20. PersonalityScale: { new(): PersonalityScale };
  21. PlayerCharacter: { new(): PlayerCharacter };
  22. Quest: {
  23. handler: object; new(questId?: any): Quest
  24. };
  25. QuestsDict: { new(): QuestsDict };
  26. Skill: { new(): Skill };
  27. VersionControl: { new(): VersionControl };
  28. //#region Listeners
  29. listeners_timeUpdate:{[key: string]: (minutes:number)=>void};
  30. //#endregion
  31. actionTemplates:{[key: string]: ActionTemplate;}
  32. activeEffects:{[key: string]: ActiveEffect;}
  33. appearanceModificators: { [key: string]: AppearanceModificatorDefinition; };
  34. bodypart: { [key: string]: BodypartDefinition;}
  35. consumables: { [key: string]: ConsumableDefinition;}
  36. deco: { [key: string]: { [key: string]: any; }}
  37. drugs: { [key: string]: DrugDefinition}
  38. effects: { [key: string]: Effect;}
  39. consumableMenus:{ [key: string]: ConsumableMenuDefinition}
  40. items: { [key: string]: ItemDefinition; };
  41. jobs: { [key: string]: JobDefinition};
  42. locations: { [key: string]: LocationDefinition; };
  43. moodlets: { [key: string]: Moodlet; };
  44. moodletGroups: { [key: string]: MoodletGroup; };
  45. npcs:{ [key: string]: NPCDefinition; };
  46. npcDefaults:{ [key: string]: NPCDefaultDefinition; };
  47. npcGenerators:{[key:string]: (flags:NPCGenerateOptions)=>NPCGenerateOptions};
  48. npcImages:{[key:string]: NPCImageDefinition};
  49. npcPreferences:{ [key: string]: NPCPreferenceDefinition; };
  50. outfits: { [key: string]: OutfitDefinition; };
  51. outfitsDefaults: {[key: string]: {[key: string]: any; } };
  52. outfitItemImagePath: {[key: string]: string | {[key: string]: any; } };
  53. painReasons: {[key: string]: PainReasonDefinition}
  54. personalityScales: {[key: string]: PersonalityScaleDefinition};
  55. skills: { [key: string]: SkillDefinition; };
  56. startingCharacters: {[key: string]: StartCharacterDefinition};
  57. connectedLocationAdd:(label:string,destination:LocationIdentifier,duration:number,image:string,content:string,flags:ConnectedLocationFlags)=>void;
  58. connectionExecute:(connectedLocation:ConnectedLocation)=>string;
  59. crimeLikelihood: (crimeId:string,location:LocationIdentifier)=>number;
  60. durationToString: any;
  61. executeActionOfIndex:(index:number)=>void;
  62. executeConnectedLocationByHotkey:(hotkey:string)=>void;
  63. executeConnectedLocationOfIndex:(index:number)=>void;
  64. executeESCLocation:()=>void;
  65. filterDict:<T extends {}>(obj:T,filter: Filter) => T;
  66. func: (passage: string, ...arguments: Array<string|number>)=>any;
  67. generateNPC:(dict:NPCsDict,purpose:string,flags:NPCGenerateOptions)=>NPC;
  68. getActionTemplate:(id:string)=>ActionTemplate;
  69. getBodyparts:()=> {[key: string]:BodypartDefinition };
  70. getBodypart:(bodypartId:string)=>BodypartDefinition;
  71. getConsumable: (type:string)=>{ [key: string]: any; };
  72. getConsumableMenu: (id:string)=>ConsumableMenuDefinition;
  73. getDeco: (type:string,position:string,id:number|string)=>{ [key: string]: any; };
  74. getDrug: (type:string)=>DrugDefinition;
  75. getDecoPosition: (type:string,position:string) => { [key: string]: any; }
  76. getDecoPositions: (type:string)=>string[];
  77. getEffect: (type:string)=>Effect;
  78. getGenericActionApplied:(actionId:string)=>any;
  79. getLocation: (locationId: string)=>LocationDefinition;
  80. getNPCPreference:(preferenceId:string)=>NPCPreferenceDefinition;
  81. getRandomNpcImage:(filters:{[key:string]:any})=>NPCImageDefinition;
  82. getStartingCharacter: (type:string)=>StartCharacterDefinition;
  83. getStartingCharactersByFilter: (filters:{},shallow:boolean)=>{};
  84. hasBodypart:(bodypartId:string)=>boolean;
  85. makeSVG: (tag:string, attrs:any,innerHTML?:string|number|undefined) => SVGElement;
  86. mediaPath(rawPath:string):string;
  87. mediaPathImage(rawPath:string):string;
  88. mergeDeep: (target:any, ...sources:any) => any;
  89. randomName: (type:string)=>string;
  90. startingCharacterApply:(id:string)=>void;
  91. startingCharacterTagsIncludes:(tag:string)=>boolean;
  92. tooltip:(elSelector:string, contentSelector:string)=>void;
  93. travel:(travelRequest:LocationTravelRequest)=>void;
  94. dailySVars:any;
  95. /**
  96. * Executes events in priority-order and according to their weight.
  97. *
  98. * Each event can end the execution of the events coming behind it. In this case, the `exitCode` is `STOPPED_BY_EVENT`. Default passage rendering should be omitted then.
  99. *
  100. * @type {(events:PrioritizedEventDict)=>{exitCode:EEventsExecuteExitCode,contents:string}}
  101. */
  102. eventsExecute:(events:PrioritizedEventDict)=>{exitCode:EEventsExecuteExitCode,contents:string,actions:Action[]};
  103. eventsGet:(tags:string|string[])=>PrioritizedEventDict;
  104. gt:(...args:any)=>void;
  105. /**
  106. * Returns whether the place the playercharacter currently is at has internet access.
  107. * @returns {boolean}
  108. */
  109. hasInternet(): boolean;
  110. navigationOverride:(destinationPassageName:string)=>string;
  111. recursionCounterGT:number[];
  112. settingsApply:(settings: any)=>void;
  113. tooltipCounter:number;
  114. wardrobeSettings:WardrobeSettings;
  115. weekDayIntToString: any;
  116. worldSettings:any;
  117. isWebVersion:boolean;
  118. difficultyOfHighHeels(shoes?: OutfitItemShoes,levelCategory?:number):ESkillDifficulty
  119. skillHistoryDrawGraph(domElementId:string,skillID:string):void;
  120. appearanceFunctions:{
  121. current: {[key:string]: (pc:PlayerCharacter) => string};
  122. lasting: {[key:string]: (pc:PlayerCharacter) => string};
  123. genetic: {[key:string]: (pc:PlayerCharacter) => string};
  124. }
  125. wardrobeWearableFunctions:{[key:string]:((outfitOwned:OutfitOwned)=>string|null)};
  126. }
  127. export interface SugarCubeStoryVariables {
  128. events: Events;
  129. finances: any;
  130. housing:any;
  131. inventory: Inventory;
  132. jobs: any;
  133. location: GameLocation;
  134. npcs:NPCsDict;
  135. pc: PlayerCharacter;
  136. q: QuestsDict;
  137. settings:any;
  138. startCharacter: string;
  139. time: GameTime;
  140. wardrobe:Wardrobe;
  141. actions:{[actionId:string]:{cooldownEnd:number}}
  142. ARGS: Array<string>;
  143. connectedLocations: ConnectedLocation[];
  144. /**
  145. * The location to go back to once an event has fired.
  146. *
  147. * @type {LocationIdentifier}
  148. */
  149. eventReturnLocation: LocationIdentifier;
  150. here: string;
  151. location_var: object;
  152. locationTravelRequest?:LocationTravelRequest;
  153. media_path: string;
  154. modVars:any;
  155. quest: (id:string)=>Quest;
  156. result: number | string;
  157. /**
  158. * The version of the game. Format is xxxxxxx.xx.xx.
  159. * @type {number}
  160. * @example
  161. * version = 10345; //1.3.45
  162. */
  163. version: number;
  164. callStack: [string,number][];
  165. }
  166. export interface SugarCubeTemporaryVariables{
  167. actions:Action[];
  168. temporaryEvents:PrioritizedEventDict;
  169. thisMainPassage:string;
  170. }
  171. }
  172. declare global {
  173. export interface Array<T>{
  174. getRandomWeighted(): T;
  175. fancyMathEvaluate(): number;
  176. filterByObject(filter: object): Array<T>;
  177. isConsecutive(stepSize?:number): boolean;
  178. sortByPriority(): Array<T>;
  179. }
  180. interface Date{
  181. format: (formatString:string)=>string;
  182. /**
  183. * Returns whether the date lies in the future according to the game-time. Returns false if the given time is now. Returns true if gametime is not initialized.
  184. * @type {()=>boolean}
  185. */
  186. isFuture: ()=>boolean;
  187. }
  188. interface Math {
  189. /**
  190. * Rounds to the higher number if positive, to the lower number if negative.
  191. * @type {(n:number)=>number}
  192. */
  193. ceilAbs: (n:number)=>number;
  194. logBase: (n:number, base:number)=>number;
  195. }
  196. export interface Number{
  197. roundToDecimal:(decimalPlaces:number)=>number;
  198. toBoolean:()=>boolean;
  199. }
  200. export interface String{
  201. formatUnicorn(format:{}):string;
  202. removeLeading(leading:string):string;
  203. toBoolean():boolean;
  204. }
  205. export class Util{
  206. static slugify(s:string): string;
  207. }
  208. export interface Window{
  209. rand(x:number,y:number): number;
  210. NPCsDict: { new(): NPCsDict };
  211. Wardrobe: { new(): Wardrobe };
  212. }
  213. export interface ActFlags{
  214. /**
  215. * Overwrite the label in the action bar
  216. * @type {?string}
  217. */
  218. ab_label?:string;
  219. /**
  220. * What's that again?
  221. * @todo
  222. * @type {?string}
  223. */
  224. action?:string;
  225. /**
  226. * Minimum required arousal
  227. * @type {?number}
  228. */
  229. arousal?:number;
  230. /**
  231. * Overwrite contents
  232. * @type {?string}
  233. */
  234. contents?:string;
  235. contents_header?:string;
  236. contents_footer?:string;
  237. /**
  238. * Captured vars-array (e.g. ['_npcID'])
  239. * @type {?string[]}
  240. */
  241. capture?:string[];
  242. cost?:{both?:number;cash?:number;bank?:number};
  243. /**
  244. * The action is disabled. Show the value as tooltip.
  245. * @type {?string}
  246. */
  247. disabled?:string;
  248. // 'fetish': The action can't be done if you're appalled by this fetish (string or array of strings)
  249. /**
  250. * Don't show this action?
  251. * @type {boolean}
  252. */
  253. hidden?:boolean;
  254. image?:string;
  255. /**
  256. * Label (if not set as arg[0])
  257. * @type {?string}
  258. */
  259. label?:string;
  260. /**
  261. * minium required mood
  262. * @type {?number}
  263. */
  264. mood?:number;
  265. moodlet?:string;
  266. /**
  267. * In case of a string, refers to the field `actions`
  268. * @type {?{
  269. * [personalityId:string]:PersonalityRequirement|string
  270. * }}
  271. */
  272. personality?:{
  273. [personalityId:string]:PersonalityRequirement|string
  274. };
  275. priority?:number;
  276. repeatReset?:{
  277. id?:string;
  278. days?:number;
  279. }
  280. /**
  281. * (e.g. '{intelligence:50}')
  282. * @type {?{[skillId:string]:number}}
  283. */
  284. skillRequirment?:{[skillId:string]:number};
  285. template?:string|string[];
  286. /**
  287. * Added time in minutes. Display the time but don't really add it if negative.
  288. * @type {?number}
  289. */
  290. time?:number;
  291. willpower?:number;
  292. }
  293. type ActionTemplate = (flags:ActFlags)=>ActFlags;
  294. export interface ActiveEffect{
  295. isActive: boolean|((pc:PlayerCharacter)=>boolean);
  296. effect:Effect|string;
  297. }
  298. export interface AppearanceChange{
  299. time: Date;
  300. key: string;
  301. from: any;
  302. to: any;
  303. }
  304. export interface AppearanceModificatorDefinition{
  305. label:string;
  306. desc:string;
  307. /**
  308. * High comes first.
  309. * @type {number}
  310. */
  311. priority?:number;
  312. /**
  313. * Sets the appearance value. Use sparingly.
  314. *
  315. * @type {?number}
  316. */
  317. set?:number;
  318. /**
  319. * Sets the max number the appearance can reach.
  320. * @type {?number}
  321. */
  322. max?:number;
  323. /**
  324. * Sets the min number the appearance can reach.
  325. * @type {?number}
  326. */
  327. min?:number;
  328. /**
  329. * Decreases the appearance by the given number;
  330. * @type {?number}
  331. */
  332. dec?:number;
  333. /**
  334. * Increases the appearance by the given number;
  335. * @type {?number}
  336. */
  337. inc?:number;
  338. }
  339. export interface StartCharacterDefinition{
  340. hidden?:boolean;
  341. /**
  342. * The description that's displayed to the player
  343. * @type {?string}
  344. */
  345. desc?:string
  346. finances?:{
  347. /**
  348. * The starting cash of the character.
  349. * @type {?number}
  350. */
  351. cash?:number
  352. },
  353. housing?:{
  354. home?: string
  355. },
  356. /**
  357. * Obvious things are obvious
  358. * @type {?string}
  359. */
  360. image?:string
  361. /**
  362. * Used internally in `setup.getStartingCharacter`. Don't overwrite.
  363. * @type {?string[]}
  364. */
  365. inheritance?:string[]
  366. items?:{
  367. [key: string]: number | {
  368. generateFunction:string,
  369. generateParameters?:any[]
  370. }
  371. }
  372. /**
  373. * What is displayed to the player
  374. * @type {?string}
  375. */
  376. label?:string
  377. location?:{
  378. [key: string]:{
  379. [key: string]:any
  380. }
  381. }
  382. locationTags?:{
  383. [key: string]:{
  384. [key: string]:any
  385. }
  386. }
  387. npcs?:{
  388. bulk?:{
  389. [key: string]:{
  390. values?:{
  391. rel?:number,
  392. fam?:number
  393. },
  394. filters?:{
  395. [key: string]:any
  396. }
  397. }
  398. }
  399. [key: string]: any
  400. }
  401. /**
  402. * Another character defintion that is to be inherited.
  403. * @type {?string}
  404. */
  405. parent?:string
  406. /**
  407. * Starting values of the PlayerCharacter. Every field of this class can be overwritten.
  408. * @type {?{ [key: string]: any; }}
  409. */
  410. pc?:{ [key: string]: any; }
  411. personality?:{ [key: string]: number; }
  412. quests?:{
  413. [key: string]: boolean;
  414. }
  415. school?:{
  416. [key: string]: any;
  417. }
  418. skills?:{
  419. [key: string]: number;
  420. }
  421. /**
  422. * Categories of the starting character.
  423. * @type {string[]}
  424. */
  425. tags?:string[]
  426. time?: any;
  427. traits?:{
  428. [key: string]: number;
  429. }
  430. wardrobe?:{
  431. itemsByFilter?:{
  432. [key: string]:{
  433. filters?:{
  434. [key: string]:any;
  435. };
  436. count?: number;
  437. action?: 'add'|'wear';
  438. }
  439. },
  440. items?:{
  441. [key: string]:'add'|'wear';
  442. }
  443. };
  444. }
  445. export interface BodypartDefinition{
  446. id?:string;
  447. /**
  448. * Name of another bodypart this bodypart is a synonym for.
  449. * @type {?string}
  450. */
  451. synonymFor?:string;
  452. /**
  453. * Is this bodypart inside the body? Default: false.
  454. * @type {?boolean}
  455. */
  456. inside?:boolean;
  457. covered?:boolean|((pc:PlayerCharacter) => boolean);
  458. /**
  459. * Which activities clean this bodypart.
  460. * @type {string[]}
  461. */
  462. clean?:string[];
  463. cumDisabled?:boolean;
  464. painDisabled?:boolean;
  465. label?:string;
  466. painDesc?:string;
  467. }
  468. export interface Character{
  469. eyecolor:EEyeColor;
  470. eyesize:EEyeSize;
  471. hairColor:EHairColor;
  472. hairLengthCategory:EHairLength;
  473. }
  474. export interface ConnectedLocation{
  475. forPassage : string,
  476. destination: LocationIdentifier,
  477. label: string,
  478. image: string,
  479. duration: number,
  480. class: string,
  481. priority: number,
  482. content: string,
  483. hotkeys: any,
  484. indecencyBlocked?:boolean,
  485. tags?:string[];
  486. capturedVars: {[key:string]:any};
  487. }
  488. export interface ConnectedLocationFlags{
  489. allowedVehicles?:string[];
  490. capture?:string[];
  491. class?:string;
  492. hotkeys?:string[];
  493. indecencyBlocked?:boolean;
  494. priority?:number;
  495. tags?:string[];
  496. }
  497. export interface ConsumableDefinition{
  498. alcohol?:number;
  499. costItems?:string[];
  500. desc?:string;
  501. /**
  502. * Relative calories with 1 being an healthy amount.
  503. * @type {?number}
  504. */
  505. energy?:number;
  506. hunger?: number;
  507. image?: string;
  508. imageRand?: ImageRand;
  509. label?:string;
  510. moodletIds?:string[];
  511. price?: number;
  512. thirst?:number;
  513. /**
  514. * The time it takes to consume.
  515. * @type {number}
  516. */
  517. time:number;
  518. type: 'drink'|'meal'|'candy';
  519. }
  520. export interface ConsumableMenuDefinition{
  521. payment:'cash'|'bank'|'both';
  522. categories:{
  523. [key:string] : {
  524. label:string;
  525. items:{
  526. [key:string] : {
  527. /**
  528. * Overwrites the original items price with a flat number. In case of a function, the original price is taken as input. `Math.round()` is always applied to the result then.
  529. * @type {(number|((n:number)=>number))}
  530. */
  531. price?:number|((n:number)=>number);
  532. }
  533. }
  534. }
  535. }
  536. }
  537. export interface DrugDefinition{
  538. deterioration: number;
  539. effects:{[key: string]:{condition:any; effect:string;}};
  540. byproduct?:DrugByproductDefinition;
  541. /*{
  542. buildup: 1.5,
  543. deterioration: 0.0017,
  544. effects:{
  545. hangover:{
  546. condition:{mainEffectsInactive:true},
  547. effect: 'hangover'
  548. }
  549. }
  550. }*/
  551. }
  552. export interface DrugByproductDefinition extends DrugDefinition{
  553. buildup: number;
  554. }
  555. export interface DrugInCharacter{
  556. vol:number;byproduct?:number;
  557. }
  558. export interface Effect{
  559. /**
  560. * If true, an icon will be displayed in the sidebar. Make sure to specify `desc` and `image` in this case.
  561. * @type {?boolean}
  562. */
  563. sidebar?:boolean;
  564. desc?:string;
  565. image?: string;
  566. /**
  567. * ID of a moodlet that should automatically be enabled while the effect is active.
  568. * @type {string}
  569. */
  570. moodlet?: string;
  571. /**
  572. * Influences variables such as cerebral skill learning. 1 is the default value.
  573. *
  574. * Multiplicative
  575. * @type {number}
  576. */
  577. consciousness?: number;
  578. /**
  579. * Plain reduction of overall pain.
  580. * @type {?number}
  581. */
  582. painReduction?: number;
  583. /**
  584. * Plain increase in pain in bodypart for given reason.
  585. * @type {?{[bodypartId:string]:{[painReasonId:string]:number}}}
  586. */
  587. pain?:{[bodypartId:string]:{[painReasonId:string]:number}};
  588. painGain?:{
  589. [bodypartId:string]:
  590. number
  591. }
  592. painRegen?:{
  593. [bodypartId:string]:
  594. number
  595. }
  596. /**
  597. * Plain increase in skill.
  598. * @type {?{[skillId:string]:number}}
  599. */
  600. skills?:{[skillId:string]:number};
  601. /**
  602. * Percentage of skill gain. 1 is default. 0.9 would be a 10% decrease in skill gain.
  603. * @type {{
  604. * [skillId:string]:number
  605. * }}
  606. */
  607. skillGain?:{
  608. [skillId:string]:number
  609. }
  610. skillTagGain?:{
  611. [tag:string]:number
  612. }
  613. }
  614. export interface ExpiringVar<T>{
  615. val:T;
  616. til:Date;
  617. }
  618. export interface Filter{
  619. }
  620. export interface GameEvent{
  621. priority: number, weight: number, contents: string
  622. }
  623. export interface ImageRand{
  624. }
  625. export interface ItemDefinition{
  626. /**
  627. * An optional description to be displayed to the player.
  628. * @type {?string}
  629. */
  630. desc?: string;
  631. /**
  632. * Information on how the item behaves if used as furniture.
  633. * @type {?object}
  634. */
  635. furniture?:object;
  636. /**
  637. * Path to the image of the item.
  638. * @type {string}
  639. */
  640. image:string;
  641. /**
  642. * The label that's displayed to the player. Defaults to the id of the item.
  643. * @type {?string}
  644. */
  645. label?:string;
  646. /**
  647. * How many items of the same type fit into a purse.
  648. * @type {?number}
  649. */
  650. limit?:number;
  651. /**
  652. * A passage the player is sent to when he clicks the item in the inventory.
  653. * @type {?string}
  654. */
  655. passage?:string;
  656. /**
  657. * Default price.
  658. * @type {?number}
  659. */
  660. price?: number;
  661. }
  662. export interface JobDefinition{
  663. }
  664. export interface LocationDefinition{
  665. openTimes?:TimespanIdentifier;
  666. }
  667. export type NPC = NPCAccessor & Character & {[key:string]:any};
  668. export interface NPCActivity{
  669. location:string;
  670. activity:string[];
  671. }
  672. export interface NPCDefinition{
  673. passage?:string;
  674. image?:string;
  675. rel?:number;
  676. dna?:string;
  677. firstname?:string;
  678. nickname?:string;
  679. lastname?:string;
  680. usedname?:string;
  681. dob?:number;
  682. gender: EGender;
  683. haircol?:number;
  684. height?:number;
  685. notes?:string;
  686. thdick?:string;
  687. dick?:number;
  688. bust?:number;
  689. spermpot?:number;
  690. sexskill?:number;
  691. rep?:number;
  692. intel?:number;
  693. hotcat_rating?:number;
  694. preference?:{[key:string]:NPCPreference};
  695. defaults?:string[];
  696. /**
  697. * Information on where the NPC is and what they do there at a given time.
  698. * @type {?Timetable<NPCActivity>}
  699. */
  700. timetable?:Timetable<NPCActivity>;
  701. }
  702. export interface NPCDefaultDefinition{
  703. }
  704. export interface NPCGenerateOptions {
  705. generators?:string[];
  706. fields?:{gender?:EGender} & {[key:string]:any};
  707. vars?:{[key:string]:any};
  708. }
  709. export interface NPCImageDefinition{
  710. path:string;
  711. age: EAgeBracket;
  712. gender:EGender;
  713. }
  714. export interface NPCPreference{
  715. state: ENPCPreference;
  716. }
  717. export interface NPCPreferenceDefinition{
  718. matches:(pc:PlayerCharacter)=>boolean;
  719. }
  720. export type OutfitDefinition = OutfitDefinitionBodysuit | OutfitDefinitionBra | OutfitDefinitionClothes | OutfitDefinitionCoat | OutfitDefinitionPanties | OutfitDefinitionPurse | OutfitDefinitionShoes | OutfitDefinitionSwimwear;
  721. export interface OutfitDefinitionRaw{
  722. quality: EOutfitQuality;
  723. vendor:string;
  724. index?: number;
  725. description?: string;
  726. /**
  727. * When accessing an Outfit-object, use the getter `image`, since it supports legacy outfits as well.
  728. * @type {?string}
  729. */
  730. imagePath?:string;
  731. }
  732. export interface OutfitDefinitionBodysuit extends OutfitDefinitionRaw{
  733. type:'bodysuit';
  734. subtype?:number;
  735. material?:number;
  736. fun?:number;
  737. thinness?:number;
  738. cover?:number;
  739. coverFront?:number;
  740. coverBack?:number;
  741. }
  742. export interface OutfitDefinitionBra extends OutfitDefinitionRaw{
  743. type:'bra';
  744. subtype?: number;
  745. fun?: number;
  746. thinness?: number;
  747. material?: number;
  748. cover?: number;
  749. }
  750. export interface OutfitDefinitionClothes extends OutfitDefinitionRaw{
  751. type:'clothes';
  752. subtype:string;
  753. thinness: number;
  754. topcut?: number;
  755. includesBra?: number;
  756. includesPanties?: number;
  757. isDress?:number;
  758. isOnepiece?: number;
  759. inhib?: number;
  760. pantsShortness?:number;
  761. skirtShortness?:number;
  762. coverTop?:number;
  763. coverBack?:number;
  764. coverFront?:number;
  765. /**
  766. * 4 seems to be prostitution.
  767. * @type {number}
  768. */
  769. style?: number;
  770. style2?: number;
  771. style3?:number;
  772. bimbo?:number;
  773. }
  774. export interface OutfitDefinitionCoat extends OutfitDefinitionRaw{
  775. type:'coat';
  776. warm:number;
  777. }
  778. export interface OutfitDefinitionPanties extends OutfitDefinitionRaw{
  779. type:'panties';
  780. subtype?: number;
  781. fun?: number;
  782. thinness?: number;
  783. material?: number;
  784. coverBack?:number;
  785. coverFront?:number;
  786. }
  787. export interface OutfitDefinitionPurse extends OutfitDefinitionRaw{
  788. type:'purse';
  789. }
  790. export interface OutfitDefinitionShoes extends OutfitDefinitionRaw{
  791. type:'shoes';
  792. style?:number;
  793. cut?:number;
  794. heels?:number;
  795. }
  796. export interface OutfitDefinitionSwimwear extends OutfitDefinitionRaw{
  797. type:'swimwear';
  798. subtype?:string;
  799. thinness:number;
  800. topcut?:number;
  801. coverTop?:number;
  802. coverFront?:number;
  803. coverBack?:number;
  804. includesBra?:number;
  805. includesPanties:number;
  806. isOnepiece?:number;
  807. bimbo?:number;
  808. inhib:number;
  809. }
  810. export type OutfitOwned = OutfitDefinition & OutfitOwnerShipData;
  811. export interface OutfitOwnerShipData{
  812. h?:number;
  813. l?:number;
  814. bmi?:number;
  815. }
  816. export interface PainReasonDefinition{
  817. /**
  818. * How much the pain deteriorats each hour.
  819. * @type {number}
  820. */
  821. deterioration: number;
  822. label: string;
  823. description:string;
  824. }
  825. export interface PersonalityRequirement{
  826. impact: number|string;
  827. /**
  828. * Costs willpower if you're under the value, but not if you're over it.
  829. * @type {?number}
  830. */
  831. min?:number;
  832. /**
  833. * Costs willpower if you're over the value, but not if you're under it.
  834. * @type {?number}
  835. */
  836. max?:number;
  837. /**
  838. * Costs you willpower if you're under or over the value.
  839. * @type {?number}
  840. */
  841. target?:number;
  842. }
  843. export interface PersonalityScaleDefinition{
  844. /**
  845. * Hide this from the player if true. Will not appear in lists and won't be mentioned in dialogs.
  846. * @type {?boolean}
  847. */
  848. hidden?:boolean;
  849. start: number;
  850. interval: number[];
  851. label: string | string[];
  852. desc?: string;
  853. image?:string;
  854. actions?:{[key:string]:PersonalityRequirement};
  855. impacts?:{[key:string]:number};
  856. msg_tooHigh?:string;
  857. msg_tooLow?:string;
  858. functions?:{[key:string]:(any:any) => any}
  859. }
  860. export interface PrioritizedEventDict{
  861. [priority:number]:GameEvent
  862. }
  863. export interface SexEncounter{
  864. /**
  865. * The ID of the npc Sveta had sex with. If she has sex with more than one character (e.g. threesome) an encounter has to be created for each of them.
  866. * @type {string}
  867. */
  868. npcId: string,
  869. time:Date,
  870. types: ESexEncounterType[],
  871. /**
  872. * Is Sveta aware of the sex-act? False in case of hypnosis, blackouts, etc.
  873. * @type {boolean}
  874. */
  875. aware: boolean,
  876. /*civ: Cum in vagina
  877. civa:Cum in vagina aware*/
  878. tags: string[]
  879. }
  880. export interface SexStatistics{/*
  881. bj:SexStatistic;
  882. hj:SexStatistic;
  883. vaginal:SexStatistic;
  884. anal:SexStatistic;*/
  885. [key:string]: SexStatistic
  886. }
  887. export interface SexStatistic{
  888. /*love:number[];
  889. friend:number[];
  890. acquaintance:number[];
  891. stranger:number[];*/
  892. [key:string]: number[]
  893. }
  894. export interface SkillDefinition{
  895. label ?: string;
  896. description?:string;
  897. descibtionByLevel?:{[key:number]: string};
  898. image?:string;
  899. dailyExpLimit?:number|((levelAtStartOfDay:number)=>number);
  900. /**
  901. * If true, the amount of gained experience depends on the difficulty of a task.
  902. * @type {?boolean}
  903. */
  904. isDifficultyBased?:boolean;
  905. /**
  906. * Hide this skill from players in overviews when set to true.
  907. * @type {?boolean}
  908. */
  909. hidden?: boolean;
  910. /**
  911. * A function that provides a skill level.
  912. * @type {(skillLevel:number)=>number} Experience
  913. */
  914. e2s?: (skillLevel:number)=>number;
  915. /**
  916. * A function that provides a number of required skillpoints.
  917. * @type {(skillLevel:number)=>number} Skill Level
  918. */
  919. s2e?: (skillLevel:number)=>number;
  920. functions?: {[functionId:string]:Function};
  921. vars?:{[key:string]:any};
  922. }
  923. export interface SkillOfCharacter{
  924. /**
  925. * The maximum number the experience can reach. 0 if disabled.
  926. * @type {number}
  927. */
  928. ceil:number;
  929. /**
  930. * Current number of experience points.
  931. * @type {number}
  932. */
  933. experience:number;
  934. /**
  935. * History of this skill for the last days.
  936. * @type {number[]}
  937. */
  938. experienceHistory:number[];
  939. /**
  940. * The minimum number the experience can reach.
  941. * @type {number}
  942. */
  943. floor: number;
  944. /**
  945. * The last daystart this skill has been used.
  946. * @type {number}
  947. */
  948. lastUsed: number;
  949. }
  950. export interface TimespanIdentifier{
  951. days?: ('MO'|'TU'|'WE'|'TH'|'FR'|'SA'|'SU'|'work')[];
  952. daysBL?: ('MO'|'TU'|'WE'|'TH'|'FR'|'SA'|'SU'|'work')[];
  953. /**
  954. * True: The day needs to be a school holiday. False: The day needs to be
  955. * @type {?boolean}
  956. */
  957. holiday?:EDayVacationState;
  958. /*vacation?:boolean;*/
  959. begin?:number[];
  960. end?:number[];
  961. }
  962. export interface Timetable<T>{
  963. [key:string]:{
  964. time: TimespanIdentifier;
  965. result?: T;
  966. subtable?:Timetable<T>;
  967. either?:T[];
  968. }
  969. }
  970. export interface WardrobeSettings{
  971. /**
  972. * Maximum difference of the bmi-value of bought and worn clothes.
  973. * @type {number}
  974. */
  975. bmiSizeMaxDifference: number;
  976. }
  977. export interface WornOutfitDefinition{
  978. bra: string,
  979. coat: string,
  980. clothes: string,
  981. panties: string,
  982. purse: string,
  983. shoes: string
  984. }
  985. }
  986. export { };