Skip to content

Commit

Permalink
Moved smart covers. Singletons for frequently used vectors. Add missi…
Browse files Browse the repository at this point in the history
…ng animpoint with harmonica.
  • Loading branch information
Neloreck committed Jul 23, 2023
1 parent 32dbf34 commit f589594
Show file tree
Hide file tree
Showing 42 changed files with 665 additions and 320 deletions.
36 changes: 36 additions & 0 deletions src/engine/core/objects/animation/animations/animpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -779,4 +779,40 @@ export const animpointAnimations: LuaTable<TName, IAnimationDescriptor> = $fromO
idle: createSequence("animpoint_sit_low_harmonica_idle_1", "animpoint_sit_low_harmonica_idle_1"),
rnd: null,
},
[EStalkerState.ANIMPOINT_SIT_ASS_HARMONICA]: {
prop: {
maxidle: 3,
sumidle: 3,
rnd: 80,
moving: null,
},
into: createSequence(
[
"sit_2_harmonica_1_0",
{ a: misc.harmonica_a },
{
f: (object: ClientObject) => {
CampManager.startPlayingHarmonica(object);
},
},
"sit_2_harmonica_1_1",
],
[
"sit_2_harmonica_1_0",
{ a: misc.harmonica_a },
{
f: (object: ClientObject) => {
CampManager.startPlayingHarmonica(object);
},
},
"sit_2_harmonica_1_1",
]
),
out: createSequence(
["harmonica_1_sit_2_0", { d: misc.harmonica_a }, "harmonica_1_sit_2_1"],
["harmonica_1_sit_2_0", { d: misc.harmonica_a }, "harmonica_1_sit_2_1"]
),
idle: createSequence("harmonica_0", "harmonica_0"),
rnd: null,
},
});
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { move } from "xray16";

import { ISmartCoverDescriptor } from "@/engine/core/objects/server/smart_cover/smart_covers_list";
import { getAnimPriA22Loophole } from "@/engine/core/objects/server/smart_cover/smart_covers_loophole_anim_pri_a22";
import { createEmptyVector, createVector } from "@/engine/core/utils/vector";
import { getAnimPriA22Loophole } from "@/engine/core/objects/animation/smart_covers/loophole_anim_pri_a22";
import { ISmartCoverDescriptor } from "@/engine/core/objects/animation/smart_covers/types_smart_covers";
import { MZ_VECTOR, ZERO_VECTOR } from "@/engine/lib/constants/vectors";

