Barebones function 212

From Unofficial QEdit Wiki Guide
Jump to: navigation, search

Barebones function 212

Function 212: 212:

  • Function 212 = Part of player invincible, or delay/wait seconds countdown timer.

Player invincible, or delay/wait seconds countdown timer

You may want to make your players be invincible for short bursts in your quests (commonly refereed to in game as a blessing), or just have there be a delay before an script occurs, or just have the players wait longer. This time code dose all that.

To use this code make a new function then start by using leti on...

Register 70 = Player invincibility off = 00000000. Player invincibility on = 00000001.

Register 72 = xxxxxxxx amount of time the timer will countdown in seconds.

Then just call 210, or 211 depending on the needs of your quest and end with a ret.


Barebones function 210 = Function 210 threads function 211, and function 213.then switch calls if register 70 equals 00000000 call function 1. if register 70 equals 00000001 call function 214.

Barebones function 211 = Function 211 threaded in function 210. Waits 1 frame. when register 72 equals 00000000 jump to function 212. Converts frames in register 71 to seconds in register 72. Subtracts 00000001 from the value of the time set in register 72. Jumps to function 211.

Barebones function 212 = Function 212 clears the registers used in this from of time also allowing the player to receive damage again.

Barebones function 213 = Function 213 threaded in function 210. Waits 1 frame. players will be invincible until register 72 equals 00000000 based on if register 70 is set to 00000001 on or 00000000 off the Jumps to function 213.

Barebones function 214 = Function 214 threads function 215.

Barebones function 215 = Function 215 threaded in function 214 makes the blessing particles appear on all players on all screens. (The particles may be changed to suit the needs of your quest.)

Use

Function 212 clears the registers used in this from of time also allowing the player to receive damage again.

How the function appears in the script


212:     leti R70, 00000000 //Makes register 70 equal 00000000.
         leti R71, 00000000 //Makes register 71 equal 00000000.
         leti R72, 00000000 //Makes register 72 equal 00000000.
         ret 

Also see

leti, ret, Barebones function 210, Barebones function 211,

Barebones function 213, Barebones function 214, Barebones function 215