Skip to content
cyberspace-admin edited this page Nov 9, 2022 · 169 revisions

Description

A starship, starcraft or interstellar spacecraft is a theoretical spacecraft designed for traveling between planetary systems, as opposed to an aerospace-vehicle designed for orbital spaceflight or interplanetary travel.

Specification

  • Targetable
  • Moving / Movable
  • Place for landing

Slots

Slot Type Max Level
ENGINE 2202 2
TANK 2203 2
RADAR 2204 2
SCANNER 2205 2
DROID 2206 2
GRIPPER 2207 2
PROTECTOR 2208 2
WEAPON1 22091 2
WEAPON2 0 0
WEAPON3 0 0
WEAPON4 0 0
WEAPON5 0 0
ARTIFACT1 0 0
ARTIFACT2 0 0
ARTIFACT3 0 0
ARTIFACT4 0 0

Types

export enum T6Ship {
    SHUTTLE = 61,
    DESTROYER = 62,
    FRIGATE = 63,
    CRUISER = 64,
    DREADNOUGHT = 65,
    INTERCEPTOR = 66,
    CORVETTE = 67,
    CORSAIR = 68
}

interface ISlot {
    uuid: string,
    type: CargoType
}

interface IAttackResult {
    status: boolean, 
    reason: string
}

interface IBShip extends IBBillable {

    shield: number;

    grade: {
        level               : number;
        exp_current         : number;
        exp_required        : number;
        _v                  : number;
    }

    skills: {
        points: Array<any>,
        abilities: {
            [key: string]   : number;
            _v              : number;
        }
        _v                  : number;
    }

    slots: {
        [Slot.HULL]         : ISlot;
        [Slot.ENGINE]       : ISlot;
        [Slot.TANK]         : ISlot;
        [Slot.RADAR]        : ISlot;
        [Slot.SCANNER]      : ISlot;
        [Slot.DROID]        : ISlot;
        [Slot.GRIPPER]      : ISlot;
        [Slot.PROTECTOR]    : ISlot;
        [Slot.WEAPON1]      : ISlot;
        [Slot.WEAPON2]      : ISlot;
        [Slot.WEAPON3]      : ISlot;
        [Slot.WEAPON4]      : ISlot;
        [Slot.WEAPON5]      : ISlot;
        [Slot.ARTIFACT1]    : ISlot;
        [Slot.ARTIFACT2]    : ISlot;
        [Slot.ARTIFACT3]    : ISlot;
        [Slot.ARTIFACT4]    : ISlot;
        _v                  : number;
    }

    quest?      : any;
    target?     : any;
    ensurance?  : string;
    group?      : string;

}

interface IEntityModel {

    uuid        : string;
    owner       : string;
    type        : number;
    view        : number;
    parent      : string;

    body        : IBShip;
    nodes?      : Array<IEntityModel>;
    metadata?   : any;

}

class Ship {

    async explore(): Promise<IShipDetails>;

    async radar(): Promise<IEntityModel>;

    async scan(uuid: string): Promise<IEntityModel>;

    async equip(slot: string, uuid: string);

    async unequip(slot: string);

    async learn(type: number);

    async skill(type: number, payload: any);

    async landing(uuid: string);

    async move(x: number, y: number);

    async grab(uuid: string);

    async drop(uuid: string);

    async warp(uuid: string);

    async attack(uuid: string, weapons: Array<number>): Promise<Array<IAttackResult>>;   

    async escape();

    async refuel();

    async repair();

    async accept(uuid: string, count?: number);

    async transfer(uuid: string, type: string);

    async apply(type: CommandType, payload?: any);

    async viewQuest();

    async answerQuest(selected: number);

    async joinGroup(uuid: string, password: string);

    async leaveGroup();

}

Methods

explore(): Promise<IShipDetails>
[ACCESS_DENIED]

The method returns SHIP details.


radar(): Promise<IEntityModel>
[ACCESS_DENIED, NO_RADAR]

The method returns simple data (only necessary data, if you want to see full details, pls see .scan) about space objects near you.

[NO_RADAR] 
// Your [RADAR] is not equipped, please check 'body.radar' slot on your [SHIP]

