@chronodivide/game-api 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.d.ts +68 -8
- package/dist/index.js +1 -1
- package/dist/res/ra2cd.mix +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Euler as Euler_2 } from 'three';
|
|
2
|
+
import { Quaternion as Quaternion_2 } from 'three';
|
|
3
|
+
|
|
1
4
|
export declare class ActionsApi {
|
|
2
5
|
#private;
|
|
3
6
|
placeBuilding(buildingName: string, rx: number, ry: number): void;
|
|
@@ -219,10 +222,25 @@ export declare class CrewRules {
|
|
|
219
222
|
readIni(ini: IniSection): this;
|
|
220
223
|
}
|
|
221
224
|
|
|
225
|
+
export declare class Cylindrical extends THREE.Cylindrical {
|
|
226
|
+
setFromVector3(vec3: Vector3): this;
|
|
227
|
+
}
|
|
228
|
+
|
|
222
229
|
export declare class DMislRules extends MissileRules {
|
|
223
230
|
readIni(ini: IniSection): this;
|
|
224
231
|
}
|
|
225
232
|
|
|
233
|
+
export declare class Euler extends THREE.Euler {
|
|
234
|
+
isEuler: true;
|
|
235
|
+
private _x;
|
|
236
|
+
private _y;
|
|
237
|
+
private _z;
|
|
238
|
+
private _order;
|
|
239
|
+
setFromRotationMatrix(m: Matrix4, order?: string, update?: boolean): this;
|
|
240
|
+
reorder(newOrder: string): Euler_2;
|
|
241
|
+
toVector3(optionalResult?: Vector3): Vector3;
|
|
242
|
+
}
|
|
243
|
+
|
|
226
244
|
export declare interface FactoryData {
|
|
227
245
|
status: FactoryStatus;
|
|
228
246
|
/** The unit currently being delivered by the factory, if its status is {@link FactoryStatus.Delivering} */
|
|
@@ -310,7 +328,7 @@ export declare interface GameObjectData {
|
|
|
310
328
|
/** What tile the object is currently on. If the object occupies more than one tile, this is the top-most tile */
|
|
311
329
|
tile: Tile;
|
|
312
330
|
/** The object position in world space */
|
|
313
|
-
worldPosition:
|
|
331
|
+
worldPosition: Vector3;
|
|
314
332
|
/** The object elevation above the ground, in Z levels */
|
|
315
333
|
tileElevation: number;
|
|
316
334
|
/** The size in tiles occupied by this object */
|
|
@@ -457,6 +475,7 @@ export declare class IniSection {
|
|
|
457
475
|
getNumberArray(key: string, sep?: RegExp, defaultValue?: number[]): number[];
|
|
458
476
|
getFixedArray(key: string, sep?: RegExp, defaultValue?: number[]): number[];
|
|
459
477
|
getEnum<T>(key: string, enumType: any, defaultValue: T, caseInsensitive?: boolean): T;
|
|
478
|
+
getEnumNumeric<T>(key: string, enumType: any, defaultValue: T): T;
|
|
460
479
|
getEnumArray<T>(key: string, enumType: any, sep?: RegExp, defaultValue?: T[], caseInsensitive?: boolean): T[];
|
|
461
480
|
getHighestNumericIndex(): number;
|
|
462
481
|
getConcatenatedValues(): string;
|
|
@@ -496,14 +515,15 @@ export declare enum LandType {
|
|
|
496
515
|
Railroad = 5,
|
|
497
516
|
/** Tunnel entrance/exit (works in Tiberian Sun, in Red Alert 2 requires Terrain Expansion (aka TX)). */
|
|
498
517
|
/** Tiberium Veins (Works in TS, in RA2 it is not assigned to anything and can be used for new movement rules). */
|
|
518
|
+
Weeds = 6,
|
|
499
519
|
/** Water as in lakes or ocean areas. */
|
|
500
|
-
Water =
|
|
520
|
+
Water = 7,
|
|
501
521
|
/** Non-firestorm/non-laserfence walls. */
|
|
502
|
-
Wall =
|
|
522
|
+
Wall = 8,
|
|
503
523
|
/** Ore/Gem/Tiberium overlays. */
|
|
504
|
-
Tiberium =
|
|
524
|
+
Tiberium = 9,
|
|
505
525
|
/** Cliffs (before Red Alert 2 Rock was used for cliffs). */
|
|
506
|
-
Cliff =
|
|
526
|
+
Cliff = 10
|
|
507
527
|
}
|
|
508
528
|
|
|
509
529
|
export declare class LightningStormRules {
|
|
@@ -547,6 +567,18 @@ export declare class MapApi {
|
|
|
547
567
|
getAllTilesResourceData(): TileResourceData[];
|
|
548
568
|
}
|
|
549
569
|
|
|
570
|
+
export declare class Matrix4 extends THREE.Matrix4 {
|
|
571
|
+
extractRotation(m: Matrix4): this;
|
|
572
|
+
makeRotationFromEuler(euler: Euler): this;
|
|
573
|
+
lookAt(eye: Vector3, target: Vector3, up: Vector3): this;
|
|
574
|
+
getMaxScaleOnAxis(): number;
|
|
575
|
+
makeRotationX(theta: number): this;
|
|
576
|
+
makeRotationY(theta: number): this;
|
|
577
|
+
makeRotationZ(theta: number): this;
|
|
578
|
+
makeRotationAxis(axis: Vector3, angle: number): this;
|
|
579
|
+
decompose(position: Vector3, quaternion: Quaternion, scale: Vector3): Object[];
|
|
580
|
+
}
|
|
581
|
+
|
|
550
582
|
export declare class MissileRules {
|
|
551
583
|
/** How many frames the rocket pauses on the launcher before tilting */
|
|
552
584
|
pauseFrames: number;
|
|
@@ -881,6 +913,18 @@ export declare class PublicApi {
|
|
|
881
913
|
createGame(opts: CreateOpts): Promise<GameInstanceApi>;
|
|
882
914
|
}
|
|
883
915
|
|
|
916
|
+
export declare class Quaternion extends THREE.Quaternion {
|
|
917
|
+
private _x;
|
|
918
|
+
private _y;
|
|
919
|
+
private _z;
|
|
920
|
+
private _w;
|
|
921
|
+
setFromEuler(euler: Euler, update?: boolean): this;
|
|
922
|
+
setFromAxisAngle(axis: Vector3, angle: number): this;
|
|
923
|
+
setFromRotationMatrix(m: Matrix4): this;
|
|
924
|
+
length(): number;
|
|
925
|
+
slerp(qb: Quaternion, t: number): this | Quaternion_2;
|
|
926
|
+
}
|
|
927
|
+
|
|
884
928
|
export declare interface QueueData {
|
|
885
929
|
size: number;
|
|
886
930
|
maxSize: number;
|
|
@@ -1055,6 +1099,10 @@ export declare enum SpeedType {
|
|
|
1055
1099
|
Winged = 7
|
|
1056
1100
|
}
|
|
1057
1101
|
|
|
1102
|
+
export declare class Spherical extends THREE.Spherical {
|
|
1103
|
+
setFromVector3(vec3: Vector3): this;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1058
1106
|
export declare enum StanceType {
|
|
1059
1107
|
None = 0,
|
|
1060
1108
|
Guard = 1,
|
|
@@ -1410,7 +1458,7 @@ export declare class TechnoRules extends ObjectRules {
|
|
|
1410
1458
|
/** Only for aircraft */
|
|
1411
1459
|
pitchSpeed: number;
|
|
1412
1460
|
damageParticleSystems: string[];
|
|
1413
|
-
damageSmokeOffset:
|
|
1461
|
+
damageSmokeOffset: Vector3;
|
|
1414
1462
|
minDebris: number;
|
|
1415
1463
|
maxDebris: number;
|
|
1416
1464
|
/** Only for vehicles */
|
|
@@ -1419,7 +1467,7 @@ export declare class TechnoRules extends ObjectRules {
|
|
|
1419
1467
|
debrisAnims: string[];
|
|
1420
1468
|
/** Only for lamps */
|
|
1421
1469
|
isLightpost: boolean;
|
|
1422
|
-
/** Only for lamps */
|
|
1470
|
+
/** Only for lamps. Distance in leptons that the light emitted from this building is visible from */
|
|
1423
1471
|
lightVisibility: number;
|
|
1424
1472
|
/** Only for lamps */
|
|
1425
1473
|
lightIntensity: number;
|
|
@@ -1589,7 +1637,7 @@ export declare interface UnitData extends GameObjectData {
|
|
|
1589
1637
|
/** If the unit is not currently incapacitated and is able to move */
|
|
1590
1638
|
canMove?: boolean;
|
|
1591
1639
|
/** The current velocity vector in world space */
|
|
1592
|
-
velocity?:
|
|
1640
|
+
velocity?: Vector3;
|
|
1593
1641
|
/** Only applicable to infantry */
|
|
1594
1642
|
stance?: StanceType;
|
|
1595
1643
|
/** Only applicable to harvesters */
|
|
@@ -1610,6 +1658,18 @@ export declare class V3RocketRules extends MissileRules {
|
|
|
1610
1658
|
readIni(ini: IniSection): this;
|
|
1611
1659
|
}
|
|
1612
1660
|
|
|
1661
|
+
export declare class Vector3 extends THREE.Vector3 {
|
|
1662
|
+
applyEuler(euler: Euler): this;
|
|
1663
|
+
applyAxisAngle(axis: Vector3, angle: number): this;
|
|
1664
|
+
length(): number;
|
|
1665
|
+
projectOnPlane(planeNormal: Vector3): this;
|
|
1666
|
+
reflect(normal: Vector3): this;
|
|
1667
|
+
angleTo(v: Vector3): number;
|
|
1668
|
+
distanceTo(v: Vector3): number;
|
|
1669
|
+
setFromSpherical(s: Spherical): this;
|
|
1670
|
+
setFromCylindrical(c: Cylindrical): this;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1613
1673
|
export declare enum VeteranAbility {
|
|
1614
1674
|
FASTER = 0,
|
|
1615
1675
|
STRONGER = 1,
|