XP 스크립트

#--------------------------------------------------------------------------
#HP bars for all ABS enemies
#By Takanuva Hagah
#--------------------------------------------------------------------------
class Window_Enemy < Window_Base
def initialize
super(-16, -16, 672, 640)
self.contents = Bitmap.new(width-32, height-32)
self.opacity = 0
self.contents.font.size = 14
@old_enemy = $ABS.enemies.size
for i in 0...$ABS.enemies.size
event_z = $ABS.enemies.values[i].event_id
@old_x = $game_map.events[event_z].real_x
@old_y = $game_map.events[event_z].real_y
@old_hp = $ABS.enemies.values[i].hp
end
@player_x = $game_player.real_x
@player_y = $game_player.real_y
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(6, 28, 32, 14, "")
self.contents.font.color = normal_color
for i in 0...$ABS.enemies.size
event_z = $ABS.enemies.values[i].event_id
x = ($game_map.events[event_z].real_x - $game_map.display_x) / 4
y = ($game_map.events[event_z].real_y - $game_map.display_y) / 4
data_id = $ABS.enemies.values[i].id
e2 = $data_enemies[data_id].maxhp
e1 = $ABS.enemies.values[i].hp
self.contents.draw_text(x-10, y-50, 73, 14, $ABS.enemies.values[i].name)
draw_enemy_bar("", x, y+40, 30, 5, Color.new(255, 255, 0), Color.new(204, 204, 0), e1, e2)
end
end
def update
super
if @old_enemy != $ABS.enemies.size
refresh
@old_enemy = $ABS.enemies.size
end
if @player_x != $game_player.real_x or
@player_y != $game_player.real_y
refresh
@player_x = $game_player.real_x
@player_y = $game_player.real_y
end
for i in 0...$ABS.enemies.size
event_z = $ABS.enemies.values[i].event_id
if @old_x != $game_map.events[event_z].real_x or
@old_y != $game_map.events[event_z].real_y or
@old_hp[i] != $ABS.enemies.values[i].hp
refresh
event_z = $ABS.enemies.values[i].event_id
@old_x = $game_map.events[event_z].real_x
@old_y = $game_map.events[event_z].real_y
@old_hp = $ABS.enemies.values[i].hp
end
end
end
def draw_enemy_bar(actor, x, y, length, thick, c1, c2, e1, e2)
width = length
height = thick
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
end
class Scene_Map
alias enemy_scene_map_main main
alias enemy_scene_map_update update
def main
@enemy = Window_Enemy.new
enemy_scene_map_main
@enemy.dispose
end
def update
@enemy.update
enemy_scene_map_update
end
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '11'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
721 이동 및 탈것 그래픽 변경 데쉬 3 file 백호 2009.02.22 2499
720 Fog of War 4 file 실마릴 2008.06.19 2498
719 전투 전투 결과 화면 개조 스크립트 10 file 백호 2009.02.21 2494
» 기타 ABS 몬스터 HP 게이지 바 11 백호 2009.02.22 2483
717 기타 맵 이동시 로딩 그림 표시 14 file 백호 2009.02.21 2479
716 장비 장비창업그레이드 ps인간 2009.01.23 2478
715 HUD MOG_Active_Hud 3 file Bera 2010.09.11 2468
714 기타 [신기술 체험] 마우스 사용 심플액션 7 file 백호 2009.02.22 2467
713 전투 배틀 스테이터스·클리어 디자인 13 file 백호 2009.02.21 2467
712 HUD 머리위에 직업명을 표시해줍니다... 9 file 제로스S2 2009.08.03 2465
711 기타 대화 글씨가 한글자씩 나오는 스크립트 2 백호 2009.02.22 2464
710 전투 GubiD's Tactical Battle System 1.5.1.4 (RMXP용) GTBS 2 Alkaid 2010.09.03 2456
709 전투 전투 카메라 스크립트 5 file 백호 2009.02.21 2454
708 스킬 스킬북 스크립트 8 WMN 2008.03.17 2452
707 메뉴 1인용 메뉴 스크립트 6 WMN 2008.03.17 2450
706 기타 업데이트 (죽었을경우부활 )스크립트한글화 2 by향온 2011.09.27 2438
705 [알피지2님 제공] 발소리 스크립트 9 file 아방스 2007.11.09 2438
704 상태/속성 Cool Edited Status Screen. 10 아방스 2009.01.12 2430
703 기타 [신기술 체험] 페스트 채팅 17 file 백호 2009.02.22 2412
702 이동 및 탈것 8방향 스크립트 12 file 백호 2009.02.21 2412
Board Pagination Prev 1 ... 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ... 52 Next
/ 52