scan(uuid: string): Promise<IEntityModel>
[ACCESS_DENIED, NO_RADAR, NO_TARGET, NOT_ENOUGH_POWER_OR_DISTANCE]

The method returns full data about a space object if your SCANNER is stronger than its PROTECTOR. The distance depends on the power of RADAR.

[NO_RADAR]
// Your [RADAR] is not equipped, please check 'body.radar' slot on your [SHIP]
[NO_TARGET]
// You're trying to scan non-existent object in space
[NOT_ENOUGH_POWER_OR_DISTANCE]
// Your [RADAR] doesn't have enough power or distance

equip(slot: string, uuid: string)
[ACCESS_DENIED, INCORRECT_CARGO_TYPE]

The method equips specified EQUIPMENT to specified slot.

This method doesn't work for HULL equipment, to change HULL equipment you should use the corresponding service in the SCIENTIFIC STATION.

[INCORRECT_CARGO_TYPE]
// You're sending incorrect slot or the [CARGO] with the specified uuid does not exist

unequip(slot: string)
[ACCESS_DENIED, CANT_UNEQUIP_HULL, SLOT_IS_EMPTY]

The method dismantles a specified slot.

This method doesn't work for HULL, you can change the HULL only via changing your JOB.

[CANT_UNEQUIP_HULL]
// You're trying to unequip [HULL].
[SLOT_IS_EMPTY]
// You're trying to unequip empty slot.

learn(type: number)
[ACCESS_DENIED, JOB_L3_IS_NOT_ABLE_TO_LEARN]

The method learns an ability specified by type. See your JOB page to understand all abilities. Consumes 1 skill point L2 or L4.

[JOB_L3_IS_NOT_ABLE_TO_LEARN]
// You can learn skills only for L2 or L4 jobs.

skill(type: number, payload: any)
[ACCESS_DENIED, LOCATION_SHOULD_BE_SYSTEM, SKILL_IS_NOT_ACTIVE, SKILL_ON_COOLDOWN, NOT_ENOUGH_POWER]

The method uses a specified skill, this skill should be learned by method learn. See your JOB page to understand a payload for each type of skill.

[LOCATION_SHOULD_BE_SYSTEM]
// You should use this method only in space
[SKILL_IS_NOT_ACTIVE]
// You can use only active skills.
[SKILL_ON_COOLDOWN]
// You can use this skill when the cooldown is up.
[NOT_ENOUGH_POWER]
// Please make sure that your POWER is enough.

landing(uuid: string)
[ACCESS_DENIED, LOCATION_SHOULD_BE_SYSTEM, CANT_LANDING]

The method initiates the procedure of landing on the PLANET or STATION. (Watch)

[LOCATION_SHOULD_BE_SYSTEM]
// You should use this method only in space
[CANT_LANDING]
// The distance between the [SHIP] and a target should be less than 50.

move(x: number, y: number)
[ACCESS_DENIED, LOCATION_SHOULD_BE_SYSTEM, CARGO_TOO_HEAVY]

The method initiates the process of moving the SHIP. (Watch)

Affected: Ship
Formula: Speed = (Hull.TOTAL_HP - Hull.WEIGHT) / Hull.TOTAL_HP * Engine.SPEED * 0.8 + Engine.SPEED * 0.2

[LOCATION_SHOULD_BE_SYSTEM]
// You should use this method only in space
[CARGO_TOO_HEAVY]
// The sum of the sizes of the [EQUIPMENT] on the [SHIP] should not exceed the [TOTAL_HP] of your [HULL]
// Check body.mods of your [HULL]

grab(uuid: string)
[ACCESS_DENIED, LOCATION_SHOULD_BE_SYSTEM, NOT_CARGO, 
OUT_OF_RANGE, GRIPPER_DOESNT_EXIST, NOT_ENOUGH_POWER]

The method grabs CARGO from the space. (Watch)

If you want to grab [MINERALS] but the power (traction) of your [GRIPPER] is not enough then you can use the .attack method to split them into smaller pieces. Example: ship.attack('uuid', [1]);

[LOCATION_SHOULD_BE_SYSTEM]
// You should use this method only in space 
[NOT_CARGO]
// The uuid is not a [CARGO]
[OUT_OF_RANGE]
// The distance between your [SHIP] and the [CARGO] must be less than 100
[GRIPPER_DOESNT_EXIST]
// Your [GRIPPER] is not equipped, please check 'body.gripper' slot on your [SHIP]
[NOT_ENOUGH_POWER]
// Your [GRIPPER] equipment must have a [traction] modifier greater than the size of the [CARGO]

drop(uuid: string)
[ACCESS_DENIED, LOCATION_SHOULD_BE_SYSTEM, CANT_DROP]

The method drops CARGO from the SHIP. (Watch)

[LOCATION_SHOULD_BE_SYSTEM]
// You should use this method only in space
[CANT_DROP]
// You can't drop a [CARGO] because it's currently equipped, please unequip and try again

warp(uuid: string)
[ACCESS_DENIED, LOCATION_SHOULD_BE_SYSTEM, INCORRECT_DATA, 
ENGINE_NOT_EXIST, NOT_ENOUGH_POWER, INCORRECT_POSITION]

The method warps to another star SYSTEM. (Watch)

[LOCATION_SHOULD_BE_SYSTEM]
// You should use this method only in space
[INCORRECT_DATA]
// You're trying to warp to non-existent start
[ENGINE_NOT_EXIST]
// Your [ENGINE] is not equipped, please check 'body.engine' slot on your [SHIP]
[NOT_ENOUGH_POWER]
// Your [ENGINE] equipment must have a [warp] modifier greater than the distance between stars
[INCORRECT_POSITION]
// You must be in the correct position to warp, see error description

attack(uuid: string, weapons: Array<number>): Promise<Array<IAttackResult>>
[ACCESS_DENIED, LOCATION_SHOULD_BE_SYSTEM, ZERO_WEAPONS]

The method attacks the target with specified WEAPON. (Watch)

[LOCATION_SHOULD_BE_SYSTEM]
// You should use this method only in space
[ZERO_WEAPONS]
// You're sending incorrect array of [WEAPONS]

Why array of weapons is incorrect ?
You should send slot indexes -> weapon[index], for example: [1,2,3] - if you want to use slots weapon1, weapon2, weapon3. If you want to attack with a single weapon please send array with only one index, for example: [1] or [3].

Which reasons can be returned from the method if status is false ?
All of internal statuses described below.

[NOT_READY]
// You can use this [WEAPON] only once per period of time, see [countdown] modifier of your [WEAPON]
[TARGET_DOESNT_EXIST]
// You're sending incorrect uuid of the target
[NOT_ALLOWED]
// You're trying to attack target in protected system (GREEN), you can use method only in (RED) system
[OUT_OF_RANGE]
// Distance between your [SHIP] and target should be less then [distance] modifier of your [WEAPON]

escape()
[ACCESS_DENIED, LOCATION_SHOULD_BE_PLANET, CARGO_TOO_HEAVY]

The method escapes from the current PLANET or STATION. (Watch)

[LOCATION_SHOULD_BE_PLANET]
// You should use this method only on [PLANET] or [STATION]
[CARGO_TOO_HEAVY]
// The sum of the sizes of the [EQUIPMENT] on the [SHIP] should not exceed the [TOTAL_HP] of your [HULL]
// Check body.mods of your [HULL]

refuel()
[ACCESS_DENIED, LOCATION_SHOULD_BE_PLANET, PLANET_IS_UNINHABITED, 
NO_TANK, NOT_ENOUGH_MONEY]

The method fills a full TANK. Method consumes 10 IGC for each unit of volume.

[LOCATION_SHOULD_BE_PLANET]
// You should use this method only on [PLANET] or [STATION]
[PLANET_IS_UNINHABITED]
// You're trying to fill-up on uninhabited [PLANET]
[NO_TANK]
// Your [TANK] equipment doesn't exist, please check 'body.tank' slot on your [SHIP]
[NOT_ENOUGH_MONEY]
// Your [SHIP] doesn't have enough in-game coins on the balance

repair()
[ACCESS_DENIED, LOCATION_SHOULD_BE_PLANET, PLANET_IS_UNINHABITED, 
NO_HULL, NOT_ENOUGH_MONEY]

The method repairs the HULL. Method consumes 1 IGC for each missing point.

[LOCATION_SHOULD_BE_PLANET]
// You should use this method only on [PLANET] or [STATION]
[PLANET_IS_UNINHABITED]
// You're trying to fill-up on uninhabited [PLANET]
[NO_HULL]
// Your [HULL] equipment doesn't exist, please check 'body.tank' slot on your [SHIP]
[NOT_ENOUGH_MONEY]
// Your [SHIP] doesn't have enough in-game coins on the balance

accept(uuid: string, count?: number)
[ACCESS_DENIED, LOCATION_SHOULD_BE_PLANET, PLANET_IS_UNINHABITED, 
DEAL_DOESNT_EXIST, NO_REQUIRED_ITEM, INCORRECT_COUNT, NOT_ENOUGH_MONEY]

The method accepts the deal on a PLANET, if you want to buy/sell MINERALS, you can specify their quantity.

[LOCATION_SHOULD_BE_PLANET]
// You should use this method only on [PLANET] or [STATION]
[PLANET_IS_UNINHABITED]
// You're trying to fill-up on uninhabited [PLANET]
[DEAL_DOESNT_EXIST]
// The specified deal does not exist
[NO_REQUIRED_ITEM]
// You do not have an item as expected for this deal
[INCORRECT_COUNT]
// You specified incorrect count
[NOT_ENOUGH_MONEY]
// Your [SHIP] doesn't have enough in-game coins on the balance

transfer(uuid: string, type: string)
[ACCESS_DENIED, LOCATION_SHOULD_BE_PLANET, INCORRECT_OWNERSHIP, 
CARGO_DOESNT_EXIST, CURRENTLY_EQUIPPED]

Transfer CARGO from your SHIP to the PLANET you own.

[LOCATION_SHOULD_BE_PLANET]
// You should use this method only on [PLANET] or [STATION]
[INCORRECT_OWNERSHIP]
// You can transfer equipment only to your own [PLANET].
[CARGO_DOESNT_EXIST]
// You are trying to transfer a non-existent [CARGO].
[CURRENTLY_EQUIPPED]
// You should unequip [CARGO] before you will be able to transfer it.

apply(type: CommandType, payload?: any)
[ACCESS_DENIED, LOCATION_SHOULD_BE_PLANET]

The method applies a specific command in a specific place.

enum CommandType {
    GET_TRANSPORT_QUEST = 'GET_TRANSPORT_QUEST',
    COLONIZATION = 'COLONIZATION',
    EXTERMINATION = 'EXTERMINATION',

    INFO = 'INFO',
    DEPOSIT = 'DEPOSIT',
    DEPOSIT_CLOSE = 'DEPOSIT_CLOSE',
    CREDIT = 'CREDIT',
    CREDIT_REPAY = 'CREDIT_REPAY',
    EXCHANGE = 'EXCHANGE',
    EXCHANGE_CANCEL = 'EXCHANGE_CANCEL',

    GET_EMBRYO = 'GET_EMBRYO',
    GET_VIRUS = 'GET_VIRUS',

    CHANGE_JOB = 'CHANGE_JOB',
    LEVEL_UP = 'LEVEL_UP',
    EXP_LEARN = 'EXP_LEARN',
    EXP_BOOST = 'EXP_BOOST',
    EXP_BUY_DATABASE = 'EXP_BUY_DATABASE',

    ENSURANCE = 'ENSURANCE',

    CONTRACT_CREATE = 'CONTRACT_CREATE',
    CONTRACT_APPLY = 'CONTRACT_APPLY'
}

viewQuest()
[ACCESS_DENIED, NO_QUEST]

The method returns details of your current quest.

[NO_QUEST]
// You don't have a quest

answerQuest(selected: number)
[ACCESS_DENIED]

The method sends an answer specified by number and process quest to the next step.


joinGroup(uuid: string, password: string)
[ACCESS_DENIED, GROUP_DOES_NOT_EXIST, INCORRECT_PASSWORD]

The method joins to specified group.

[GROUP_DOES_NOT_EXIST]
// Group with specified uuid does not exist
[INCORRECT_PASSWORD]
// Incorrect password

leaveGroup()
[ACCESS_DENIED, GROUP_DOES_NOT_EXIST]

The method leaves current group.

[GROUP_DOES_NOT_EXIST]
// Group with specified uuid does not exist