[Open Assets] Rings as Health

This content may be freely modified and/or maintained by anyone.
Status
Not open for further replies.
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.

Modifications

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.

Example:
Code:
function G_BigBomb (mobj, victimhealth)
    if mobj.type == MT_BIGFATREALLYREALLYBIGBOMB
        return 100
    else
        return 0
    end
end

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

Commands/Variables

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.
 

Attachments

  • ringhealth.lua
    8.9 KB · Views: 482
  • ringhealthv1-1c.lua
    14.7 KB · Views: 554
Last edited:
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!
 
This is pretty amazing, it sure fixes the old petty Sonic Health system in match, good stuff!
 
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:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top