Clone: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 10:
 
Normal clones can be in one of two states:
* '''Targeting:''' The clone will moveMove towards the nearest player at a speed of 0.75 px/frame. This only targets players, not victims or [[decoys]]. If there is no player within 239 pixels on a single axis while in this state, then the clone will despawn.
* '''Mimicking:''' The clone will moveMove in the direction of the cloned player's d-pad input at a speed of 0.75 px/frame. Stand still if the player is not pressing any direction on the d-pad.
 
Clones start in the targeting state, but will switch to the mimicking state after 1 frame. Afterwards, the clone will repeatedly switch to the opposite state after a random amount of time between 1 and 255 frames (about 4.25 seconds).
Line 23:
== Animation ==
 
Clones have a 4 frame animation cycle, with 87 frames in between each animation frame. There is a separate set of animation frames for each of the 4 orthogonal directions, chosen based on which direction the clone is moving. There is also a separate set of animations for Zeke and Julie, chosen based on the character of the player who is being cloned. If the clone is moving diagonal, it uses the left or right animation. If the clone is not moving, it uses a single right-facing sprite for all 4 animation frames.
 
== Bugs ==
 
* [[Fire extinguisher|Freezing]] or [[Bubble gun|bubbling]] a clone, then letting it despawn will count as killing it. This is because the logic forthat determines if a clone was killed or not checks if it was ever hit by a weapon, not if it lost all its HP.
* The normal clone can randomly get a value of 0 for the amount of time in between state changes. If this happens, the value will roll overunderflow and it will take a full 65536 frames (about 18.2 minutes) for it to change states again.
 
== RAM map ==
 
=== Entity arguments ===
 
{| class="wikitable"
|-
! Address !! Length !! [[Data types|Type]] !! Description
|-
| $00 || 2 || int16 || X position
|-
| $02 || 2 || int16 || Y position
|}
 
=== Entity memory ===
 
{| class="wikitable"
|-
! Address !! Length !! [[Data types|Type]] !! Description
|-
| $08 || 2 || pointer16 || Pointer to sprite
|-
| $0A || 2 || uint16 || Number of frames until next animation frame
|-
| $0C || 2 || uint16 || Current animation frame (x2 during spawn animation)
|-
| $0E || 2 || direction || Current direction
|-
| $10 || 2 || unused || Unused
|-
| $12 || 2 || int16 || X position in pixels (derived from $16)
|-
| $14 || 2 || int16 || Y position in pixels (derived from $18)
|-
| $16 || 2 || int16 x4 || X position
|-
| $18 || 2 || int16 x4 || Y position
|-
| $1A || 2 || int16 || New X position in pixels
|-
| $1C || 2 || int16 || New Y position in pixels
|-
| $1E || 2 || int16 x4 || New X position
|-
| $20 || 2 || int16 x4 || New Y position
|-
| $22 || 2 || int16 0-based || Health
|-
| $24 || 2 || uint16 || Current state (0 = targeting, 1 = mimicking)
|-
| $26 || 2 || uint16 || Number of frames until state change
|-
| $28 || 2 || pointer16 || Pointer to spawn animation
|-
| $2A || 2 || pointer16 || Pointer to walking animations table
|-
| $2C || 2 || uint16 x2 || Which player is being cloned
|-
| $2E || 2 || boolean || Dead
|-
| $30 || 2 || sprite type || Type of weapon shot sprite collided with
|- class="breakrow"
| $7E || 2 || unused || Value is set but not used
|}
 
[[Category:Respawning monster]]