546 - bombShield(int a, int script)


Sets the bomb invulnerability flag (a=0 false, a=1 true), the caller's ANM script will change to script when a bomb is active.

611 - etEx(int etId, int async, int type, float a, float b)


Adds bullet transformation to bullet manager etId, Transformation of flag type determines the specific behaviour of the bullet. Documentation can be found here.

BulletEffectType-67108864 - etExDelay(string et, string isAsync, string time)


Hide the bullet for time frames. During this time, it will not move, will be invisible and won't have a hitbox. If used as a first transformation, can be used to delay when the bullet actually appears.

6 - isDelayedSpawn


While this flag is set, the bullet will be invisible and not have a hitbox. This flag is cleared once the delay timer ends.

4 - short_timer


Integer value between -1 and 15 inclusive (by default -1). If non-negative, shooters using short_timer shoot their bullets and timer increments by 1 per frame until 15 is reached. Once 15, timer reset to -1 or 0 depending on Z key state.

5 - long_timer


Integer value between -1 and 120 inclusive (by default -1). If non-negative, shooters using long_timer shoot their bullets and timer increments by 1 per frame until 120 is reached. Once 120, timer reset to -1 or 0 depending on Z key state.

503 - flagClear(int n)


Clears flag(s) according to n. Refer to the flag table here for exact values.

91 - floatTime(int slot, float var, int time, int mode, float start, float final)


In time frames using mode mode, variable var changes from start to final. slot is used to set the slot to be used by this ins, every enemy has 8 slots.

-9980 - F1


Local float variable, inherited by spawned enemies.

-9984 - I1


Local integer variable, inherited by spawned enemies.

-9989 - ANGLE_PLAYER


Angle from the enemy to the player.

-9962 - BOSS_Y


Final Y position of the boss.

-9990 - PLAYER_Y


Player's Y position.

-9963 - BOSS_X


Final X position of the boss.

-9991 - PLAYER_X


Player's X position.

81 - circlePos(float varX, float varY, float angle, float radius)


Performs following operation: varX = cos(angle) * radius and varY = cos(angle) * radius

-9981 - F0


Local float variable, inherited by spawned enemies.

300 - enmCreate(string sub, float x, float y, int hp, int score, int item)


Creates an enemy using subroutine sub at coordinates (x, y) (relative to position of the parent), health of created enemy is hp, score bonus is score and item drop is item.

601 - etOn(int etId)


Shoots bullet(s) using properties from bullet manager etId.

23 - wait(int time)


Stops sub execution for time frames.

1 - delete()


Returns to the top of current call stack.

2 - GAME_SPEED


The value controls by how much faster the game speed is run. This variable is often set to a number between 0 and 1. This value is often changed when a (final) boss dies or when a photo is taken. Its default value is 1.

-9985 - I0


Local integer variable, inherited by spawned enemies.

-9983 - I2


Local integer variable, inherited by spawned enemies.

-9982 - I3


Local integer variable, inherited by spawned enemies.

-9954 - ENEMY_HP


Enemy's current HP.

3 - goheiExists


A flag that determines if a gohei exists on-screen or not. Flag is set to true by active gohei. Flag is set to false if gohei goes off-screen or is despawning.

-9926 - GI0


Global integer value. Value is initialised to 0 on stage load but not on stage reset.

-9925 - GI1


Global integer value. Value is initialised to 0 on stage load but not on stage reset.

-9924 - GI2


Global integer value. Value is initialised to 0 on stage load but not on stage reset.

-9923 - GI3


Global integer value. Value is initialised to 0 on stage load but not on stage reset.

17 - distortion(int a)


Triggers distortion effects on the edge of the screen. The meaning of the argument is not entirely clear. SA uses a value of 1 to create distortion at the bottom of the screen, while UFO uses this same value to create distortion at the top.

539 - spell3(int id, int timeRate, int unused, string name)


Declares a spell-card with id id and name unused. The ID passed to the spell-creating function is id + difficulty - 2 (with easy=0, normal=1, ..., overdrive=5). timeRate determines how much time the spell circle takes to shrink (in frames), as well as how fast the spell bonus decreases.

514 - setInterrupt(int slot, int hp, int duration, string subroutine)


Sets an interrupt on slot slot. Once caller's HP reaches hp or duration frames have passed since this instruction was called, the caller will terminate all subroutines it's currently running and execute subroutine subroutine.

