Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // ToggleThingFactory.
- //=============================================================================
- class ToggleThingFactory expands ThingFactory;
- var() bool bStatus; //set me to be on or off
- var bool curStatus;
- var() bool bAnnounceToggle; //should I announce if I get changed?
- Auto State Waiting
- {
- function Trigger( actor Other, pawn EventInstigator )
- {
- TriggerEvent(Event,Self,EventInstigator);
- curStatus = bStatus;
- bStatus = !bStatus;
- if (curStatus) {
- if (bAnnounceToggle) BroadcastMessage(self.name@": status is"@self.curStatus, true, 'CriticalEvent');
- GotoState('Spawning');
- }
- }
- function Touch(Actor Other)
- {
- local pawn otherpawn;
- otherpawn = Pawn(Other);
- if ( (otherpawn != None) && (!bOnlyPlayerTouched || otherpawn.bIsPlayer) )
- Trigger(other, otherPawn);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement