SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Releases > Lua

Thread Tools
Rings as Health Details »»
Rings as Health
Version: 1.1c, by Blaze The Cat (& Knuckles) Blaze The Cat is offline
Developer Last Online: Dec 2017

Category: Version: SRB2 Rating: (1 votes - 3.20 average)
Released: 02-10-2017 Last Update: 02-22-2017 Installs: 0
Scripts Re-Useable Content

The old ringhealth.lua has been included for legacy purposes.

How it works

This concept is very simple; your rings instead become your health. When shot, you lose rings. To compensate, all shields will instead give you 25 rings. In addition, you begin with 25 rings (or, 26 health)

The damage table is as follows:
  • Red Ring - Your basic weapon. Does 4 damage.
  • Automatic Ring - Rapid fire. Does 3 damage.
  • Bounce Ring - Can bounce off multiple enemies. 5 damage.
  • Scatter Ring - Each piece does 4 damage. Land all five for a whopping 20 damage, which is the highest damage for a weapon.
  • Explosion Ring - Does 12 damage, and hits everyone in the explosion vicinity.
  • Grenade Ring - Does 15 damage, and acts as a proximity mine. Hits only once per ring, and does the highest damage of any single weapon.
  • Rail Ring - The tactical weapon. Cuts down health by 1/2, rounded up.
  • Infinity Ring - Shooting doesn't consume rings. 4 damage.

When you do damage, you get points equivalent to the damage you've dealt. Killing a player awards a 100-point bonus.

If you are in your super form, you can hurt players when you touch them, and take half the damage you normally would. Rails still take out a quarter of your health, so be careful.

While you can have as many as 9999 rings, ring-hoarding is both a safety and a liability, as having a lot of rings can result in an opponent scoring a large number of points off of you with a rail.


As of 1.1, you may also include your own damage values.

To input an entry to the table, you call the globalized function G_AddToDamageTable.

ringhealth.G_AddToDamageTable(fixed_t knockback, string killmsg, function logic, [boolean swapnames])

knockback: This tells the script how much to kick the player if they get shot by this weapon.
killmsg: Should include two %s variables. The first one is replaced by the attacker, the second one is replaced by the victim. If swapnames is true, this will switch these two variables around.
logic: This is a function you supply to the script to check for the projectile or damage you want to add to the table. It will need to accept a mobj_t and an integer, for the hazardous mobj and the damaged player's health, respectively. Your function then returns the damage value output. If the logic comes out false, return 0.
swapnames: This swaps the player's names in the death message, in case you want the victim's name first. This parameter is optional.

function G_BigBomb (mobj, victimhealth)
        return 100
        return 0

ringhealth.G_AddToDamageTable(64*FRACUNIT, "Wow, %s really DID have a Honkey-Donkey Super-Sonic Big Fat Really Really Big bomb, %s!", G_BigBomb)

rh_knockback <on/off> will determine if players take knockback from being shot. By default, this is on.
rh_friendlypushing <on/off> will determine if players on the same team can kick each other around. By default, this is on.
rh_debug <on/off> will allow you to see what entries in the damage table are activating, and how much damage they do. This will also disable any damage taken from shots to allow you to use players as test dummies. By default, this is off.

painsound <number/sfx_name> allows you to set the sound your character plays when getting hurt. By default, this is set to 5, the first pain sound. It can be one of the following:
  • A soundtest number
  • A sfx_name
  • A DSLUMP name.

Download Now

File Type: lua ringhealth.lua (8.9 KB, 242 views)
File Type: lua ringhealthv1-1c.lua (14.7 KB, 232 views)

Supporters / CoAuthors

Show Your Support

  • The author of this addon has given explicit permission for its content to be re-used and/or reproduced.

Old 02-13-2017   #2
AKA FuriousFox
FuriousFox's Avatar

Welcome to Releases!
FuriousFox is online now   Reply With Quote
Old 02-14-2017   #3
Ya Gal Sal Here (σᴥσ)
TehRealSalt's Avatar

I like this a lot, after I got to try it out in a fairly large netgame. Makes me realize how many of Match's problems are simply from the wacko Sonic health system; you don't feel like you're being robbed of your weapons every second!
Twitter | Twitch | Youtube
TehRealSalt is offline   Reply With Quote
Old 02-14-2017   #4
Spoonman Heaven
Boo's Avatar

This is pretty amazing, it sure fixes the old petty Sonic Health system in match, good stuff!
Some things just aren't for everyone and dreaming isn't prevented. Such perception is adverse.
Boo is offline   Reply With Quote
Old 02-15-2017   #5
Blaze The Cat
& Knuckles
Blaze The Cat's Avatar

I'm going to have to add in the following things:
  • DONE A function that lets you define your own damage logic without having to even touch the Lua anymore
  • Instead, a feature A check to see if classes are loaded, and, if so, tell the script to cap your rings (Because Having no rails can make for a deathless death-match!)
  • A use for shields, a way to toggle between shield functionality and the legacy ring gain.
  • Make all shield box sprites turn into basic shield sprites if legacy mode is enabled, just so nobody grabs an armageddon shield or attraction shield and feel sad over it.
  • DONE A toggleable knockback system.

Last edited by Blaze The Cat; 02-22-2017 at 01:56 PM.
Blaze The Cat is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:43 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.