Pomogła: 1 raz Dołączyła: 26 Wrz 2009 Posty: 88 Skąd: Stumilowy Las
Wysłany: Pią 02 Paź, 2009 08:16
HP/MP przeciwników podczas walki
Dzień dobry
Dodaję nowy skrypt który umożliwi wam obserwowanie stanu HP i MP oraz statusów które mogą oni posiadać. Skrypt ten nieznacznie zmodyfikowałam, nie jestem jednak jego autorką. Autor jest mi nieznany.
ALWAYS_UPDATE = true # BIEŻĄCA AKTUALIZACJA KONDYCJI PRZECIWNIKA
SPACING_X = 80 # WOLNA PRZESTRZEŃ MIĘDZY BARAMI (POZIOM)
SPACING_Y = 40 # WOLNA PRZESTRZEŃ MIĘDZY BARAMI (PION)
COLUMNS = 4 # LICZBA KOLUMN Z HP PRZECIWNIKA
SHOW_STATES = true # POKAZUJE STATUSY PRZECIWNIKA
end
#======================================================================
# Start Game_System Edit
#======================================================================
class Game_System
attr_accessor :enemy_hp # Show enemy HP on battle
alias flower_system_initialize_enemy_hp initialize
#=============================================
# Initialize Values
#=============================================
def initialize
# Initialize enemy hp window to true
@enemy_hp = true
# Call previous methods
flower_system_initialize_enemy_hp
end
end # END Game system Edit
class Window_Base
#====================================
# Define Enemy Name
#====================================
def draw_enemy_name(enemy, x, y)
self.contents.font.color = normal_color
self.contents.draw_text (x, y, 120, 32, enemy.name)
end
#==========================
# Define Enemy State
#========================
def draw_enemy_state(enemy, x, y)
count = 0
for state in enemy.states
draw_icon(state.icon_index, x + 24 * count, y)
count += 1
break if (24 * count > width - 24)
end
end
#--------------------------------------------------------------------------
# * Draw Enemy HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_enemy_hp(enemy, x, y, width = 120)
draw_enemy_hp_gauge(enemy, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
last_font_size = self.contents.font.size
xr = x + width
if width < 120
self.contents.draw_text(xr - 44, y, 44, WLH, enemy.hp, 2)
else
self.contents.draw_text(xr - 99, y, 44, WLH, enemy.hp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
self.contents.draw_text(xr - 44, y, 44, WLH, enemy.maxhp, 2)
end
end
#--------------------------------------------------------------------------
# * Draw HP gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_enemy_hp_gauge(enemy, x, y, width = 120)
gw = width * enemy.hp / enemy.maxhp
gc1 = hp_gauge_color1
gc2 = hp_gauge_color2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
end #End of Window_Base Class
#=====================================#
# Window_EnemyHP #
# Class handles window for Enemy's HP #
#=====================================#
class Window_EnemyHP < Window_Selectable
def initialize
super ( 0, 0, 545, 300)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@column_max = OZZMA::COLUMNS
refresh
end
def refresh
self.contents.clear
for i in 0...$game_troop.members.size
enemy = $game_troop.members[i]
x = i % @column_max * (OZZMA::SPACING_X + @spacing)
if OZZMA::SHOW_STATES
y = (i / @column_max * (OZZMA::SPACING_Y + WLH) )
else
y = (i / @column_max * ((OZZMA::SPACING_Y - 34) + WLH) )
end
#========================================
# If Using Game_Switch
#=========================================
if OZZMA::SHOW_STATES
draw_enemy_state(enemy, x, y +44)
end
#==========================================
# If Using Script Switch
#==========================================
if $game_system.enemy_hp == true # Start check if Window Flag is On
draw_enemy_hp(enemy, x, y+20, 90)
draw_enemy_name(enemy, x, y)
if OZZMA::SHOW_STATES
draw_enemy_state(enemy, x, y +44)
end # END CHECK
end #End flag check
end
end #End Refresh
end #End of Window_EnemyHP Class
#====================================#
# Scene_Battle #
# New methods that were aliased: #
#====================================#
class Scene_Battle
alias flower_create_info_viewport create_info_viewport
alias flower_dispose_info_viewport dispose_info_viewport
alias flower_start_item_selection start_item_selection
alias flower_start_skill_selection start_skill_selection
alias flower_end_item_selection end_item_selection
alias flower_end_skill_selection end_skill_selection
alias flower_process_victory process_victory
alias flower_update_info_viewport update_info_viewport
alias flower_start_party_command_selection start_party_command_selection
alias flower_execute_action execute_action
alias flower_turn_end turn_end
# Create Information
def create_info_viewport
flower_create_info_viewport
@enemy_window = Window_EnemyHP.new
end
# Dispose Information
def dispose_info_viewport
flower_dispose_info_viewport
@enemy_window.dispose
end
#=============================================
# Always Update Window
#============================================
def update_info_viewport
if OZZMA::ALWAYS_UPDATE == true
@enemy_window.refresh
flower_update_info_viewport
else
flower_update_info_viewport
end
end
#=============================================
# Update Only When Turn starts and ends
#============================================
def start_party_command_selection
if OZZMA::ALWAYS_UPDATE == true
flower_start_party_command_selection
else
@enemy_window.visible = true
@enemy_window.refresh
flower_start_party_command_selection
end
end
def execute_action
if OZZMA::ALWAYS_UPDATE == true
flower_execute_action
else
@enemy_window.visible = false
flower_execute_action
end
end
def turn_end
if OZZMA::ALWAYS_UPDATE == true
flower_turn_end
else
@enemy_window.refresh
flower_turn_end
end
end
#============================================
# END OF UPDATE CHECK
#===========================================
#=====================================
# Remove Window During Selection
def start_item_selection
@enemy_window.visible = false
flower_start_item_selection
end
# Remove Window During Selection
def start_skill_selection
@enemy_window.visible = false
flower_start_skill_selection
end
# True Visibility after slection
def end_item_selection
flower_end_item_selection
@enemy_window.visible = true
end
# True Visibility after selection
def end_skill_selection
flower_end_skill_selection
@enemy_window.visible = true
end
# Refresh When Victorious
def process_victory
@enemy_window.refresh
flower_process_victory
end
#=====================================#
# End of Scene_Battle Method Edits #
#=====================================#
Pomógł: 16 razy Dołączył: 05 Lis 2009 Posty: 359 Skąd: spytaj innych
Wysłany: Nie 28 Lis, 2010 10:20
Tutaj nie dają MP, użyj tego:
Spoiler:
Kod:
#===============================================================
# ● [VX] ◦ Enemy Status Filter ◦ □
#--------------------------------------------------------------
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 16/11/2008
# ◦ Version: 1.0
#--------------------------------------------------------------
# ◦ How to use:
# - Put this script above Main.
# - Jak chcesz daj w notce wroga coś z tego:
# NO_NAME - żeby nie pokazywało nazwy wroga
# NO_STATE - aby nie pokazywało statusu wroga
# NO_HP - aby nie pisalo hp
# NO_MP - by nie pokazywalo mp
# NO_STATUS - zeby wogole nie mozna bylo sie nic dowiedziec o wrogu
#=================================================================
class Window_TargetEnemy < Window_Command
def initialize
@enemies = []
commands = []
$game_troop.members.each do |enemy|
next unless enemy.exist?
@enemies.push(enemy)
commands.push(enemy.name)
end
super(416, commands)
self.height = 128
end
def enemy
return @enemies[@index]
end
def draw_item(index)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
actor = @enemies[index]
unless actor.stat_note?('NO_STATUS')
draw_actor_name(actor, 4, rect.y) unless actor.stat_note?('NO_NAME')
draw_actor_state(actor, 114, rect.y, 48) unless actor.stat_note?('NO_STATE')
draw_actor_hp(actor, 174, rect.y, 120) unless actor.stat_note?('NO_HP')
draw_actor_mp(actor, 310, rect.y, 70) unless actor.stat_note?('NO_MP')
end
end
end
class Game_Enemy < Game_Battler
attr_reader :status_note
alias wora_enstat_gamene_ini initialize
def initialize(*args)
wora_enstat_gamene_ini(*args)
@status_note = enemy.note
end
def stat_note?(note)
return @status_note.include?(note)
end
end
:D
________________________ po co to kopiujesz? ;d
Spoiler:
Fakty:
1.Widzisz mój podpis
2.Jesteś w internecie
3.Czytasz
4.Siedzisz przy komputerze
5.Jesteś na UltimaForum
6.Twój nick to Gość
kiedys tu bylo fajniej... coz gospoda rma forever
chwala tym ktorzy nadal robia w 2k
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum