Bub: Difference between revisions

27 bytes added ,  8 May 2021
m
Full name
(Interwiki link Cheep-Cheep)
m (Full name)
Line 21: Line 21:
|coins=
|coins=
}}
}}
'''Bubs''' are [[mariowiki:Cheep-Cheep|Cheep-Cheep]] like enemies appearing in [[DDD]]. There are 2 Bubs in DDD, both located above the whirlpool in the first section. Bubs swim around slowly and do not home in on Mario, but they do deal damage.
'''Bubs''' are [[mariowiki:Cheep-Cheep|Cheep-Cheep]] like enemies appearing in [[Dire, Dire Docks]]. There are 2 Bubs in Dire, Dire Docks, both located above the whirlpool in the first section. Bubs swim around slowly and do not home in on Mario, but they do deal damage.


==Behavior==
==Behavior==
===Spawning===
===Spawning===
Bub has 4 spawner functions, only one of which appears to do anything. First, the game stores a variable equal to an attribute for a value indicating the number of Bubs to spawn. If Mario is within 1500 units of the spawner, the game spawns as many Bubs as the stored value is equal to. Then, the game sets the spawner’s action to 1. When the spawner’s action is 1, the game checks if the difference between Mario and the spawner’s Y-values are greater than 2000. If they are, the game sets the spawner’s action to 2. Then the game sets the spawner’s action to 3, and then sets the spawner’s action to 0.
Bub has 4 spawner functions, only one of which appears to do anything. First, the game stores a variable equal to an attribute for a value indicating the number of Bubs to spawn. If Mario is within 1500 units of the spawner, the game spawns as many Bubs as the stored value is equal to. Then, the game sets the spawner’s action to 1. When the spawner’s action is 1, the game checks if the difference between Mario and the spawner’s Y-values are greater than 2000. If they are, the game sets the spawner’s action to 2. Then the game sets the spawner’s action to 3, and then sets the spawner’s action to 0.
===Actions===
===Actions===
Bub has three different action functions. The 0th function sets Bub’s first random variable attribute to a random number between 0 and 1 times 100, then sets Bub’s second random variable attribute to a random number between 0 and 1 times 300, then sets Bub’s action to 1. Action 1 checks if the object’s timer is equal to 0. If it is, Bub’s forward velocity is set to 2 plus a random number between 0 and 1 times 2 units/frame, and Bub’s third random variable is set to a random number between 0 and 1. A variable initialized at the start of action 1 is set to Bub’s Y-position minus Mario’s Y-position. If the Bub’s Y-position is less than the water level minus 50 units, the game can do one of two things. If the difference between Mario and Bub’s Y-positions is negative, it is subtracted from 0 to make it positive. If the difference is less than 500 units, Bub’s vertical function is called with a value of 1. Otherwise, Bub’s vertical function is called with a value of 4. If Bub’s Y-position is above the threshold, Bub’s Y-Position is set equal to the threshold and if the distance between Mario’s Y-position and Bub’s Y-position is greater than 300, Bub’s Y-position is lowered by 1 unit. If the lateral distance between Bub’s home and Mario is greater than 800, Bub’s angle toward Mario is set to its angle to its home. Bub rotates towards Mario at 1.4 degrees/frame. If Bub’s distance from Mario is less than 200, and if Bub’s third random variable attribute is less than .5, Bub’s action is set to action 2. If Bub and Mario collide, Bub’s action is set to action 2. In action 2, if Bub’s timer is less than 20, and if Bub is interacted with, white particles are spawned. Otherwise, Bub’s interaction status is reset to 0. If Bub’s timer is equal to 0, a sound is played. If Bub’s forward velocity is 0, Bub’s forward velocity is changed to 6 units/frame. The game then computes the distance between Mario’s Y-position and the object’s Y-position, and runs the same loop as in action 1, with a few differences. If the difference between Mario and Bub’s Y-positions is less than 500, Bub’s vertical function is called with a value of 2 instead of 1, and instead of turning toward Mario at 1.4 degrees/frame, Bub turns toward an angle 180 degrees from Mario at 5.6 degrees/frame. When Bub’s timer reaches 200 and Mario’s distance from Bub is greater than 600, Bub returns to action 1.  
Bub has three different action functions. The 0th function sets Bub’s first random variable attribute to a random number between 0 and 1 times 100, then sets Bub’s second random variable attribute to a random number between 0 and 1 times 300, then sets Bub’s action to 1. Action 1 checks if the object’s timer is equal to 0. If it is, Bub’s forward velocity is set to 2 plus a random number between 0 and 1 times 2 units/frame, and Bub’s third random variable is set to a random number between 0 and 1. A variable initialized at the start of action 1 is set to Bub’s Y-position minus Mario’s Y-position. If the Bub’s Y-position is less than the water level minus 50 units, the game can do one of two things. If the difference between Mario and Bub’s Y-positions is negative, it is subtracted from 0 to make it positive. If the difference is less than 500 units, Bub’s vertical function is called with a value of 1. Otherwise, Bub’s vertical function is called with a value of 4. If Bub’s Y-position is above the threshold, Bub’s Y-Position is set equal to the threshold and if the distance between Mario’s Y-position and Bub’s Y-position is greater than 300, Bub’s Y-position is lowered by 1 unit. If the lateral distance between Bub’s home and Mario is greater than 800, Bub’s angle toward Mario is set to its angle to its home. Bub rotates towards Mario at 1.4 degrees/frame. If Bub’s distance from Mario is less than 200, and if Bub’s third random variable attribute is less than .5, Bub’s action is set to action 2. If Bub and Mario collide, Bub’s action is set to action 2. In action 2, if Bub’s timer is less than 20, and if Bub is interacted with, white particles are spawned. Otherwise, Bub’s interaction status is reset to 0. If Bub’s timer is equal to 0, a sound is played. If Bub’s forward velocity is 0, Bub’s forward velocity is changed to 6 units/frame. The game then computes the distance between Mario’s Y-position and the object’s Y-position, and runs the same loop as in action 1, with a few differences. If the difference between Mario and Bub’s Y-positions is less than 500, Bub’s vertical function is called with a value of 2 instead of 1, and instead of turning toward Mario at 1.4 degrees/frame, Bub turns toward an angle 180 degrees from Mario at 5.6 degrees/frame. When Bub’s timer reaches 200 and Mario’s distance from Bub is greater than 600, Bub returns to action 1.  
218

edits