mirror of
https://github.com/kucherenko/jscpd.git
synced 2026-09-19 08:11:03 +08:00
64e471e2b0
Adds 92 new tests (178 → 270 total) with zero source-file modifications: - packages/finder: 13 new test files covering all reporters, subscribers, validators, hooks, utils, options, cloneFound, getFilesToDetect, and InFilesDetector; shared buildClone() factory helper - apps/jscpd: 3 new test files (options-unit, print, store) plus extensions to formats, modes, and options integration tests - vitest.config.ts added to both packages to restrict coverage.include to src/** only, eliminating bin/ and prism.js noise - Fixes 3 tokenizer bugs (trailing space in format lookup, tokenization edge cases) uncovered by the new format fixture suite - Adds fixture files for 40+ language formats to support formats.test.ts
90 lines
1.5 KiB
Ucode
90 lines
1.5 KiB
Ucode
// Unreal Engine 3 UnrealScript - Character Controller
|
|
class MyCharacter extends GamePawn
|
|
placeable;
|
|
|
|
var float WalkSpeed;
|
|
var float RunSpeed;
|
|
var float JumpHeight;
|
|
var bool bIsRunning;
|
|
var bool bIsCrouching;
|
|
|
|
var SoundCue FootstepSound;
|
|
var SoundCue JumpSound;
|
|
var SoundCue LandSound;
|
|
|
|
var ParticleSystemComponent DustEffect;
|
|
|
|
simulated event PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
WalkSpeed = 300.0f;
|
|
RunSpeed = 600.0f;
|
|
JumpHeight = 420.0f;
|
|
bIsRunning = false;
|
|
bIsCrouching = false;
|
|
GroundSpeed = WalkSpeed;
|
|
}
|
|
|
|
simulated function SetRunning(bool bRun)
|
|
{
|
|
bIsRunning = bRun;
|
|
if (bIsRunning)
|
|
{
|
|
GroundSpeed = RunSpeed;
|
|
}
|
|
else
|
|
{
|
|
GroundSpeed = WalkSpeed;
|
|
}
|
|
}
|
|
|
|
simulated function SetCrouching(bool bCrouch)
|
|
{
|
|
bIsCrouching = bCrouch;
|
|
if (bIsCrouching)
|
|
{
|
|
GroundSpeed = WalkSpeed * 0.5f;
|
|
ShouldCrouch(true);
|
|
}
|
|
else
|
|
{
|
|
GroundSpeed = bIsRunning ? RunSpeed : WalkSpeed;
|
|
ShouldCrouch(false);
|
|
}
|
|
}
|
|
|
|
event Landed(vector HitNormal, Actor FloorActor)
|
|
{
|
|
Super.Landed(HitNormal, FloorActor);
|
|
if (LandSound != None)
|
|
{
|
|
PlaySound(LandSound);
|
|
}
|
|
if (DustEffect != None && VSize(Velocity) > 200.0f)
|
|
{
|
|
DustEffect.ActivateSystem();
|
|
}
|
|
}
|
|
|
|
function bool DoJump(bool bUpdating)
|
|
{
|
|
if (Super.DoJump(bUpdating))
|
|
{
|
|
if (JumpSound != None)
|
|
{
|
|
PlaySound(JumpSound);
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
defaultproperties
|
|
{
|
|
WalkSpeed = 300.0
|
|
RunSpeed = 600.0
|
|
JumpHeight = 420.0
|
|
bCanCrouch = true
|
|
bCanJump = true
|
|
}
|