Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/frontend/src/game/weapons/functions/renderWeapon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { GamePlayerState } from "../../utils/geckos/geckos";
// Import Weapons Below:
import { AK47 } from "../weapons/primary/AK47/AK47";
import { AWP } from "../weapons/primary/AWP/AWP";
import { Famas } from "../weapons/primary/Famas/Famas";
import { FiveSeven } from "../weapons/secondary/FiveSeven/FiveSeven";
import { Knife } from "../weapons/melee/Knife";
import { M203 } from "../weapons/secondary/M203/M203";
Expand All @@ -27,6 +28,8 @@ export const RenderWeapon: React.FC<RenderWeaponProps> = ({ playerStateRef }) =>
// Assault Rifles
case "AK47":
return <AK47 playerStateRef={playerStateRef} />;
case "Famas":
return <Famas playerStateRef={playerStateRef} />;
case "Saiga":
return <Saiga playerStateRef={playerStateRef} />;
// SMGs
Expand Down
59 changes: 59 additions & 0 deletions packages/frontend/src/game/weapons/weapons/primary/Famas/Famas.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from "react";
import { GamePlayerState } from "../../../../utils/geckos/geckos";
import { PUBLIC_PATHS } from "../../../../constants/publicPaths";
import { useGLTF } from "@react-three/drei";
import { Vector3 } from "three";
import { WeaponChild } from "../../../WeaponChild";
import { WEAPONS } from "@fps/lib";

interface FamasProps {
playerStateRef: React.MutableRefObject<GamePlayerState>;
}

export const Famas: React.FC<FamasProps> = ({ playerStateRef }) => {
return (
<WeaponChild
adsOffset={new Vector3(0.00139, -0.006, -0.0019)}
adsRotation={new Vector3(0.025, 3.085, 0.15)}
animationValues={{
adsWalkAmplitude: 0.0001,
crawl: {
appliedRotation: { x: -1.5, y: 0.5, z: 1.0 },
appliedTranslation: { x: 0.0001, y: 0.01, z: 0.005 },
initialValues: {
rotateX: -0.55,
rotateY: 4.3,
rotateZ: -0.5,
translateX: -0.004,
translateY: -0.01,
translateZ: -0.005,
},
},
idleAmplitude: 0.0002,
sprint: {
amplitude: 0.1,
appliedRotation: { x: 0.3, y: 0.3, z: 0.3 },
appliedTranslation: { x: 0, y: 0.025, z: 0.2 },
initialValues: {
rotateX: -0.5,
rotateY: 4.2,
rotateZ: -0.4,
translateX: -0.004,
translateY: -0.0095,
translateZ: -0.004,
},
},
walkingAmplitude: 0.0003,
}}
idleOffset={new Vector3(-0.0018, -0.007, -0.001)}
idleRotation={new Vector3(0, 3.2, 0.1)}
meshPath={PUBLIC_PATHS.weapons.Saiga} // TODO: https://app.clickup.com/t/86b5vk9q1
playerStateRef={playerStateRef}
scale={0.01}
shootBufferUrl={""}
stats={WEAPONS.Famas}
/>
);
};

useGLTF.preload(PUBLIC_PATHS.weapons.Saiga); // TODO: https://app.clickup.com/t/86b5vk9q1
69 changes: 23 additions & 46 deletions packages/lib/src/objects/weapon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,29 @@ export const WEAPONS = {
weaponType: "Primary",
weight: 1,
},
Famas: {
adsTimeMs: 0,
bulletSpread: 0,
bulletsPerMagazine: 30,
bulletsPerShot: 1,
damageType: "Ballistic",
displayName: "Famas",
fireRateMs: 100,
firingMode: "Burst",
maxDamagePerBullet: 35,
recoil: {
horizontal: 0.01,
kickback: 0.1,
vertical: 0.008,
},
reloadTimeMs: 3000,
reserveAmmo: 150,
sprintToFireTimeMs: 250,
shotsPerBurst: 3,
weaponClass: "Assault Rifle",
weaponType: "Primary",
weight: 1,
},
Saiga: {
adsTimeMs: 0,
bulletSpread: 0,
Expand Down Expand Up @@ -251,52 +274,6 @@ export const WEAPONS = {
weaponType: "Melee",
weight: 1,
},

// TODO: Remove this, its just here to get the linter to stop yelling about unnecessary checks https://app.clickup.com/t/86b5v1xmm
Test: {
adsTimeMs: 0,
bulletSpread: 0,
bulletsPerMagazine: 30,
bulletsPerShot: 1,
damageType: "Ballistic",
displayName: "AK-47",
fireRateMs: 100,
firingMode: "Single",
maxDamagePerBullet: 35,
recoil: {
horizontal: 0.01,
kickback: 0.1,
vertical: 0.008,
},
reloadTimeMs: 3000,
reserveAmmo: 150,
sprintToFireTimeMs: 250,
weaponClass: "Assault Rifle",
weaponType: "Primary",
weight: 1,
},
Test2: {
adsTimeMs: 0,
bulletSpread: 0,
bulletsPerMagazine: 30,
bulletsPerShot: 1,
damageType: "Ballistic",
displayName: "AK-47",
fireRateMs: 100,
firingMode: "Burst",
maxDamagePerBullet: 35,
recoil: {
horizontal: 0.01,
kickback: 0.1,
vertical: 0.008,
},
reloadTimeMs: 3000,
reserveAmmo: 150,
sprintToFireTimeMs: 250,
weaponClass: "Assault Rifle",
weaponType: "Primary",
weight: 1,
},
} satisfies Record<string, WeaponStats>;

// All weapons in the game
Expand Down