조회 수 619 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
출처 : http://www.hbgames.org/forums/viewtopic.php?f=11&t=75877

사용법은 다들 아시리라 생각됩니다.
아래 빨간색 부분을 스크립트에 붙여주시면 됩니다.


#==============================================================================
# ** Damage Popup
#------------------------------------------------------------------------------
# © Dargor, 2011
# 01/12/11
# Version 1.0
#------------------------------------------------------------------------------
# VERSION HISTORY:
# - 1.0 (01/12/11), Initial release
#------------------------------------------------------------------------------
# INSTRUCTIONS:
# - Paste this above main
# - Edit the constants in Damage_Popup module
#==============================================================================

#==============================================================================
# ** Damage Popup Customization Module
#==============================================================================

module Damage_Popup
HP_Damage_Color = Color.new(255,255,255)
MP_Damage_Color = Color.new(172,0,234)
TP_Damage_Color = Color.new(253,157,62)
HP_Recover_Color = Color.new(0,255,0)
MP_Recover_Color = Color.new(48,192,255)
TP_Recover_Color = Color.new(255,242,0)
end

#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display battlers. It observes a instance of the
# Game_Battler class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dargor_ace_dmgpopup_sprite_battler_initialize initialize
alias dargor_ace_dmgpopup_sprite_battler_setup_new_effect setup_new_effect
alias dargor_ace_dmgpopup_sprite_battler_start_effect start_effect
alias dargor_ace_dmgpopup_sprite_battler_update_effect update_effect
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
# The Usual
dargor_ace_dmgpopup_sprite_battler_initialize(viewport, battler)
# Create damage sprite
@damage_sprite = Sprite_Base.new(viewport)
@damage_sprite.bitmap = Bitmap.new(160,48)
@damage_sprite.bitmap.font.bold = true
@damage_sprite.bitmap.font.outline = true
@damage_sprite.bitmap.font.size = 32
@damage_sprite.visible = false
@damage_duration = 0
@damage_effect = nil
end
#--------------------------------------------------------------------------
# * Setup New Effect
#--------------------------------------------------------------------------
def setup_new_effect
# The Usual
dargor_ace_dmgpopup_sprite_battler_setup_new_effect
# Check for HP Damage
if display_damage_sprite? && @battler.result.hp_damage > 0
start_damage(:hp_damage)
# Check for MP Damage
elsif display_damage_sprite? && @battler.result.mp_damage > 0
start_damage(:mp_damage)
# Check for TP Damage
elsif display_damage_sprite? && @battler.result.tp_damage > 0
start_damage(:tp_damage)
# Check for HP Recover
elsif display_damage_sprite? && @battler.result.hp_damage < 0
start_damage(:hp_recover)
# Check for MP Recover
elsif display_damage_sprite? && @battler.result.mp_damage < 0
start_damage(:mp_recover)
# Check for TP Recover
elsif display_damage_sprite? && @battler.result.tp_damage < 0
start_damage(:tp_recover)
end
end
#--------------------------------------------------------------------------
# * Damage Display Test
#--------------------------------------------------------------------------
def display_damage_sprite?
return (@battler.result.success && @damage_duration == 0)
end
#--------------------------------------------------------------------------
# * Start Damage Effect
#--------------------------------------------------------------------------
def start_damage(effect_type)
@damage_effect = effect_type
@damage_duration = 60
case @damage_effect
when :hp_damage
@damage_sprite.bitmap.font.color = Damage_Popup::HP_Damage_Color
when :mp_damage
@damage_sprite.bitmap.font.color = Damage_Popup::MP_Damage_Color
when :tp_damage
@damage_sprite.bitmap.font.color = Damage_Popup::TP_Damage_Color
when :hp_recover
@damage_sprite.bitmap.font.color = Damage_Popup::HP_Recover_Color
when :mp_recover
@damage_sprite.bitmap.font.color = Damage_Popup::MP_Recover_Color
when :tp_recover
@damage_sprite.bitmap.font.color = Damage_Popup::TP_Recover_Color
end
update_damage_popup_position
update_damage_popup_text
@damage_sprite.visible = true
@damage_sprite.opacity = 255
end
#--------------------------------------------------------------------------
# * Update Effects
#--------------------------------------------------------------------------
def update_effect
# Update effects
if @damage_duration > 0
@damage_duration -= 1
update_damage
if @damage_duration == 0
@damage_sprite.visible = false
@damage_type = nil
@battler.result.clear_hit_flags
end
end
# The Usual
dargor_ace_dmgpopup_sprite_battler_update_effect
end
#--------------------------------------------------------------------------
# * Update Damage Sprite Potision
#--------------------------------------------------------------------------
def update_damage_popup_position
if @battler && @battler.use_sprite?
@damage_sprite.x = @battler.screen_x
@damage_sprite.y = @battler.screen_y - 48
@damage_sprite.z = @battler.screen_z + 10
end
end
#--------------------------------------------------------------------------
# * Update Damage Sprite Text
#--------------------------------------------------------------------------
def update_damage_popup_text
case @damage_effect
when :hp_damage, :hp_recover
string = @battler.result.hp_damage.abs.to_s
when :mp_damage, :mp_recover
string = @battler.result.mp_damage.abs.to_s
when :tp_damage, :tp_recover
string = @battler.result.tp_damage.abs.to_s
end
rect = @damage_sprite.bitmap.text_size(string)
@damage_sprite.bitmap.clear
@damage_sprite.bitmap.draw_text(rect, string, 1)
end
#--------------------------------------------------------------------------
# * Update Damage
#--------------------------------------------------------------------------
def update_damage
case @damage_duration
when 58..59
@damage_sprite.y -= 4
when 56..57
@damage_sprite.y -= 2
when 54..55
@damage_sprite.y += 2
when 48..53
@damage_sprite.y += 4
end
if @damage_duration <= 20
@damage_sprite.opacity = @damage_duration * 11
end
end
end
?

  1. 구간 루프 음악 스크립트

    Date2015.08.24 Category유니티 스크립트 By맛난호빵 Views235 Votes0
    Read More
  2. [C#] 보안 64비트 정수

    Date2016.01.04 Category유니티 스크립트 By맛난호빵 Views388 Votes0
    Read More
  3. Custom Icon Sheets (커스텀 아이콘 적용 스크립트)

    Date2016.01.10 CategoryRPGVX Ace 스크립트 Byplam Views476 Votes0
    Read More
  4. [JS] 세이브 갯수를 20개에서 변경하기.

    Date2015.10.26 CategoryRPGMV 플러그인 By천무 Views511 Votes0
    Read More
  5. Ace로 만든 습작 랜덤 위치로 지형변환.

    Date2014.10.04 CategoryRPGVX Ace 스크립트 ByJunkMan Views518 Votes0
    Read More
  6. 배틀미스트(전투중포그효과) 플러그인

    Date2015.10.26 CategoryRPGMV 플러그인 By파란별빛 Views547 Votes0
    Read More
  7. RPG MV 와 AJAX를 이용한 웹 통신 플러그인

    Date2015.10.26 CategoryRPGMV 플러그인 By파란별빛 Views548 Votes0
    Read More
  8. Universal Message System 1.8.0 by ccoa

    Date2013.10.01 CategoryRPGXP 스크립트 By Views581 Votes0
    Read More
  9. Switchless Common Events

    Date2013.10.01 CategoryRPGXP 스크립트 By Views588 Votes0
    Read More
  10. Initial Switches and Variables

    Date2013.10.01 CategoryRPGXP 스크립트 By Views602 Votes0
    Read More
  11. 현실 시간 변수 대입 플러그인

    Date2015.10.26 CategoryRPGMV 플러그인 By최빛빛 Views606 Votes1
    Read More
  12. 메뉴에서 실제시간 보는 스크립트

    Date2013.09.24 CategoryRPGXP 스크립트 By청담 Views607 Votes0
    Read More
  13. Random Dungeon Generator - Random Cave

    Date2014.10.08 CategoryRPGVX Ace 스크립트 ByJunkMan Views610 Votes0
    Read More
  14. Damage Popup by Dargor (데미지 수치 팝업하는 스크립트)

    Date2016.01.10 CategoryRPGVX Ace 스크립트 Byplam Views619 Votes0
    Read More
  15. 한글조합입력기(영어가능)

    Date2019.11.10 CategoryRPGXP 스크립트 By조규진1 Views640 Votes0
    Read More
  16. 파일 존재의 유무 체크

    Date2013.09.30 CategoryRPGVX Ace 스크립트 By휴리드 Views642 Votes0
    Read More
  17. 셀프 스위치 조작

    Date2013.09.29 CategoryRPGXP 스크립트 By청담 Views656 Votes0
    Read More
  18. 텍스트 파일생성

    Date2013.09.30 CategoryRPGVX Ace 스크립트 By휴리드 Views656 Votes0
    Read More
  19. 레벨업시 전회복 스크립트

    Date2013.09.24 CategoryRPGXP 스크립트 By청담 Views695 Votes0
    Read More
  20. 프리로드 매니저 (소재를 미리 불러서 게임진행을 빠르게)

    Date2015.10.26 CategoryRPGMV 플러그인 By파란별빛 Views698 Votes0
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)