Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- ##~~============================================================================
- --Enemy Character Hues (Yami Symphony add-on)--
- Version: 1.1
- Author: IceSage
- Parent Author/Source: Yami Engine Symphony / Add-on: Enemy Character Set
- Compatibility:
- Compatible with Yami's Engine Symphony "Enemy Character Set" script only.
- Description:
- Allows you to change the hue of an enemy Character Set Battler by
- adjusting the hue slider when chosing a picture for a Monster normally.
- YES: Enemy Character Set Battlers did not come with this featured integrated, so
- changing the hue for your enemy monster did nothing.
- You may also adjust the hue by using & modifying your current note tags
- for your enemy battlers, adding an extra number to assign a hue to
- the battler. (This will overwrite whatever hue was chosen when you
- imported the picture / adjusted the hue slider.)
- Example:
- <battler set: filename, index[, hue]>
- <battler set: Monster2, 6>
- Default notetag. Hue will default to monster's default.
- <battler set: Monster2, 6, 99>
- Hue added, changes hue to 99 regardless of currently set hue.
- ##~~============================================================================
- Terms:
- -Free for Commercial / Non-Commercial use.
- Any terms by Yami still apply.
- -Must accept that code is "as is."
- Will do bug fixes, but no external compatibility other than YEA/YES.
- -Must accept it won't be compatible with other scripts or parent script.
- -Author not responsible for any errors or incompatibility.
- -No need to add credit to me in your game, but preserve this header.
- -Can redistribute and modify, but preserve this header.
- ##~~============================================================================
- =end
- if $imported["BattleSymphony-EnemyCharset"]
- ##========================================================================
- # Cache doesn't have "hue" for characters. Let's make one!
- ##========================================================================
- class << Cache
- def character(filename, hue = 0)
- load_bitmap("Graphics/Characters/", filename, hue)
- end
- end
- ##========================================================================
- # Let's change it so that only enemies get hues, then change the bitmap.
- ##========================================================================
- class Sprite_Battler < Sprite_Base
- def set_character_bitmap
- @huecolor = self.battler.battler_hue
- #Check if Battler is Enemy or not.
- if battler.actor?
- self.bitmap = Cache.character(@character_name, 0)
- #Player Actors don't get hue.
- else
- self.bitmap = Cache.character(@character_name, @huecolor)
- #Enemies get a hue.
- end
- sign = @character_name[/^[\!\$]./]
- if sign && sign.include?('$')
- @cw = bitmap.width / 3
- @ch = bitmap.height / 4
- else
- @cw = bitmap.width / 12
- @ch = bitmap.height / 8
- end
- end
- end
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :character_name
- attr_accessor :character_index
- attr_accessor :eweapon_1
- attr_accessor :eweapon_2
- attr_accessor :eshield
- attr_accessor :battler_hue
- ##===========================================================================
- # Overwrite Symphony method: battle_symphony_enemy_charset
- # Adding an extra field to the battle tag for hue.
- ##===========================================================================
- def battle_symphony_enemy_charset
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when REGEXP::SYMPHONY::CHARSET
- str_scan = $1.scan(/[^,]+/i)
- @character_name = str_scan[0]
- @character_index = str_scan[1].to_i
- @battler_hue = str_scan[2].to_i if str_scan[2]
- when REGEXP::SYMPHONY::WEAPON1
- @eweapon_1 = $1.to_i
- when REGEXP::SYMPHONY::WEAPON2
- @eweapon_2 = $1.to_i
- when REGEXP::SYMPHONY::SHIELD
- @eshield = $1.to_i
- end
- }
- end
- end # RPG::BaseItem
- else #Yami Imported If-else
- msg = "Battler Hues not Compatible!\n"
- msg += "This script is an addon and requires its parent.\n"
- msg += "You have 'Enemy Battler Hues' added, but not 'YEA: Enemy Battlers' \n"
- msg += "Either remove this script, or add Yami's Enemy Battlers."
- msgbox(sprintf(msg))
- exit
- end #Yami Check Imported
- ##~~=====================================================================
- # END OF SCRIPT
- ##~~=====================================================================
RAW Paste Data