Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 |
/** * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved. */ class UDKKActorBreakable extends KActor native; /** If true, this vehicle has health */ var() bool bHasHealth; /** If true, this will cause Damage on Encroachment (DOE) */ var() bool bDamageOnEncroachment; /** If true bDamageOnEncroachment will reset when this actor sleeps or falls below a threshold */ var() bool bResetDOEWhenAsleep; /** Should this KActor take damage when it encroaches*/ var() bool bTakeDamageOnEncroachment; /** If true, this KActor will break when it causes damage */ var() bool bBreakWhenCausingDamage; /** How much health this actor has before it's destroyed */ var() int Health; /** How much damage this actor does upon contact */ var() int EncroachDamage_Other; /** How much should it take */ var() int EncroachDamage_Self; /** When causing damage, use this damage type */ var() class<DamageType> DmgTypeClass; /** This is the velocity threshhold at which the DOE will reset. If set to 0, it will only reset on sleep */ var() int DOEResetThreshold; /** Emitter template to use when this object breaks */ var() ParticleSystem BrokenTemplate; /** Allows things to pass along a damage instigator */ var controller InstigatorController; /** If true, this actor is broken and no longer functional */ var repnotify bool bBroken; cpptext { // AActor interface virtual void physRigidBody(FLOAT DeltaTime); } /** * This delegate is called when this UDKKActorBreakable breaks */ delegate OnBreakApart(); /** * This delegate is called when this UDKKActorBreakable encroaches on another actor */ delegate bool OnEncroach(actor Other); event TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType, HitInfo, DamageCauser); if ( bHasHealth ) { Health -= Damage; if ( Health < 0 ) { BreakApart(); } } } function bool EncroachingOn(Actor Other) { if ( OnEncroach(Other) ) return Super.EncroachingOn(Other); if ( bDamageOnEncroachment && Other != InstigatorController && Other != InstigatorController.Pawn ) { Other.TakeDamage(EncroachDamage_Other, InstigatorController, Location, Velocity, DmgTypeClass); } if ( bTakeDamageOnEncroachment && bHasHealth) { TakeDamage(EncroachDamage_Self, none ,Location, vect(0,0,0), DmgTypeClass); } return Super.EncroachingOn(Other); } function BreakApart() { SetPhysics(PHYS_None); SetCollision(false,false,false); StaticMeshComponent.SetHidden(true); OnBreakApart(); if (WorldInfo.NetMode != NM_DedicatedServer && BrokenTemplate != none) { WorldInfo.MyEmitterPool.SpawnEmitter(BrokenTemplate, Location, Rotation); } bBroken = true; bNetDirty = true; } simulated event ReplicatedEvent(name VarName) { if (VarName == 'bBroken') { BreakApart(); } } defaultproperties { DmgTypeClass=class'DmgType_Crushed' DOEResetThreshold=40 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |