diff --git a/devTools/sugarcube.d.ts b/devTools/sugarcube.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..740be661787f88418b8d299271e4c0fdbe6ec15e --- /dev/null +++ b/devTools/sugarcube.d.ts @@ -0,0 +1,1998 @@ +declare namespace SugarCube { + + type navigationOverride = (passageName: string) => any; + type saveObjectHander = (save: SaveObject) => void; + + type DisplayTaskFunction = (taskName: string) => void; + type RenderTaskFunction = (content: HTMLElement, taskName: string) => void; + + export interface StringTMap<T> { [key: string]: T; }; + + declare interface Config { + audio: { + pauseOnFadeToZero: boolean; + preloadMetadata: boolean; + }; + history: { + controls: boolean; + maxStates: number; + }; + macros: { + ifAssignmentError: boolean; + maxLoopIterations: number; + }; + navigation: { + override: navigationOverride; + }; + passages: { + descriptions: any; + /** Determines whether passage titles are combined with the story title, within the browser's/tab's titlebar, when + * passages are displayed. + * @default false + */ + displayTitles: boolean; + /** + * Determines whether rendering passages have their leading/trailing newlines removed and all remaining sequences of + * newlines replaced with single spaces before they're rendered. Equivalent to including the nobr special tag on + * every passage. + * @default false + */ + nobr: boolean; + + /** + * Sets the title of the initial passage, the very first passage which will be displayed. + * + * @default Twine 2: none; Twine 1/Twee: "Start" + */ + start: string; + + /** + * Determines whether outgoing passage transitions are enabled. Valid values are the name of the property being + * animated, which causes the outgoing passage elements to be removed once that transition animation is complete, + * or an integer delay (in milliseconds), which causes the outgoing passage elements to be removed once the delay + * has expired. + */ + transitionOut: string | number; + }; + + saves: { + /** + * Determines whether the autosave, if it exists, is automatically loaded upon story startup. Valid values are + * boolean true, which simply causes the autosave to be loaded, the string "prompt", which prompts the player via a + * dialog to load the autosave, or a function, which causes the autosave to be loaded if its return value is truthy. + + NOTE: If the autosave cannot be loaded, for any reason, then the start passage is loaded instead. + * @since v2.0.0 + */ + autoload: boolean | string | Function; + + /** + * Determines whether the autosave is created/updated when passages are displayed. Valid values are boolean true, + * which causes the autosave to be updated with every passage, a string, which causes the autosave to be updated for + * each passage with a matching tag, or an array of strings, which causes the autosave to be updated for each + * passage with at least one matching tag. + * + * NOTE: When setting the value to boolean true, you will likely also need to use the Config.saves.isAllowed + * property to disallow saving on the start passage. Or, if you use the start passage as real part of your story and + * allow the player to reenter it, rather than just as the initial landing/cover page, then you might wish to only + * disallow saving on the start passage the very first time it's displayed (at story startup). + * @since v2.0.0 + */ + autosave: boolean | string | string[]; + + /** + * Sets the story ID associated with saves. + * @default slugified story title + * @since v2.0.0 + * @example + * Config.saves.id = "a-big-huge-story-part-1"; + */ + id: string; + + /** + * Determines whether saving is allowed within the current context. The callback is invoked each time a save is + * requested. If its return value is falsy, the save is disallowed. If its return value is truthy, the save is + * allowed to continue unperturbed. + * @default undefined + * @since v2.0.0 + * @example + * Config.saves.isAllowed = function () { + * // code + * }; + */ + isAllowed: Function; + + /** + * Performs any required pre-processing before the save data is loaded. The callback is passed one parameter, the + * save object to be processed. If it encounters an unrecoverable problem during its processing, it may throw an + * exception containing an error message; the message will be displayed to the player and loading of the save will + * be terminated. + * @default undefined + * @since v2.0.0 + * @example + * Config.saves.onLoad = function (save) { + * // code + * }; + */ + onLoad: saveObjectHander; + + /** + * Performs any required post-processing before the save data is saved. The callback is passed one parameter, the + * save object to be processed. + * + * NOTE: See the save objects section of the Save API for information on the format of a save. + * @default undefined + * @since v2.0.0 + * @example + * Config.saves.onSave = function (save) { + * // code + * }; + */ + onSave: saveObjectHander; + + /** + * Sets the maximum number of available save slots. + * @default 8 + * @since v2.0.0 + * @example + * Config.saves.slots = 4; + */ + slots: number; + + /** + * Sets the version property of saves. + * + * NOTE: This completely optional property is only for developer use, it is ignored by SugarCube. + * + * @since v2.0.0 + * @example + * // As an integer + * Config.saves.version = 3; + * @example + * // As a string + * Config.saves.version = "v3"; + */ + version: any; + }; + + ui: { + /** + * Determines whether the UI bar (sidebar) starts in the stowed (shut) state initially. Valid values are boolean + * true/false, which causes the UI bar to always/never start in the stowed state, or an integer, which causes the UI + * bar to start in the stowed state if the viewport width is less-than-or-equal-to the specified number of pixels. + * + * @since 2.11.0 + * + * @example + * // As a boolean; always start stowed + * Config.ui.stowBarInitially = true; + * + * @example + * // As a boolean; never start stowed + * Config.ui.stowBarInitially = false; + * + * @example + * // As an integer; start stowed if the viewport is 800px or less + * Config.ui.stowBarInitially = 800; + */ + stowBarInitially: boolean | number; + + /** + * Determines whether certain elements within the UI bar are updated when passages are displayed. The affected + * elements are the story: banner, subtitle, author, caption, and menu. + * + * NOTE: SugarCube uses the story's title as the basis for the key used to store and load data used when playing the + * story and for saves. Because of this, the story title is not included in updates and it is strongly recommended + * that you do not add any kind of dynamic code to it. + * + * @default true + * @since 2.0.0 + * @example + * // If you don't need those elements to update + * Config.ui.updateStoryElements = false; + */ + updateStoryElements: boolean; + }; + + /** + * Determines whether the link-visited class is added to internal passage links which go to previously visited + * passages — i.e. the passage already exists within the story history + * @default false + * NOTE You must provide your own styling for the link-visited class as none is provided by default. + * @since 2.0.0 + * @example + * Config.addVisitedLinkClass = true; + * // An example style: (Twine 2: goes in Story Stylesheet; Twine 1/Twee: goes in a stylesheet-tagged passage) + * .link-visited { + * color: purple; + * } + */ + addVisitedLinkClass: boolean; + + /** + * Determines whether the output of the Wikifier is post-processed into more sane markup — i.e. where appropriate, it + * tries to transition the plethora of <br> elements into <p> elements. + * @default false + * @since 2.0.0 + * @example + * Config.cleanupWikifierOutput = true; + */ + cleanupWikifierOutput: boolean; + + /** + * Indicates whether SugarCube is running in test mode, which enables debug views. See Test Mode for more information. + * + * NOTE: This property is automatically set based on whether you're using a testing mode in a Twine compiler — i.e. Test + * mode in Twine 2, Test Play From Here in Twine 1, or the test mode options (-t, --test) in Tweego. You may, however, + * forcibly enable it if you need to for some reason — e.g. if you're using another compiler, which doesn't offer a way + * to enable test mode. + * + * @default false + * @since 2.2.0 + * @example + * // Forcibly enable test mode + * Config.debug = true; + * + * @example + * // Check if test mode is enabled in JavaScript + * if (Config.debug) { + * // do something debug related + * } + * + * @example + * // Check if test mode is enabled via the <<if>> macro + * <<if Config.debug>> + * // do something debug related + * <</if>> + */ + debug: boolean; + + /** + * Sets the integer delay (in milliseconds) before the loading screen is dismissed, once the document has signaled its + * readiness. Not generally necessary, however, some browsers render slower than others and may need a little extra time + * to get a media-heavy page done. This allows you to fine tune for those cases. + * + * @default 0 + * @since 2.0.0 + * + * @example + * // Delay the dismissal of the loading screen by 2000ms (2s) + * Config.loadDelay = 2000; + */ + loadDelay: number; + }; + + declare interface Dialog { + /** + * Adds WAI-ARIA-compatible mouse/keyboard event handlers to the target element(s) which open the dialog when + * activated. + * @param targets The DOM element(s) to attach the handler to—may be either an HTMLElement object, a jQuery object, + * or a jQuery-style selector set. + * @param options he options object; the currently understood properties are: + * top: Top y-coordinate of the dialog (default: 50; in pixels, but without the unit). + * opacity: Opacity of the overlay (default: 0.8). + * @param tartFn The function to execute at the start of Dialog.addClickHandler(). This is commonly used to setup + * the dialog. + * @param doneFn The function to execute at the end of Dialog.addClickHandler(). + * @param closeFn The function to execute whenever the associated dialog is closed. + * @since 2.0.0 + * @example + * // Commonly used something like the following. + * Dialog.addClickHandler("#some-element", null, function () { + * Dialog.setup("My Dialog Title", "my-dialog-class"); + * Dialog.wiki(Story.get("MyDialogContents").processText()); + * }); + */ + addClickHandler(targets: HTMLElement | string, options?: object, + tartFn?: () => void, doneFn?: () => void, closeFn?: () => void): void; + + /** + * Appends the given content to the dialog's content area. Returns a reference to the Dialog object for chaining. + * + * NOTE: If your content contains any SugarCube markup, you'll need to use the Dialog.wiki() method instead. + * @param content The content to append. As this method is essentially a shortcut for jQuery(Dialog.body()).append + * (…), see jQuery's append() method for the range of valid content types. + * @since 2.9.0 + * @example + * Dialog.append("Cry 'Havoc!', and let slip the <em>ponies</em> of <strong>friendship</strong>."); + * Dialog.append( <some DOM nodes> ); + */ + append(content: string | string[]): Dialog; + + /** + * Returns a reference to the dialog's content area + * @since 2.0.0 + * @example + * jQuery(Dialog.body()).append("Cry 'Havoc!', and let slip the <em>ponies</em> of <strong>friendship</strong>."); + * jQuery(Dialog.body()).wiki("Cry 'Havoc!', and let slip the //ponies// of ''friendship''."); + */ + body(): HTMLElement; + + /** + * Closes the dialog. Returns a reference to the Dialog object for chaining. + * @since 2.0.0 + */ + close(): Dialog; + + /** + * Returns whether the dialog is currently open. + * @param classNames the space-separated-list of classes to check for when determining the state of the dialog. + * Each of built-in dialogs contains a name-themed class which can be tested for in this manner—e.g. the Saves + * dialog contains the class saves. + * @since 2.0.0 + * @example + * if (Dialog.isOpen()) { + * // code to execute if the dialog is open... + * } + * @example + * if (Dialog.isOpen("saves")) { + * // code to execute if the Saves dialog is open + * } + */ + isOpen(classNames?: string): boolean; + + /** + * Opens the dialog. Returns a reference to the Dialog object for chaining. + * + * NOTE: Call this only after populating the dialog with content. + * @param options The options object. @see addClickHandler() for more information. + * @param closeFn The function to execute whenever the dialog is closed. + * @since 2.0.0 + */ + open(options?: object, closeFn?: () => void): Dialog; + + /** + * Prepares the dialog for use and returns a reference to its content area. + * @param title The title of the dialog. + * @param classNames The space-separated-list of classes to add to the dialog. + * @since 2.0.0 + * @example + * // Basic example. + * Dialog.setup(); + * Dialog.wiki("Blah //blah// ''blah''."); + * Dialog.open(); + * + * @example + * // Adding a title to the dialog. + * Dialog.setup("Character Sheet"); + * Dialog.wiki(Story.get("PC Sheet").processText()); + * Dialog.open(); + * + * @example + * // Adding a title and class to the dialog. + * Dialog.setup("Character Sheet", "charsheet"); + * Dialog.wiki(Story.get("PC Sheet").processText()); + * Dialog.open(); + */ + setup(title?: string, classNames?: string): HTMLElement; + + /** + * Renders the given markup and appends it to the dialog's content area. Returns a reference to the Dialog object + * for chaining. + * + * NOTE: If your content consists of DOM nodes, you'll need to use the @see Dialog.append() method instead. + * @param wikiMarkup The markup to render. + * @since 2.9.0 + * @example + * Dialog.wiki("Cry 'Havoc!', and let slip the //ponies// of ''friendship''."); + */ + wiki(wikiMarkup: string): Dialog; + } + + declare interface Engine { + /** + * Returns a timestamp representing the last time Engine.play() was called. + * @since 2.0.0 + */ + lastPlay: number; + + /** + * Returns the current state of the engine ("idle", "playing", "rendering"). + * States: + * "idle": The engine is idle, awaiting the triggering of passage navigation—the default state. + * "playing": Passage navigation has been triggered and a turn is being processed. + * "rendering": The incoming passage is being rendered and added to the page—takes place during turn processing, + * so implies "playing". + * @since 2.7.0 + */ + state: string; + + /** + * Moves backward one moment within the full history (past + future), if possible, activating and showing the + * moment moved to. Returns whether the history navigation was successful (should only fail if already at the + * beginning of the full history). + * @since 2.0.0 + */ + backward(): boolean; + + /** + * Moves forward one moment within the full history (past + future), if possible, activating and showing the moment + * moved to. Returns whether the history navigation was successful (should only fail if already at the end of the + * full history). + * @since 2.0.0 + */ + forward(): boolean; + + /** + * Activates the moment at the given offset from the active (present) moment within the full state history and show + * it. Returns whether the history navigation was successful (should only fail if the offset from the active + * (present) moment is not within the bounds of the full history). + * @param offset The offset from the active (present) moment of the moment to go to. + * @since 2.0.0 + */ + go(offset: number): boolean; + + /** + * Activates the moment at the given index within the full state history and show it. Returns whether the history + * navigation was successful (should only fail if the index is not within the bounds of the full history). + * @param index The index of the moment to go to. + * @since 2.0.0 + * @example + * Engine.goTo(0) // Goes to the first moment + * Engine.goTo(9) // Goes to the tenth moment + */ + goTo(index: number): boolean; + + /** + * Returns whether the engine is idle. + * @since 2.16.0 + */ + isIdle(): boolean; + + /** + * Returns whether the engine is processing a turn — i.e. passage navigation has been triggered. + * @since 2.16.0 + */ + isPlaying(): boolean; + + /** + * Returns whether the engine is rendering the incoming passage. + * @since 2.16.0 + */ + isRendering(): boolean; + + /** + * Renders and displays the passage referenced by the given title, optionally without adding a new moment to the + * history. + * @param passageTitle The title of the passage to play. + * @param noHistory Disables the update of the history (i.e. no moment is added to the history). + * @since 2.0.0 + */ + play(passageTitle: string, noHistory?: boolean): HTMLElement; + + /** + * Restarts the story. + * + * WARNING: The player will not be prompted and all unsaved state will be lost. + * NOTE: In general, you should not call this method directly. Instead, call the UI.restart() static method, which + * prompts the player with an OK/Cancel dialog before itself calling Engine.restart(), if they accept. + * @since 2.0.0 + */ + restart(): void; + + /** + * Renders and displays the active (present) moment's associated passage without adding a new moment to the history. + * @since 2.0.0 + */ + show(): HTMLElement; + } + + declare interface LoadScreen { + /** + * Acquires a loading screen lock and returns its ID. Displays the loading screen, if necessary. + * @since 2.15.0 + */ + lock(): number; + + /** + * Releases the loading screen lock with the given ID. Hides the loading screen, if no other locks exist. + * @param lockId The loading screen lock ID. + * @since 2.15.0 + * @example + * var lockId = LoadScreen.lock(); + * // Do something whose timing is unpredictable which should be hidden by the loading screen + * LoadScreen.unlock(lockId); + */ + unlock(lockId: number): void; + } + + declare interface MacroTags { + /** + * Return the named macro tag's parents array (includes the names of all macros who have registered the tag as a + * child), or null on failure. + * @param name Name of the macro tag whose parents array should be returned. + * @since 2.0.0 + * @example + * Macro.tags.get("else") // For the standard library, returns: ["if"] + */ + get(name: string): string[]; + + /** + * Returns whether the named macro tag exists. + * @param name Name of the macro tag to search for. + * @since 2.0.0 + */ + has(name: string): boolean; + } + + declare interface MacroArgsArray extends Array<String> { + /** + * The current tag's argument string after converting all TwineScript syntax elements into their + * native JavaScript counterparts. Equivalent in function to <MacroContext>.args.full. + */ + full: string; + /** + * The current tag's unprocessed argument string. Equivalent in function to <MacroContext>.args.raw. + */ + raw: string; + } + + declare interface MacroContexObject { + /** + * Name of the current tag. + */ + name: string; + /** + * The current tag's argument string parsed into an array of discrete arguments. + * Equivalent in function to <MacroContext>.args. + */ + args: MacroArgsArray; + + /** + * The current tag's contents—i.e. the text between the current tag and the next. + */ + contents: string; + } + + + declare interface MacroContex { + /** + * The argument string parsed into an array of discrete arguments. + * @since 2.0.0 + */ + args: MacroArgsArray; + + /** + * The name of the macro. + * @since 2.0.0 + */ + name: string; + + /** + * The current output element. + * @since 2.0.0 + */ + output: HTMLElement; + + /** + * The (execution) context object of the macro's parent, or null if the macro has no parent. + * @since 2.0.0 + */ + parent: object; + + /** + * The text of a container macro parsed into discrete payload objects by tag. + * @since 2.0.0 + */ + payload: MacroContexObject[]; + + /** + * The macro's definition — created via @see Macro.add() + * @since 2.0.0 + */ + self: object; + + /** + * Returns whether any of the macro's ancestors passed the test implemented by the given + * filter function. + * @param filter he function used to test each ancestor execution context object, which + * is passed in as its sole parameter. + * @since 2.0.0 + */ + contextHas(filter: (MacroContexObject) => boolean): boolean; + + /** + * Returns the first of the macro's ancestors which passed the test implemented by the given + * filter function or null, if no members pass. + * @param filter The function used to test each ancestor execution context object, which is + * passed in as its sole parameter. + * @since 2.0.0 + */ + contextSelect(filter: (MacroContexObject) => boolean): object; + + /** + * Returns a new array containing all of the macro's ancestors which passed the test implemented + * by the given filter function or an empty array, if no members pass. + * @since 2.0.0 + * @param filter + */ + contextSelectAll(filter: (MacroContexObject) => boolean): object[]; + + /** + * Renders the message prefixed with the name of the macro and returns false. + * @param message The error message to output. + * @since 2.0.0 + */ + error(message: string): false; + } + + declare interface Macro { + /** + * Add new macro(s). + * @param name Name, or array of names, of the macro(s) to add. + * @param definition Definition of the macro(s) or the name of an existing macro whose definition to copy. + * Definition object: + * A macro definition object should have some of the following properties (only handler is absolutely required): + * skipArgs: (optional, boolean) Disables parsing argument strings into discrete arguments. Used by macros which + * only use the raw/full argument strings. + * tags: (optional, null | string array) Signifies that the macro is a container macro—i.e. not self-closing. An + * array of the names of the child tags, or null if there are no child tags. + * handler: (function) The macro's main function. It will be called without arguments, but with its this set to a + * macro context object. + * @param deep Enables deep cloning of the definition. Used to give macros separate instances of the same + * definition. + * @since 2.0.0 + * @example + * // Example of a very simple/naive <<if>>/<<elseif>>/<<else>> macro implementation. + * Macro.add('if', { + * skipArgs: true, + * tags: ['elseif', 'else'], + * handler: function () { + * try { + * for (var i = 0, len = this.payload.length; i < len; ++i) { + * if ( + * this.payload[i].name === 'else' || + * !!Scripting.evalJavaScript(this.payload[i].args.full) + * ) { + * jQuery(this.output).wiki(this.payload[i].contents); + * break; + * } + * } + * } + * catch (ex) { + * return this.error('bad conditional expression: ' + ex.message); + * } + * } + * }); + */ + add(name: string | string[], + definition: { handler: (this: MacroContex) => void, tags?: string[], skipArgs?: boolean }, + deep?: boolean): void; + + /** + * Remove existing macro(s). + * @param name Name, or array of names, of the macro(s) to remove. + * @since 2.0.0 + */ + delete(name: string | string[]): void; + + /** + * Return the named macro definition, or null on failure. + * @param name Name of the macro whose definition should be returned. + * @since 2.0.0 + */ + get(name: string): object; + + /** + * Returns whether the named macro exists. + * @param name Name of the macro to search for. + * @since 2.0.0 + */ + has(name: string): boolean; + + /** + * @since 2.0.0 + */ + tags: MacroTags; + } + + declare interface Passage { + /** + * The DOM ID of the passage (created from the slugified passage title). + * @since 2.0.0 + */ + domId: string; + + /** + * The tags of the passage. + * @since 2.0.0 + */ + tags: string[]; + + /** + * The raw text of the passage. + * @since 2.0.0 + */ + text: string; + + /** + * The title of the passage. + * @since 2.0.0 + */ + title: string; + + /** + * Returns the description of the passage (created from either an excerpt of the passage or the + * Config.passages.descriptions object). + * @since 2.0.0 + */ + description(): string; + + /** + * Returns the text of the Passage object (similar to <Passage>.text) after applying nobr tag and image passage + * processing to it. + * @since 2.0.0 + */ + processText(): string; + } + + declare interface SavedMoment { + /** The title of the associated passage. */ + title: string; + /** The current variable store object, which contains sigil - less name ⇒ value pairs(e.g.$foo exists as foo). */ + variables: any; + /** The current pull count of SugarCube's seedable PRNG, exists only if enabled. */ + pull?: number; + } + + declare interface SavedState { + /** The array of moment objects. */ + history: SavedMoment[]; + /** The index of the active moment. */ + index: number; + /** The array of expired moment passage titles, exists only if any moments have expired. */ + expired?: string[]; + /** The seed of SugarCube's seedable PRNG, exists only if enabled. */ + seed?: string; + } + + declare interface SaveObject { + /** The story's save ID.*/ + id: string; + /** The marshaled story history(see below for details). */ + state: SavedState; + /** The title of the save. */ + title: string; + /** The date when the save was created(in milliseconds elapsed since epoch). */ + date: integer; + /** Save metadata(end - user specified; must be JSON - serializable). */ + metadata?: any; + /** Save version(end - user specified via Config.saves.version). */ + version?: any; + } + + declare interface Save { + /** + * Deletes all slot saves and the autosave, if it's enabled. + * @since 2.0.0 + */ + clear(): void; + + /** + * Returns the saves object. + * @since 2.0.0 + */ + get(): object; + + /** + * Returns whether both the slot saves and autosave are available and ready. + * @since 2.0.0 + */ + ok(): boolean; + + slots: { + /** + * Returns the total number of available slots. + * @since 2.0.0 + */ + length: number; + + /** + * Returns the total number of filled slots. + * @since 2.0.0 + */ + count(): number; + + /** + * Deletes a save from the given slot. + * @param slot Save slot index (0-based). + * @since 2.0.0 + */ + delete(slot: number): void; + + /** + * Returns a save object from the given slot or null, if there was no save in the given slot. + * @param slot Save slot index (0-based). + * @since 2.0.0 + */ + get(slot: number): SaveObject; + + /** + * Returns whether the given slot is filled. + * @param slot Save slot index (0-based). + * @since 2.0.0 + */ + has(slot: number): boolean; + + /** + * Returns whether there are any filled slots. + * @since 2.0.0 + */ + isEmpty(): boolean; + + /** + * Loads a save from the given slot. + * @param slot + */ + load(slot: number): void; + + /** + * Returns whether the slot saves are available and ready. + * @since 2.0.0 + */ + ok(): boolean; + + /** + * Saves to the given slot. + * @param slot Save slot index (0-based). + * @param title The title of the save. If omitted or null, defaults to the passage's description. + * @param metadata The data to be stored in the save object's metadata property. Must be JSON-serializable. + * @since 2.0.0 + */ + save(slot: number, title?: string, metadata?: any): void; + } + + autosave: { + /** + * Deletes the autosave. + * @since 2.0.0 + */ + delete(): void; + + /** + * Returns the save object from the autosave or null, if there was no autosave. + * @since 2.0.0 + */ + get(): SaveObject; + + /** + * Returns whether the autosave is filled. + * @since 2.0.0 + */ + has(): boolean; + + /** + * Loads the autosave. + * @since 2.0.0 + */ + load(): void; + + /** + * Returns whether the autosave is available and ready. + * @since 2.0.0 + */ + ok(): boolean; + + /** + * Saves to the autosave. + * @param title The title of the save. If omitted or null, defaults to the passage's description. + * @param metadata The data to be stored in the save object's metadata property. Must be JSON-serializable. + * @since 2.0.0 + */ + save(title?: string, metadata?: any): void; + } + + /** + * Saves to disk. + * @param filename The base filename of the save, which gets slugified to remove most symbols. Appended to this is a datestamp + * (format: YYYMMDD-hhmmss) and the file extension .save. (e.g. "The Scooby Chronicles" would result in the full filename: + * the-scooby-chronicles-{datestamp}.save). If omitted or null, defaults to the story's title. + * @param metadata The data to be stored in the save object's metadata property. Must be JSON-serializable. + * @since 2.8.0 + */ + export(filename?: string, metadata?: any): void; + + /** + * Loads a save from disk. + * + * NOTE: You do not call this manually, it must be called by the change event handler of an <input type="file"> element. + * @param event The event object which was passed to the change event handler of the associated <input type="file"> element. + * @since 2.0.0 + * @example + * // Add file input + * var input = document.createElement('input'); + * input.type = 'file'; + * input.id = 'saves-import-file'; + * input.name = 'saves-import-file'; + * // Set up Save.import() as the event handler for when a file has been chosen + * jQuery(input).on('change', Save.import); + */ + import(event: Event): void; + + /** + * Returns a save as a serialized string, or null if saving is not allowed within the current context. + * @param metadata The data to be stored as metadata. Must be JSON-serializable. + * @since 2.21.0 + */ + serialize(metadata?: any): string; + + /** + * Deserializes the given save string, created via Save.serialize(), and loads the save. Returns the bundled metadata, if any, + * or null if the given save could not be deserialized and loaded. + * @param saveStr The serialized save string. + * @since 2.21.0 + */ + deserialize(saveStr: string): any; + } + + declare interface Settings { + /** + * Adds a header to the Settings dialog. + * @param name Name of the header. + * @param desc Description explaining the header in greater detail. + * @since 2.7.1 + */ + addHeader(name: string, desc?: string): void; + + /** + * Adds the named property to the settings object and a toggle control for it to the Settings dialog. + * @param name Name of the settings property to add, which the control will manage. + * @param definition Definition of the control. + * @since 2.26.0 + */ + addToggle(name: string, definition: { + label: string, + desc?: string, + default?: boolean, + onInit?: () => void, + onChange?: () => void + }): void; + + /** + * Adds the named property to the settings object and a list control for it to the Settings dialog. + * @param name Name of the settings property to add, which the control will manage. + * @param definition Definition of the control. + * @since 2.26.0 + */ + addList(name: string, definition: { + label: string, + list: [], + desc?: string, + default?: any, + onInit?: () => void, + onChange?: () => void + }): void; + + /** + * Adds the named property to the settings object and a range control for it to the Settings dialog. + * @param name Name of the settings property to add, which the control will manage. + * @param definition Definition of the control. + * @since 2.0.0 + */ + addRange(name: string, definition: { + /** Label to use for the control. */ + label: string, + /** The minimum value. */ + min: number, + /** The maximum value. */ + max: number, + /** Limits the increments to which the value may be set.It must be evenly divisible into the full range + * — i.e.max - min. */ + step: numbe, + /** Description explaining the control in greater detail. */ + desc?: string, + /** The default value for the setting and default state of the control.Leaving it undefined means to use + * the value of max as the default. */ + default?: number, + /** The function to call during initialization. */ + onInit?: () => void, + /** The function to call when the control's state is changed. */ + onChange?: () => void + }): void; + + /** + * Loads the settings from storage. + * + * NOTE: The API automatically calls this method at startup, so you should never need to call this method manually. + * @since 2.0.0 + */ + load(): void; + + /** + * Resets the setting with the given name to its default value. If no name is given, resets all settings. + * @param name Name of the settings object property to reset. + * @since 2.0.0 + */ + reset(name?: string): void; + + /** + * Saves the settings to storage. + * + * NOTE: The controls of the Settings dialog automatically call this method when settings are changed, + * so you should normally never need to call this method manually. Only when manually modifying the values + * of settings object properties, outside of the controls, would you need to call this method. + * @since 2.0.0 + */ + save(); + } + + declare interface Story { + /** + * The DOM ID of the story (created from the slugified story title). + * @since 2.0.0 + */ + domId: string; + + /** + * The title of the story. + * @since 2.0.0 + */ + title: string; + + /** + * Returns the Passage object referenced by the given title, or an empty Passage object on failure. + * @param passageTitle The title of the Passage object to return. + * @since 2.0.0 + */ + get(passageTitle: string): Passage; + + /** + * Returns whether a Passage object referenced by the given title exists. + * @param passageTitle The title of the Passage object whose existence will be verified. + * @since 2.0.0 + */ + has(passageTitle): boolean; + + /** + * Returns an array of Passage objects each of which must contain a property matching the given name, + * whose value matches the given needle, or an empty array, if no matches are made. + * @param propertyName The name of property whose value will be compared to the search value. + * @param searchValue he value to search for within the matched property. The type of the property determines + * how the search occurs; direct comparison for non-arrays, while arrays are iterated over. If the property + * value, for non-arrays, or any of the property members' values, for arrays, match, then the Passage object + * is added to the results array. + * @param sortProperty The property whose value will be used to lexicographically sort the returned array. + * If not given, the Passage object's title property is used. + * @since 2.0.0 + * @example + * // Returns all 'forest'-tagged Passage objects, sorted by their titles + * Story.lookup("tags", "forest"); + */ + lookup(propertyName: string, searchValue: string | number, sortProperty?: string): Passage[]; + + /** + * Returns an array of Passage objects which passed the test implemented by the given filter function or + * an empty array, if no objects pass. + * @param filter The function used to test each Passage object, which is passed in as its sole parameter. + * If the function returns true, then the Passage object is added to the results array. + * @param sortProperty The property whose value will be used to lexicographically sort the returned array. + * If not given, the Passage object's title property is used. + * @since 2.11.0 + */ + lookupWith(filter: (p: Passage) => boolean, sortProperty?:string): Passage[]; + } + + declare interface UI { + /** + * Opens the built-in alert dialog, displaying the given message to the player. + * @param message The message to display to the player. + * @param options The options object. @see Dialog.addClickHandler() for more information. + * @param closeFn The function to execute whenever the dialog is closed. + * @since 2.0.0 + */ + alert(message: string, options?: object, closeFn?: () => void): void; + + /** + * Opens the built-in jump to dialog, which is populated via the bookmark tag. + * @param options The options object. @see Dialog.addClickHandler() for more information. + * @param closeFn The function to execute whenever the dialog is closed. + * @since 2.0.0 + */ + jumpto(options: object, closeFn?: () => void): void; + + /** + * Opens the built-in restart dialog, prompting the player to restart the story. + * @param options The options object. @see Dialog.addClickHandler() for more information. + * @since 2.0.0 + */ + restart(options?: any): void; + + /** + * Opens the built-in saves dialog. + * @param options The options object. See Dialog.addClickHandler() for more information. + * @param closeFn The function to execute whenever the dialog is closed. + * @since 2.0.0 + */ + saves(options: object, closeFn?: () => void): void; + + /** + * Opens the built-in settings dialog, which is populated from the Setting API. + * @param options The options object. See Dialog.addClickHandler() for more information. + * @param closeFn The function to execute whenever the dialog is closed. + * @sine 2.0.0 + * + */ + settings(options: object, closeFn?: () => void): void; + + /** + * Opens the built-in share dialog, which is populated from the StoryShare passage. + * @param options The options object. See Dialog.addClickHandler() for more information. + * @param closeFn The function to execute whenever the dialog is closed. + * @since 2.0.0 + */ + share(options: object, closeFn?: () => void): void; + } + + declare interface UIBar { + /** + * Completely removes the UI bar and all of its associated styles and event handlers. + * @since 2.17.0 + */ + destroy(): void; + + /** + * Stows the UI bar, so that it takes up less space. + * @since 2.17.0 + */ + stow(): void; + + /** + * Unstows UI bar, so that it is fully accessible again. + * @since 2.17.0 + */ + unstow(): void; + } + + declare interface StoryMoment { + title: string; + variables: any; + } + + declare interface State { + /** + * Returns the active (present) moment. + * @since 2.0.0 + */ + active: StoryMoment; + /** + * Returns the bottommost (least recent) moment from the full in-play history (past + future). + * @since 2.0.0 + */ + bottom: StoryMoment; + /** + * Returns the current moment from the full in-play history (past + future), which is the pre-play version of the active + * moment. + * + * WARNING: State.current is not a synonym for State.active. You will, very likely, never need to use State.current + * directly within your code. + * + * @since 2.8.0 + */ + current: StoryMoment; + /** + * Returns the number of moments within the past in-play history (past only). + * @since 2.0.0 + */ + length: number; + /** + * Returns the title of the passage associated with the active (present) moment. + * @since 2.0.0 + */ + passage: string; + /** + * Returns the current temporary variables. + * @since 2.13.0 + */ + temporary: any; + /** + * Returns the number of moments within the full in-play history (past + future). + * @since 2.0.0 + */ + size: number; + /** + * Returns the topmost (most recent) moment from the full in-play history (past + future). + * + * WARNING: State.top is not a synonym for State.active. You will, very likely, never need to use State.top directly + * within your code. + * @since 2.0.0 + */ + top: StoryMoment; + /** + * Returns the total number of played moments within the extended past history (expired + past). + * @since 2.0.0 + */ + turns: number; + /** + * Returns the variables from the active (present) moment. + * @since 2.0.0 + */ + variables: any; + /** + * Returns the value of the story or temporary variable by the given name. + * @param varName The name of the story or temporary variable, including its sigil—e.g. $charName. + * @since 2.22.0 + */ + getVar(varName: string): any; + /** + * Returns whether any moments with the given title exist within the past in-play history (past only). + * + * NOTE: State.has() does not check expired moments. If you need to know if the player has ever been to a particular + * passage, then you must use the State.hasPlayed() method or the hasVisited() story function. + * @param passageTitle The title of the moment whose existence will be verified. + * @since 2.0.0 + */ + has(passageTitle: string): boolean; + /** + * Returns whether any moments with the given title exist within the extended past history (expired + past). + * + * NOTE: If you need to check for multiple passages, the hasVisited() story function will likely be more convenient to + * use. + * @param passageTitle The title of the moment whose existence will be verified. + * @since 2.0.0 + */ + hasPlayed(passageTitle: string): boolean; + /** + * Returns the moment, relative to the bottom of the past in-play history (past only), at the given index. + * @param index The index of the moment to return. + * @since 2.0.0 + */ + index(index: number): StoryMoment; + /** + * Initializes the seedable pseudo-random number generator (PRNG) and integrates it into the story state and saves. + * Once initialized, the State.random() method and story functions, random() and randomFloat(), return results from + * the seeded PRNG (by default, they return results from Math.random()). + * + * NOTE: State.initPRNG() must be called during story initialization, within either a script section (Twine 2: the + * Story JavaScript, Twine 1/Twee: a script-tagged passage) or the StoryInit special passage. Additionally, it is + * recommended that you do not specify any arguments to State.initPRNG() and allow it to automatically seed itself. If + * you should chose to use an explicit seed, however, it is strongly recommended that you also enable additional + * entropy, otherwise all playthroughs for all players will be exactly the same. + * @param seed The explicit seed used to initialize the pseudo-random number generator. + * @param useEntropy Enables the use of additional entropy to pad the specified explicit seed. + * @since 2.0.0 + * @example + * State.initPRNG() // Automatically seed the PRNG (recommended) + * State.initPRNG("aVeryLongSeed") // Seed the PRNG with "aVeryLongSeed" + * State.initPRNG("aVeryLongSeed", true) // Seed the PRNG with "aVeryLongSeed" and pad it with extra entropy + */ + initPRNG(seed?: string, useEntropy?: boolean): void; + /** + * Returns whether the full in-play history (past + future) is empty. + * @since 2.0.0 + */ + isEmpty(): boolean; + /** + * Returns the moment, relative to the top of the past in-play history (past only), at the, optional, offset. + * @param offset The offset, from the top of the past in-play history, of the moment to return. If not given, an offset + * of 0 is used. + */ + peek(offset?: number): StoryMoment; + /** + * Returns a pseudo-random real number (floating-point) in the range 0 (inclusive) up to, but not including, 1 + * (exclusive). + * + * NOTE: By default, it simply returns results from Math.random(), however, when the seedable PRNG has been enabled, + * via State.initPRNG(), it returns results from the seeded PRNG instead. + * @since 2.0.0 + */ + random(): number; + /** + * Sets the value of the story or temporary variable by the given name. Returns whether the operation was successful. + * @param varName The name of the story or temporary variable, including its sigil—e.g. $charName. + * @param value The value to assign. + * @since 2.22.0 + */ + setVar(varName: string, value: any): boolean; + }; + + declare interface ISugarCube { + Config: Config; + State: State; + }; +} + +declare var SugarCube: SugarCube.ISugarCube; + +declare var Config: SugarCube.Config; +declare var Macro: SugarCube.Macro; +declare var State: SugarCube.State; +declare var Story: SugarCube.Story; +declare var setup: any; + + +/** + * Executed before the modification of the state history. + * @since 2.0.0 + */ +declare var prehistory: Record<string, SugarCube.DisplayTaskFunction>; + +/** + * Executed before the rendering of the incoming passage. + * @since 2.0.0 + */ +declare var predisplay: Record<string, SugarCube.DisplayTaskFunction>; + +/** + * Executed before the rendering of the incoming passage. + * @since 2.0.0 + */ +declare var prerender: Record<string, SugarCube.RenderTaskFunction>; + +/** + * Executed after the rendering of the incoming passage. + * @since 2.0.0 + */ +declare var postrender: Record<string, SugarCube.RenderTaskFunction>; + +/** + * Executed after the display (i.e. output) of the incoming passage. + * @since 2.0.0 + */ +declare var postdisplay: Record<string, SugarCube.DisplayTaskFunction>; + +/** + * A prototype-less generic object whose properties and values are defined by the Setting.addToggle(), + * Setting.addList(), and Setting.addRange() methods. + * + * Normally, the values of its properties are automatically managed by their associated Settings dialog + * control. If necessary, however, you may manually change their values—n.b. you'll need to call the + * Setting.save() after having done so. + * @since 2.0.0 + */ +declare var settings: any; + + +// SugarCube functions + +/** + * Returns a deep copy of the given value. + * + * @param original The object to value. + * + * NOTE: Only the primitives, generic objects, some JavaScript natives (specifically: Array, Date, Map, RegExp, and Set), + * and DOM node objects are supported by default. Unsupported objects will need a .clone() method to be properly supported + * by the cone() function—when called on such an object, it will simply defer to the local method. + * + * @since 2.0.0 + * + * @example + * // Without clone(); given the generic object: $foo = { id : 1 } + * <<set $bar to $foo>> + * <<set $bar.id to 5>> + * $foo.id -> Returns: 5 + * $bar.id -> Returns: 5 + * // With clone(); given the generic object: $foo = { id : 1 } + * <<set $bar to clone($foo)>> + * <<set $bar.id to 5>> + * $foo.id -> Returns: 1 + * $bar.id -> Returns: 5 + */ +declare function clone(original: any): any; + +/** + * Returns a random value from its given arguments. + * + * @param list The list of values to operate on. May be any combination of singular values, actual arrays, or array-like + * objects. All values will be concatenated into a single list for selection. NOTE: Does not flatten nested arrays — if + * this is required, the <Array>.flatten() method may be used to flatten the nested arrays prior to passing them to + * either(). + * @since 2.0.0 + * @example + * // Using singular values + * either("Blueberry", "Cherry", "Pecan") -> Returns a random pie from the whole list + * + * // Using arrays; given: $pies = ["Blueberry", "Cherry", "Pecan"] + * either($pies) -> Returns a random pie from the whole array + * + * // Using singular values and arrays; given: $letters = ["A", "B"] + * either($letters, "C", "D") -> Returns a random value from the whole list (i.e. "A", "B", "C", "D") + * + * // Using multiple arrays; given: $letters = ["A", "B"] & $numerals = ["1", "2"] + * either($letters, $numerals) -> Returns a random value from the whole list (i.e. "A", "B", "1", "2") + */ +declare function either(...list: any): any; + +/** + * Returns whether the passage with the given title occurred within the story history. If multiple passage titles are given, + * returns the logical-AND aggregate of the set (i.e. true if all were found, false if any were not found). + * @param passageNames The title(s) of the passage(s) to search for. May be a list or an array of passages. + * @since 2.7.0 + * @example + * <if hasVisited("Bar")>>…has been to the Bar…<</if>> + * <<if not hasVisited("Bar")>>…has never been to the Bar…<</if>> + * <<if hasVisited("Bar", "Café")>>…has been to both the Bar and Café<</if>> + * <<if not hasVisited("Bar", "Café")>>…has never been to either the Bar, Café, or both…<</if>> + */ +declare function hasVisited(...passageNames: string | string[]): boolean; + +/** + * Returns the number of turns that have passed since the last instance of the passage with the given title occurred within + * the story history or -1 if it does not exist. If multiple passage titles are given, returns the lowest count (which can + * be -1). + * @param passageNames The title(s) of the passage(s) to search for. May be a list or an array of passages. + * @since 2.0.0 + * @example + * <<if lastVisited("Bar") is -1>>…has never been to the Bar…<</if>> + * <<if lastVisited("Bar") is 0>>…is currently in the Bar…<</if>> + * <<if lastVisited("Bar") is 1>>…was in the Bar one turn ago…<</if>> + * <<if lastVisited("Bar", "Café") is -1>>…has never been to the Bar, Café, or both…<</if>> + * <<if lastVisited("Bar", "Café") is 2>>…has been to both the Bar and Café, most recently two turns ago…<</if>> + */ +declare function lastVisited(...passageNames: string | string[]): number; + +/** + * Load and integrate external JavaScript scripts. + * + * NOTE: Loading is done asynchronously at run time, so if the script must be available within a tight time frame, then you + * should use the Promise returned by the function to ensure the script is loaded before before it is needed. + * + * NOTE: A script section (Twine 2: the Story JavaScript; Twine 1/Twee: a script-tagged passage) is normally the best place + * to call importScripts(). + * + * @param urls The URLs of the external scripts to import. Loose URLs are imported concurrently, arrays of URLs are imported + * sequentially. + * + * @since 2.16.0 + * + * @example Basic usage + * // Import all scripts concurrently + * importScripts( + * "https://somesite/a/path/a.js", + * "https://somesite/a/path/b.js", + * "https://somesite/a/path/c.js", + * "https://somesite/a/path/d.js" + * ); + * + * // Import all scripts sequentially + * importScripts([ + * "https://somesite/a/path/a.js", + * "https://somesite/a/path/b.js", + * "https://somesite/a/path/c.js", + * "https://somesite/a/path/d.js" + * ]); + * + * // Import scripts a.js, b.js, and the c.js/d.js group concurrently, + * // while importing c.js and d.js sequentially relative to each other + * importScripts( + * "https://somesite/a/path/a.js", + * "https://somesite/a/path/b.js", + * [ + * "https://somesite/a/path/c.js", + * "https://somesite/a/path/d.js" + * ] + * ); + * + * @example Basic usage with the returned Promise object + * // Import a script while using the returned Promise to ensure that + * // the script has been fully loaded before executing dependent code + * importScripts("https://somesite/a/path/a.js") + * .then(function () { + * // Code that depends on the script goes here. + * }) + * .catch(function (err) { + * // There was an error loading the script, log it to the console. + * console.log(err); + * }); + * + * @example <caption>Saving the returned Promise object for later use</caption> + * // Import a script while saving the returned Promise so it may be used later + * setup.aScriptImport = importScripts("https://somesite/a/path/aScript.js"); + * + * // Use the returned Promise later on to ensure that the script has been fully + * // loaded before executing dependent code + * setup.aScriptImport + * .then(function () { + * // Code that depends on the script goes here. + * }) + * .catch(function (err) { + * // There was an error loading the script, log it to the console. + * console.log(err); + * }); + */ +declare function importScripts(...urls: string | string[]): Promise; + +/** + * Load and integrate external CSS stylesheets. + * + * NOTE: Loading is done asynchronously at run time, so if the stylesheet must be available within a tight time frame, then + * you should use the Promise returned by the function to ensure the stylesheet is loaded before it is needed. + * + * NOTE: A script section (Twine 2: the Story JavaScript; Twine 1/Twee: a script-tagged passage) is normally the best place + * to call importStyles(). + * @param urls The URLs of the external stylesheets to import. Loose URLs are imported concurrently, arrays of URLs are imported sequentially. + * @since 2.16.0 + * @example <caption>Basic usage</caption> + * // Import all stylesheets concurrently + * importStyles( + * "https://somesite/a/path/a.css", + * "https://somesite/a/path/b.css", + * "https://somesite/a/path/c.css", + * "https://somesite/a/path/d.css" + * ); + * + * // Import all stylesheets sequentially + * importStyles([ + * "https://somesite/a/path/a.css", + * "https://somesite/a/path/b.css", + * "https://somesite/a/path/c.css", + * "https://somesite/a/path/d.css" + * ]); + * + * // Import stylesheets a.css, b.css, and the c.css/d.css group concurrently, + * // while importing c.css and d.css sequentially relative to each other + * importStyles( + * "https://somesite/a/path/a.css", + * "https://somesite/a/path/b.css", + * [ + * "https://somesite/a/path/c.css", + * "https://somesite/a/path/d.css" + * ] + * ); + * + * @example <caption>Basic usage with the returned Promise object</caption> + * // Grab a loading screen lock + * var lsLockId = LoadScreen.lock(); + * + * // Import a stylesheet while using the returned Promise to ensure that the + * // stylesheet has been fully loaded before unlocking the loading screen + * importStyles("https://somesite/a/path/a.css") + * .then(function () { + * // The stylesheet has been loaded, release the loading screen lock. + * LoadScreen.unlock(lsLockId); + * }) + * .catch(function (err) { + * // There was an error loading the stylesheet, log it to the console. + * console.log(err); + * }); + */ +declare function importStyles(...urls: string | string[]): Promise; + +/** + * Returns the title of the active (present) passage. + * @since 2.0.0 + * @example + * <<if passage() is "Café">>…the current passage is the Café passage…<</if>> + */ +declare function passage(): string; + +/** + * Returns the title of the most recent previous passage whose title does not match that of the active passage or an empty + * string, if there is no such passage. + * @since 2.0.0 + * @example + * <<if previous() is "Café">>…the most recent non-active passage is the Café passage…<</if>> + * @example + * // Commonly used as part of a link to return to the most recent non-active passage + * [[Return|previous()]] + */ +declare function previous(): string; + +/** + * Returns a pseudo-random whole number (integer) within the range of the given bounds (inclusive)—i.e. [min, max]. + * + * NOTE: By default, it uses Math.random() as its source of randomness, however, when the seedable PRNG has been enabled, + * via State.initPRNG(), it uses the seeded PRNG instead. + * @param min The lower bound of the random number (inclusive). If omitted, will default to 0. + * @param max The upper bound of the random number (inclusive). + * @since 2.0.0 + * @example + * random(5) // Returns a number in the range 0–5 + * random(1, 6) // Returns a number in the range 1–6 + */ +declare function random(min?: number, max: number): number; + +/** + * Returns a pseudo-random real number (floating-point) within the range of the given bounds (inclusive for the minimum, + * exclusive for the maximum) — i.e. [min, max). + * + * NOTE: By default, it uses Math.random() as its source of randomness, however, when the seedable PRNG has been enabled, + * via State.initPRNG(), it uses the seeded PRNG instead. + * @param min The lower bound of the random number (inclusive). If omitted, will default to 0.0. + * @param max The upper bound of the random number (exclusive). + * @since 2.0.0 + * @example + * randomFloat(5.0) // Returns a number in the range 0.0–4.9999999… + * randomFloat(1.0, 6.0) // Returns a number in the range 1.0–5.9999999… + */ +declare function randomFloat(min?: number, max: number): number; + +/** + * Renders the selected passage into the target element, replacing any existing content, and returns the element. If no passages are found and default text is specified, it will be used instead. + * @param idOrElement The ID of the element or the element itself. + * @param passages The name(s) of the passage(s) to search for. May be a single passage or an array of passages. If an array + * of passage names is specified, the first passage to be found is used. + * @param defaultText The default text to use if no passages are found. + * + * @since 2.0.0 + * + * NOTE: As it is highly unlikely that either an array of passage names or default text will be needed in the vast majority + * of cases, only a few basic examples will be given. + * @example + * // Using an ID; given an existing element on the page: <div id="my-display"></div> + * setPageElement("my-display", "MyPassage"); + * @example + * // Using an element; given a reference to an existing element: myElement + * setPageElement(myElement, "MyPassage"); + */ +declare function setPageElement( + idOrElement: string | HTMLElement, + passages: string | string[], + defaultText?: string): HTMLElement | null; + +/** + * Returns a new array consisting of all of the tags of the given passages. + * @param passages The passages from which to collect tags. May be a list or an array of passages. If omitted, will default + * to the current passage. + * @since 2.0.0 + * @example + * <<if tags().includes("forest")>>…the current passage is part of the forest…<</if>> + * <<if tags("Lonely Glade").includes("forest")>>…the Lonely Glade passage is part of the forest…<</if>> + */ +declare function tags(...passages?: string | string[]): string[]; + +/** + * Returns a reference to the current temporary variables store (equivalent to: State.temporary). This is only really useful + * within pure JavaScript code, as within TwineScript you may simply access temporary variables natively. + * @since 2.19.0 + * @example + * // Given: _selection is 'Zagnut Bar' + * if (temporary().selection === 'Zagnut Bar') { + * // Do something... + * } + */ +declare function temporary(): object; + +/** + * Returns the number of milliseconds which have passed since the current passage was rendered to the page. + * @since 2.0.0 + * @example + * // Links which vary based on the time + * In the darkness, something wicked this way comes. Quickly! Do you \ + * <<link "try to run back into the light">> + * <<if time() lt 5000>> + * /% The player clicked the link in under 5s, so they escape %/ + * <<goto "Well lit passageway">> + * <<else>> + * /% Else, they're eaten by a grue %/ + * <<goto "Eaten by a grue">> + * <</if>> + * <</link>> \ + * or [[stand your ground|Eaten by a grue]]? + */ +declare function time(): number; + +/** + * Returns the number of passages that the player has visited. + * @since 2.0.0 + * @example + * << print "This is turn #" + turns() >> + */ +declare function turns(): number; + +/** + * Returns a reference to the active(present) story variables store(equivalent to: State.variables).This is only really + * useful within pure JavaScript code, as within TwineScript you may simply access story variables natively. + * @since 2.0.0 + * @example + * // Given: $hasGoldenKey is true + * if (variables().hasGoldenKey) { + * //Do something + * } + */ +declare function variables(): object; + +/** + * Returns the number of times that the passage with the given title occurred within the story history. If multiple passage + * titles are given, returns the lowest count. + * @param passages The title(s) of the passage(s) to search for. May be a list or an array of passages. If omitted, will + * default to the current passage. + * @since 2.0.0 + * @example + * <<if visited() is 3>>…this is the third visit to the current passage…<</if>> + * <<if visited("Bar")>>…has been to the Bar at least once…<</if>> + * <<if visited("Café") is 1>>…has been to the Café exactly once…<</if>> + * <<if visited("Bar", "Café") is 4>>…has been to both the Bar and Café at least four times…<</if>> + */ +declare function visited(...passages?: string | string[]): number; + +/** + * Returns the number of passages within the story history which are tagged with all of the given tags. + * @param tags The tags to search for. May be a list or an array of tags. + * @since 2.0.0 + * @example + * <<if visitedTags("forest")>>…has been to some part of the forest at least once…<</if>> + * <<if visitedTags("forest", "haunted") is 1>>…has been to the haunted part of the forest exactly once…<</if>> + * <<if visitedTags("forest", "burned") is 3>>…has been to the burned part of the forest three times…<</if>> + */ +declare function visitedTags(...tags: string | string[]): number; + +declare interface Array<T> { + /** + * Concatenates one or more unique members to the end of the base array and returns the result as a new array. Does not modify the original. + * @param members The members to concatenate. Members which are arrays will be merged—i.e. their members will be concatenated, rather than the array itself. + * @since SugarCube 2.21.0 + * @example + * // Given: $fruits1 = ["Apples", "Oranges"], $fruits2 = ["Pears", "Plums"] + * $fruits1.concatUnique($fruits2) → Returns ["Apples", "Oranges", "Pears", "Plums"] + * $fruits1.concatUnique($fruits2, $fruits2) → Returns ["Apples", "Oranges", "Pears", "Plums"] + * $fruits1.concatUnique("Pears") → Returns ["Apples", "Oranges", "Pears"] + * $fruits1.concatUnique("Pears", "Pears") → Returns ["Apples", "Oranges", "Pears"] + * $fruits1.concatUnique($fruits2, "Pears") → Returns ["Apples", "Oranges", "Pears", "Plums"] + */ + concatUnique(...members: any): T[]; + + /** + * Returns the number of times that the given member was found within the array, starting the search at position. + * @param needle The member to count. + * @param position The zero-based index at which to begin searching for needle. If omitted, will default to 0. + * @since SugarCube 2.0.0 + * @example + * // Given: $fruits = ["Apples", "Oranges", "Plums", "Oranges"] + * $fruits.count("Oranges") → Returns 2 + * $fruits.count("Oranges", 2) → Returns 1 + */ + count(needle: any, position?: number): number; + + /** + * Removes all instances of the given members from the array and returns a new array containing the removed members. + * @param needles The members to remove. May be a list of members or an array. + * @returns new array + * @since SugarCube 2.5.0 + * @example + * // Given: $fruits = ["Apples", "Oranges", "Plums", "Oranges"] + * $fruits.delete("Oranges") → Returns ["Oranges", "Oranges"]; $fruits ["Apples", "Plums"] + * $fruits.delete("Apples", "Plums") → Returns ["Apples", "Plums"]; $fruits ["Oranges", "Oranges"] + */ + delete(...needles: any): T[]; + + /** + * Removes all of the members at the given indices from the array and returns a new array containing the removed + * members. + * @param indices The indices of the members to remove. + * @sine SugarCube 2.5.0 + * @example + * // Given: $fruits = ["Apples", "Oranges", "Plums", "Oranges"] + * $fruits.deleteAt(2) → Returns ["Plums"]; $fruits ["Apples", "Oranges", "Oranges"] + * $fruits.deleteAt(1, 3) → Returns ["Oranges", "Oranges"]; $fruits ["Apples", "Plums"] + * $fruits.deleteAt(0, 2) → Returns ["Apples", "Plums"]; $fruits ["Oranges", "Oranges"] + */ + deleteAt(...indices: number | number[]): T[]; + + /** + * Removes all of the members that pass the test implemented by the given predicate function from the array and returns + * a new array containing the removed members. + * @param predicate The function used to test each member. It is called with three arguments: + * value: The member being processed. + * index: (optional, integer) The index of member being processed. + * array: (optional, array) The array being processed. + * @param thisArg The value to use as this when executing predicate. + * @example + * // Given: $fruits = ["Apples", "Apricots", "Oranges"] + * $fruits.deleteWith(function (val) { + * return val === "Apricots"; + * }) // Returns ["Apricots"]; + * // and now $fruits is ["Apples", "Oranges"] + * + * $fruits.deleteWith(function (val) { + * return val.startsWith("Ap"); + * }) // Returns ["Apples", "Apricots"]; + * // and now $fruits is ["Oranges"] + * + * // Given: $fruits = [{ name : "Apples" }, { name : "Apricots" }, { name : "Oranges" }] + * $fruits.deleteWith(function (val) { + * return val.name === "Apricots"; + * }) // Returns [{ name : "Apricots" }]; $fruits [{ name : "Apples" }, { name : "Oranges" }] + * + * $fruits.deleteWith(function (val) { + * return val.name.startsWith("Ap"); + * }) // Returns [{ name : "Apples" }, { name : "Apricots" }]; + * // and now $fruits is [{ name : "Oranges" }] + */ + deleteWith(predicate: (value: T, index?: number, array?: T[]) => boolean, thisArg?: T[]): T[]; + + /** + * Returns the first member from the array. Does not modify the original. + * @since SugarCube 2.2.7.0 + * @example + * // Given: $pies = ["Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin"] + * $pies.first() // Returns "Blueberry" + */ + first(): T; + + /** + * Returns a new array consisting of the flattened source array (i.e. flat map reduce). Does not modify the original. + * @since SugarCube 2.0.0 + * @example + * // Given: $npa = [["Alfa", "Bravo"], [["Charlie", "Delta"], ["Echo"]], "Foxtrot"] + * $npa.flatten() // Returns ["Alfa", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot"] + */ + flatten(): T[]; + + /** + * Returns whether all of the given members were found within the array. + * @param needles The members to find. May be a list of members or an array. + * @since SugarCube 2.10.0 + * @example + * // Given: $pies = ["Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin"] + * <<if $pies.includesAll("Cherry", "Pecan")>>…found Cherry and Pecan pies…<</if>> + * @example + * // Given: $search = ["Blueberry", "Pumpkin"] + * <<if $pies.includesAll($search)>>…found Blueberry and Pumpkin pies…<</if>> + */ + includesAll(...needles: T | T[]): boolean; + + /** + * Returns whether any of the given members were found within the array. + * @param needles The members to find. May be a list of members or an array. + * @since SugarCube 2.10.0 + * @example + * // Given: $pies = ["Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin"] + * <<if $pies.includesAny("Cherry", "Pecan")>>…found Cherry or Pecan pie…<</if>> + * @example + * // Given: $search = ["Blueberry", "Pumpkin"] + * <<if $pies.includesAny($search)>>…found Blueberry or Pumpkin pie…<</if>> + */ + includesAny(...needles: T | T[]): boolean; + + /** + * Returns the last member from the array. Does not modify the original. + * @since SugarCube 2.27.0 + * @example + * // Given: $pies = ["Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin"] + * $pies.last() // Returns "Pumpkin" + */ + last(): T; + + /** + * Removes and returns a random member from the array. + * @since SugarCube 2.0.0 + * @example + * // Given: $pies = ["Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin"] + * $pies.pluck() // Removes and returns a random pie from the array + */ + pluck(): T; + + /** + * Randomly removes the given number of members from the base array and returns the removed members as a new array. + * @param want The number of members to pluck. + * @since SugarCube 2.20.0 + * @example + * // Given: $pies = ["Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin"] + * $pies.pluckMany(3) // Removes three random pies from the array and returns them as a new array + */ + pluckMany(want?: number): T[]; + + /** + * Appends one or more unique members to the end of the base array and returns its new length. + * @param members The members to append. + * @since 2.21.0 + * @example + * // Given: $fruits = ["Apples", "Oranges"] + * $fruits.pushUnique("Apples") // Returns 2; $fruits ["Apples", "Oranges"] + * $fruits.pushUnique("Plums", "Plums") // Returns 3; $fruits ["Apples", "Oranges", "Plums"] + */ + pushUnique(...members): number; + + /** + * Returns a random member from the array. Does not modify the original. + * @since SugarCube 2.0.0 + * @example + * // Given: $pies = ["Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin"] + * $pies.random() // Returns a random pie from the array + */ + random(): T; + + /** + * Randomly selects the given number of unique members from the array and returns the selected members as a new array. + * Does not modify the original. + * @param want The number of members to select. + * @since SugarCube 2.20.0 + * @example + * // Given: $pies = ["Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin"] + * $pies.randomMany(3) // Returns a new array containing three unique random pies from the array + */ + randomMany(want?: number): T[]; + + /** + * Randomly shuffles the array. + * @since SugarCube 2.0.0 + * @example + * // Given: $pies = ["Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin"] + * $pies.shuffle() // Randomizes the order of the pies in the array + */ + shuffle(): T[]; + + + /** + * Prepends one or more unique members to the beginning of the base array and returns its new length. + * @param members The members to append. + * @since SugarCube 2.21.0 + * @example + * // Given: $fruits = ["Oranges", "Plums"] + * $fruits.unshiftUnique("Oranges") // Returns 2; $fruits ["Oranges", "Plums"] + * $fruits.unshiftUnique("Apples", "Apples") // Returns 3; $fruits ["Apples", "Oranges", "Plums"] + */ + unshiftUnique(...members?: T): number; + + // deprecated members + + /** + * + * @param needle + * @param position + * @deprecated in favor of <Array>.includes(). + */ + contains(needle: any, position?: number): boolean; + + /** + * + * @param needle + * @deprecated in favor of <Array>.includesAll(). + */ + containsAll(...needle): boolean; + + /** + * + * @param needle + * @deprecated in favor of <Array>.includesAny(). + */ + containsAny(...needle): boolean; + + /** + * + * @param array + * @deprecated + */ + random(array: []): any; +} + + +interface JSON { + /** + * Returns the given code string, and optional data chunk, wrapped within the JSON deserialization revive wrapper. + * Intended to allow authors to easily wrap their custom object types (a.k.a. classes) revival code and associated data + * within the revive wrapper, which should be returned from an object instance's .toJSON() method, so that the instance + * may be properly revived upon deserialization. + * @param codeString The revival code string to wrap. + * @param reviveData he data which should be made available to the evaluated revival code during deserialization via the + * special $ReviveData$ variable. WARNING: Attempting to pass the value of an object instance's this directly as the + * reviveData parameter will trigger out of control recursion in the serializer, so a clone of the instance's own data + * must be passed instead. + * @since SugarCube 2.9.0 + * @example + * JSON.reviveWrapper( <valid JavaScript code string> ); // -> Without data chunk + * JSON.reviveWrapper( <valid JavaScript code string> , myOwnData); // -> With data chunk + * // E.g. Assume that you're attempting to revive an instance of a custom class named + * // `Character`, which is assigned to a story variable named `$pc`. The call + * // to `JSON.reviveWrapper()` might look something like the following. + * var ownData = {}; + * Object.keys(this).forEach(function (pn) { ownData[pn] = clone(this[pn]); }, this); + * return JSON.reviveWrapper('new Character($ReviveData$)', ownData); + */ + reviveWrapper(codeString: strin, reviveData?: any): []; +} + +interface Math { + /** + * Returns the given number clamped to the specified bounds. Does not modify the original. + * @param num The number to clamp. May be an actual number or a numerical string. + * @param min The lower bound of the number. + * @param max The upper bound of the number. + * @since SugarCube 2.0.0 + * @example + * Math.clamp($stat, 0, 200) // Clamps $stat to the bounds 0–200 and returns the new value + * Math.clamp($stat, 1, 6.6) // Clamps $stat to the bounds 1–6.6 and returns the new value + */ + static clamp(num: number | string, min: number, max: number): number; + + /** + * Returns the whole(integer) part of the given number by removing its fractional part, if any. Does not modify the + * original. + * @param num The number to truncate to an integer. + * @since SugarCube 2.0.0 + * @example + * Math.trunc(12.7) // Returns 12 + * Math.trunc(-12.7) // Returns -12 + */ + static trunc(num: number): number; +} diff --git a/src/facilities/farmyard/farmyard.tw b/src/facilities/farmyard/farmyard.tw index 72a8dbea018c78103418a354f94ea4ab639bacc4..7e094e405e4792f4a525551127901ea496e0f152 100644 --- a/src/facilities/farmyard/farmyard.tw +++ b/src/facilities/farmyard/farmyard.tw @@ -267,16 +267,15 @@ $farmyardNameCaps is an oasis of growth in the midst of the jungle of steel and $farmyardNameCaps is using genetically modified seeds, moderately increasing the amount of crops it produces. <br> <</if>> -<<if $cheatMode == 1>> - <<if $rep > 18000>> - <<if $farmyardUpgrade.lab == 0>> - [[Purchase an R&D lab to experiment with different plant and animal types|Farmyard][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "farmyard"), $farmyardUpgrade.lab = 1, $farmyardLab = 1]] - //Costs <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>> and unlocks the Research Lab.// - <br> - <<else>> - A high-tech metal door, complete with retinal and fingerprint scanners, stands at the far end of $farmyardName. - <br> - <</if>> +<<if $rep > 18000>> + <<if $farmyardUpgrade.lab == 0>> + [[Purchase an R&D lab to experiment with different plant and animal types|Farmyard][cashX(forceNeg(Math.trunc(50000*$upgradeMultiplierArcology)), "farmyard"), $farmyardUpgrade.lab = 1, $farmyardLab = 1]] + //Costs <<print cashFormat(Math.trunc(50000*$upgradeMultiplierArcology))>> and unlocks the Research Lab.// + <<run $merchantIllegalWares.push("AnimalOrgans")>> + <br> + <<else>> + A high-tech metal door, complete with retinal and fingerprint scanners, stands at the far end of $farmyardName. + <br> <</if>> <</if>> </span> @@ -455,11 +454,9 @@ $farmyardNameCaps is an oasis of growth in the midst of the jungle of steel and //Will cost @@.yellowgreen;<<print cashFormat(_removeCost)>>@@// <</if>> -<<if $cheatMode == 1>> - <<if $farmyardLab > 0>> - <br><br> - A <<link "research and development lab" "FarmyardLab">><</link>> has been built at one end of $farmyardName. - <</if>> +<<if $farmyardLab > 0>> + <br><br> + A <<link "research and development lab" "FarmyardLab">><</link>> has been built at one end of $farmyardName. <</if>> </span> diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index 61c4d2d55cfd3d1b958a22ed1718d5e214f97fe3..3bbf18b63b1e7806d5678a840a2174b3192be69c 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -431,7 +431,7 @@ You should have received a copy of the GNU General Public License along with thi <</if>> /*Undefining corporation variables*/ - <<unset $corpCash,$personalShares,$publicShares,$corpDividend,$dividendTimer,$corpDiv,$corpRev,$corpDivExtraSlaves,$corpDivLegalSlaves,$corpDivBreakSlaves,$corpDivBreakSlaves2,$corpDivSurgerySlaves,$corpDivSurgerySlaves2,$corpDivTrainSlaves,$corpDivTrainSlaves2,$corpDivArcadeSlaves,$corpDivMenialSlaves,$corpDivDairySlaves,$corpDivWhoreSlaves,$corpRevOld,$corpAssetsSlaveOld,$corpAssetsSlave,$corpAssetsDevOld,$corpAssetsDev,$corpOverheadOld,$corpOpCostOld,$corpProfitOld,$corpSpecAccent,$corpSpecAge,$corpSpecAmputee,$corpSpecBalls,$corpSpecDevotion,$corpSpecDick,$corpSpecEducation,$corpSpecGender,$corpSpecGenitalia,$corpSpecWeight,$corpSpecHeight,$corpSpecHormones,$corpSpecImplants,$corpSpecInjection,$corpSpecIntelligence,$corpSpecMilk,$corpSpecMuscle,$corpSpecPussy,$corpSpecSexEd,$corpSpecTrust,$corpSpecVirgin>> + <<unset $corpCash,$personalShares,$publicShares,$corpDividend,$dividendTimer,$corpDiv,$corpRev,$corpDivExtraSlaves,$corpDivLegalSlaves,$corpDivBreakSlaves,$corpDivBreakSlaves2,$corpDivSurgerySlaves,$corpDivSurgerySlaves2,$corpDivTrainSlaves,$corpDivTrainSlaves2,$corpDivArcadeSlaves,$corpDivMenialSlaves,$corpDivDairySlaves,$corpDivWhoreSlaves,$corpRevOld,$corpAssetsSlaveOld,$corpAssetsSlave,$corpAssetsDevOld,$corpAssetsDev,$corpOverheadOld,$corpOpCostOld,$corpProfitOld,$corpSpecAccent,$corpSpecAge,$corpSpecAmputee,$corpSpecBalls,$corpSpecDevotion,$corpSpecDick,$corpSpecEducation,$corpSpecGender,$corpSpecGenitalia,$corpSpecWeight,$corpSpecHeight,$corpSpecHormones,$corpSpecImplants,$corpSpecInjection,$corpSpecIntelligence,$corpSpecMilk,$corpSpecMuscle,$corpSpecPussy,$corpSpecSexEd,$corpSpecTrust,$corpSpecVirgin,$corpDivExtraToArcade,$corpDivExtraToBreak,$corpDivExtraToMarket,$corpDivLegalToMenial,$corpDivLegalToSurgery,$corpDivLegalToTrain,$corpDivLegalToMarket,$corpDivBreakToMenial,$corpDivBreakToSurgery,$corpDivBreakToTrain,$corpDivBreakToMarket,$corpDivBreakFromMarket,$corpDivSurgeryToDairy,$corpDivSurgeryToTrain,$corpDivSurgeryToMarket,$corpDivSurgeryFromMarket,$corpDivTrainToWhore,$corpDivTrainToMarket,$corpDivTrainFromMarket,$corpDivArcadeFromMarket,$corpDivMenialFromMarket,$corpDivDairyFromMarket,$corpDivWhoreFromMarket>> <</if>> @@ -779,6 +779,7 @@ You should have received a copy of the GNU General Public License along with thi <<set $newCorp = 1>> <<set $corpEasy = 0>> <<set $vanillaShareSplit = 1>> +<<set $corpEcon = 0>> <<set $corpCashDividend = 0>> <<set $corpDiv = 0>> <<set $corpExpand = 0>> diff --git a/src/js/economyJS.js b/src/js/economyJS.js index e02c059bb277b158e4c58bf1ef5ddf72460e3fb6..b9339bb6389e1f2e6063646d52280f4aec045e1e 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -86,7 +86,7 @@ window.getCost = function(array) { cashX(forceNeg(getRecruiterCosts()), "recruiter"); cashX(forceNeg(getSchoolCosts()), "schoolBacking"); cashX(forceNeg(getPolicyCosts()), "policies"); - cashX(forceNeg(getCyberModCosts()), "cyberMod"); + cashX(forceNeg(getCyberModCosts()), "lab"); cashX(forceNeg(getPCTrainingCosts()), "PCtraining"); cashX(forceNeg(getPCCosts()), "PCmedical"); getTotalSlaveCosts(array2); diff --git a/src/npc/fSlaveImpreg.tw b/src/npc/fSlaveImpreg.tw index d8aaf62c89f34e4b2d3ef36b50254610c4a55a8d..e2fab7e1233222b1b757854948530c4c3cf62b4c 100644 --- a/src/npc/fSlaveImpreg.tw +++ b/src/npc/fSlaveImpreg.tw @@ -14,6 +14,40 @@ __Select an eligible slave to serve as the semen donatrix:__ <<if ($slaves[_i].ID != $activeSlave.ID) && canImpreg($activeSlave, $slaves[_i])>> <<set _name = SlaveFullName($slaves[_i])>> <br><<print "[[_name|FSlaveImpreg Consummate][$impregnatrix = $slaves[" + _i + "]]]">> + <<if $slaves[_i].customLabel>> (@@.yellow;''<<print $slaves[_i].customLabel>>''@@)<</if>> + <<if $familyTesting == 1 && totalRelatives($activeSlave) > 0>> + /* parental test */ + <<if ($activeSlave.father && $slaves[_i].ID == $activeSlave.father)>> + @@.lightgreen;Father@@ + <</if>> + <<if ($activeSlave.mother && $slaves[_i].ID == $activeSlave.mother)>> + @@.lightgreen;Mother@@ + <</if>> + /* offspring test */ + <<if ($slaves[_i].mother && $slaves[_i].mother == $activeSlave.ID)>> + @@.lightgreen;Daughter@@ + <</if>> + <<if ($slaves[_i].father && $slaves[_i].father == $activeSlave.ID)>> + @@.lightgreen;Daughter@@ + <</if>> + /* sibling test */ + <<switch areSisters($activeSlave, $slaves[_i])>> + <<case 1>> + @@.lightgreen;Twin.@@ + <<case 2>> + <<if ($slaves[_i].genes == "XX")>> + @@.lightgreen;Sister@@ + <<else>> + @@.lightgreen;Brother@@ + <</if>> + <<case 3>> + <<if ($slaves[_i].genes == "XX")>> + @@.lightgreen;Half-Sister@@ + <<else>> + @@.lightgreen;Half-Brother@@ + <</if>> + <</switch>> + <</if>> /* closes extended family mode */ <<set $eligibility = 1>> <</if>> <</for>> diff --git a/src/pregmod/fSlaveSlaveDick.tw b/src/pregmod/fSlaveSlaveDick.tw index f5913d9b5b3a4c249e0dac9e0aeeb6d625cb2a62..cc2f317712e2a0cdb630ef06f4f3095c0dcd7e8d 100644 --- a/src/pregmod/fSlaveSlaveDick.tw +++ b/src/pregmod/fSlaveSlaveDick.tw @@ -11,6 +11,43 @@ __Select an eligible slave:__ <<if ($slaves[_i].ID != $activeSlave.ID) && isSlaveAvailable($slaves[_i]) && canDoVaginal($slaves[_i]) && canWalk($slaves[_i])>> /* amp-amp scene is not written */ <<set _name = SlaveFullName($slaves[_i])>> <br><<print "[[_name|FSlaveSlaveDick Consummate][$slaverapistx = $slaves[" + _i + "]]]">> + <<if $slaves[_i].customLabel>> (@@.yellow;''<<print $slaves[_i].customLabel>>''@@)<</if>> + <<if (canImpreg($slaves[_i], $activeSlave))>> + @@.green;Fertile@@ + <</if>> + <<if $familyTesting == 1 && totalRelatives($activeSlave) > 0>> + /* parental test */ + <<if ($activeSlave.father && $slaves[_i].ID == $activeSlave.father)>> + @@.lightgreen;Father@@ + <</if>> + <<if ($activeSlave.mother && $slaves[_i].ID == $activeSlave.mother)>> + @@.lightgreen;Mother@@ + <</if>> + /* offspring test */ + <<if ($slaves[_i].mother && $slaves[_i].mother == $activeSlave.ID)>> + @@.lightgreen;Daughter@@ + <</if>> + <<if ($slaves[_i].father && $slaves[_i].father == $activeSlave.ID)>> + @@.lightgreen;Daughter@@ + <</if>> + /* sibling test */ + <<switch areSisters($activeSlave, $slaves[_i])>> + <<case 1>> + @@.lightgreen;Twin.@@ + <<case 2>> + <<if ($slaves[_i].genes == "XX")>> + @@.lightgreen;Sister@@ + <<else>> + @@.lightgreen;Brother@@ + <</if>> + <<case 3>> + <<if ($slaves[_i].genes == "XX")>> + @@.lightgreen;Half-Sister@@ + <<else>> + @@.lightgreen;Half-Brother@@ + <</if>> + <</switch>> + <</if>> /* closes extended family mode */ <<set _capable = 1>> <</if>> <</for>> diff --git a/src/pregmod/manageCorporation.tw b/src/pregmod/manageCorporation.tw index 2dd6af0ed5f6fc359ad1a6d1c0d74931fdc131e0..d26daf1d5fe3cf8f1b6c429bde94a3619a3cbfd1 100644 --- a/src/pregmod/manageCorporation.tw +++ b/src/pregmod/manageCorporation.tw @@ -104,10 +104,20 @@ _corpDivWhoreSlavesRoom = corpDivWhoreSlavesRoom()>> __Corporation Overview__ <br>Last Week's Revenue: @@.yellowgreen;<<print cashFormat($corpRevOld)>>@@ /*Returns last week's revenue, gets calculated in corporationDevelopments, but slaves sold here also added to it for next week*/ +<<if ($cheatMode) && ($cheatModeM) && $corpNeighborBonus > 0>> + <br>Including Last Week's Neighbor Bonus: @@.yellowgreen;<<print cashFormat($corpNeighborBonus)>>@@ +<</if>> <br>Last Week's Operating Expenses: @@.red;<<print cashFormat($corpOpCostOld)>>@@ /*Just like revenue, except for operating expenses (all calculated in corporationDevelopments)*/ <br>Last Week's Slave Expenses: <<if $corpAssetsSlaveOld > 0>>@@.red;<<print cashFormat($corpAssetsSlaveOld)>>@@<<else>>@@.yellowgreen;<<print cashFormat($corpAssetsSlaveOld)>>@@<</if>> /*buying slaves to work on adds to this expense, works just like revenue*/ <br>Last Week's Asset Expenses: <<if $corpAssetsDevOld > 0>>@@.red;<<print cashFormat($corpAssetsDevOld)>>@@<<else>>@@.yellowgreen;<<print cashFormat($corpAssetsDevOld)>>@@<</if>> /*costs associated with expanding divisions end up here, reports costs from last week, not current*/ <<if $corpOverheadOld > 0>><br>Last Week's Overhead: @@.red;<<print cashFormat($corpOverheadOld)>>@@<</if>> +<<if ($cheatMode) && ($cheatModeM)>> + <<if $corpEcon < 0>> + <br>Last Week's Economic Expenses: @@.red;<<print cashFormat(-$corpEcon)>>@@ + <<else>> + <br>Last Week's Economic Windfall: @@.yellowgreen;<<print cashFormat($corpEcon)>>@@ + <</if>> +<</if>> <br>Last Week's Profit: <<if $corpProfitOld > 0>>@@.yellowgreen;<<print cashFormat($corpProfitOld)>>@@<<else>>@@.red;<<print cashFormat($corpProfitOld)>>@@<</if>> <br> <br>Available Liquidity: @@ -517,7 +527,8 @@ __Division Management__ $menialDemandFactor -= $corpDivBreakSlaves + $corpDivBreakSlaves2, $corpExpandToken += 1>> <<unset $corpDivBreakSlaves, - $corpDivBreakSlaves2>> + $corpDivBreakSlaves2, + $corpDivExtraToBreak>> <<goto "Manage Corporation">> <</link>> <</if>> @@ -666,7 +677,9 @@ __Division Management__ $menialDemandFactor -= $corpDivSurgerySlaves + $corpDivSurgerySlaves2, $corpExpandToken += 1>> <<unset $corpDivSurgerySlaves, - $corpDivSurgerySlaves2>> + $corpDivSurgerySlaves2, + $corpDivLegalToSurgery, + $corpDivBreakToSurgery>> <<goto "Manage Corporation">> <</link>> <</if>> @@ -902,7 +915,10 @@ __Division Management__ $menialDemandFactor -= $corpDivTrainSlaves + $corpDivTrainSlaves2, $corpExpandToken += 1>> <<unset $corpDivTrainSlaves, - $corpDivTrainSlaves2>> + $corpDivTrainSlaves2, + $corpDivSurgeryToTrain, + $corpDivBreakToTrain, + $corpDivLegalToTrain>> <<goto "Manage Corporation">> <</link>> <<else>> @@ -916,7 +932,10 @@ __Division Management__ $menialDemandFactor -= $corpDivTrainSlaves + $corpDivTrainSlaves2, $corpExpandToken += 1>> <<unset $corpDivTrainSlaves, - $corpDivTrainSlaves2>> + $corpDivTrainSlaves2, + $corpDivSurgeryToTrain, + $corpDivBreakToTrain, + $corpDivLegalToTrain>> <<goto "Manage Corporation">> <</link>> <</if>> @@ -1010,7 +1029,8 @@ __Division Management__ $corpDivArcadeDev = 0, $menialDemandFactor -= $corpDivArcadeSlaves, $corpExpandToken += 1>> - <<unset $corpDivArcadeSlaves>> + <<unset $corpDivArcadeSlaves, + $corpDivExtraToArcade>> <<goto "Manage Corporation">> <</link>> <</if>> @@ -1092,7 +1112,9 @@ __Division Management__ $corpDivMenialDev = 0, $menialDemandFactor -= $corpDivMenialSlaves, $corpExpandToken += 1>> - <<unset $corpDivMenialSlaves>> + <<unset $corpDivMenialSlaves, + $corpDivBreakToMenial, + $corpDivLegalToMenial>> <<goto "Manage Corporation">> <</link>> <</if>> @@ -1174,7 +1196,8 @@ __Division Management__ $corpDivDairyDev = 0, $menialDemandFactor -= $corpDivDairySlaves, $corpExpandToken += 1>> - <<unset $corpDivDairySlaves>> + <<unset $corpDivDairySlaves, + $corpDivSurgeryToDairy>> <<goto "Manage Corporation">> <</link>> <</if>> @@ -1305,7 +1328,8 @@ __Division Management__ $corpDivWhoreDev = 0, $menialDemandFactor -= $corpDivWhoreSlaves, $corpExpandToken += 1>> - <<unset $corpDivWhoreSlaves>> + <<unset $corpDivWhoreSlaves, + $corpDivTrainToWhore>> <<goto "Manage Corporation">> <</link>> <<else>> @@ -1318,7 +1342,8 @@ __Division Management__ $corpDivWhoreDev = 0, $menialDemandFactor -= $corpDivWhoreSlaves, $corpExpandToken += 1>> - <<unset $corpDivWhoreSlaves>> + <<unset $corpDivWhoreSlaves, + $corpDivTrainToWhore>> <<goto "Manage Corporation">> <</link>> <</if>> @@ -2181,7 +2206,30 @@ __Slave specialization__ $corpSpecPussy, $corpSpecSexEd, $corpSpecTrust, - $corpSpecVirgin>> + $corpSpecVirgin, + $corpDivExtraToArcade, + $corpDivExtraToBreak, + $corpDivExtraToMarket, + $corpDivLegalToMenial, + $corpDivLegalToSurgery, + $corpDivLegalToTrain, + $corpDivLegalToMarket, + $corpDivBreakToMenial, + $corpDivBreakToSurgery, + $corpDivBreakToTrain, + $corpDivBreakToMarket, + $corpDivBreakFromMarket, + $corpDivSurgeryToDairy, + $corpDivSurgeryToTrain, + $corpDivSurgeryToMarket, + $corpDivSurgeryFromMarket, + $corpDivTrainToWhore, + $corpDivTrainToMarket, + $corpDivTrainFromMarket, + $corpDivArcadeFromMarket, + $corpDivMenialFromMarket, + $corpDivDairyFromMarket, + $corpDivWhoreFromMarket>> <<if $corpMarket == 1>> <<for _i = 0; _i < $sectors.length; _i++>> <<if $sectors[_i].type == "CorporateMarket">><<set $sectors[_i].type = "Markets">><<break>><</if>> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index a51efb7b113ee33be6896b14ba42ea40dcaca506..dc37a2205fa5d3ba4659b4dc22106c086211d532 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -2626,12 +2626,15 @@ Setting missing global variables: <</if>> <</if>> <<set $dividendTimer = $dividendTimer || 13>> +<<if ndef $corpEcon>> + <<set $corpEcon = 0>> +<</if>> /*Removing the old Corp from save*/ <<if ndef $newCorp>> <<set $newCorp = 1>> <<set $corpIncorporated = 0>> - <<set $cash += Math.min(Math.trunc(($corpValue / ($publicShares + $personalShares)) * $personalShares), 1000000)>> /*Paying the player for his old corporation, so they can get the new one started with haste. It should perhaps have a message going with it*/ + <<run cashX(Math.min(Math.trunc(($corpValue / ($publicShares + $personalShares)) * $personalShares), 1000000), "stocksTraded")>> /*Paying the player for his old corporation, so they can get the new one started with haste. It should perhaps have a message going with it*/ <<set $mercenariesHelpCorp = 0>> <<set $corpMarket = 0>> <<unset $corpPeopleEnslaved, $slaveAssets, $slaveAssetPrice, $corpProfit, $corpCash, $corpValue, $sharePrice, $oldSharePrice, $personalShares, $publicShares, $generalAssetPrice, $generalAssets, $entrapmentAssets, $entrapmentAssetPrice, $captureAssets, $captureAssetPrice, $trainingAssets, $trainingAssetPrice, $surgicalAssets, $surgicalAssetPrice, $drugAssets, $drugAssetPrice, $generalUpgradeBreaking, $generalUpgradeWeight, $generalUpgradeMuscle, $entrapmentUpgradeDevotionOne, $entrapmentUpgradeDevotionTwo, $entrapmentUpgradeIntelligence, $captureUpgradeGender, $surgicalUpgradeGenitalia, $captureUpgradeAge, $captureUpgradeRace, $trainingUpgradeAccent, $trainingUpgradeEducation, $trainingUpgradeSexEd, $surgicalUpgradeCosmetics, $surgicalUpgradeImplants, $drugUpgradeHormones, $drugUpgradeInjectionOne, $drugUpgradeInjectionTwo>> diff --git a/src/uncategorized/buySlaves.tw b/src/uncategorized/buySlaves.tw index e93f00103ee8c19d03aeaa93c23d1bdc254f8e55..f92f65f1535232b9b138efbb28e572b28c4fa356 100644 --- a/src/uncategorized/buySlaves.tw +++ b/src/uncategorized/buySlaves.tw @@ -381,16 +381,16 @@ The market price of standard Fuckdolls is <<print cashFormat(_menialPrice*2)>>. <<set _optionsBreak = 0>> <<if _bulkMax > 0>> <<if $arcologies[0].FSPaternalist == "unset" && $cash > _menialPrice*2>> - [[Buy|Buy Slaves][$fuckdolls+=1,$menialSupplyFactor-=1,cashX(forceNeg(_menialPrice*2), "menialTransfer")]] + [[Buy|Buy Slaves][$fuckdolls+=1,$menialSupplyFactor-=1,cashX(forceNeg(_menialPrice*2), "fuckdollsTransfer")]] <<if $cash > (menialSlaveCost(10)*2)*10>> - [[(x10)|Buy Slaves][$fuckdolls+=10,$menialSupplyFactor-=10,cashX(forceNeg((menialSlaveCost(10)*2)*10), "menialTransfer")]] + [[(x10)|Buy Slaves][$fuckdolls+=10,$menialSupplyFactor-=10,cashX(forceNeg((menialSlaveCost(10)*2)*10), "fuckdollsTransfer")]] <</if>> <<if $cash > (menialSlaveCost(100)*2)*100>> - [[(x100)|Buy Slaves][$fuckdolls+=100,$menialSupplyFactor-=100,cashX(forceNeg((menialSlaveCost(100)*2)*100), "menialTransfer")]] + [[(x100)|Buy Slaves][$fuckdolls+=100,$menialSupplyFactor-=100,cashX(forceNeg((menialSlaveCost(100)*2)*100), "fuckdollsTransfer")]] <</if>> <<if $cash > ((_menialPrice+1)*4)>> <<set _fuckdollBulkPremium = Math.trunc(1 + Math.clamp($cash/(_menialPrice*2),0,_bulkMax)/400)>> - [[(max)|Buy Slaves][$fuckdolls+=Math.trunc(Math.clamp($cash/(_menialPrice*2+_fuckdollBulkPremium),0,_bulkMax)),$menialSupplyFactor-=Math.trunc(Math.clamp($cash/(_menialPrice*2+_fuckdollBulkPremium),0,_bulkMax)),cashX(forceNeg(Math.trunc(Math.clamp($cash/(_menialPrice*2+_fuckdollBulkPremium),0,_bulkMax))*(_menialPrice*2+_fuckdollBulkPremium)), "menialTransfer")]] + [[(max)|Buy Slaves][$fuckdolls+=Math.trunc(Math.clamp($cash/(_menialPrice*2+_fuckdollBulkPremium),0,_bulkMax)),$menialSupplyFactor-=Math.trunc(Math.clamp($cash/(_menialPrice*2+_fuckdollBulkPremium),0,_bulkMax)),cashX(forceNeg(Math.trunc(Math.clamp($cash/(_menialPrice*2+_fuckdollBulkPremium),0,_bulkMax))*(_menialPrice*2+_fuckdollBulkPremium)), "fuckdollsTransfer")]] <</if>> //Bulk transactions may require offering a premium.// <<set _optionsBreak = 1>> @@ -398,14 +398,14 @@ The market price of standard Fuckdolls is <<print cashFormat(_menialPrice*2)>>. <</if>> <<if $fuckdolls >= 1>> <<if _optionsBreak>>|<</if>> - [[Sell|Buy Slaves][$fuckdolls-=1,$menialDemandFactor-=1,cashX((_menialPrice*2), "menialTransfer")]] + [[Sell|Buy Slaves][$fuckdolls-=1,$menialDemandFactor-=1,cashX((_menialPrice*2), "fuckdollsTransfer")]] <<if $fuckdolls >= 10>> - [[(x10)|Buy Slaves][$fuckdolls-=10,$menialDemandFactor-=10,cashX((menialSlaveCost(-10)*20), "menialTransfer")]] + [[(x10)|Buy Slaves][$fuckdolls-=10,$menialDemandFactor-=10,cashX((menialSlaveCost(-10)*20), "fuckdollsTransfer")]] <<if $fuckdolls >= 100>> - [[(x100)|Buy Slaves][$fuckdolls-=100,$menialDemandFactor-=100,cashX((menialSlaveCost(-100)*200), "menialTransfer")]] + [[(x100)|Buy Slaves][$fuckdolls-=100,$menialDemandFactor-=100,cashX((menialSlaveCost(-100)*200), "fuckdollsTransfer")]] <</if>> <</if>> -[[(all)|Buy Slaves][$cash+=$fuckdolls*(menialSlaveCost(-$fuckdolls)*2),$menialDemandFactor-=$fuckdolls,$fuckdolls = 0]] +[[(all)|Buy Slaves][cashX($fuckdolls*(menialSlaveCost(-$fuckdolls)*2), "fuckdollsTransfer"),$menialDemandFactor-=$fuckdolls,$fuckdolls = 0]] <</if>> <</if>> @@ -421,16 +421,16 @@ The market price of standard bioreactors is <<print cashFormat((_menialPrice-100 <<set _optionsBreak = 0>> <<if _bulkMax > 0>> <<if $arcologies[0].FSPaternalist == "unset" && $cash > _menialPrice+100>> - [[Buy|Buy Slaves][$menialBioreactors+=1,$menialSupplyFactor-=1,cashX(forceNeg(_menialPrice+100), "menialTransfer")]] + [[Buy|Buy Slaves][$menialBioreactors+=1,$menialSupplyFactor-=1,cashX(forceNeg(_menialPrice+100), "menialBioreactors")]] <<if $cash > (menialSlaveCost(10)-100)*10>> - [[(x10)|Buy Slaves][$menialBioreactors+=10,$menialSupplyFactor-=10,cashX(forceNeg((menialSlaveCost(10)-100)*10), "menialTransfer")]] + [[(x10)|Buy Slaves][$menialBioreactors+=10,$menialSupplyFactor-=10,cashX(forceNeg((menialSlaveCost(10)-100)*10), "menialBioreactors")]] <</if>> <<if $cash > (menialSlaveCost(100)-100)*100>> - [[(x100)|Buy Slaves][$menialBioreactors+=100,$menialSupplyFactor-=100,cashX(forceNeg((menialSlaveCost(100)-100)*100), "menialTransfer")]] + [[(x100)|Buy Slaves][$menialBioreactors+=100,$menialSupplyFactor-=100,cashX(forceNeg((menialSlaveCost(100)-100)*100), "menialBioreactors")]] <</if>> <<if $cash > (_menialPrice-99)*2>> <<set _bioreactorBulkPremium = Math.trunc(1+ Math.clamp($cash/(_menialPrice-99),0,_bulkMax)/400)>> - [[(max)|Buy Slaves][$menialBioreactors+=Math.trunc(Math.clamp($cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax)),$menialSupplyFactor-=Math.trunc(Math.clamp($cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax)),cashX(forceNeg(Math.trunc(Math.clamp($cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax))*(_menialPrice-99+_bioreactorBulkPremium)), "menialTransfer")]] + [[(max)|Buy Slaves][$menialBioreactors+=Math.trunc(Math.clamp($cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax)),$menialSupplyFactor-=Math.trunc(Math.clamp($cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax)),cashX(forceNeg(Math.trunc(Math.clamp($cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax))*(_menialPrice-99+_bioreactorBulkPremium)), "menialBioreactors")]] <</if>> //Bulk transactions may require offering a premium.// <<set _optionsBreak = 1>> @@ -438,13 +438,13 @@ The market price of standard bioreactors is <<print cashFormat((_menialPrice-100 <</if>> <<if $menialBioreactors >= 1>> <<if _optionsBreak>>|<</if>> - [[Sell|Buy Slaves][$menialBioreactors-=1,$menialDemandFactor-=1,cashX((_menialPrice-100), "menialTransfer")]] + [[Sell|Buy Slaves][$menialBioreactors-=1,$menialDemandFactor-=1,cashX((_menialPrice-100), "menialBioreactors")]] <<if $menialBioreactors >= 10>> - [[(x10)|Buy Slaves][$menialBioreactors-=10,$menialDemandFactor-=10,cashX(((menialSlaveCost(-10)-100)*10), "menialTransfer")]] + [[(x10)|Buy Slaves][$menialBioreactors-=10,$menialDemandFactor-=10,cashX(((menialSlaveCost(-10)-100)*10), "menialBioreactors")]] <<if $menialBioreactors >= 100>> - [[(x100)|Buy Slaves][$menialBioreactors-=100,$menialDemandFactor-=100,cashX(((menialSlaveCost(-100)-100)*100), "menialTransfer")]] + [[(x100)|Buy Slaves][$menialBioreactors-=100,$menialDemandFactor-=100,cashX(((menialSlaveCost(-100)-100)*100), "menialBioreactors")]] <</if>> <</if>> -[[(all)|Buy Slaves][cashX(($menialBioreactors*(menialSlaveCost(-$menialBioreactors)-100)), "menialTransfer"),$menialDemandFactor-=$menialBioreactors,$menialBioreactors = 0]] +[[(all)|Buy Slaves][cashX(($menialBioreactors*(menialSlaveCost(-$menialBioreactors)-100)), "menialBioreactors"),$menialDemandFactor-=$menialBioreactors,$menialBioreactors = 0]] <</if>> <</if>> diff --git a/src/uncategorized/corporationDevelopments.tw b/src/uncategorized/corporationDevelopments.tw index efa17afa0ff958f816bac757681fe317bac9a651..a4f4543ad53c67c6ca8c1da9b2b1cdb2c3c418f5 100644 --- a/src/uncategorized/corporationDevelopments.tw +++ b/src/uncategorized/corporationDevelopments.tw @@ -1,6 +1,6 @@ :: Corporation Developments [nobr] -/*Main Corporation Loop*/ +/*Main Corporation Pass*/ <<if $corpCash < 0>> <<set $corpCash = Math.trunc($corpCash * 1.02)>> /*2% weekly interest rate on negative cash*/ @@ -510,23 +510,33 @@ _corpDivWhoreSlavesRoom = corpDivWhoreSlavesRoom()>> <<set $corpCash -= _corpOverhead, _corpProfitProvisional = $corpRev - $corpAssetsDev - $corpAssetsSlave - _corpOpCost>> <<if _corpProfitProvisional > 0>> - <<set _corpEcon = Math.trunc(_corpProfitProvisional / (100 / $localEcon) - _corpProfitProvisional), - $corpCash += _corpEcon, - $corpProfitOld = _corpProfitProvisional + _corpEcon>> /*this is probably the best place for the economy to show itself, the rest is finnicky enough as is*/ + <<set $corpEcon = Math.trunc(_corpProfitProvisional / (100 / $localEcon) - _corpProfitProvisional), + $corpCash += $corpEcon, + $corpProfitOld = _corpProfitProvisional + $corpEcon>> /*this is probably the best place for the economy to show itself, the rest is finnicky enough as is*/ <<else>> <<set $corpProfitOld = _corpProfitProvisional>> <</if>> <br>Revenue: @@.yellowgreen;<<print cashFormat($corpRev)>>@@ +<<if ($cheatMode) && ($cheatModeM) && $corpNeighborBonus > 0>> + <br>Including Neighbor Bonus: @@.yellowgreen;<<print cashFormat($corpNeighborBonus)>>@@ +<</if>> <br>Operating Expenses: @@.red;<<print cashFormat(_corpOpCost)>>@@ <<if $corpAssetsSlave > 0>> - <br>Slave Expenses: @@.red;<<print $corpAssetsSlave>>@@ + <br>Slave Expenses: @@.red;<<print cashFormat($corpAssetsSlave)>>@@ <<else>> - <br>Slave Expenses: @@.yellowgreen;<<print $corpAssetsSlave>>@@ + <br>Slave Expenses: @@.yellowgreen;<<print cashFormat($corpAssetsSlave)>>@@ <</if>> <<if $corpAssetsDev > 0>> - <br>Asset Expenses: @@.red;<<print $corpAssetsDev>>@@ + <br>Asset Expenses: @@.red;<<print cashFormat($corpAssetsDev)>>@@ <<else>> - <br>Asset Expenses: @@.yellowgreen;<<print $corpAssetsDev>>@@ + <br>Asset Expenses: @@.yellowgreen;<<print cashFormat($corpAssetsDev)>>@@ +<</if>> +<<if ($cheatMode) && ($cheatModeM)>> + <<if $corpEcon < 0>> + <br>Economic Expenses: @@.red;<<print cashFormat(-$corpEcon)>>@@ + <<else>> + <br>Economic Windfall: @@.yellowgreen;<<print cashFormat($corpEcon)>>@@ + <</if>> <</if>> <<if _corpOverhead != 0>><br>Overhead: @@.red;<<print cashFormat(_corpOverhead)>>@@<</if>> <br>Profit: <<if $corpProfitOld > 0>>@@.yellowgreen;<<print cashFormat($corpProfitOld)>>@@<<else>>@@.red;<<print cashFormat($corpProfitOld)>>@@<</if>> diff --git a/src/uncategorized/costsBudget.tw b/src/uncategorized/costsBudget.tw index b1df4ff92ca28bd4ca6c18db287696edef4ab200..236021b03bc94d0012e457dea9706b907b7e4db7 100644 --- a/src/uncategorized/costsBudget.tw +++ b/src/uncategorized/costsBudget.tw @@ -42,7 +42,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <table class="finances" border="1"> <tr> - <th><h2>Jobs</h2></th> + <th><h2>Penthouse</h2></th> <th>Income</th> <th>Expense</th> <th>Totals</th> @@ -138,39 +138,9 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> - <<if $lastWeeksCashIncome.subordinateSlave || $lastWeeksCashExpenses.subordinateSlave>> - <tr> - <td>subordinateSlaves</td> - <td> - <<if Math.trunc($lastWeeksCashIncome.subordinateSlave) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.subordinateSlave))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashIncome.subordinateSlave))>> - <</if>> - </td> - <td> - <<if Math.trunc($lastWeeksCashExpenses.subordinateSlave) < 0>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.subordinateSlave)))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashExpenses.subordinateSlave))>> - <</if>> - </td> - <td> - <<set $lastWeeksCashProfits.subordinateSlave = ($lastWeeksCashIncome.subordinateSlave + $lastWeeksCashExpenses.subordinateSlave)>> - <<if $lastWeeksCashProfits.subordinateSlave > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.subordinateSlave))>>@@ - <<elseif Math.trunc($lastWeeksCashProfits.subordinateSlave) == 0>> - <<print cashFormat(Math.trunc($lastWeeksCashProfits.subordinateSlave))>> - <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.subordinateSlave)))>>@@ - <</if>> - </td> - </tr> - <</if>> - <<if $lastWeeksCashIncome.houseServant || $lastWeeksCashExpenses.houseServant>> <tr> - <td>HouseServants</td> + <td>House servants</td> <td> <<if Math.trunc($lastWeeksCashIncome.houseServant) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.houseServant))>>@@ @@ -352,9 +322,6 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <tr> <h2>Structures</h2> /* TODO: using h2s doesn't fit in with the rest of the game */ </tr> - <tr> - //Slaves working in these buildings have their profits reported in "jobs".// - </tr> <<if $lastWeeksCashIncome.brothel || $lastWeeksCashExpenses.brothel>> <tr> @@ -386,9 +353,39 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> + <<if $lastWeeksCashIncome.whoreBrothel || $lastWeeksCashExpenses.whoreBrothel>> /* If it's not 0, it will return true. */ + <tr> + <td>Brothel whores</td> + <td> + <<if Math.trunc($lastWeeksCashIncome.whoreBrothel) > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.whoreBrothel))>>@@ + <<else>> + <<print cashFormat(Math.trunc($lastWeeksCashIncome.whoreBrothel))>> + <</if>> + </td> + <td> + <<if Math.trunc($lastWeeksCashExpenses.whoreBrothel) < 0>> + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.whoreBrothel)))>>@@ + <<else>> + <<print cashFormat(Math.trunc($lastWeeksCashExpenses.whoreBrothel))>> + <</if>> + </td> + <td> + <<set $lastWeeksCashProfits.whoreBrothel = ($lastWeeksCashIncome.whoreBrothel + $lastWeeksCashExpenses.whoreBrothel)>> + <<if $lastWeeksCashProfits.whoreBrothel > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.whoreBrothel))>>@@ + <<elseif Math.trunc($lastWeeksCashProfits.whoreBrothel) == 0>> + <<print cashFormat(Math.trunc($lastWeeksCashProfits.whoreBrothel))>> + <<else>> + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.whoreBrothel)))>>@@ + <</if>> + </td> + </tr> + <</if>> + <<if $lastWeeksCashIncome.brothelAds || $lastWeeksCashExpenses.brothelAds>> <tr> - <td>[[Brothel Ads|Brothel Advertisement][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] also increase the income of whoring slaves in "jobs."</td> /* TODO: this is also weird */ + <td>[[Brothel ads|Brothel Advertisement][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] also increase the income of whoring slaves in "jobs."</td> /* TODO: this is also weird */ <td> <<if Math.trunc($lastWeeksCashIncome.brothelAds) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.brothelAds))>>@@ @@ -416,6 +413,10 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> + <<if $brothel > 0>> + <br> + <</if>> + <<if $lastWeeksCashIncome.club || $lastWeeksCashExpenses.club>> <tr> <td>[[$clubNameCaps|Club][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($clubSlaves slaves)</td> @@ -448,7 +449,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.clubAds || $lastWeeksCashExpenses.clubAds>> <tr> - <td>[[Club Ads|Club Advertisement][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> + <td>[[Club ads|Club Advertisement][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> <td> <<if Math.trunc($lastWeeksCashIncome.clubAds) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.clubAds))>>@@ @@ -476,6 +477,10 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> + <<if $club > 0>> + <br> + <</if>> + <<if $lastWeeksCashIncome.arcade || $lastWeeksCashExpenses.arcade>> <tr> <td>[[$arcadeNameCaps|Arcade][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($arcadeSlaves slaves)</td> @@ -504,6 +509,41 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> + <<if $lastWeeksCashIncome.gloryholeArcade || $lastWeeksCashExpenses.gloryholeArcade>> + <tr> + <td>Arcade slaves</td> + <td> + <<if Math.trunc($lastWeeksCashIncome.gloryholeArcade) > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.gloryholeArcade))>>@@ + <<else>> + <<print cashFormat(Math.trunc($lastWeeksCashIncome.gloryholeArcade))>> + <</if>> + </td> + <td> + <<if Math.trunc($lastWeeksCashExpenses.gloryholeArcade) < 0>> + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.gloryholeArcade)))>>@@ + <<else>> + <<print cashFormat(Math.trunc($lastWeeksCashExpenses.gloryholeArcade))>> + <</if>> + </td> + <td> + <<set $lastWeeksCashProfits.gloryholeArcade = ($lastWeeksCashIncome.gloryholeArcade + $lastWeeksCashExpenses.gloryholeArcade)>> + <<if $lastWeeksCashProfits.gloryholeArcade > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.gloryholeArcade))>>@@ + <<elseif Math.trunc($lastWeeksCashProfits.gloryholeArcade) == 0>> + <<print cashFormat(Math.trunc($lastWeeksCashProfits.gloryholeArcade))>> + <<else>> + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.gloryholeArcade)))>>@@ + <</if>> + </td> + </tr> + <</if>> + + <<if $arcade > 0>> + <br> + <</if>> + + <<if $lastWeeksCashIncome.dairy || $lastWeeksCashExpenses.dairy>> <tr> <td>[[$dairyNameCaps|Dairy][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($dairySlaves slaves)</td> @@ -534,6 +574,40 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> + <<if $lastWeeksCashIncome.milkedDairy || $lastWeeksCashExpenses.milkedDairy>> + <tr> + <td>Dairy cows</td> + <td> + <<if Math.trunc($lastWeeksCashIncome.milkedDairy) > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.milkedDairy))>>@@ + <<else>> + <<print cashFormat(Math.trunc($lastWeeksCashIncome.milkedDairy))>> + <</if>> + </td> + <td> + <<if Math.trunc($lastWeeksCashExpenses.milkedDairy) < 0>> + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.milkedDairy)))>>@@ + <<else>> + <<print cashFormat(Math.trunc($lastWeeksCashExpenses.milkedDairy))>> + <</if>> + </td> + <td> + <<set $lastWeeksCashProfits.milkedDairy = ($lastWeeksCashIncome.milkedDairy + $lastWeeksCashExpenses.milkedDairy)>> + <<if $lastWeeksCashProfits.milkedDairy > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.milkedDairy))>>@@ + <<elseif Math.trunc($lastWeeksCashProfits.milkedDairy) == 0>> + <<print cashFormat(Math.trunc($lastWeeksCashProfits.milkedDairy))>> + <<else>> + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.milkedDairy)))>>@@ + <</if>> + </td> + </tr> + <</if>> + + <<if $dairy > 0>> + <br> + <</if>> + <<if $lastWeeksCashIncome.servantsQuarters || $lastWeeksCashExpenses.servantsQuarters>> <tr> <td>[[Servants' Quarters][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($servantsQuartersSlaves slaves)</td> @@ -756,39 +830,6 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> <</if>> - - - - - <<if $lastWeeksCashIncome.cyberMod || $lastWeeksCashExpenses.cyberMod>> - <tr> - <td>CyberMod</td> /* TODO: this doesn't fit in*/ - <td> - <<if Math.trunc($lastWeeksCashIncome.cyberMod) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.cyberMod))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashIncome.cyberMod))>> - <</if>> - </td> - <td> - <<if Math.trunc($lastWeeksCashExpenses.cyberMod) < 0>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.cyberMod)))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashExpenses.cyberMod))>> - <</if>> - </td> - <td> - <<set $lastWeeksCashProfits.cyberMod = ($lastWeeksCashIncome.cyberMod + $lastWeeksCashExpenses.cyberMod)>> - <<if $lastWeeksCashProfits.cyberMod > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.cyberMod))>>@@ - <<elseif Math.trunc($lastWeeksCashProfits.cyberMod) == 0>> - <<print cashFormat(Math.trunc($lastWeeksCashProfits.cyberMod))>> - <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.cyberMod)))>>@@ - <</if>> - </td> - </tr> - <</if>> <<if $lastWeeksCashIncome.incubator || $lastWeeksCashExpenses.incubator>> <tr> @@ -910,36 +951,6 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> - <<if $lastWeeksCashIncome.arcologyImprovement || $lastWeeksCashExpenses.arcologyImprovement>> - <tr> - <td>Arcology construction and repair</td> - <td> - <<if Math.trunc($lastWeeksCashIncome.arcologyImprovement) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.arcologyImprovement))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashIncome.arcologyImprovement))>> - <</if>> - </td> - <td> - <<if Math.trunc($lastWeeksCashExpenses.arcologyImprovement) < 0>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.arcologyImprovement)))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashExpenses.arcologyImprovement))>> - <</if>> - </td> - <td> - <<set $lastWeeksCashProfits.arcologyImprovement = ($lastWeeksCashIncome.arcologyImprovement + $lastWeeksCashExpenses.arcologyImprovement)>> - <<if $lastWeeksCashProfits.arcologyImprovement > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.arcologyImprovement))>>@@ - <<elseif Math.trunc($lastWeeksCashProfits.arcologyImprovement) == 0>> - <<print cashFormat(Math.trunc($lastWeeksCashProfits.arcologyImprovement))>> - <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.arcologyImprovement)))>>@@ - <</if>> - </td> - </tr> - <</if>> - <<if $lastWeeksCashIncome.environment || $lastWeeksCashExpenses.environment>> <tr> <td>Environment</td> @@ -973,7 +984,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.weather || $lastWeeksCashExpenses.weather>> /* TODO: this doesn't fit in */ <tr> <td> - <<if $lastWeeksCashExpenses.weather > 0>> + <<if $lastWeeksCashExpenses.weather < 0 && $weatherCladding == 0>> Weather is causing @@.red;expensive damage.@@ Consider a protective [[upgrade|Manage Arcology][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]. <<else>> Weather @@ -1039,7 +1050,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.extraMilk || $lastWeeksCashExpenses.extraMilk>> <tr> - <td>Extra Milk</td> + <td>Extra milk</td> <td> <<if Math.trunc($lastWeeksCashIncome.extraMilk) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.extraMilk))>>@@ @@ -1067,6 +1078,36 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> + <<if $lastWeeksCashIncome.slaveTransfer || $lastWeeksCashExpenses.slaveTransfer>> + <tr> + <td>Selling/buying major slaves</td> + <td> + <<if Math.trunc($lastWeeksCashIncome.slaveTransfer) > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveTransfer))>>@@ + <<else>> + <<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveTransfer))>> + <</if>> + </td> + <td> + <<if Math.trunc($lastWeeksCashExpenses.slaveTransfer) < 0>> + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.slaveTransfer)))>>@@ + <<else>> + <<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveTransfer))>> + <</if>> + </td> + <td> + <<set $lastWeeksCashProfits.slaveTransfer = ($lastWeeksCashIncome.slaveTransfer + $lastWeeksCashExpenses.slaveTransfer)>> + <<if $lastWeeksCashProfits.slaveTransfer > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveTransfer))>>@@ + <<elseif Math.trunc($lastWeeksCashProfits.slaveTransfer) == 0>> + <<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveTransfer))>> + <<else>> + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.slaveTransfer)))>>@@ + <</if>> + </td> + </tr> + <</if>> + <<if $lastWeeksCashIncome.menialTransfer || $lastWeeksCashExpenses.menialTransfer>> <tr> <td>Menials: [[Assistant's|Personal assistant options][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] flipping</td> @@ -1157,61 +1198,31 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> - <<if $lastWeeksCashIncome.fuckdollsTransfer || $lastWeeksCashExpenses.fuckdollsTransfer>> - <tr> - <td>Fuckdolls: [[Assistant's|Personal assistant options][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] flipping</td> - <td> - <<if Math.trunc($lastWeeksCashIncome.fuckdollsTransfer) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdollsTransfer))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdollsTransfer))>> - <</if>> - </td> - <td> - <<if Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer) < 0>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer)))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer))>> - <</if>> - </td> - <td> - <<set $lastWeeksCashProfits.fuckdollsTransfer = ($lastWeeksCashIncome.fuckdollsTransfer + $lastWeeksCashExpenses.fuckdollsTransfer)>> - <<if $lastWeeksCashProfits.fuckdollsTransfer > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer))>>@@ - <<elseif Math.trunc($lastWeeksCashProfits.fuckdollsTransfer) == 0>> - <<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer))>> - <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer)))>>@@ - <</if>> - </td> - </tr> - <</if>> - - <<if $lastWeeksCashIncome.menialBioreactorsTransfer || $lastWeeksCashExpenses.menialBioreactorsTransfer>> + <<if $lastWeeksCashIncome.babyTransfer || $lastWeeksCashExpenses.babyTransfer>> <tr> - <td>Bioreactors: [[Assistant's|Personal assistant options][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] flipping</td> + <td>Selling/buying babies</td> <td> - <<if Math.trunc($lastWeeksCashIncome.menialBioreactorsTransfer) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialBioreactorsTransfer))>>@@ + <<if Math.trunc($lastWeeksCashIncome.babyTransfer) > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.babyTransfer))>>@@ <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashIncome.menialBioreactorsTransfer))>> + <<print cashFormat(Math.trunc($lastWeeksCashIncome.babyTransfer))>> <</if>> </td> <td> - <<if Math.trunc($lastWeeksCashExpenses.menialBioreactorsTransfer) < 0>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.menialBioreactorsTransfer)))>>@@ + <<if Math.trunc($lastWeeksCashExpenses.babyTransfer) < 0>> + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.babyTransfer)))>>@@ <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialBioreactorsTransfer))>> + <<print cashFormat(Math.trunc($lastWeeksCashExpenses.babyTransfer))>> <</if>> </td> <td> - <<set $lastWeeksCashProfits.menialBioreactorsTransfer = ($lastWeeksCashIncome.menialBioreactorsTransfer + $lastWeeksCashExpenses.menialBioreactorsTransfer)>> - <<if $lastWeeksCashProfits.menialBioreactorsTransfer > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialBioreactorsTransfer))>>@@ - <<elseif Math.trunc($lastWeeksCashProfits.menialBioreactorsTransfer) == 0>> - <<print cashFormat(Math.trunc($lastWeeksCashProfits.menialBioreactorsTransfer))>> + <<set $lastWeeksCashProfits.babyTransfer = ($lastWeeksCashIncome.babyTransfer + $lastWeeksCashExpenses.babyTransfer)>> + <<if $lastWeeksCashProfits.babyTransfer > 0>> + @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.babyTransfer))>>@@ + <<elseif Math.trunc($lastWeeksCashProfits.babyTransfer) == 0>> + <<print cashFormat(Math.trunc($lastWeeksCashProfits.babyTransfer))>> <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.menialBioreactorsTransfer)))>>@@ + @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.babyTransfer)))>>@@ <</if>> </td> </tr> @@ -1307,36 +1318,6 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> - <<if ($lastWeeksCashIncome.fuckDollBioFactory) || ($lastWeeksCashExpenses.fuckDollBioFactory)>> - <tr> - <td>Menials: labor</td> - <td> - <<if Math.trunc($lastWeeksCashIncome.fuckDollBioFactory) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckDollBioFactory))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckDollBioFactory))>> - <</if>> - </td> - <td> - <<if Math.trunc($lastWeeksCashExpenses.fuckDollBioFactory) < 0>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.fuckDollBioFactory)))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashExpenses.fuckDollBioFactory))>> - <</if>> - </td> - <td> - <<set $lastWeeksCashProfits.fuckDollBioFactory = ($lastWeeksCashIncome.fuckDollBioFactory + $lastWeeksCashExpenses.fuckDollBioFactory)>> - <<if $lastWeeksCashProfits.fuckDollBioFactory > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckDollBioFactory))>>@@ - <<elseif Math.trunc($lastWeeksCashProfits.fuckDollBioFactory) == 0>> - <<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckDollBioFactory))>> - <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.fuckDollBioFactory)))>>@@ - <</if>> - </td> - </tr> - <</if>> - <<if $lastWeeksCashIncome.porn || $lastWeeksCashExpenses.porn>> <tr> <td>Porn</td> @@ -1397,96 +1378,6 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <</if>> - <<if $lastWeeksCashIncome.slaveTransfer || $lastWeeksCashExpenses.slaveTransfer>> - <tr> - <td>Buying/Selling Major Slaves</td> - <td> - <<if Math.trunc($lastWeeksCashIncome.slaveTransfer) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveTransfer))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveTransfer))>> - <</if>> - </td> - <td> - <<if Math.trunc($lastWeeksCashExpenses.slaveTransfer) < 0>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.slaveTransfer)))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveTransfer))>> - <</if>> - </td> - <td> - <<set $lastWeeksCashProfits.slaveTransfer = ($lastWeeksCashIncome.slaveTransfer + $lastWeeksCashExpenses.slaveTransfer)>> - <<if $lastWeeksCashProfits.slaveTransfer > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveTransfer))>>@@ - <<elseif Math.trunc($lastWeeksCashProfits.slaveTransfer) == 0>> - <<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveTransfer))>> - <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.slaveTransfer)))>>@@ - <</if>> - </td> - </tr> - <</if>> - - <<if $lastWeeksCashIncome.fuckdollsTransfer || $lastWeeksCashExpenses.fuckdollsTransfer>> - <tr> - <td>Buying/Selling Fuckdolls</td> - <td> - <<if Math.trunc($lastWeeksCashIncome.fuckdollsTransfer) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdollsTransfer))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdollsTransfer))>> - <</if>> - </td> - <td> - <<if Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer) < 0>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer)))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer))>> - <</if>> - </td> - <td> - <<set $lastWeeksCashProfits.fuckdollsTransfer = ($lastWeeksCashIncome.fuckdollsTransfer + $lastWeeksCashExpenses.fuckdollsTransfer)>> - <<if $lastWeeksCashProfits.fuckdollsTransfer > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer))>>@@ - <<elseif Math.trunc($lastWeeksCashProfits.fuckdollsTransfer) == 0>> - <<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer))>> - <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer)))>>@@ - <</if>> - </td> - </tr> - <</if>> - - <<if $lastWeeksCashIncome.babyTransfer || $lastWeeksCashExpenses.babyTransfer>> - <tr> - <td>Buying/Selling Babies</td> - <td> - <<if Math.trunc($lastWeeksCashIncome.babyTransfer) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.babyTransfer))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashIncome.babyTransfer))>> - <</if>> - </td> - <td> - <<if Math.trunc($lastWeeksCashExpenses.babyTransfer) < 0>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.babyTransfer)))>>@@ - <<else>> - <<print cashFormat(Math.trunc($lastWeeksCashExpenses.babyTransfer))>> - <</if>> - </td> - <td> - <<set $lastWeeksCashProfits.babyTransfer = ($lastWeeksCashIncome.babyTransfer + $lastWeeksCashExpenses.babyTransfer)>> - <<if $lastWeeksCashProfits.babyTransfer > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.babyTransfer))>>@@ - <<elseif Math.trunc($lastWeeksCashProfits.babyTransfer) == 0>> - <<print cashFormat(Math.trunc($lastWeeksCashProfits.babyTransfer))>> - <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.babyTransfer)))>>@@ - <</if>> - </td> - </tr> - <</if>> - <<if $lastWeeksCashIncome.menialRetirement || $lastWeeksCashExpenses.menialRetirement>> <tr> <td>Menials retiring</td> @@ -1519,7 +1410,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.slaveMod || $lastWeeksCashExpenses.slaveMod>> <tr> - <td>Slave Modification</td> + <td>Slave modification</td> <td> <<if Math.trunc($lastWeeksCashIncome.slaveMod) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveMod))>>@@ @@ -1549,7 +1440,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.slaveSurgery || $lastWeeksCashExpenses.slaveSurgery>> <tr> - <td>Slave Surgery</td> + <td>Slave surgery</td> <td> <<if Math.trunc($lastWeeksCashIncome.slaveSurgery) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveSurgery))>>@@ @@ -1579,7 +1470,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.birth || $lastWeeksCashExpenses.birth>> <tr> - <td>Slave Surgery</td> + <td>Slave surgery</td> <td> <<if Math.trunc($lastWeeksCashIncome.birth) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.birth))>>@@ @@ -1614,7 +1505,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.personalBusiness || $lastWeeksCashExpenses.personalBusiness>> <tr> - <td>Personal Business</td> + <td>Personal business</td> <td> <<if Math.trunc($lastWeeksCashIncome.personalBusiness) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.personalBusiness))>>@@ @@ -1993,7 +1884,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.capEx || $lastWeeksCashExpenses.capEx>> <tr> - <td>Capital Expenses</td> + <td>Capital expenses</td> <td> <<if Math.trunc($lastWeeksCashIncome.capEx) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.capEx))>>@@ @@ -2057,7 +1948,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.policies || $lastWeeksCashExpenses.policies>> <tr> - <td>[[Policies|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> + <td>[[Policies|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] and [[Edicts|edicts][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> <td> <<if Math.trunc($lastWeeksCashIncome.policies) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.policies))>>@@ @@ -2087,7 +1978,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $FSSpending != 0>> <tr> - <td>[[Society Shaping|Future Society][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> + <td>[[Society shaping|Future Society][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> <td> <<if Math.trunc($lastWeeksCashIncome.futureSocieties) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.futureSocieties))>>@@ @@ -2258,7 +2149,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.securityExpansion || $lastWeeksCashExpenses.securityExpansion>> <tr> - <td>Security Expansion</td> + <td>Security expansion</td> <td> <<if Math.trunc($lastWeeksCashIncome.securityExpansion) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.securityExpansion))>>@@ @@ -2288,7 +2179,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.specialForces || $lastWeeksCashExpenses.specialForces>> <tr> - <td>Special Forces</td> + <td>Special forces</td> <td> <<if Math.trunc($lastWeeksCashIncome.specialForces) > 0>> @@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.specialForces))>>@@ diff --git a/src/uncategorized/costsWidgets.tw b/src/uncategorized/costsWidgets.tw index 24888e8d0652796342ea103306b18653c66e4ad5..24879dbd81aafdae4ee1bc11433827da3cc7205e 100644 --- a/src/uncategorized/costsWidgets.tw +++ b/src/uncategorized/costsWidgets.tw @@ -457,16 +457,18 @@ <<set $lastWeeksCashIncome = { /*Slave Jobs*/ whore: 0, +whoreBrothel: 0, rest: 0, fucktoy: 0, -subordinateSlave: 0, houseServant: 0, confined: 0, publicServant: 0, classes: 0, milked: 0, +milkedDairy: 0, extraMilk: 0, /*milk from slaves doing other things*/ gloryhole: 0, +gloryholeArcade: 0, porn: 0, recruiter: 0, @@ -508,7 +510,6 @@ nursery: 0, farmyard: 0, pit: 0, -arcologyImprovement:0, environment: 0, weather: 0, @@ -516,7 +517,6 @@ mercenaries:0, peacekeepers: 0, specialForces: 0, securityExpansion: 0, -cyberMod: 0, citizenOrphanage:0, diff --git a/src/uncategorized/neighborsDevelopment.tw b/src/uncategorized/neighborsDevelopment.tw index 1ca6964a9ef8f5b02954aa531a0e5e475aab4dd4..e87743ebd51d7beb3ff14e809411db7c7124f4cd 100644 --- a/src/uncategorized/neighborsDevelopment.tw +++ b/src/uncategorized/neighborsDevelopment.tw @@ -9,7 +9,8 @@ <</for>> <<set $averageProsperity = $averageProsperity/$arcologies.length>> -<<set _corpBonus = Math.trunc(1000 * Math.pow(corpValue(), 0.2))>> +<<set _corpBonus = Math.trunc(1000 * Math.pow(corpValue(), 0.1)), +$corpNeighborBonus = 0>> <<if $useTabs == 0>>__Arcologies in the Free City__<</if>> @@ -686,8 +687,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if !$corpSpecRaces.includes($arcologies[$i].FSSupremacistRace)>> It's a @@.lightgreen;good market@@ for your corporation's racially inferior slaves, improving sales and helping social progress. <<set $arcologies[$i].FSSupremacist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -754,8 +754,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecRaces.includes($arcologies[$i].FSSubjugationistRace)>> It's a @@.lightgreen;good market@@ for your corporation's $arcologies[$i].FSSubjugationistRace slaves, improving sales and helping social progress. <<set $arcologies[$i].FSSubjugationist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -797,18 +796,15 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecMilk > 0>> It's a @@.lightgreen;good market@@ for your corporation's milky cows, improving sales and helping social progress. <<set $arcologies[$i].FSRepopulationFocus += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSpecAge == 1>> It's a @@.lightgreen;good market@@ for your corporation's youthful captures, improving sales and helping social progress. <<set $arcologies[$i].FSRepopulationFocus += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSpecInjection == 5>> It's a @@.lightgreen;good market@@ for your corporation's milky cows, improving sales and helping social progress. <<set $arcologies[$i].FSRepopulationFocus += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -849,18 +845,15 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecBalls == -1>> It's an @@.lightgreen;excellent market@@ for your corporation's neutered slavegirls, improving sales and helping social progress. <<set $arcologies[$i].FSRestart += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <<elseif $corpSpecSexEd == 2>> It's a @@.lightgreen;good market@@ for your corporation's well trained toys, improving sales and helping social progress. <<set $arcologies[$i].FSRestart += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSpecIntelligence == 3>> It's a @@.lightgreen;good market@@ for your corporation's smarter captures, improving sales and helping social progress. <<set $arcologies[$i].FSRestart += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -903,26 +896,22 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecHormones > 0>> It's a @@.lightgreen;good market@@ for your corporation's hormonally treated slaves, improving sales and helping social progress. <<set $arcologies[$i].FSGenderRadicalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <<if $corpSpecPussy == 1 && $corpSpecDick == 1>> It's a @@.lightgreen;good market@@ for your corporation's beautiful futanari, improving sales and helping social progress. <<set $arcologies[$i].FSGenderRadicalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSpecBalls == -1>> It's a @@.lightgreen;good market@@ for your corporation's clipped buttsluts, improving sales and helping social progress. <<set $arcologies[$i].FSGenderRadicalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <<if ($corpSpecGender == 2) || ($seeDicks == 100)>> It's a @@.lightgreen;good market@@ for your corporation's feminized slaves, improving sales and helping social progress. <<set $arcologies[$i].FSGenderRadicalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <<elseif $arcologies[$i].FSGenderFundamentalist != "unset">> @@ -961,8 +950,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if ($corpSpecGender == 1) || ($seeDicks == 0)>> It's a @@.lightgreen;good market@@ for your corporation's enslaved females, improving sales and helping social progress. <<set $arcologies[$i].FSGenderFundamentalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1004,19 +992,16 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecTrust > 3>> It's a @@.lightgreen;good market@@ for your corporation's well-treated companions, improving sales and helping social progress. <<set $arcologies[$i].FSPaternalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <<if $corpSpecCosmetics == 1>> It's a @@.lightgreen;good market@@ for your corporation's meticulously beautified ladies, improving sales and helping social progress. <<set $arcologies[$i].FSPaternalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSpecEducation > 0>> It's a @@.lightgreen;good market@@ for your corporation's educated ladies, improving sales and helping social progress. <<set $arcologies[$i].FSPaternalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1056,19 +1041,16 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecTrust < 3>> It's a @@.lightgreen;good market@@ for your corporation's thoroughly terrified slaves, improving sales and helping social progress. <<set $arcologies[$i].FSDegradationist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <<if $corpSpecIntelligence == 1>> It's a @@.lightgreen;good market@@ for your corporation's idiotic sluts, improving sales and helping social progress. <<set $arcologies[$i].FSDegradationist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSpecAmputee == 1>> It's a @@.lightgreen;good market@@ for your corporation's human sex toys, improving sales and helping social progress. <<set $arcologies[$i].FSDegradationist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1111,8 +1093,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecAmputee != 1>> It's a @@.lightgreen;good market@@ for your corporation's implant-free slaves, improving sales and helping social progress. <<set $arcologies[$i].FSBodyPurist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1154,13 +1135,11 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecImplants == 1>> It's a @@.lightgreen;good market@@ for your corporation's implanted slaves, improving sales and helping social progress. <<set $arcologies[$i].FSTransformationFetishist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSpecImplants == 2>> It's an @@.lightgreen;excellent market@@ for your corporation's absurdly implanted slaves, improving sales and helping social progress. <<set $arcologies[$i].FSTransformationFetishist += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <</if>> <</if>> <</if>> @@ -1203,8 +1182,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecAge == 1>> It's a @@.lightgreen;good market@@ for your corporation's young slaves, improving sales and helping social progress. <<set $arcologies[$i].FSYouthPreferentialist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1244,8 +1222,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecAge == 3>> It's a @@.lightgreen;good market@@ for your corporation's enslaved MILFs, improving sales and helping social progress. <<set $arcologies[$i].FSMaturityPreferentialist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1289,8 +1266,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecWeight < 3>> It's a @@.lightgreen;good market@@ for your corporation's trim slaves, improving sales and helping social progress. <<set $arcologies[$i].FSSlimnessEnthusiast += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1332,18 +1308,15 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSPecInjection == 4>> It's an @@.lightgreen;excellent market@@ for your corporation's world-class tits and ass, improving sales and helping social progress. <<set $arcologies[$i].FSAssetExpansionist += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <<elseif $corpSpecInjection == 5>> It's a @@.lightgreen;good market@@ for your corporation's hugely endowed cows, improving sales and helping social progress. <<set $arcologies[$i].FSAssetExpansionist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSPecInjection == 3>> It's a @@.lightgreen;good market@@ for your corporation's stacked slaves, improving sales and helping social progress. <<set $arcologies[$i].FSAssetExpansionist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1382,13 +1355,11 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecInjection == 5>> It's an @@.lightgreen;excellent market@@ for your corporation's world-class milk producers, improving sales and helping social progress. <<set $arcologies[$i].FSPastoralist += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <<elseif $corpSpecMilk > 0>> It's an @@.lightgreen;excellent market@@ for your corporation's world-class milk producers, improving sales and helping social progress. <<set $arcologies[$i].FSPastoralist += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <</if>> <</if>> <</if>> @@ -1428,18 +1399,15 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecInjection == 5>> It's an @@.lightgreen;excellent market@@ for your corporation's world-class cum producers, improving sales and helping social progress. <<set $arcologies[$i].FSCummunism += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <<elseif $corpSpecHormones == 2>> It's a @@.lightgreen;good market@@ for your corporation's masculinized slaves, improving sales and helping social progress. <<set $arcologies[$i].FSCummunism += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSpecDick == 1 && $corpSpecBalls == 1>> It's a @@.lightgreen;good market@@ for your corporation's slaves standard dicks and balls, improving sales and helping social progress. <<set $arcologies[$i].FSCummunism += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1481,18 +1449,15 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecMuscle == 5 >> It's an @@.lightgreen;excellent market@@ for your corporation's ripped chicks, improving sales and helping social progress. <<set $arcologies[$i].FSPhysicalIdealist += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <<elseif $corpSpecMuscle == 4>> It's a @@.lightgreen;good market@@ for your corporation's toned ladies, improving sales and helping social progress. <<set $arcologies[$i].FSPhysicalIdealist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <<elseif $corpSpecHeight > 3>> It's a @@.lightgreen;good market@@ for your corporation's tall ladies, improving sales and helping social progress. <<set $arcologies[$i].FSPhysicalIdealist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1533,13 +1498,11 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecTrust > 3>> It's an @@.lightgreen;excellent market@@ for your corporation's well kept, happy slaves, improving sales and helping social progress. <<set $arcologies[$i].FSHedonisticDecadence += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <<elseif $corpSpecSexEd == 2>> It's a @@.lightgreen;good market@@ for your corporation's skilled slaves, improving sales and helping social progress. <<set $arcologies[$i].FSHedonisticDecadence += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1578,8 +1541,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecAge == 3>> It's a @@.lightgreen;good market@@ for your corporation's motherly slaves, especially those that look like peoples mothers, improving sales and helping social progress. <<set $arcologies[$i].FSIncestFetishist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1618,13 +1580,11 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecSexEd == 2>> It's an @@.lightgreen;excellent market@@ for your corporation's holy sex slaves, improving sales and helping social progress. <<set $arcologies[$i].FSChattelReligionist += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <<elseif $corpSpecSexEd == 1>> It's a @@.lightgreen;good market@@ for your corporation's aspiring sexual acolytes, improving sales and helping social progress. <<set $arcologies[$i].FSChattelReligionist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1678,8 +1638,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecEducation > 0>> It's a @@.lightgreen;good market@@ for your corporation's properly educated slaves, improving sales and helping social progress. <<set $arcologies[$i].FSRomanRevivalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1731,8 +1690,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecAccent == 1>> It's a @@.lightgreen;good market@@ for your corporation's lovely mix of slave accents, improving sales and helping social progress. <<set $arcologies[$i].FSAztecRevivalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1784,8 +1742,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecAccent == 1>> It's a @@.lightgreen;good market@@ for your corporation's lovely mix of slave accents, improving sales and helping social progress. <<set $arcologies[$i].FSEgyptianRevivalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1837,8 +1794,7 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecAccent == 2>> It's a @@.lightgreen;good market@@ for your corporation's linguistically perfect slaves, improving sales and helping social progress. <<set $arcologies[$i].FSEdoRevivalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1890,13 +1846,11 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecDevotion == 5>> It's an @@.lightgreen;excellent market@@ for your corporation's harem-ready devotees, improving sales and helping social progress. <<set $arcologies[$i].FSArabianRevivalist += 2>> - <<set $corpCash += _corpBonus*2, - $corpRev += _corpBonus*2>> + <<set $corpNeighborBonus += _corpBonus*2>> <<elseif $corpSpecDevotion == 4>> It's a @@.lightgreen;good market@@ for your corporation's properly broken girls, improving sales and helping social progress. <<set $arcologies[$i].FSArabianRevivalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> @@ -1948,13 +1902,15 @@ has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcol <<if $corpSpecIntelligence == 3>> It's a @@.lightgreen;good market@@ for your corporation's intelligent Head Girl prospects, improving sales and helping social progress. <<set $arcologies[$i].FSChineseRevivalist += 1>> - <<set $corpCash += _corpBonus, - $corpRev += _corpBonus>> + <<set $corpNeighborBonus += _corpBonus>> <</if>> <</if>> <</if>> <</if>> +<<set $corpCash += $corpNeighborBonus, +$corpRev += $corpNeighborBonus>> + /* FUTURE SOCIETY ADOPTION */ <<if $arcologies[$i].direction != 0>> diff --git a/src/uncategorized/reSlaveMarriage.tw b/src/uncategorized/reSlaveMarriage.tw index 7fb8af4f0c715d4b778fe5c40a81c053c509dcf1..70e755396529be2feb1b1c20c8ce8328c93ca5ad 100644 --- a/src/uncategorized/reSlaveMarriage.tw +++ b/src/uncategorized/reSlaveMarriage.tw @@ -5,13 +5,30 @@ <<if $groomSlave == 0>> <<set $groomSlave = $eventSlave>> <</if>> +<<run Enunciate($groomSlave)>> +<<setLocalPronouns $groomSlave>> <<if $brideSlave == 0>> <<set $brideSlave = getSlave($groomSlave.relationshipTarget)>> <</if>> -<<run Enunciate($groomSlave)>> +<<setLocalPronouns $brideSlave 2>> + -<<print "[[$groomSlave.slaveName|Long Slave Description][$nextLink = passage(), $eventDescription = 1,$activeSlave = $groomSlave]]">> and <<print "[[$brideSlave.slaveName|Long Slave Description][$nextLink = passage(), $eventDescription = 1,$activeSlave = $brideSlave]]">> come into your office <<if ($groomSlave.amp != 1) && ($brideSlave.amp != 1)>>holding hands<<else>>doing their best to stay close to one another despite their physical limitations<</if>>. $brideSlave.slaveName looks at $groomSlave.slaveName expectantly, but she's terribly nervous and makes several false starts before beginning. Finally $groomSlave.slaveName musters her courage and <<if !canTalk($groomSlave)>>asks you with simple gestures to grant the two of them a slave marriage.<<else>>asks with her voice cracking, "<<Master>>, would you plea<<s>>e grant u<<s>> a <<s>>lave marriage?"<</if>> +<span id="artFrame"> +/* 000-250-006 */ +<<if $seeImages == 1>> + <div class="imageRef medImg"> + <<SlaveArt $groomSlave 2 0>> + </div> + <div class="imageRef medImg"> + <<SlaveArt $brideSlave 2 0>> + </div> +<</if>> +/* 000-250-006 */ +</span> + +<<print "[[$groomSlave.slaveName|Long Slave Description][$nextLink = passage(), $eventDescription = 1,$activeSlave = $groomSlave]]">> and <<print "[[$brideSlave.slaveName|Long Slave Description][$nextLink = passage(), $eventDescription = 1,$activeSlave = $brideSlave]]">> come into your office +<<if ($groomSlave.amp != 1) && ($brideSlave.amp != 1)>>holding hands<<else>>doing their best to stay close to one another despite their physical limitations<</if>>. $brideSlave.slaveName looks at $groomSlave.slaveName expectantly, but _he2's terribly nervous and makes several false starts before beginning. Finally $groomSlave.slaveName musters $his courage and <<if !canTalk($groomSlave)>>asks you with simple gestures to grant the two of them a slave marriage.<<else>>asks with $his voice cracking, "<<Master>>, would you plea<<s>>e grant u<<s>> a <<s>>lave marriage?"<</if>> <br><br> @@ -19,9 +36,99 @@ <<link "Of course">> <<replace "#result">> You inquire as to whether they understand the Free Cities slave marriage ceremony, and they nod, not trusting themselves to do anything more. You give them a few minutes to get dressed in special outfits you make available. When they come back, they're wearing lacy lingerie designed to resemble old world wedding dresses, but without concealing anything. - <br><br><<if ($groomSlave.vagina == 0)>>$groomSlave.slaveName is a virgin, so she's wearing white<<elseif ($groomSlave.pregKnown == 1)>>$groomSlave.slaveName is pregnant, so she's wearing light pink<<elseif ($groomSlave.vagina < 0)>>$groomSlave.slaveName is a sissy slave, so she's wearing light blue<<else>>$groomSlave.slaveName is an experienced sex slave, so she's wearing light pink<</if>> against her $groomSlave.skin skin. <<if ($groomSlave.dickAccessory == "chastity") || ($groomSlave.dickAccessory == "combined chastity")>>She has a little bow on her chastity cage.<<elseif canAchieveErection($groomSlave)>>The sight of $brideSlave.slaveName has her stiffly erect, and she's wearing a little bow around her cockhead.<<elseif ($groomSlave.dick > 0)>>She's impotent, but she's wearing a little bow around her useless cockhead.<<elseif ($groomSlave.clit > 0)>>Her prominent clit is engorged, and she's wearing a tiny bow on it.<<else>>She's wearing a demure little bow just over her pussy.<</if>><<if ($groomSlave.anus > 1)>> Her lacy panties are designed to spread her buttocks a little and display her big butthole.<<elseif ($groomSlave.anus == 0)>> Her lacy panties cover her virgin anus, for once.<</if>> <<if ($groomSlave.boobs > 1000)>>The bra makes no attempt to cover or even support her huge breasts, simply letting them through holes in the lace to jut proudly out.<<elseif ($groomSlave.boobs > 500)>>The bra supports and presents her big breasts, leaving her stiffening nipples bare.<<else>>The bra supports and presents her breasts, giving her more cleavage than she usually displays.<</if>><<if $groomSlave.belly >= 1500>> Her <<if $groomSlave.preg > 0>>growing pregnancy<<else>>rounded middle<</if>> prominently bulges from the gap between her lingerie.<</if>> - <br><br><<if ($brideSlave.vagina == 0)>>$brideSlave.slaveName is a virgin, so she's wearing white<<elseif ($groomSlave.pregKnown == 1)>>$brideSlave.slaveName is pregnant, so she's wearing light pink<<elseif ($brideSlave.vagina < 0)>>$brideSlave.slaveName is a sissy slave, so she's wearing light blue<<else>>$brideSlave.slaveName is an experienced sex slave, so she's wearing light pink<</if>> against her $brideSlave.skin skin. <<if ($brideSlave.dickAccessory == "chastity") || ($brideSlave.dickAccessory == "combined chastity")>>She has a little bow on her chastity cage.<<elseif canAchieveErection($brideSlave)>>The sight of $groomSlave.slaveName has her stiffly erect, and she's wearing a little bow around her cockhead.<<elseif ($brideSlave.dick > 0)>>She's impotent, but she's wearing a little bow around her useless cockhead.<<elseif ($brideSlave.clit > 0)>>Her prominent clit is engorged, and she's wearing a tiny bow on it.<<else>>She's wearing a demure little bow just over her pussy.<</if>><<if ($brideSlave.anus > 1)>> Her lacy panties are designed to spread her buttocks a little and display her big butthole.<<elseif ($brideSlave.anus == 0)>> Her lacy panties cover her virgin anus, for once.<</if>> <<if ($brideSlave.boobs > 1000)>>The bra makes no attempt to cover or even support her huge breasts, simply letting them through holes in the lace to jut proudly out.<<elseif ($brideSlave.boobs > 500)>>The bra supports and presents her big breasts, leaving her stiffening nipples bare.<<else>>The bra supports and presents her breasts, giving her more cleavage than she usually displays.<</if>><<if $brideSlave.belly >= 1500>> Her <<if $brideSlave.preg > 0>>growing pregnancy<<else>>rounded middle<</if>> prominently bulges from the gap between her lingerie.<</if>> - <br><br>The procedure is simple. The two of them prostrate themselves on the ground and beg your indulgence. You state that you grant it, and hand each of them a simple gold band to be worn on the little finger in advertisement of the inferiority of their union. In turn, each of them gives the other her ring, and they kiss. You pronounce them slave wives, and offer them the couch for their honeymoon; they @@.mediumaquamarine;thank you profusely@@ through their building tears. It's always touching to see <<if $groomSlave.bellyPreg >= 5000 && $brideSlave.bellyPreg >= 5000>>two pregnant slaves fingering each other<<else>>a 69<</if>> in which both participants are @@.hotpink;softly crying with happiness.@@ <<if $groomSlave.pregSource == $brideSlave.ID && $brideSlave.pregSource == $groomSlave.ID>>When $groomSlave.slaveName and $brideSlave.slaveName tire, they rest, shoulder to shoulder, with a hand upon each other's bulging belly. Gently, they caress their growing pregnancies, knowing that they carry the other's love child.<<elseif $brideSlave.pregSource == $groomSlave.ID>>When they tire, $groomSlave.slaveName rests her head upon $brideSlave.slaveName's lap and gently kisses her lover's belly, knowing the child of their love is growing within.<<elseif $groomSlave.pregSource == $brideSlave.ID>>When they tire, $brideSlave.slaveName rests her head upon $groomSlave.slaveName's lap and gently kisses her lover's belly, knowing the child of their love is growing within.<</if>> + + <br><br> + <<if ($groomSlave.vagina == 0)>> + $groomSlave.slaveName is a virgin, so $he's wearing white + <<elseif ($groomSlave.pregKnown == 1)>> + $groomSlave.slaveName is pregnant, so $he's wearing light pink + <<elseif ($groomSlave.vagina < 0)>> + $groomSlave.slaveName is a sissy slave, so $he's wearing light blue + <<else>> + $groomSlave.slaveName is an experienced sex slave, so $he's wearing light pink + <</if>> + against $his $groomSlave.skin skin. + <<if ($groomSlave.dickAccessory == "chastity") || ($groomSlave.dickAccessory == "combined chastity")>> + $He has a little bow on $his chastity cage. + <<elseif canAchieveErection($groomSlave)>> + The sight of $brideSlave.slaveName has $him stiffly erect, and $he's wearing a little bow around $his cockhead. + <<elseif ($groomSlave.dick > 0)>> + $He's impotent, but $he's wearing a little bow around $his useless cockhead. + <<elseif ($groomSlave.clit > 0)>> + $His prominent clit is engorged, and $he's wearing a tiny bow on it. + <<else>> + $He's wearing a demure little bow just over $his pussy. + <</if>> + <<if ($groomSlave.anus > 1)>> + $His lacy panties are designed to spread $his buttocks a little and display $his big butthole. + <<elseif ($groomSlave.anus == 0)>> + $His lacy panties cover $his virgin anus, for once. + <</if>> + <<if ($groomSlave.boobs > 1000)>> + The bra makes no attempt to cover or even support $his huge breasts, simply letting them through holes in the lace to jut proudly out. + <<elseif ($groomSlave.boobs > 500)>> + The bra supports and presents $his big breasts, leaving $his stiffening nipples bare. + <<else>> + The bra supports and presents $his breasts, giving $him more cleavage than $he usually displays. + <</if>> + <<if $groomSlave.belly >= 1500>> + $His + <<if $groomSlave.preg > 0>> + growing pregnancy + <<else>> + rounded middle + <</if>> + prominently bulges from the gap between $his lingerie. + <</if>> + + <br><br> + <<if ($brideSlave.vagina == 0)>> + $brideSlave.slaveName is a virgin, so _he2's wearing white + <<elseif ($groomSlave.pregKnown == 1)>> + $brideSlave.slaveName is pregnant, so _he2's wearing light pink + <<elseif ($brideSlave.vagina < 0)>> + $brideSlave.slaveName is a sissy slave, so _he2's wearing light blue + <<else>> + $brideSlave.slaveName is an experienced sex slave, so _he2's wearing light pink + <</if>> + against _his2 $brideSlave.skin skin. + <<if ($brideSlave.dickAccessory == "chastity") || ($brideSlave.dickAccessory == "combined chastity")>> + _He2 has a little bow on _his2 chastity cage. + <<elseif canAchieveErection($brideSlave)>> + The sight of $groomSlave.slaveName has _him2 stiffly erect, and _he2's wearing a little bow around _his2 cockhead. + <<elseif ($brideSlave.dick > 0)>> + $He's impotent, but _he2's wearing a little bow around _his2 useless cockhead. + <<elseif ($brideSlave.clit > 0)>> + _His2 prominent clit is engorged, and _he2's wearing a tiny bow on it. + <<else>> + _He2's wearing a demure little bow just over _his2 pussy. + <</if>> + <<if ($brideSlave.anus > 1)>> + _His2 lacy panties are designed to spread _his2 buttocks a little and display _his2 big butthole. + <<elseif ($brideSlave.anus == 0)>> + _His2 lacy panties cover _his2 virgin anus, for once. + <</if>> + <<if ($brideSlave.boobs > 1000)>> + The bra makes no attempt to cover or even support _his2 huge breasts, simply letting them through holes in the lace to jut proudly out. + <<elseif ($brideSlave.boobs > 500)>> + The bra supports and presents _his2 big breasts, leaving _his2 stiffening nipples bare. + <<else>> + The bra supports and presents _his2 breasts, giving _him2 more cleavage than _he2 usually displays. + <</if>> + <<if $brideSlave.belly >= 1500>> + _His2 + <<if $brideSlave.preg > 0>> + growing pregnancy + <<else>> + rounded middle + <</if>> + prominently bulges from the gap between _his2 lingerie. + <</if>> + + <br><br>The procedure is simple. The two of them prostrate themselves on the ground and beg your indulgence. You state that you grant it, and hand each of them a simple gold band to be worn on the little finger in advertisement of the inferiority of their union. In turn, each of them gives the other their ring, and they kiss. You pronounce them slave spouses, and offer them the couch for their honeymoon; they @@.mediumaquamarine;thank you profusely@@ through their building tears. It's always touching to see <<if $groomSlave.bellyPreg >= 5000 && $brideSlave.bellyPreg >= 5000>>two pregnant slaves fingering each other<<else>>a 69<</if>> in which both participants are @@.hotpink;softly crying with happiness.@@ <<if $groomSlave.pregSource == $brideSlave.ID && $brideSlave.pregSource == $groomSlave.ID>>When $groomSlave.slaveName and $brideSlave.slaveName tire, they rest, shoulder to shoulder, with a hand upon each other's bulging belly. Gently, they caress their growing pregnancies, knowing that they carry the other's love child. + <<elseif $brideSlave.pregSource == $groomSlave.ID>> + When they tire, $groomSlave.slaveName rests $his head upon $brideSlave.slaveName's lap and gently kisses $his lover's belly, knowing the child of their love is growing within.<<elseif $groomSlave.pregSource == $brideSlave.ID>>When they tire, $brideSlave.slaveName rests _his2 head upon $groomSlave.slaveName's lap and gently kisses _his2 lover's belly, knowing the child of their love is growing within. + <</if>> <<set $groomSlave.devotion += 4>> <<set $brideSlave.devotion += 4>> <<set $groomSlave.trust += 4>> diff --git a/src/uncategorized/saGetMilked.tw b/src/uncategorized/saGetMilked.tw index 0248e26f42413e84b27a35f246ed285782e094c5..c93325c98942e9e315ec2f76001eba6f29153e1f 100644 --- a/src/uncategorized/saGetMilked.tw +++ b/src/uncategorized/saGetMilked.tw @@ -168,7 +168,14 @@ gets milked this week. <<set $milkSale = $milk*6>> $His milk is sold for @@.yellowgreen;<<print cashFormat($milkSale)>>.@@ <</if>> - <<run cashX($milkSale, "milked", $slaves[$i])>> + <<if $slaves[$i].assignment == "work in the dairy">> + <<run cashX($milkSale, "milkedDairy", $slaves[$i])>> + <<elseif $slaves[$i].assignment == "get milked">> + <<run cashX($milkSale, "milked", $slaves[$i])>> + <<else>> + <<run cashX($milkSale, "extraMilk", $slaves[$i])>> + <</if>> + <<set _incomeStats.income += $milkSale>> <<if $slaves[$i].fetishKnown>> @@ -393,7 +400,13 @@ gets milked this week. <<if $slaves[$i].vasectomy == 1 || $slaves[$i].ballType == "sterile">><<set _cumSale *= 0.2>><<elseif $slaves[$i].prostate == 3>><<set _cumSale *= 0.5>><</if>> $He produces <<print $cum>> deciliters of cum over the week; the fresh ejaculate, which is in high demand given the new cultural preference for slave products, is sold for @@.yellowgreen;<<print cashFormat(_cumSale)>>.@@ <</if>> - <<run cashX(_cumSale, "milked", $slaves[$i])>> + <<if $slaves[$i].assignment == "work in the dairy">> + <<run cashX(_cumSale, "milkedDairy", $slaves[$i])>> + <<elseif $slaves[$i].assignment == "get milked">> + <<run cashX(_cumSale, "milked", $slaves[$i])>> + <<else>> + <<run cashX(_cumSale, "extraMilk", $slaves[$i])>> + <</if>> <<set _incomeStats.income += _cumSale>> <<if ($slaves[$i].energy > 95)>> @@ -465,7 +478,13 @@ gets milked this week. Because of your arcology's cultural preferences, it comes with extra value. <</if>> It is sold for @@.yellowgreen;<<print cashFormat($fluidSale)>>.@@ - <<run cashX( $fluidSale, "milked", $slaves[$i])>> + <<if $slaves[$i].assignment == "work in the dairy">> + <<run cashX($fluidSale, "milkedDairy", $slaves[$i])>> + <<elseif $slaves[$i].assignment == "get milked">> + <<run cashX($fluidSale, "milked", $slaves[$i])>> + <<else>> + <<run cashX($fluidSale, "extraMilk", $slaves[$i])>> + <</if>> <<set _incomeStats.income += $fluidSale>> <</if>> /* CLOSES FEMALE PROSTATE FLUID GATHERING */ @@ -486,7 +505,13 @@ gets milked this week. <<else>> an incident without lasting effect. <</if>> - <<run cashX(Math.trunc($FResult*_vignette.effect), "milked", $slaves[$i])>> + <<if $slaves[$i].assignment == "work in the dairy">> + <<run cashX(Math.trunc($FResult*_vignette.effect), "milkedDairy", $slaves[$i])>> + <<elseif $slaves[$i].assignment == "get milked">> + <<run cashX(Math.trunc($FResult*_vignette.effect), "milked", $slaves[$i])>> + <<else>> + <<run cashX(Math.trunc($FResult*_vignette.effect), "extraMilk", $slaves[$i])>> + <</if>> <<set _incomeStats.income += Math.trunc($FResult*_vignette.effect)>> <<elseif (_vignette.type == "devotion")>> <<if (_vignette.effect > 0)>> diff --git a/src/uncategorized/saWhore.tw b/src/uncategorized/saWhore.tw index c4f03eafdf5d84a5e03aa39e41f7e0929dc74165..be7a1307f99b3347c905c8be4c76f0879c514540 100644 --- a/src/uncategorized/saWhore.tw +++ b/src/uncategorized/saWhore.tw @@ -1063,9 +1063,16 @@ $His appearance attracted $beauty customers (<<print Math.trunc($beauty/7)>> a d In total, you were paid @@.yellowgreen;<<print cashFormat(Math.trunc($beauty*$FResult))>>@@ for the use of $slaves[$i].slaveName's body this week. <<set _cashX = Math.trunc(($beauty*$FResult)*(1+(0.002*$slaves[$i].whoreSkill)))>> -<<run cashX(_cashX, "whore", $slaves[$i])>> <<set _incomeStats.income += Math.trunc(($beauty*$FResult)*(1+(0.002*$slaves[$i].whoreSkill)))>> +<<if $slaves[$i].assignment == "work in the brothel">> + <<run cashX(_cashX, "whoreBrothel", $slaves[$i])>> +<<elseif $slaves[$i].assignment == "whore">> + <<run cashX(_cashX, "whore", $slaves[$i])>> +<<else>> + <<run cashX(_cashX, "whoring in an unregistered building", $slaves[$i])>> +<</if>> + /* FACILITY DECORATION IMPACTS */ <<if $slaves[$i].assignment == "work in the brothel">> @@ -1230,7 +1237,13 @@ In total, you were paid @@.yellowgreen;<<print cashFormat(Math.trunc($beauty*$FR an incident without lasting effect. <</if>> <<set _cashX = Math.trunc($FResult*_vignette.effect)>> - <<run cashX(_cashX, "whore", $slaves[$i])>> + <<if $slaves[$i].assignment == "work in the brothel">> + <<run cashX(_cashX, "whoreBrothel", $slaves[$i])>> + <<elseif $slaves[$i].assignment == "whore">> + <<run cashX(_cashX, "whore", $slaves[$i])>> + <<else>> + <<run cashX(_cashX, "whoring in an unregistered building", $slaves[$i])>> + <</if>> <<set _incomeStats.income += Math.trunc($FResult*_vignette.effect)>> <<elseif (_vignette.type == "devotion")>> <<if (_vignette.effect > 0)>> diff --git a/src/uncategorized/saWorkAGloryHole.tw b/src/uncategorized/saWorkAGloryHole.tw index 687e5b0dd497750fcf5fcbc7b472478dd2388d21..67899edc14e7baf1d03932d0a2e8eb837694fe09 100644 --- a/src/uncategorized/saWorkAGloryHole.tw +++ b/src/uncategorized/saWorkAGloryHole.tw @@ -265,6 +265,12 @@ $His feelings, skills, and appearance do not matter. $He is condemned to a world <<set $slaves[$i].bellyImplant += _cervixPump>> <</if>> -<<run cashX(($beauty*$FResult), "gloryhole", $slaves[$i])>> +<<if $slaves[$i].assignment == "work a glory hole"">> + <<run cashX(($beauty*$FResult), "gloryhole", $slaves[$i])>> +<<elseif $slaves[$i].assignment == "be confined in the arcade">> + <<run cashX(($beauty*$FResult), "gloryholeArcade", $slaves[$i])>> +<<else>> + <<run cashX(($beauty*$FResult), "working a gloryhole in an unregistered building", $slaves[$i])>> +<</if>> <<set _profits += ($beauty*$FResult)>> <<set _incomeStats.income += ($beauty*$FResult)>>