Battler States
Authors: ThallionDarkshine
Version: 0.1
Type: Battle Add-on
Key Term: Battle Add-on
IntroductionAnother script with a quite ambiguous name from me. This script allows users to configure different ranges of health that each have their own custom tag that is added to enemies' names. Actors have these health "states" too, but they are not shown in their names. This is another cool feature from Blizz's game that I really liked because it allows players to see enemies health without giving away actual numbers.
Features
- Add health "states" to battlers
- Create different "states" for different ranges of health
- Show custom tags in enemy names for each "state"
ScreenshotsNone required, would just be a picture showing a tag like "[Excellent]" in an enemy's name.
DemoNone yet.
Script
class Game_Battler
attr_reader :state
STATES = [
[0..6, '[Critical]'],
[7..36, '[Bad]'],
[37..65, '[OK]'],
[66..92, '[Good]'],
[93..100, '[Excellent]'],
]
alias tdks_state_init initialize
def initialize(*args)
tdks_state_init(*args)
@state = Game_Battler::STATES.detect { |i| 100.between?(i[0].first, i[0].last) }[1]
end
alias tdks_state_hp= hp=
def hp=(val)
self.tdks_state_hp=(val)
percent = (@hp * 100.0 / maxhp).ceil
@state = Game_Battler::STATES.detect { |i| percent.between?(i[0].first, i[0].last) }[1] unless @hp == 0
end
end
class Game_Enemy
alias tdks_state_name name
def name
return tdks_state_name + ' ' + @state
end
end
InstructionsJust paste the script in, configure the states like this:
[HEALTH_RANGE_MIN..HEALTH_RANGE_MAX, TAG_NAME]
CompatibilityI don't think there are any issues.
Credits and Thanks
- ThallionDarkshine
- Blizz for making CP
Author's NotesNone