/**
* todo;
*/
export function getSmartCoverAnimPriA22(): ISmartCoverDescriptor {
return {
need_weapon: false,
loopholes: [
getAnimPriA22Loophole("anim_pri_a22", createVector(0, 0, 0), createVector(0, 0, -1), createVector(0, 0, -1)),
] as any,
loopholes: $fromArray([getAnimPriA22Loophole("anim_pri_a22", ZERO_VECTOR, MZ_VECTOR, MZ_VECTOR)]),
transitions: [
{
vertex0: "",
Expand All @@ -25,7 +23,7 @@ export function getSmartCoverAnimPriA22(): ISmartCoverDescriptor {
actions: [
{
animation: "pri_a22_colonel_lean_on_tabl_in",
position: createEmptyVector(),
position: ZERO_VECTOR,
body_state: move.crouch,
movement_type: move.run,
},
Expand All @@ -44,7 +42,7 @@ export function getSmartCoverAnimPriA22(): ISmartCoverDescriptor {
actions: [
{
animation: "pri_a22_colonel_lean_on_tabl_out",
position: createEmptyVector(),
position: ZERO_VECTOR,
body_state: move.standing,
movement_type: move.run,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import { move } from "xray16";

import { ISmartCoverDescriptor } from "@/engine/core/objects/server/smart_cover/smart_covers_list";
import { getAnimpointPriA15Loophole } from "@/engine/core/objects/server/smart_cover/smart_covers_loophole_animpoint_pri_a15";
import { createVector } from "@/engine/core/utils/vector";
import { getAnimpointPriA15Loophole } from "@/engine/core/objects/animation/smart_covers/loophole_animpoint_pri_a15";
import { ISmartCoverDescriptor } from "@/engine/core/objects/animation/smart_covers/types_smart_covers";
import { Z_VECTOR, ZERO_VECTOR } from "@/engine/lib/constants/vectors";

/**
* todo;
*/
export function getSmartCoverAnimpointPriA15(): ISmartCoverDescriptor {
return {
need_weapon: false,
loopholes: [
getAnimpointPriA15Loophole(
"animpoint_pri_a15",
createVector(0, 0, 0),
createVector(0, 0, 1),
createVector(0, 0, 1)
),
] as any,
loopholes: $fromArray([getAnimpointPriA15Loophole("animpoint_pri_a15", ZERO_VECTOR, Z_VECTOR, Z_VECTOR)]),
transitions: [
{
vertex0: "",
Expand All @@ -30,7 +23,7 @@ export function getSmartCoverAnimpointPriA15(): ISmartCoverDescriptor {
actions: [
{
animation: "idle_0_idle_0",
position: createVector(0, 0, 0),
position: ZERO_VECTOR,
body_state: move.standing,
movement_type: move.run,
},
Expand All @@ -49,7 +42,7 @@ export function getSmartCoverAnimpointPriA15(): ISmartCoverDescriptor {
actions: [
{
animation: "idle_0_idle_0",
position: createVector(0, 0, 0),
position: ZERO_VECTOR,
body_state: move.standing,
movement_type: move.run,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { move } from "xray16";

import { getAnimpointSitAssLoophole } from "@/engine/core/objects/animation/smart_covers/loophole_animpoint_sit_ass";
import { ISmartCoverDescriptor } from "@/engine/core/objects/animation/smart_covers/types_smart_covers";
import { MZ_VECTOR, ZERO_VECTOR } from "@/engine/lib/constants/vectors";

/**
* todo;
*/
export function getSmartCoverAnimpointSitAss(): ISmartCoverDescriptor {
return {
need_weapon: false,
loopholes: $fromArray([getAnimpointSitAssLoophole("animpoint_sit_ass", ZERO_VECTOR, MZ_VECTOR, MZ_VECTOR)]),
transitions: [
{
vertex0: "",
vertex1: "animpoint_sit_ass",
weight: 1.0,
actions: [
{
precondition_functor: "xr_conditions.always",
precondition_params: "",
actions: [
{
animation: "idle_0_to_sit_2",
position: ZERO_VECTOR,
body_state: move.crouch,
movement_type: move.run,
},
],
},
],
},
{
vertex0: "animpoint_sit_ass",
vertex1: "",
weight: 1.1,
actions: [
{
precondition_functor: "xr_conditions.always",
precondition_params: "",
actions: [
{
animation: "sit_2_to_idle_0",
position: ZERO_VECTOR,
body_state: move.standing,
movement_type: move.run,
},
],
},
],
},
],
};
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import { move } from "xray16";

import { ISmartCoverDescriptor } from "@/engine/core/objects/server/smart_cover/smart_covers_list";
import { getAnimpointSitHighLoophole } from "@/engine/core/objects/server/smart_cover/smart_covers_loophole_animpoint_sit_high";
import { createVector } from "@/engine/core/utils/vector";
import { getAnimpointSitHighLoophole } from "@/engine/core/objects/animation/smart_covers/loophole_animpoint_sit_high";
import { ISmartCoverDescriptor } from "@/engine/core/objects/animation/smart_covers/types_smart_covers";
import { MZ_VECTOR, ZERO_VECTOR } from "@/engine/lib/constants/vectors";

/**
* todo;
*/
export function getSmartCoverAnimpointSitHigh(): ISmartCoverDescriptor {
return {
need_weapon: false,
loopholes: [
getAnimpointSitHighLoophole(
"animpoint_sit_high",
createVector(0, 0, 0),
createVector(0, 0, -1),
createVector(0, 0, -1)
),
] as any,
loopholes: [getAnimpointSitHighLoophole("animpoint_sit_high", ZERO_VECTOR, MZ_VECTOR, MZ_VECTOR)] as any,
transitions: [
{
vertex0: "",
Expand All @@ -30,7 +23,7 @@ export function getSmartCoverAnimpointSitHigh(): ISmartCoverDescriptor {
actions: [
{
animation: "animpoint_sit_high_in_1",
position: createVector(0, 0, 0),
position: ZERO_VECTOR,
body_state: move.crouch,
movement_type: move.run,
},
Expand All @@ -49,7 +42,7 @@ export function getSmartCoverAnimpointSitHigh(): ISmartCoverDescriptor {
actions: [
{
animation: "animpoint_sit_high_out_1",
position: createVector(0, 0, 0),
position: ZERO_VECTOR,
body_state: move.standing,
movement_type: move.run,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { move } from "xray16";

import { getAnimpointSitKneeLoophole } from "@/engine/core/objects/animation/smart_covers/loophole_animpoint_sit_knee";
import { ISmartCoverDescriptor } from "@/engine/core/objects/animation/smart_covers/types_smart_covers";
import { MZ_VECTOR, ZERO_VECTOR } from "@/engine/lib/constants/vectors";

/**
* todo;
*/
export function getSmartCoverAnimpointSitKnee(): ISmartCoverDescriptor {
return {
need_weapon: false,
loopholes: $fromArray([getAnimpointSitKneeLoophole("animpoint_sit_knee", ZERO_VECTOR, MZ_VECTOR, MZ_VECTOR)]),
transitions: [
{
vertex0: "",
vertex1: "animpoint_sit_knee",
weight: 1.0,
actions: [
{
precondition_functor: "xr_conditions.always",
precondition_params: "",
actions: [
{
animation: "idle_0_to_sit_1",
position: ZERO_VECTOR,
body_state: move.crouch,
movement_type: move.run,
},
],
},
],
},
{
vertex0: "animpoint_sit_knee",
vertex1: "",
weight: 1.1,
actions: [
{
precondition_functor: "xr_conditions.always",
precondition_params: "",
actions: [
{
animation: "sit_1_lazy_idle_0",
position: ZERO_VECTOR,
body_state: move.standing,
movement_type: move.run,
},
],
},
],
},
],
};
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import { move } from "xray16";

import { ISmartCoverDescriptor } from "@/engine/core/objects/server/smart_cover/smart_covers_list";
import { getAnimpointSitLowLoophole } from "@/engine/core/objects/server/smart_cover/smart_covers_loophole_animpoint_sit_low";
import { createVector } from "@/engine/core/utils/vector";
import { getAnimpointSitLowLoophole } from "@/engine/core/objects/animation/smart_covers/loophole_animpoint_sit_low";
import { ISmartCoverDescriptor } from "@/engine/core/objects/animation/smart_covers/types_smart_covers";
import { MZ_VECTOR, ZERO_VECTOR } from "@/engine/lib/constants/vectors";

/**
* todo;
*/
export function getSmartCoverAnimpointSitLow(): ISmartCoverDescriptor {
return {
need_weapon: false,
loopholes: [
getAnimpointSitLowLoophole(
"animpoint_sit_low",
createVector(0, 0, 0),
createVector(0, 0, -1),
createVector(0, 0, -1)
),
] as any,
loopholes: $fromArray([getAnimpointSitLowLoophole("animpoint_sit_low", ZERO_VECTOR, MZ_VECTOR, MZ_VECTOR)]),
transitions: [
{
vertex0: "",
Expand All @@ -30,7 +23,7 @@ export function getSmartCoverAnimpointSitLow(): ISmartCoverDescriptor {
actions: [
{
animation: "animpoint_sit_low_in_1",
position: createVector(0, 0, 0),
position: ZERO_VECTOR,
body_state: move.crouch,
movement_type: move.run,
},
Expand All @@ -49,7 +42,7 @@ export function getSmartCoverAnimpointSitLow(): ISmartCoverDescriptor {
actions: [
{
animation: "animpoint_sit_low_out_1",
position: createVector(0, 0, 0),
position: ZERO_VECTOR,
body_state: move.standing,
movement_type: move.run,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
import { move } from "xray16";

import { ISmartCoverDescriptor } from "@/engine/core/objects/server/smart_cover/smart_covers_list";
// eslint-disable-next-line max-len
import { getAnimpointSitNormalLoophole } from "@/engine/core/objects/server/smart_cover/smart_covers_loophole_animpoint_sit_normal";
import { createVector } from "@/engine/core/utils/vector";
import { getAnimpointSitNormalLoophole } from "@/engine/core/objects/animation/smart_covers/loophole_animpoint_sit_normal";
import { ISmartCoverDescriptor } from "@/engine/core/objects/animation/smart_covers/types_smart_covers";
import { MZ_VECTOR, ZERO_VECTOR } from "@/engine/lib/constants/vectors";

/**
* todo;
*/
export function getSmartCoverAnimpointSitNormal(): ISmartCoverDescriptor {
return {
need_weapon: false,
loopholes: $fromArray([
getAnimpointSitNormalLoophole(
"animpoint_sit_normal",
createVector(0, 0, 0),
createVector(0, 0, -1),
createVector(0, 0, -1)
),
]),
loopholes: $fromArray([getAnimpointSitNormalLoophole("animpoint_sit_normal", ZERO_VECTOR, MZ_VECTOR, MZ_VECTOR)]),
transitions: [
{
vertex0: "",
Expand All @@ -31,7 +23,7 @@ export function getSmartCoverAnimpointSitNormal(): ISmartCoverDescriptor {
actions: [
{
animation: "animpoint_sit_normal_in_1",
position: createVector(0, 0, 0),
position: ZERO_VECTOR,
body_state: move.crouch,
movement_type: move.run,
},
Expand All @@ -50,7 +42,7 @@ export function getSmartCoverAnimpointSitNormal(): ISmartCoverDescriptor {
actions: [
{
animation: "animpoint_sit_normal_out_1",
position: createVector(0, 0, 0),
position: ZERO_VECTOR,
body_state: move.standing,
movement_type: move.run,
},
Expand Down
Loading

0 comments on commit f589594

Please sign in to comment.