270 - enmCreate270(string sub, float x, float y, int hp, int score, int item)


Creates an enemy using subroutine sub at coordinates (x, y) (relative to position of the stage background camera), health of created enemy is hp, score bonus is score and item drop is item.

MarisaB Backward Laser


Specifications


  • Versions: 1.00 - 1.01 - 1.02 - 1.02a - 1.02b - 1.02c - 1.02d - 1.02e - 1.02f - 1.02h
  • Difficulty: Easy - Normal - Hard - Lunatic - Extra
  • Mode: Main game - Practice mode
  • Shottype: ReimuA - ReimuB - MarisaA - MarisaB

What happens


MarisaB's laser can fire backward, dealing a small amount of damage to enemies that are behind her lasers. This damage only lasts for one frame.

How it happens


This can be done by shooting with an enemy being behind MarisaB's lasers. However, the laser does not extend infinitely backwards, so you might not hit an enemy if you are too far away from one. To be more specific, an enemy must be within a 240 unit range of MarisaB's laser to be able to be hit by the laser.

Why it happens


To understand how this bug happens, we need to look at how player bullets work, We look at player bullets since MarisaB's lasers are implemented as a subtype of player bullets. Bullet take many parameters, but the parameters we are interested in are as follows:

  • x_pos: X-position of bullet
  • y_pos: Y-position of bullet
  • width: Width of bullet hitbox
  • height: Height of bullet hitbox

The coordinate system in EoSD works as follows:

A screenshot showing the coordinates of the game
Figure 1: Screenshot showing the x- and y-coordinates of the game

Next up we will talk about the initialization and updating process of bullets.

Bullet values and execution


The table below summarizes the parameter values of MarisaB's lasers:

x_pos y_pos width height
On Initialization shooter_x_pos shooter_y_pos 10.0 or 15.0 or 20.0 480
On Update shooter_x_pos shooter_y_pos / 2.0 10.0 or 15.0 or 20.0 shooter_y_pos

The initialized bullet state takes place for one frame before the first update frame occurs. This means the values of "On Initialization" are only true for one frame.

The position of the lasers are of course relative to MarisaB's position. The shooter_x_pos and shooter_y_pos values are the x and y coordinate values of MarisaB's shooters, which are the white orbs that are next to her character where her laser spawns from. The width being 10.0 or 15.0 or 20.0 is because the values change depending on MarisaB's power level.

On Update


Below is an ordinary screenshot of MarisaB, showcasing the "on update" part of her laser:

An in-game screenshot of MarisaB firing her lasers with coloured boxes drawn around/in it.
Figure 2: MarisaB's left laser is highlighted. The green area represents the dimensions of the laser (width=20, height=155), and the small pink area is the position of the laser (x_pos=34, y_pos=74)

Although the laser visually extends upward from the shooter, the laser's logical position (x_pos, y_pos) still represents the center of the laser's hitbox. It means its position has to be in the middle, which is where the pink square is. The laser's height is calculated to be shooter_y_pos to make sure it reaches the top of the screen. This gets updated every in-game frame until the laser despawns.

On Initialization


Recall that the laser's height is 480 units, which is larger than the visible screen height of 432. This means that I cannot show the full laser in a screenshot. To illustrate the backwards laser, I had to cut off the extended laser at the top. The following image is taken where MarisaB is high up on-screen:

An in-game screenshot of MarisaB firing her lasers with coloured boxes drawn around/in it.
Figure 3: MarisaB's left laser is highlighted. The green area represents the dimensions of the laser (width=20, height=480), and the small pink area is the position of the laser (x_pos=159, y_pos=91). The left laser has been hacked into this position for demonstration purposes.

Since the y_pos is the same as shooter_y_pos, it means the laser is shifted to the middle of her shooter. The height is initialized to 480, so 240 units of the laser extend downward. The game never explicitly performs the correction like it does on the "On Update" function, resulting in the laser also partially appearing backwards.

Conclusion


The backwards laser appears for one frame because the laser's center is at her shooter's position, and the laser's height is initialized to 480 units. This means half of the laser's hitbox is extended downward for one frame. On the next update frame, the laser is correctly repositioned higher and resized.


Replays


This section has no content yet. Would you like to add to this section? Contact me if you are interested!

Videos


This section has no content yet. Would you like to add to this section? Contact me if you are interested!