irpg Community
[สคริปต์] Enemy HP/SP (โชว์พลังศัตรู) [ใช้กับ minkoff/Atoa ได้] - Printable Version

+- irpg Community (https://irpg.in.th)
+-- Forum: irpg Fabella RPG Maker Academia (https://irpg.in.th/forum-4.html)
+--- Forum: RGSS and JS Showcase (https://irpg.in.th/forum-26.html)
+--- Thread: [สคริปต์] Enemy HP/SP (โชว์พลังศัตรู) [ใช้กับ minkoff/Atoa ได้] (/thread-655.html)



[สคริปต์] Enemy HP/SP (โชว์พลังศัตรู) [ใช้กับ minkoff/Atoa ได้] - Galaxy - 10-16-2012

[Image: gafss.png]

สคริปนี้ดีตรงถ้าเราใช้หลอดพลังแบบไหนไว้ ศัตรูก็จะใช้หลอดพลังแบบเดียวกันด้วย

สคริป

Code:
# Energia do Inimigo
# by Tetra-Z
# O script permite que quando o cursor entiver sobre o alvo
# inimigo monstre o HP e SP.
#==============================================================================
# ? Game_Temp
#==============================================================================
class Game_Temp
attr_accessor :action_input_actor
end
#==============================================================================
# ? Window_Help
#==============================================================================
class Window_Help < Window_Base
def see_through_element_all
return 0
end
def see_through_element_self
return 0
end
def enemy_status_searched(enemy)
return true if $data_enemies[enemy.id].element_ranks[see_through_element_self] < 3
return true if $data_enemies[enemy.id].element_ranks[see_through_element_all] < 3
unless (see_through_element_self <= 0 or
$data_enemies[enemy.id].element_ranks[see_through_element_self] > 3)
actor = $game_temp.action_input_actor
if ($data_classes[actor.class_id].element_ranks[see_through_element_self] < 3 or
actor.equip_element_set.include?(see_through_element_self))
return true
end
end
unless (see_through_element_all <= 0 or
$data_enemies[enemy.id].element_ranks[see_through_element_all] > 3)
for actor in $game_party.actors
if (($data_classes[actor.class_id].element_ranks[see_through_element_all] < 3 or
actor.equip_element_set.include?(see_through_element_all)) and
actor.movable?)
return true
end
end
end
return false
end
def draw_actor_name(actor, x, y)
if actor.is_a?(Game_Actor)
return super
end
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 192, 32, actor.name)
end
alias tetraz28_set_enemy set_enemy
def set_enemy(enemy)
if enemy_status_searched(enemy) and !Input.press?(Input::A)
if (enemy != @actor or @enemy.nil? or
[enemy.states, enemy.hp, enemy.maxhp, enemy.sp, enemy.maxsp] != @enemy)
self.contents.clear
draw_actor_name(enemy, 4, 0)
draw_actor_state(enemy, 196, 0)
draw_actor_hp(enemy, 300, 0)
draw_actor_sp(enemy, 460, 0)
@actor = enemy
@enemy = [enemy.states, enemy.hp, enemy.maxhp, enemy.sp, enemy.maxsp]
@text = nil
end
self.visible = true
else
tetraz28_set_enemy(enemy)
end
end
end
#==============================================================================
# ? Scene_Battle
#==============================================================================
class Scene_Battle
alias tetraz28_update_phase3_enemy_select update_phase3_enemy_select
def update_phase3_enemy_select
$game_temp.action_input_actor = @active_battler
tetraz28_update_phase3_enemy_select
end
end

เครดิต : Tetra-Z