arx-level-generator
Version:
A tool for creating Arx Fatalis maps
127 lines (126 loc) • 4.27 kB
TypeScript
import { ArxInteractiveObject } from 'arx-convert/types';
import { Expand } from 'arx-convert/utils';
import { Audio } from './Audio.js';
import { EntityModel } from './EntityModel.js';
import { Rotation } from './Rotation.js';
import { Script } from './Script.js';
import { Settings } from './Settings.js';
import { Texture } from './Texture.js';
import { Vector3 } from './Vector3.js';
import { TextureOrMaterial } from './types.js';
export type EntityConstructorProps = {
id?: number;
/**
* specify the script file for the entity with `.asl` extension
*
* if the ASL file for the entity has the same name as it's container folder
* like `items/magic/fern/fern.asl` then you can shorten it to `items/magic/fern`
*/
src: string;
/**
* default value is Vector3(0, 0, 0)
*/
position?: Vector3;
/**
* default value is Rotation(0, 0, 0)
*/
orientation?: Rotation;
/**
* default value is undefined
*/
inventoryIcon?: Texture;
/**
* default value is undefined
*/
model?: EntityModel;
/**
* stuff that I can't put elsewhere, but needs to get exported
*/
otherDependencies?: (Audio | TextureOrMaterial)[];
};
export type EntityConstructorPropsWithoutSrc = Expand<Omit<EntityConstructorProps, 'src'>>;
export declare class Entity {
id: number;
/**
* specify the script file for the entity with `.asl` extension
*
* if the ASL file for the entity has the same name as it's container folder
* like `items/magic/fern/fern.asl` then you can shorten it to `items/magic/fern`
*/
src: string;
position: Vector3;
orientation: Rotation;
inventoryIcon?: Texture;
script?: Script;
model?: EntityModel;
/**
* stuff that I can't put elsewhere, but needs to get exported
*/
otherDependencies: (Audio | TextureOrMaterial)[];
constructor(props: EntityConstructorProps);
/**
* returns the name of the entity without any id, for example "marker"
*/
get entityName(): string;
hasScript(): this is {
script: Script;
};
hasModel(): this is {
model: EntityModel;
};
hasInventoryIcon(): this is {
inventoryIcon: Texture;
};
needsInventoryIcon(): boolean;
withScript(): this;
at({ position, orientation }: {
position?: Vector3;
orientation?: Rotation;
}): this;
clone(): Entity;
static fromArxInteractiveObject(entity: ArxInteractiveObject): Entity;
toArxInteractiveObject(): ArxInteractiveObject;
/**
* returns the reference to the entity that can be used in scripts,
* for example "marker_0001"
*/
get ref(): string;
exportScriptTarget(settings: Settings): string;
exportInventoryIcon(settings: Settings): Promise<Record<string, string>>;
exportOtherDependencies(settings: Settings): Promise<Record<string, string>>;
move(offset: Vector3): void;
static get marker(): Entity;
static get torch(): Entity;
static get fern(): Entity;
static get mushroom(): Entity;
static get key(): Entity;
static get powerStonePlace(): Entity;
static get powerStone(): Entity;
static get lock(): Entity;
static get rope(): Entity;
static get cube(): Promise<import("./prefabs/entity/Cube.js").Cube>;
static get bone(): Entity;
static get boneWeap(): Entity;
static get skull(): Entity;
static get boneBassin(): Entity;
static get barrel(): Entity;
static get brokenBottle(): Entity;
static get brokenShield(): Entity;
static get brokenStool(): Entity;
static get seatStool1(): Entity;
static get akbaaBloodChickenHead(): Entity;
static get hangedGob(): Entity;
static get lampGoblin1(): Entity;
static get lampGoblin2(): Entity;
static get lampGoblin3(): Entity;
static get lampHuman1(): Entity;
static get lampHuman2(): Entity;
static get lampHuman3(): Entity;
static get lampHumanPalace(): Entity;
static get lampHumanPalaceRoom(): Entity;
static get lampHumanSnake1(): Entity;
static get lampHumanSnake2(): Entity;
static get lampHumanTorch1(): Entity;
static get lampSnake1(): Entity;
static get lampSnake2(): Entity;
}