06-12-2014, 04:05 AM
Lycan Enemy Bars / MGC Mode7 Edit Patch
Version: 1.0
Version: 1.0
Introduction
This system is designed to permit the Enemy HP/SP bars from Lycan Enemy Bars to show properly with the slanted perspective feature of Mode7 by MGC.
Script
Code:
#==============================================================================
# ** Lycan Enemy Bars / MGC Mode7 Edit Patch
#------------------------------------------------------------------------------
# version 1.0
# by DerVVulfman
# 06-11-2014
# RGSS / RPGMaker XP
#------------------------------------------------------------------------------
# * Designed for the Lycan Enemy Bars version 1.1+
# * Designed for the MGC Mode7 Edit - DerVVulfman's rewrite of MGCaladtogel
# original Mode7 script from April 24, '08
#==============================================================================
#
# INSTALLATION:
#
#
# To use, The MGC Mode7 Edit must be placed above both the Lycan Enemy Bars
# and the Lycan ABS system, and this patch below all three. It does not adapt
# the Lycan ABS to function with Mode7, but a separate patch is availeble.
#
# The patch contains not configuration values. All configuration values are
# handled by their respective scripts or script systems.
#
#
#==============================================================================
#==============================================================================
# ** Enemy_Bars
#------------------------------------------------------------------------------
# This sprite is used to display the ABS Enemy HP Bars. They automatically
# change based on the ABS Enemy's health conditions.
#==============================================================================
class Enemy_Bars < Sprite
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
event = $game_map.events[@enemy.event_id]
#First move it
@old_x = event.screen_x-10
@old_y = event.screen_y
# Define new self coordinates based on Mode7 or not
update_character_coordinates(@old_x, @old_y)
# HP Bar Check
return if @old_hp == @enemy.hp
self.bitmap.clear
# Reset original HP
@old_hp = @enemy.hp
#Show the bar
draw_gradient_bar(0,0,@enemy.hp,@enemy.maxhp, HP_BAR)
end
#--------------------------------------------------------------------------
# * Refresh SP
#--------------------------------------------------------------------------
def refresh_sp
event = $game_map.events[@enemy.event_id]
#First move it
@old_x = event.screen_x-10
@old_y = event.screen_y
# Define new self coordinates based on Mode7 or not
update_character_coordinates(@old_x, @old_y)
# Reset original SP
@old_sp = @enemy.sp
#Show the bar
draw_gradient_bar(0, HP_BAR_HEIGHT, @enemy.sp, @enemy.maxsp, SP_BAR)
end
#--------------------------------------------------------------------------
# * Frame Update (when placing a graphic into position)
#--------------------------------------------------------------------------
def update_character_coordinates(char_x, char_y)
x_intermediate = char_x
y_intermediate = char_y
y_intermediate -= $game_temp.pivot + 4 if $game_system.mode7
# if vertical looping
if $game_system.loop_y
h = 32 * $game_map.height
y_intermediate = (y_intermediate + h / 2) % h - h / 2
end
# if it is a Mode7 map
if $game_system.mode7
# Acquire Mode7 Altered Y Position
mode_y = mode7_y($game_temp.distance_h, y_intermediate,
$game_temp.sin_angle, $game_temp.cos_angle,
$game_temp.pivot)
# Exit method ineffective and hide if coordinate failed
if mode_y[1] == false
self.opacity = 0
return false
end
# Set Y coordinate
self.y = mode_y[0]
self.zoom_x = $game_temp.slope_value * y + $game_temp.corrective_value
self.zoom_y = zoom_x
self.x = 320 + zoom_x * (x_intermediate - 320)
if $game_system.loop_x
offset = ($game_map.width >= 24 ? 64 * zoom_x : 0)
l = 32 * $game_map.width * zoom_x
self.x = (x + offset) % l - offset
end
# normal map
else
self.zoom_x = 1.0
self.zoom_y = 1.0
self.x = x_intermediate
self.y = y_intermediate
end
self.z = self.y + 10
return true
end
end
Compatibility
Requires the Mode7 script and the Lycan Enemy Bars script version 1.1 or higher.