feat: more lighting

This commit is contained in:
TrèsAbhi committed 2025-08-29 13:21:41 -05:00
1 parent 5d397de766
commit 5c2e49453e
4 files changed
+17 -8

No files matched your search

@@ -16,6 +16,7 @@ import {
Path, Path,
Quaternion, Quaternion,
} from 'three'; } from 'three';
import { isHalloween } from '../../../core/blitzkit/isHalloween';
import { LocaleProvider, useLocale } from '../../../hooks/useLocale'; import { LocaleProvider, useLocale } from '../../../hooks/useLocale';
import { import {
TankopediaEphemeral, TankopediaEphemeral,
@@ -72,11 +73,8 @@ export function ShotDisplay() {
}); });
useEffect(() => { useEffect(() => {
const data = new Date();
const isHalloween = data.getMonth() === 9 && data.getDate() === 31;
if ( if (
isHalloween && isHalloween() &&
shot?.splashRadius !== undefined && shot?.splashRadius !== undefined &&
shot.in.status === 'penetration' shot.in.status === 'penetration'
) { ) {
@@ -1,10 +1,17 @@
import type { SpotLightProps } from '@react-three/fiber'; import type { SpotLightProps } from '@react-three/fiber';
import { memo } from 'react';
import { Color } from 'three';
import { isHalloween } from '../core/blitzkit/isHalloween';
interface Props extends SpotLightProps { interface Props extends SpotLightProps {
debug?: boolean; debug?: boolean;
} }
export function HelpingSpotLight({ debug, ...props }: Props) { export const HelpingSpotLight = memo<Props>(({ debug, ...props }) => {
const color = new Color();
if (isHalloween()) color.set(1, 0.25, 0.25);
return ( return (
<> <>
{debug && ( {debug && (
@@ -14,7 +21,7 @@ export function HelpingSpotLight({ debug, ...props }: Props) {
</mesh> </mesh>
)} )}
<spotLight {...props} /> <spotLight color={color} {...props} />
</> </>
); );
} });
@@ -3,7 +3,7 @@ import { clamp } from 'lodash-es';
import { useRef } from 'react'; import { useRef } from 'react';
import { MeshStandardMaterial } from 'three'; import { MeshStandardMaterial } from 'three';
const SIZE = 2 ** 6; const SIZE = 2 ** 5;
export function SceneProps() { export function SceneProps() {
const material = useRef<MeshStandardMaterial>(null); const material = useRef<MeshStandardMaterial>(null);
@@ -0,0 +1,4 @@
export function isHalloween() {
const data = new Date();
return data.getMonth() === 9 && data.getDate() === 31;
}