PlayerGunData Resource
Namespace: SpaceUsurper
Inheritance: Object → HotloadedData → PlayerGunData
Note
This resource type supports #include, so it can inherit properties
from other resources of the same type.
Properties
Handlers
Script Parameters
Note
These parameters are available for you to use while writing scripts inside of a resource of this type.
| Name | Description | 
|---|---|
| campaignIndex | The stage's index in the campaign. Type: Int32 | 
| charge | The current charge amount of this gun. Type: Single | 
| chargePercent | The percent of charge toward the required charge ( 0-1).Type: Single | 
| collideBullet | The bullet collided with, for use in onHitBullethandler.Type: Bullet | 
| collideBulletEntity | Type: BulletEntity | 
| collideUnit | The unit that contains the pixel a player ran into, for use in onHitPixelhandler.Type: Unit | 
| damagedByLaser | True if the player was damaged by hitting a laser, for use in onHithandler.Type: Boolean | 
| damagedByPixel | True if the player was damaged by hitting a pixel, for use in onHithandler.Type: Boolean | 
| damageDir | The direction of the effect that damaged the player, for use in onHithandler.Type: Vector2 | 
| dt | In-game time since the last update (1/60s), modified by timescale. Type: Single | 
| dtRaw | In-game time since the last update (1/60s), unaffected by timescale changes. Type: Single | 
| facingDir | The facing direction of the gun. Type: Vector2 | 
| gunNum | When multiple guns of the same type exist, this is the index (first gun of each type is num 0).Type: Int32 | 
| gunTime | The amount of time this gun has existed. Type: Single | 
| level | Optional property to facilitate creating guns of increasing power, or whatever else. Type: Int32 | 
| numShots | How many times this gun has shot. Type: Int32 | 
| offsetDir | The direction of the gun's offset from the player. Type: Vector2 | 
| pixelHitNormal | The pixel collision normal, for use in onHitPixelhandler.Type: Vector2 | 
| pixelHitPos | The pixel collision position, for use in onHitPixelhandler.Type: Vector2 | 
| player | This player. Type: Player | 
| players | List of all players. Type: Player[] | 
| rand | Type: Rand | 
| recoilPercent | Returns 1immediately after firing, easing to0over the gun'srecoilTime.Type: Single | 
| ropeCurrLength | Type: Single | 
| ropeNumSprings | Type: Int32 | 
| ropeSpringNum | Type: Int32 | 
| ropeTotalLength | Type: Single | 
| shootPercent | Type: Single | 
| stage | The currently playing stage. Type: GameStage | 
| stageHeight | The height of the arena. Type: Single | 
| stagePath | The location of this stage's config data. Type: String | 
| stageSize | The size of the arena. Type: Vector2 | 
| stageTime | The elapsed time for the current run. Type: Single | 
| stageWidth | The width of the arena. Type: Single | 
| this | This PlayerGun. Type: PlayerGun | 
| xMax | The right boundary of the arena. Type: Single | 
| xMin | The left boundary of the arena. Type: Single | 
| yMax | The upper boundary of the arena. Type: Single | 
| yMin | The lower boundary of the arena. Type: Single | 
| $version | Alias of stage.GetScriptVersion(FILE) Type: Int32 | 
| averageMoveInputPercent | Alias of stage.PlayerHandler.AverageMoveInputPercent Type: Single | 
| averagePlayerPos | Alias of stage.AveragePlayerPos Type: Vector2 | 
| averagePlayerVel | Alias of stage.AveragePlayerVel Type: Vector2 | 
| averageShootInputPercent | Alias of stage.PlayerHandler.AverageShootInputPercent Type: Single | 
| chunkCenterOfMass | Alias of player.ChunkCenterOfMassPos Type: Vector2 | 
| debugToggle | Alias of stage.MiscDebugToggle Type: Boolean | 
| difficulty | Alias of stage.Difficulty Type: Single | 
| diffInt | Alias of stage.DifficultyInt Type: Int32 | 
| disconnectPos | Alias of player.ChunkDisconnectPos Type: Vector2 | 
| isDocked | Alias of stage.IsDocked Type: Boolean | 
| isGameOver | Alias of stage.IsGameOver Type: Boolean | 
| isPaused | Alias of stage.IsPaused Type: Boolean | 
| isPlayerCollidingWithPixel | Alias of player.IsCollidingWithPixel Type: Boolean | 
| isSwitch | Alias of stage.IsSwitch Type: Boolean | 
| maxPlayerInvulnPercent | Alias of stage.MaxPlayerInvulnPercent Type: Single | 
| numAlivePlayers | Alias of stage.AlivePlayerCount Type: Int32 | 
| numChunkPixels | Alias of player.NumChunkPixels Type: Int32 | 
| numPlayers | Alias of stage.PlayerCount Type: Int32 | 
| numShotPatterns | Alias of stage.NumShotPatterns Type: Int32 | 
| numSpawnedPatterns | Alias of stage.NumSpawnedPatterns Type: Int32 | 
| numUnits | Alias of stage.UnitHandler.NumActiveUnits Type: Int32 | 
| PI | Alias of 3.141593 Type: Single | 
| playerAimAngle | Alias of player.Input.AimAngle Type: Single | 
| playerAimDir | Alias of player.Input.AimDirection Type: Vector2 | 
| playerAimInputPercent | Alias of player.Input.AimInputPercent Type: Single | 
| playerAimVector | Alias of player.Input.AimVector Type: Vector2 | 
| playerBodyColorA | Alias of player.Body.BodyColorA Type: Color | 
| playerBodyColorB | Alias of player.Body.BodyColorB Type: Color | 
| playerBodyColorC | Alias of player.Body.BodyColorC Type: Color | 
| playerBodyOpacity | Alias of player.Body.BodyOpacity Type: Single | 
| playerBodySize | Alias of player.Body.Size Type: Vector2 | 
| playerBodyWidthMods | Alias of player.Body.WidthMods Type: Vector2 | 
| playerBoostPercent | Alias of player.BoostPercent Type: Single | 
| playerBrakeInputPercent | Alias of player.Input.BrakeInputPercent Type: Single | 
| playerBrakePercent | Alias of player.Body.BrakePercent Type: Single | 
| playerDamageBonus | Alias of player.DamageBonus Type: Single | 
| playerDeathPercent | Alias of player.DeathPercent Type: Single | 
| playerFacingAngle | Alias of player.Body.FacingAngle Type: Single | 
| playerFacingDir | Alias of player.Body.FacingDirection Type: Vector2 | 
| playerGrazePercent | Alias of player.Health.GrazePercent Type: Single | 
| playerGrazePos | Alias of player.Health.GrazePos Type: Vector2 | 
| playerGunAngle | Alias of player.GunHandler.AimAngle Type: Single | 
| playerGunDir | Alias of player.GunHandler.AimDirection Type: Vector2 | 
| playerGunPos | Alias of player.GunHandler.Position Type: Vector2 | 
| playerGunSize | Alias of player.GunHandler.Size Type: Vector2 | 
| playerGunWidthMods | Alias of player.GunHandler.WidthMods Type: Vector2 | 
| playerIgnoreBulletDamage | Alias of player.IgnoreBulletDamage Type: Boolean | 
| playerIgnoreLaserDamage | Alias of player.IgnoreLaserDamage Type: Boolean | 
| playerInvulnPercent | Alias of player.Health.InvulnPercent Type: Single | 
| playerIsDead | Alias of player.IsDead Type: Boolean | 
| playerIsDying | Alias of player.IsDying Type: Boolean | 
| playerIsIntangible | Alias of player.IsIntangible Type: Boolean | 
| playerIsInvuln | Alias of player.Health.IsInvulnerable Type: Boolean | 
| playerLastHitBullet | Alias of player.Health.BulletDamageSource Type: DataPath<BulletData> | 
| playerLastHitSourceIsBullet | Alias of player.Health.PlayerLastDamageSourceIsBullet Type: Boolean | 
| playerLastHitUnit | Alias of player.Health.UnitDamageSource Type: DataPath<UnitData> | 
| playerLastPos | Alias of player.Movement.LastPos Type: Vector2 | 
| playerLastStatusActivated | Alias of player.StatusEffectHandler.LastStatusActivatedPath Type: DataPath<StatusEffectData> | 
| playerLastStatusLevelChangedAmount | Alias of player.StatusEffectHandler.LastStatusLevelChangedAmount Type: Int32 | 
| playerLastStatusLevelChangedPath | Alias of player.StatusEffectHandler.LastStatusLevelChangedPath Type: DataPath<StatusEffectData> | 
| playerMoveDelta | Alias of player.Movement.MoveDelta Type: Vector2 | 
| playerMoveInputPercent | Alias of player.Input.MoveInputPercent Type: Single | 
| playerMoveVector | Alias of player.Input.MoveVector Type: Vector2 | 
| playerNum | Alias of player.PlayerNumber Type: Int32 | 
| playerNumTimesPreventedDeath | Alias of player.Health.NumTimesPreventedDeath Type: Int32 | 
| playerPixelLastCollisionTime | Alias of player.LastPixelCollisionTime Type: Single | 
| playerPos | Alias of player.Movement.Position Type: Vector2 | 
| playerRecoilPercent | Alias of player.GunHandler.MaxRecoilPercent Type: Single | 
| playerSelectedStatusPath | Alias of player.StatusEffectHandler.SelectedStatusPath Type: DataPath<StatusEffectData> | 
| playerShootInputPercent | Alias of player.Input.ShootInputPercent Type: Single | 
| playerVel | Alias of player.Movement.Velocity Type: Vector2 | 
| playerVelPercent | Alias of player.Movement.VelocityPercent Type: Single | 
| rawStageTime | Alias of stage.RawFixedElapsedTime Type: Single | 
| song | Alias of stage.SongHandler.Song Type: Song | 
| stageBaseBgColor | Alias of stage.BaseBgColor Type: Color | 
| stageBgColor | Alias of stage.BgColor Type: Color | 
| stageBounds | Alias of stage.Bounds Type: Rect | 
| stageCenter | Alias of stage.BoundsCenter Type: Vector2 | 
| stageProgress | Alias of stage.ScoringHandler.Progress Type: Single | 
| stageState | Alias of stage.BehaviourHandler.CurrentState Type: String | 
| timeScale | Alias of stage.TimeScaleHandler.CurrentTimeScale Type: Single |