Jump to content

Link & Enemy Damage and Healing Numbers

Overview
Creator: Moosh Added: 18 Nov 2019 Tags: Global
Rating[?]: No rating
View Script
Information

Description Setup Reviews Comments

Combine the example global script with your own and set the following constants:
  • NPCM_DAMAGENUMBERSLASTHP: An npc->Misc[] index (0-15, or 0-31 in 2.55) that's unused by any other scripts.
Damage Number Digit Graphics:
These are sets of 11 tiles or combos each and CSets to draw them in, representing the numbered digits 0-9 and decimal point. GFX_ constants are the first of the 11 tiles or combos. If the constant is >0, it will use tiles for the graphics and if it's <0 it will use combos. If it's 0 then that type of damage number will be disabled. If you don't have your own tiles, I've included mine in the script's images. CS_ constants are the CSet the tiles are drawn in.
  • GFX_DAMAGENUMBERS_ENEMY
  • CS_DAMAGENUMBERS_ENEMY
  • GFX_DAMAGENUMBERS_ENEMYHEAL
  • CS_DAMAGENUMBERS_ENEMYHEAL
  • GFX_DAMAGENUMBERS_LINK
  • CS_DAMAGENUMBERS_LINK
  • GFX_DAMAGENUMBERS_LINKHEAL
  • CS_DAMAGENUMBERS_LINKHEAL
DAMAGENUMBERS_WIDTH and DAMAGENUMBERS_HEIGHT determine the size in pixels of the digits. They're expected to be monospaced, meaning each digit has the same width and height.

DAMAGENUMBERS_ENEMY_MULTIPLIER and DAMAGENUMBERS_LINK_MULTIPLIER will multiply the damage amount shown. So with a multiplier of 0.0625, 16 points of damage will show up as 1.

DAMAGENUMBERS_ENEMY_DECIMAL_PLACES and DAMAGENUMBERS_LINK_DECIMAL_PLACES will affect the number of decimal places that are always shown. If -1, it will show however many are needed, leaving off any trailing zeroes.

Optional Constants:
  • DAMAGENUMBERS_MAX: The maximum number of damage numbers that can be drawn to the screen at once.
  • DAMAGENUMBERS_FRAMES: How many frames damage numbers persist for
  • DAMAGENUMBERS_SPAWNFRAMES: How many frames the spawning animation of the numbers takes (0 for instant)
  • DAMAGENUMBERS_XOFF: X offset for the spawn position of the numbers
  • DAMAGENUMBERS_YOFF: Y offset for the spawn position of the numbers
  • DAMAGENUMBERS_YSPEED: How fast the number moves on the Y axis in pixels per frame (negative is upwards on the screen)
  • DAMAGENUMBERS_BOUNCEHEIGHT: How high the number bounces during its spawn in animation in pixels per frame
  • DAMAGENUMBERS_LINKDAMAGECOOLDOWN: How many frames minimum between numbers for Link being hit appearing (in case you have scripts damaging him every frame)
  • DAMAGENUMBERS_LINKHEALCOOLDOWN: How many frames minimum between numbers for Link being healed appearing (in case you have scripts healing him every frame)
  • DAMAGENUMBERS_ALLOW_LARGE_NEGATIVE: If this is 1, enemies with -1000 HP can still show damage numbers. Generally this may cause buggy interaction with scripts but if you have really high player damage in your quest, go ahead.
This script only requires std.zh.