Alien - alexneargarder/Broforce-Docs GitHub Wiki
Alien
Table of Contents
- Unity Lifecycle & Setup
- Position & Physics
- Combat & Damage
- Special Abilities
- Environmental Interaction
- Networking & RPC
- Helper & Utility
Unity Lifecycle & Setup
Methods
protected override void Start()
Initializes the alien unit with enhanced mobility settings for wall climbing and jumping
protected override void Update()
Updates the alien's behavior including panic-inducing presence that affects nearby enemy units
Position & Physics
Methods
protected override void AnimateActualJumpingFrames()
Animates jumping frames while maintaining proper vertical scale during acrobatic movements
protected override void GetEnemyMovement()
Processes enemy AI movement unless the alien is performing tumbling or somersault maneuvers
protected override void NotPressingJump()
Handles wall climbing state transitions based on directional input when not jumping
Properties
protected override bool WallDrag { get; set; }
Gets or sets wall dragging state with automatic wall climbing activation based on input
Combat & Damage
Methods
public override void Death(float xI, float yI, DamageObject damage)
Handles alien death while ensuring proper sprite scaling is maintained
Parameters:
- float xI: Horizontal force applied to the corpse
- float yI: Vertical force applied to the corpse
- DamageObject damage: The damage object that caused death
protected override void FallDamage(float yI)
Applies fall damage effects based on fall speed and current acrobatic state
Parameters:
- float yI: The vertical impact velocity (negative values indicate downward motion)
Special Abilities
Methods
protected override bool CanPassThroughBarriers()
Determines that aliens can always pass through barrier blocks
Returns:
bool
: Always returns true, granting aliens unrestricted barrier passage
public override bool Inseminate(AlienFaceHugger unit, float xForce, float yForce)
Prevents face hugger insemination of alien units
Parameters:
- AlienFaceHugger unit: The AlienFaceHugger attempting insemination
- float xForce: Horizontal force component (unused)
- float yForce: Vertical force component (unused)
Returns:
bool
: Always returns false, making aliens immune to face hugger attacks
Environmental Interaction
Methods
protected override bool IsAboveLadder()
Determines that aliens never detect ladders below them
Returns:
bool
: Always returns false, preventing downward ladder detection
protected override bool IsNearbyLadder(float xOffset, float yOffset)
Determines that aliens never detect nearby ladders regardless of position
Parameters:
- float xOffset: Horizontal offset for proximity check (unused)
- float yOffset: Vertical offset for proximity check (unused)
Returns:
bool
: Always returns false, preventing all ladder proximity detection
protected override bool IsOverLadder(float xOffset, ref float ladderXPos)
Determines that aliens never interact with ladders when checking overhead positions
Parameters:
- float xOffset: Horizontal offset for ladder detection (unused)
- out float ladderXPos: Output parameter for ladder X position (not set)
Returns:
bool
: Always returns false, preventing overhead ladder detection
Networking & RPC
Methods
public override UnityStream UnpackState(UnityStream stream)
Deserializes network state and applies death state if the unit was dead
Parameters:
- UnityStream stream: The network stream containing serialized state data
Returns:
UnityStream
: The stream after unpacking for potential further processing
Helper & Utility
Fields
protected ActionState lastActionState
Stores the previous action state for state transition detection
protected bool lastWallClimbing
Tracks the previous frame's wall climbing state for transition detection
protected bool lastWallDragging
Tracks the previous frame's wall dragging state for transition detection
private float panicSurroundingMooksDelay
Countdown timer controlling the panic aura effect frequency in seconds