123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659 |
- declare module "twine-sugarcube" {
- export interface SugarCubeSetupObject {
- Appearance: { new(playerCharacter: PlayerCharacter): Appearance };
- BodyDescription: { new(): BodyDescription };
- Consumable: { new(): Consumable };
- Drugs: { new(): Drugs };
- Events: { new(): Events };
- GameTime: { new(): GameTime };
- Inventory: { new(): Inventory };
- Location:{ new(): GameLocation };
- LocationIdentifier:{ new(): LocationIdentifier };
- Mood: { new(): Mood };
- Moodlet: { new(): Moodlet };
- MoodletGroup: { new(): MoodletGroup };
- OutfitItem: { new(): OutfitItem };
- Pain: { new(): Pain };
- PlayerCharacter: { new(): PlayerCharacter };
- Quest: {
- handler: object; new(questId?: any): Quest
- };
- QuestsDict: { new(): QuestsDict };
- Skill: { new(): Skill };
- VersionControl: { new(): VersionControl };
- //#region Listeners
- listeners_timeUpdate:{[key: string]: (minutes:number)=>void};
- //#endregion
- appearanceModificators: { [key: string]: any; };
- consumables: { [key: string]: ConsumableDefinition;}
- deco: { [key: string]: { [key: string]: any; }}
- drugs: { [key: string]: DrugDefinition}
- effects: { [key: string]: { [key: string]: any; }}
- consumableMenus:{ [key: string]: ConsumableMenuDefinition}
- items: { [key: string]: ItemDefinition; };
- jobs: { [key: string]: JobDefinition};
- locations: { [key: string]: LocationDefinition; };
- moodlets: { [key: string]: Moodlet; };
- moodletGroups: { [key: string]: MoodletGroup; };
- outfits: { [key: string]: OutfitDefinition; };
- outfitsDefaults: {[key: string]: {[key: string]: any; } };
- outfitItemImagePath: {[key: string]: string | {[key: string]: any; } };
- painReasons: {[key: string]: { [key: string]: any; }}
- skills: { [key: string]: SkillDefinition; };
- startingCharacters: {[key: string]: StartCharacterDefinition};
- crimeLikelihood: (crimeId:string,location:LocationIdentifier)=>number;
- durationToString: any;
- filterDict:<T extends {}>(obj:T,filter: Filter) => T;
- func: (passage: string, ...arguments: Array<string|number>)=>any;
- getBodyparts: any;
- getBodypart:any;
- getConsumable: (type:string)=>{ [key: string]: any; };
- getConsumableMenu: (id:string)=>ConsumableMenuDefinition;
- getDeco: (type:string,position:string,id:number|string)=>{ [key: string]: any; };
- getDrug: (type:string)=>DrugDefinition;
- getDecoPosition: (type:string,position:string) => { [key: string]: any; }
- getDecoPositions: (type:string)=>string[];
- getEffect: (type:string)=>{ [key: string]: any; };
- getLocation: (locationId: string)=>LocationDefinition;
- getStartingCharacter: (type:string)=>StartCharacterDefinition;
- getStartingCharactersByFilter: (filters:{},shallow:boolean)=>{};
- makeSVG: (tag:string, attrs:any,innerHTML?:string|number|undefined) => SVGElement;
- mediaPath(rawPath:string):string;
- mediaPathImage(rawPath:string):string;
- mergeDeep: (target:any, ...sources:any) => any;
- randomName: (type:string)=>string;
- startingCharacterApply:(id:string)=>void;
- startingCharacterTagsIncludes:(tag:string)=>boolean;
-
- /**
- * Returns whether the place the playercharacter currently is at has internet access.
- * @returns {boolean}
- */
- hasInternet(): boolean;
- settingsApply:(settings: any)=>void;
- wardrobeSettings:WardrobeSettings;
- weekDayIntToString: any;
- worldSettings:any;
- isWebVersion:boolean;
- difficultyOfHighHeels(shoes?: OutfitItemShoes,levelCategory?:number):number
- skillHistoryDrawGraph(domElementId:string,skillID:string):void;
- wardrobeWearableFunctions:{[key:string]:((outfitOwned:OutfitOwned)=>string|null)};
- }
-
- export interface SugarCubeStoryVariables {
- events: Events;
- finances: any;
- housing:any;
- inventory: Inventory;
- jobs: any;
- location: GameLocation;
- npcs:any;
- pc: PlayerCharacter;
- q: QuestsDict;
- settings:any;
- startCharacter: string;
- time: GameTime;
- wardrobe:Wardrobe;
-
-
- ARGS: Array<string>;
- connectedLocations: ConnectedLocation[];
- eventReturnLocation: LocationIdentifier;
- here: string;
- location_var: object;
- media_path: string;
- quest: (id:string)=>Quest;
- result: number | string;
- /**
- * The version of the game. Format is xxxxxxx.xx.xx.
- * @type {number}
- * @example
- * version = 10345; //1.3.45
- */
- version: number;
- }
-
-
- }
- declare global {
- export interface Array<T>{
- fancyMathEvaluate(): number;
- filterByObject(filter: object): Array<T>;
- isConsecutive(stepSize?:number): boolean;
- }
- interface Math {
- ceilAbs: (n:number)=>number;
- logBase: (n:number, base:number)=>number;
- }
- export interface Number{
- roundToDecimal:(decimalPlaces:number)=>number;
- toBoolean:()=>boolean;
-
- }
- export interface String{
- formatUnicorn(format:{}):string;
- removeLeading(leading:string):string;
- toBoolean():boolean;
- }
- export class Util{
- static slugify(s:string): string;
- }
- export interface Window{
- rand(x:number,y:number): number;
- Wardrobe: { new(): Wardrobe };
- }
- export interface StartCharacterDefinition{
- /**
- * The description that's displayed to the player
- * @type {?string}
- */
- desc?:string
- finances?:{
-
- /**
- * The starting cash of the character.
- * @type {?number}
- */
- cash?:number
- },
- housing?:{
- home?: string
- },
- /**
- * Obvious things are obvious
- * @type {?string}
- */
- image?:string
-
- /**
- * Used internally in `setup.getStartingCharacter`. Don't overwrite.
- * @type {?string[]}
- */
- inheritance?:string[]
- items?:{
- [key: string]: number | {
- generateFunction:string,
- generateParameters?:any[]
- }
-
- }
-
- /**
- * What is displayed to the player
- * @type {?string}
- */
- label?:string
- location?:{
- [key: string]:{
- [key: string]:any
- }
- }
- locationTags?:{
- [key: string]:{
- [key: string]:any
- }
- }
- npcs?:{
- bulk?:{
- [key: string]:{
- values?:{
- rel?:number,
- fam?:number
- },
- filters?:{
- [key: string]:any
- }
- }
- }
- [key: string]: any
- }
-
-
- /**
- * Another character defintion that is to be inherited.
- * @type {?string}
- */
- parent?:string
- /**
- * Starting values of the PlayerCharacter. Every field of this class can be overwritten.
- * @type {?{ [key: string]: any; }}
- */
- pc?:{ [key: string]: any; }
- quests?:{
- [key: string]: boolean;
- }
- school?:{
- [key: string]: any;
- }
- skills?:{
- [key: string]: number;
- }
-
- /**
- * Categories of the starting character.
- * @type {string[]}
- */
- tags?:string[]
- time?: any;
- traits?:{
- [key: string]: number;
- }
- wardrobe?:{
- itemsByFilter?:{
- [key: string]:{
- filters?:{
- [key: string]:any;
- };
- count?: number;
- action?: 'add'|'wear';
- }
- },
- items?:{
- [key: string]:'add'|'wear';
- }
- };
- }
- export interface ConnectedLocation{
- forPassage : string,
- targetPassage: string,
- targetArguments: undefined,
- label: string,
- image: string,
- duration: number,
- class: string,
- priority: number,
- content: string,
- hotkeys: any,
- indecencyBlocked?:boolean,
- capturedVars: {[key:string]:any};
- }
- export interface ConsumableDefinition{
- alcohol?:number;
- costItems?:string[];
- desc?:string;
-
- /**
- * Relative calories with 1 being an healthy amount.
- * @type {?number}
- */
- energy?:number;
- hunger?: number;
- image?: string;
- imageRand?: ImageRand;
- label?:string;
- moodletIds?:string[];
- price?: number;
-
- thirst?:number;
- /**
- * The time it takes to consume.
- * @type {number}
- */
- time:number;
- type: 'drink'|'meal'|'candy';
- }
-
- export interface ConsumableMenuDefinition{
- payment:'cash'|'bank'|'both';
- categories:{
- [key:string] : {
- label:string;
- items:{
- [key:string] : {
-
- /**
- * 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.
- * @type {(number|((n:number)=>number))}
- */
- price?:number|((n:number)=>number);
- }
- }
- }
- }
- }
- export interface DrugDefinition{
- deterioration: number;
- effects:{[key: string]:{condition:any; effect:string;}};
- byproduct?:DrugByproductDefinition;
-
- /*{
- buildup: 1.5,
- deterioration: 0.0017,
- effects:{
- hangover:{
- condition:{mainEffectsInactive:true},
- effect: 'hangover'
- }
- }
- }*/
- }
- export interface DrugByproductDefinition extends DrugDefinition{
- buildup: number;
- }
- export interface DrugInCharacter{
- vol:number;byproduct?:number;
- }
- export interface Filter{
- }
- export interface ImageRand{
- }
- export interface ItemDefinition{
-
-
- /**
- * An optional description to be displayed to the player.
- * @type {?string}
- */
- desc?: string;
-
- /**
- * Information on how the item behaves if used as furniture.
- * @type {?object}
- */
- furniture?:object;
- /**
- * Path to the image of the item.
- * @type {string}
- */
- image:string;
- /**
- * The label that's displayed to the player. Defaults to the id of the item.
- * @type {?string}
- */
- label?:string;
-
- /**
- * How many items of the same type fit into a purse.
- * @type {?number}
- */
- limit?:number;
-
- /**
- * A passage the player is sent to when he clicks the item in the inventory.
- * @type {?string}
- */
- passage?:string;
-
- /**
- * Default price.
- * @type {?number}
- */
- price?: number;
-
- }
- export interface JobDefinition{
- }
- export interface LocationDefinition{
- openTimes?:TimespanIdentifier;
- }
- export type OutfitDefinition = OutfitDefinitionBodysuit | OutfitDefinitionBra | OutfitDefinitionClothes | OutfitDefinitionCoat | OutfitDefinitionPanties | OutfitDefinitionPurse | OutfitDefinitionShoes | OutfitDefinitionSwimwear;
- export interface OutfitDefinitionRaw{
- quality: number;
- vendor:string;
- index: number;
- description?: string;
- }
- export interface OutfitDefinitionBodysuit extends OutfitDefinitionRaw{
- type:'bodysuit';
- subtype?:number;
- material?:number;
- fun?:number;
- thinness?:number;
- cover?:number;
- coverFront?:number;
- coverBack?:number;
- }
- export interface OutfitDefinitionBra extends OutfitDefinitionRaw{
- type:'bra';
- subtype?: number;
- fun?: number;
- thinness?: number;
- material?: number;
- cover?: number;
- }
- export interface OutfitDefinitionClothes extends OutfitDefinitionRaw{
- type:'clothes';
- subtype:string;
- thinness: number;
- topcut?: number;
- includesBra?: number;
- includesPanties?: number;
- isDress?:number;
- isOnepiece?: number;
- inhib?: number;
- pantsShortness?:number;
- skirtShortness?:number;
- coverTop?:number;
- coverBack?:number;
- coverFront?:number;
-
- /**
- * 4 seems to be prostitution.
- * @type {number}
- */
- style?: number;
- style2?: number;
- style3?:number;
- bimbo?:number;
- }
- export interface OutfitDefinitionCoat extends OutfitDefinitionRaw{
- type:'coat';
- warm:number;
- }
- export interface OutfitDefinitionPanties extends OutfitDefinitionRaw{
- type:'panties';
- subtype?: number;
- fun?: number;
- thinness?: number;
- material?: number;
- coverBack?:number;
- coverFront?:number;
- }
- export interface OutfitDefinitionPurse extends OutfitDefinitionRaw{
- type:'purse';
- }
- export interface OutfitDefinitionShoes extends OutfitDefinitionRaw{
- type:'shoes';
- style?:number;
- cut?:number;
- heels?:number;
- }
- export interface OutfitDefinitionSwimwear extends OutfitDefinitionRaw{
- type:'swimwear';
- subtype?:string;
- thinness:number;
- topcut:number;
- includesPanties:number;
- isOnepiece:number;
- inhib:number;
- }
- export type OutfitOwned = OutfitDefinition & OutfitOwnerShipData;
- export interface OutfitOwnerShipData{
- h?:number;
- l?:number;
- bmi?:number;
- }
- export interface TimespanIdentifier{
- days?: ('MO'|'TU'|'WE'|'TH'|'FR'|'SA'|'SU'|'work')[];
- daysBL?: ('MO'|'TU'|'WE'|'TH'|'FR'|'SA'|'SU'|'work')[];
- holiday?:boolean;
- vacation?:boolean;
- begin?:number[];
- end?:number[];
- }
- export interface SkillDefinition{
-
- label ?: string;
- description?:string;
- descibtionByLevel?:{[key:number]: string};
- image?:string;
- dailyExpLimit?:number|((levelAtStartOfDay:number)=>number);
-
- /**
- * If true, the amount of gained experience depends on the difficulty of a task.
- * @type {?boolean}
- */
- isDifficultyBased?:boolean;
-
- /**
- * Hide this skill from players in overviews when set to true.
- * @type {?boolean}
- */
- hidden?: boolean;
- /**
- * A function that provides a skill level.
- * @type {(skillLevel:number)=>number} Experience
- */
- e2s?: (skillLevel:number)=>number;
- /**
- * A function that provides a number of required skillpoints.
- * @type {(skillLevel:number)=>number} Skill Level
- */
- s2e?: (skillLevel:number)=>number;
- }
-
- export interface SkillOfCharacter{
-
-
- /**
- * The maximum number the experience can reach. 0 if disabled.
- * @type {number}
- */
- ceil:number;
-
- /**
- * Current number of experience points.
- * @type {number}
- */
- experience:number;
-
- /**
- * History of this skill for the last days.
- * @type {number[]}
- */
- experienceHistory:number[];
-
- /**
- * The minimum number the experience can reach.
- * @type {number}
- */
- floor: number;
- /**
- * The last daystart this skill has been used.
- * @type {number}
- */
- lastUsed: number;
- }
- export interface WardrobeSettings{
-
- /**
- * Maximum difference of the bmi-value of bought and worn clothes.
- * @type {number}
- */
- bmiSizeMaxDifference: number;
- }
- export interface WornOutfitDefinition{
- bra: string,
- coat: string,
- clothes: string,
- panties: string,
- purse: string,
- shoes: string
- }
- }
- export { };
|