interfaces.d.ts 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241
  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)=>string;
  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. quest: (id:string)=>Quest;
  155. result: number | string;
  156. /**
  157. * The version of the game. Format is xxxxxxx.xx.xx.
  158. * @type {number}
  159. * @example
  160. * version = 10345; //1.3.45
  161. */
  162. version: number;
  163. callStack: [string,number][];
  164. }
  165. export interface SugarCubeTemporaryVariables{
  166. actions:Action[];
  167. temporaryEvents:PrioritizedEventDict;
  168. thisMainPassage:string;
  169. }
  170. }
  171. declare global {
  172. export interface Array<T>{
  173. fancyMathEvaluate(): number;
  174. filterByObject(filter: object): Array<T>;
  175. isConsecutive(stepSize?:number): boolean;
  176. sortByPriority(): Array<T>;
  177. }
  178. interface Date{
  179. format: (formatString:string)=>string;
  180. /**
  181. * 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.
  182. * @type {()=>boolean}
  183. */
  184. isFuture: ()=>boolean;
  185. }
  186. interface Math {
  187. /**
  188. * Rounds to the higher number if positive, to the lower number if negative.
  189. * @type {(n:number)=>number}
  190. */
  191. ceilAbs: (n:number)=>number;
  192. logBase: (n:number, base:number)=>number;
  193. }
  194. export interface Number{
  195. roundToDecimal:(decimalPlaces:number)=>number;
  196. toBoolean:()=>boolean;
  197. }
  198. export interface String{
  199. formatUnicorn(format:{}):string;
  200. removeLeading(leading:string):string;
  201. toBoolean():boolean;
  202. }
  203. export class Util{
  204. static slugify(s:string): string;
  205. }
  206. export interface Window{
  207. rand(x:number,y:number): number;
  208. NPCsDict: { new(): NPCsDict };
  209. Wardrobe: { new(): Wardrobe };
  210. }
  211. export interface ActFlags{
  212. /**
  213. * Overwrite the label in the action bar
  214. * @type {?string}
  215. */
  216. ab_label?:string;
  217. /**
  218. * What's that again?
  219. * @todo
  220. * @type {?string}
  221. */
  222. action?:string;
  223. /**
  224. * Minimum required arousal
  225. * @type {?number}
  226. */
  227. arousal?:number;
  228. /**
  229. * Overwrite contents
  230. * @type {?string}
  231. */
  232. contents?:string;
  233. contents_header?:string;
  234. contents_footer?:string;
  235. /**
  236. * Captured vars-array (e.g. ['_npcID'])
  237. * @type {?string[]}
  238. */
  239. capture?:string[];
  240. cost?:{both?:number;cash?:number;bank?:number};
  241. /**
  242. * The action is disabled. Show the value as tooltip.
  243. * @type {?string}
  244. */
  245. disabled?:string;
  246. // 'fetish': The action can't be done if you're appalled by this fetish (string or array of strings)
  247. /**
  248. * Don't show this action?
  249. * @type {boolean}
  250. */
  251. hidden?:boolean;
  252. image?:string;
  253. /**
  254. * Label (if not set as arg[0])
  255. * @type {?string}
  256. */
  257. label?:string;
  258. /**
  259. * minium required mood
  260. * @type {?number}
  261. */
  262. mood?:number;
  263. moodlet?:string;
  264. /**
  265. * In case of a string, refers to the field `actions`
  266. * @type {?{
  267. * [personalityId:string]:PersonalityRequirement|string
  268. * }}
  269. */
  270. personality?:{
  271. [personalityId:string]:PersonalityRequirement|string
  272. };
  273. priority?:number;
  274. repeatReset?:{
  275. id?:string;
  276. days?:number;
  277. }
  278. /**
  279. * (e.g. '{intelligence:50}')
  280. * @type {?{[skillId:string]:number}}
  281. */
  282. skillRequirment?:{[skillId:string]:number};
  283. template?:string|string[];
  284. /**
  285. * Added time in minutes. Display the time but don't really add it if negative.
  286. * @type {?number}
  287. */
  288. time?:number;
  289. willpower?:number;
  290. }
  291. type ActionTemplate = (flags:ActFlags)=>ActFlags;
  292. export interface ActiveEffect{
  293. isActive: boolean|((pc:PlayerCharacter)=>boolean);
  294. effect:Effect|string;
  295. }
  296. export interface AppearanceChange{
  297. time: Date;
  298. key: string;
  299. from: any;
  300. to: any;
  301. }
  302. export interface AppearanceModificatorDefinition{
  303. label:string;
  304. desc:string;
  305. /**
  306. * High comes first.
  307. * @type {number}
  308. */
  309. priority?:number;
  310. /**
  311. * Sets the appearance value. Use sparingly.
  312. *
  313. * @type {?number}
  314. */
  315. set?:number;
  316. /**
  317. * Sets the max number the appearance can reach.
  318. * @type {?number}
  319. */
  320. max?:number;
  321. /**
  322. * Sets the min number the appearance can reach.
  323. * @type {?number}
  324. */
  325. min?:number;
  326. /**
  327. * Decreases the appearance by the given number;
  328. * @type {?number}
  329. */
  330. dec?:number;
  331. /**
  332. * Increases the appearance by the given number;
  333. * @type {?number}
  334. */
  335. inc?:number;
  336. }
  337. export interface StartCharacterDefinition{
  338. hidden?:boolean;
  339. /**
  340. * The description that's displayed to the player
  341. * @type {?string}
  342. */
  343. desc?:string
  344. finances?:{
  345. /**
  346. * The starting cash of the character.
  347. * @type {?number}
  348. */
  349. cash?:number
  350. },
  351. housing?:{
  352. home?: string
  353. },
  354. /**
  355. * Obvious things are obvious
  356. * @type {?string}
  357. */
  358. image?:string
  359. /**
  360. * Used internally in `setup.getStartingCharacter`. Don't overwrite.
  361. * @type {?string[]}
  362. */
  363. inheritance?:string[]
  364. items?:{
  365. [key: string]: number | {
  366. generateFunction:string,
  367. generateParameters?:any[]
  368. }
  369. }
  370. /**
  371. * What is displayed to the player
  372. * @type {?string}
  373. */
  374. label?:string
  375. location?:{
  376. [key: string]:{
  377. [key: string]:any
  378. }
  379. }
  380. locationTags?:{
  381. [key: string]:{
  382. [key: string]:any
  383. }
  384. }
  385. npcs?:{
  386. bulk?:{
  387. [key: string]:{
  388. values?:{
  389. rel?:number,
  390. fam?:number
  391. },
  392. filters?:{
  393. [key: string]:any
  394. }
  395. }
  396. }
  397. [key: string]: any
  398. }
  399. /**
  400. * Another character defintion that is to be inherited.
  401. * @type {?string}
  402. */
  403. parent?:string
  404. /**
  405. * Starting values of the PlayerCharacter. Every field of this class can be overwritten.
  406. * @type {?{ [key: string]: any; }}
  407. */
  408. pc?:{ [key: string]: any; }
  409. personality?:{ [key: string]: number; }
  410. quests?:{
  411. [key: string]: boolean;
  412. }
  413. school?:{
  414. [key: string]: any;
  415. }
  416. skills?:{
  417. [key: string]: number;
  418. }
  419. /**
  420. * Categories of the starting character.
  421. * @type {string[]}
  422. */
  423. tags?:string[]
  424. time?: any;
  425. traits?:{
  426. [key: string]: number;
  427. }
  428. wardrobe?:{
  429. itemsByFilter?:{
  430. [key: string]:{
  431. filters?:{
  432. [key: string]:any;
  433. };
  434. count?: number;
  435. action?: 'add'|'wear';
  436. }
  437. },
  438. items?:{
  439. [key: string]:'add'|'wear';
  440. }
  441. };
  442. }
  443. export interface BodypartDefinition{
  444. id?:string;
  445. /**
  446. * Name of another bodypart this bodypart is a synonym for.
  447. * @type {?string}
  448. */
  449. synonymFor?:string;
  450. /**
  451. * Is this bodypart inside the body? Default: false.
  452. * @type {?boolean}
  453. */
  454. inside?:boolean;
  455. covered?:boolean|((pc:PlayerCharacter) => boolean);
  456. /**
  457. * Which activities clean this bodypart.
  458. * @type {string[]}
  459. */
  460. clean?:string[];
  461. cumDisabled?:boolean;
  462. painDisabled?:boolean;
  463. label?:string;
  464. painDesc?:string;
  465. }
  466. export interface Character{
  467. eyecolor:EEyeColor;
  468. eyesize:EEyeSize;
  469. hairColor:EHairColor;
  470. hairLengthCategory:EHairLength;
  471. }
  472. export interface ConnectedLocation{
  473. forPassage : string,
  474. destination: LocationIdentifier,
  475. label: string,
  476. image: string,
  477. duration: number,
  478. class: string,
  479. priority: number,
  480. content: string,
  481. hotkeys: any,
  482. indecencyBlocked?:boolean,
  483. tags?:string[];
  484. capturedVars: {[key:string]:any};
  485. }
  486. export interface ConnectedLocationFlags{
  487. allowedVehicles?:string[];
  488. capture?:string[];
  489. class?:string;
  490. hotkeys?:string[];
  491. indecencyBlocked?:boolean;
  492. priority?:number;
  493. tags?:string[];
  494. }
  495. export interface ConsumableDefinition{
  496. alcohol?:number;
  497. costItems?:string[];
  498. desc?:string;
  499. /**
  500. * Relative calories with 1 being an healthy amount.
  501. * @type {?number}
  502. */
  503. energy?:number;
  504. hunger?: number;
  505. image?: string;
  506. imageRand?: ImageRand;
  507. label?:string;
  508. moodletIds?:string[];
  509. price?: number;
  510. thirst?:number;
  511. /**
  512. * The time it takes to consume.
  513. * @type {number}
  514. */
  515. time:number;
  516. type: 'drink'|'meal'|'candy';
  517. }
  518. export interface ConsumableMenuDefinition{
  519. payment:'cash'|'bank'|'both';
  520. categories:{
  521. [key:string] : {
  522. label:string;
  523. items:{
  524. [key:string] : {
  525. /**
  526. * 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.
  527. * @type {(number|((n:number)=>number))}
  528. */
  529. price?:number|((n:number)=>number);
  530. }
  531. }
  532. }
  533. }
  534. }
  535. export interface DrugDefinition{
  536. deterioration: number;
  537. effects:{[key: string]:{condition:any; effect:string;}};
  538. byproduct?:DrugByproductDefinition;
  539. /*{
  540. buildup: 1.5,
  541. deterioration: 0.0017,
  542. effects:{
  543. hangover:{
  544. condition:{mainEffectsInactive:true},
  545. effect: 'hangover'
  546. }
  547. }
  548. }*/
  549. }
  550. export interface DrugByproductDefinition extends DrugDefinition{
  551. buildup: number;
  552. }
  553. export interface DrugInCharacter{
  554. vol:number;byproduct?:number;
  555. }
  556. export interface Effect{
  557. /**
  558. * If true, an icon will be displayed in the sidebar. Make sure to specify `desc` and `image` in this case.
  559. * @type {?boolean}
  560. */
  561. sidebar?:boolean;
  562. desc?:string;
  563. image?: string;
  564. /**
  565. * ID of a moodlet that should automatically be enabled while the effect is active.
  566. * @type {string}
  567. */
  568. moodlet?: string;
  569. /**
  570. * Influences variables such as cerebral skill learning. 1 is the default value.
  571. *
  572. * Multiplicative
  573. * @type {number}
  574. */
  575. consciousness?: number;
  576. /**
  577. * Plain reduction of overall pain.
  578. * @type {?number}
  579. */
  580. painReduction?: number;
  581. /**
  582. * Plain increase in pain in bodypart for given reason.
  583. * @type {?{[bodypartId:string]:{[painReasonId:string]:number}}}
  584. */
  585. pain?:{[bodypartId:string]:{[painReasonId:string]:number}};
  586. painGain?:{
  587. [bodypartId:string]:
  588. number
  589. }
  590. painRegen?:{
  591. [bodypartId:string]:
  592. number
  593. }
  594. /**
  595. * Plain increase in skill.
  596. * @type {?{[skillId:string]:number}}
  597. */
  598. skills?:{[skillId:string]:number};
  599. /**
  600. * Percentage of skill gain. 1 is default. 0.9 would be a 10% decrease in skill gain.
  601. * @type {{
  602. * [skillId:string]:number
  603. * }}
  604. */
  605. skillGain?:{
  606. [skillId:string]:number
  607. }
  608. skillTagGain?:{
  609. [tag:string]:number
  610. }
  611. }
  612. export interface ExpiringVar<T>{
  613. val:T;
  614. til:Date;
  615. }
  616. export interface Filter{
  617. }
  618. export interface GameEvent{
  619. priority: number, weight: number, contents: string
  620. }
  621. export interface ImageRand{
  622. }
  623. export interface ItemDefinition{
  624. /**
  625. * An optional description to be displayed to the player.
  626. * @type {?string}
  627. */
  628. desc?: string;
  629. /**
  630. * Information on how the item behaves if used as furniture.
  631. * @type {?object}
  632. */
  633. furniture?:object;
  634. /**
  635. * Path to the image of the item.
  636. * @type {string}
  637. */
  638. image:string;
  639. /**
  640. * The label that's displayed to the player. Defaults to the id of the item.
  641. * @type {?string}
  642. */
  643. label?:string;
  644. /**
  645. * How many items of the same type fit into a purse.
  646. * @type {?number}
  647. */
  648. limit?:number;
  649. /**
  650. * A passage the player is sent to when he clicks the item in the inventory.
  651. * @type {?string}
  652. */
  653. passage?:string;
  654. /**
  655. * Default price.
  656. * @type {?number}
  657. */
  658. price?: number;
  659. }
  660. export interface JobDefinition{
  661. }
  662. export interface LocationDefinition{
  663. openTimes?:TimespanIdentifier;
  664. }
  665. export type NPC = NPCAccessor & Character;
  666. export interface NPCActivity{
  667. location:string;
  668. activity:string[];
  669. }
  670. export interface NPCDefinition{
  671. passage?:string;
  672. image?:string;
  673. rel?:number;
  674. dna?:string;
  675. firstname?:string;
  676. nickname?:string;
  677. lastname?:string;
  678. usedname?:string;
  679. dob?:number;
  680. gender: EGender;
  681. haircol?:number;
  682. height?:number;
  683. notes?:string;
  684. thdick?:string;
  685. dick?:number;
  686. bust?:number;
  687. spermpot?:number;
  688. sexskill?:number;
  689. rep?:number;
  690. intel?:number;
  691. hotcat_rating?:number;
  692. preference?:{[key:string]:NPCPreference};
  693. defaults?:string[];
  694. /**
  695. * Information on where the NPC is and what they do there at a given time.
  696. * @type {?Timetable<NPCActivity>}
  697. */
  698. timetable?:Timetable<NPCActivity>;
  699. }
  700. export interface NPCDefaultDefinition{
  701. }
  702. export interface NPCGenerateOptions {
  703. generators?:string[];
  704. fields?:{[key:string]:any};
  705. vars?:{[key:string]:any};
  706. }
  707. export interface NPCImageDefinition{
  708. path:string;
  709. age: EAgeBracket;
  710. gender:EGender;
  711. }
  712. export interface NPCPreference{
  713. state: ENPCPreference;
  714. }
  715. export interface NPCPreferenceDefinition{
  716. matches:(pc:PlayerCharacter)=>boolean;
  717. }
  718. export type OutfitDefinition = OutfitDefinitionBodysuit | OutfitDefinitionBra | OutfitDefinitionClothes | OutfitDefinitionCoat | OutfitDefinitionPanties | OutfitDefinitionPurse | OutfitDefinitionShoes | OutfitDefinitionSwimwear;
  719. export interface OutfitDefinitionRaw{
  720. quality: EOutfitQuality;
  721. vendor:string;
  722. index?: number;
  723. description?: string;
  724. /**
  725. * When accessing an Outfit-object, use the getter `image`, since it supports legacy outfits as well.
  726. * @type {?string}
  727. */
  728. imagePath?:string;
  729. }
  730. export interface OutfitDefinitionBodysuit extends OutfitDefinitionRaw{
  731. type:'bodysuit';
  732. subtype?:number;
  733. material?:number;
  734. fun?:number;
  735. thinness?:number;
  736. cover?:number;
  737. coverFront?:number;
  738. coverBack?:number;
  739. }
  740. export interface OutfitDefinitionBra extends OutfitDefinitionRaw{
  741. type:'bra';
  742. subtype?: number;
  743. fun?: number;
  744. thinness?: number;
  745. material?: number;
  746. cover?: number;
  747. }
  748. export interface OutfitDefinitionClothes extends OutfitDefinitionRaw{
  749. type:'clothes';
  750. subtype:string;
  751. thinness: number;
  752. topcut?: number;
  753. includesBra?: number;
  754. includesPanties?: number;
  755. isDress?:number;
  756. isOnepiece?: number;
  757. inhib?: number;
  758. pantsShortness?:number;
  759. skirtShortness?:number;
  760. coverTop?:number;
  761. coverBack?:number;
  762. coverFront?:number;
  763. /**
  764. * 4 seems to be prostitution.
  765. * @type {number}
  766. */
  767. style?: number;
  768. style2?: number;
  769. style3?:number;
  770. bimbo?:number;
  771. }
  772. export interface OutfitDefinitionCoat extends OutfitDefinitionRaw{
  773. type:'coat';
  774. warm:number;
  775. }
  776. export interface OutfitDefinitionPanties extends OutfitDefinitionRaw{
  777. type:'panties';
  778. subtype?: number;
  779. fun?: number;
  780. thinness?: number;
  781. material?: number;
  782. coverBack?:number;
  783. coverFront?:number;
  784. }
  785. export interface OutfitDefinitionPurse extends OutfitDefinitionRaw{
  786. type:'purse';
  787. }
  788. export interface OutfitDefinitionShoes extends OutfitDefinitionRaw{
  789. type:'shoes';
  790. style?:number;
  791. cut?:number;
  792. heels?:number;
  793. }
  794. export interface OutfitDefinitionSwimwear extends OutfitDefinitionRaw{
  795. type:'swimwear';
  796. subtype?:string;
  797. thinness:number;
  798. topcut?:number;
  799. coverTop?:number;
  800. coverFront?:number;
  801. coverBack?:number;
  802. includesBra?:number;
  803. includesPanties:number;
  804. isOnepiece?:number;
  805. bimbo?:number;
  806. inhib:number;
  807. }
  808. export type OutfitOwned = OutfitDefinition & OutfitOwnerShipData;
  809. export interface OutfitOwnerShipData{
  810. h?:number;
  811. l?:number;
  812. bmi?:number;
  813. }
  814. export interface PainReasonDefinition{
  815. /**
  816. * How much the pain deteriorats each hour.
  817. * @type {number}
  818. */
  819. deterioration: number;
  820. label: string;
  821. description:string;
  822. }
  823. export interface PersonalityRequirement{
  824. impact: number|string;
  825. /**
  826. * Costs willpower if you're under the value, but not if you're over it.
  827. * @type {?number}
  828. */
  829. min?:number;
  830. /**
  831. * Costs willpower if you're over the value, but not if you're under it.
  832. * @type {?number}
  833. */
  834. max?:number;
  835. /**
  836. * Costs you willpower if you're under or over the value.
  837. * @type {?number}
  838. */
  839. target?:number;
  840. }
  841. export interface PersonalityScaleDefinition{
  842. /**
  843. * Hide this from the player if true. Will not appear in lists and won't be mentioned in dialogs.
  844. * @type {?boolean}
  845. */
  846. hidden?:boolean;
  847. start: number;
  848. interval: number[];
  849. label: string | string[];
  850. desc?: string;
  851. image?:string;
  852. actions?:{[key:string]:PersonalityRequirement};
  853. impacts?:{[key:string]:number};
  854. msg_tooHigh?:string;
  855. msg_tooLow?:string;
  856. functions?:{[key:string]:(any:any) => any}
  857. }
  858. export interface PrioritizedEventDict{
  859. [priority:number]:GameEvent
  860. }
  861. export interface SexStatistics{
  862. bj:SexStatistic;
  863. hj:SexStatistic;
  864. vaginal:SexStatistic;
  865. anal:SexStatistic;
  866. }
  867. export interface SexStatistic{
  868. love:number[];
  869. friend:number[];
  870. acquaintance:number[];
  871. stranger:number[];
  872. }
  873. export interface SkillDefinition{
  874. label ?: string;
  875. description?:string;
  876. descibtionByLevel?:{[key:number]: string};
  877. image?:string;
  878. dailyExpLimit?:number|((levelAtStartOfDay:number)=>number);
  879. /**
  880. * If true, the amount of gained experience depends on the difficulty of a task.
  881. * @type {?boolean}
  882. */
  883. isDifficultyBased?:boolean;
  884. /**
  885. * Hide this skill from players in overviews when set to true.
  886. * @type {?boolean}
  887. */
  888. hidden?: boolean;
  889. /**
  890. * A function that provides a skill level.
  891. * @type {(skillLevel:number)=>number} Experience
  892. */
  893. e2s?: (skillLevel:number)=>number;
  894. /**
  895. * A function that provides a number of required skillpoints.
  896. * @type {(skillLevel:number)=>number} Skill Level
  897. */
  898. s2e?: (skillLevel:number)=>number;
  899. functions?: {[functionId:string]:Function};
  900. vars?:{[key:string]:any};
  901. }
  902. export interface SkillOfCharacter{
  903. /**
  904. * The maximum number the experience can reach. 0 if disabled.
  905. * @type {number}
  906. */
  907. ceil:number;
  908. /**
  909. * Current number of experience points.
  910. * @type {number}
  911. */
  912. experience:number;
  913. /**
  914. * History of this skill for the last days.
  915. * @type {number[]}
  916. */
  917. experienceHistory:number[];
  918. /**
  919. * The minimum number the experience can reach.
  920. * @type {number}
  921. */
  922. floor: number;
  923. /**
  924. * The last daystart this skill has been used.
  925. * @type {number}
  926. */
  927. lastUsed: number;
  928. }
  929. export interface TimespanIdentifier{
  930. days?: ('MO'|'TU'|'WE'|'TH'|'FR'|'SA'|'SU'|'work')[];
  931. daysBL?: ('MO'|'TU'|'WE'|'TH'|'FR'|'SA'|'SU'|'work')[];
  932. /**
  933. * True: The day needs to be a school holiday. False: The day needs to be
  934. * @type {?boolean}
  935. */
  936. holiday?:EDayVacationState;
  937. /*vacation?:boolean;*/
  938. begin?:number[];
  939. end?:number[];
  940. }
  941. export interface Timetable<T>{
  942. [key:string]:{
  943. time: TimespanIdentifier;
  944. result?: T;
  945. subtable?:Timetable<T>;
  946. either?:T[];
  947. }
  948. }
  949. export interface WardrobeSettings{
  950. /**
  951. * Maximum difference of the bmi-value of bought and worn clothes.
  952. * @type {number}
  953. */
  954. bmiSizeMaxDifference: number;
  955. }
  956. export interface WornOutfitDefinition{
  957. bra: string,
  958. coat: string,
  959. clothes: string,
  960. panties: string,
  961. purse: string,
  962. shoes: string
  963. }
  964. }
  965. export { };