hengmana   07-11-2012, 06:54 PM
#1
ZeroKB_Battle_Help3
สคริปต์เขียนโดย : 0KB หรือ AYA (2011/7/30)
ลิงค์ต้นฉบับ : http://w0kb.web.fc2.com/frame.html

[Image: untitled-s6.jpg]
รายละเอียด :
Battle_Help แบบใหม่ตอน (ใช้สกิล) (ป้องกัน) (ใช้ไอเทม)

วิธีการใช้งาน :
สร้าง script ใหม่ เหนือ main ใส่ชื่ออะไรก็ได้ แล้ว copy script ข้างล่างไปแปะให้หมด แล้ว
*เซฟรูปด้านล่าง ตั้งชื่อเป็น Battle_Help_Back แล้วใส่ในไฟล์ Windowskins
[Image: battle_help_back.png]

ข้อตกลงการนำไปใช้งาน :
???????????????????????????????(?????)?
???????????????????????????????????(?????)
??????????????????????????????????????????????????????
google แปลคร่าวๆ จับใจความได้ว่า ถ้าจะใช้ไม่จำเป็นต้องรายงาน ใช้ฟรีและดัดแปลงได้ ฉันจะดีใจที่คุณได้ใช้มันในเกม


โค๊ดสคริปต์
ต้นฉบับ อยู่ที่ DL? http://w0kb.web.fc2.com/RGSS/material_RGSSHelp.html

หรือ อันนี้ดัดแปลง ขีดบรรทัดให้สั้นลง ตามรูปข้างบน
Code:
#------------------------------------------------------------------------------
# ????????????????? Ver0.5
#------------------------------------------------------------------------------
=begin

??0KB http://0kb.kenkenpa.net/ ?By.AYA

?????????????????????????
????????????????????????(;??`)
????????????? ????????????????????

??????
??Windowskin???????Battle_Help_Back??????????
??(????????????????????????)


??2011/7/30??????

=end
#------------------------------------------------------------------------------

module ZeroKB_Battle_Help3
#--------------------------------------------------------------------------
# ??????
#--------------------------------------------------------------------------

#?????????????????
SHBack = "Battle_Help_Back"

#????????????(????)
SHSkillName = Color.new(250,255,255,255)
#??????????????(???????)
SHBorder = Color.new(191,155,001,255)
#???????????????????(????)
SHInfo = Color.new(50,155,255,255)

#???????
SHFont = "EucrosiaUPC"

#--------------------------------------------------------------------------
# ????????
#--------------------------------------------------------------------------
end

class Scene_Battle
#--------------------------------------------------------------------------
# ?????
#--------------------------------------------------------------------------
def main
# ???????????????
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# ??????????????????
$game_system.battle_interpreter.setup(nil, 0)
# ???????
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# ????????????????
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
# ????????????
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window3 = Window_Help3.new
#@help_window.back_opacity = 160
@help_window.visible = false
@help_window3.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# ???????????
@spriteset = Spriteset_Battle.new
# ????????????
@wait_count = 0
# ?????????
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# ???????????
start_phase1
# ??????
loop do
# ????????
Graphics.update
# ???????
Input.update
# ??????
update
# ????????????????
if $scene != self
break
end
end
# ??????????
$game_map.refresh
# ?????????
Graphics.freeze
# ????????
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@help_window3.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# ???????????
@spriteset.dispose
# ???????????????
if $scene.is_a?(Scene_Title)
# ??????????
Graphics.transition
Graphics.freeze
end
# ???????????????????????????
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end


#--------------------------------------------------------------------------
# ??????? ????
#--------------------------------------------------------------------------
def make_basic_action_result
# ?????
if @active_battler.current_action.basic == 0
# ??????? ID ???
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
# ???????????????
if @active_battler.is_a?(Game_Enemy)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
end
# ???????????????
if @active_battler.is_a?(Game_Actor)
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
end
# ?????????????
@target_battlers = [target]
# ??????????
for target in @target_battlers
target.attack_effect(@active_battler)
end
return
end
# ?????
if @active_battler.current_action.basic == 1
# ????????? "??" ???
$name_help = "GARD"
@help_window3.set_text($data_system.words.guard, 1)
return
end
# ??????
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
# ????????? "???" ???
$name_help = "ESCAPE"
@help_window3.set_text("ESCAPE", 1)
# ???
@active_battler.escape
return
end
# ????????
if @active_battler.current_action.basic == 3
# ??????????????????
$game_temp.forcing_battler = nil
# ???? 1 ???
@phase4_step = 1
return
end
end

#--------------------------------------------------------------------------
# ???????? ????
#--------------------------------------------------------------------------
def make_skill_action_result
# ??????
@skill = $data_skills[@active_battler.current_action.skill_id]
# ????????????
unless @active_battler.current_action.forcing
# SP ????????????????
unless @active_battler.skill_can_use?(@skill.id)
# ??????????????????
$game_temp.forcing_battler = nil
# ???? 1 ???
@phase4_step = 1
return
end
end
# SP ??
@active_battler.sp -= @skill.sp_cost
# ?????????????????
@status_window.refresh
# ????????????????################
$name_help = "SKILL  ATTACK"
@help_window3.set_text(@skill.name, 1)
# ??????? ID ???
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# ??????? ID ???
@common_event_id = @skill.common_event_id
# ??????????
set_target_battlers(@skill.scope)
# ?????????
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
#--------------------------------------------------------------------------
# ????????? ????
#--------------------------------------------------------------------------
def make_item_action_result
# ???????
@item = $data_items[@active_battler.current_action.item_id]
# ????????????????????
unless $game_party.item_can_use?(@item.id)
# ???? 1 ???
@phase4_step = 1
return
end
# ??????
if @item.consumable
# ????????? 1 ???
$game_party.lose_item(@item.id, 1)
end
# ?????????????????
$name_help = "USING  ITEM"
@help_window3.set_text(@item.name, 1)


# ??????? ID ???
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
# ??????? ID ???
@common_event_id = @item.common_event_id
# ?????
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
# ??????????
set_target_battlers(@item.scope)
# ??????????
for target in @target_battlers
target.item_effect(@item)
end
end

#--------------------------------------------------------------------------
# ?????? (??????? ???? 5 : ??????)
#--------------------------------------------------------------------------
def update_phase4_step5
# ???????????
@help_window.visible = false
@help_window3.visible = false
# ?????????????????
@status_window.refresh
# ??????
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
end
end
# ???? 6 ???
@phase4_step = 6
end
end
#--------------------------------------------------------------------------
# ??????
#--------------------------------------------------------------------------
class Bitmap
def draw_hemming_text(x, y, w, h, text, align = 0, black_color = Color.new(0,0,0,255))
original_color = self.font.color.dup
self.font.color = black_color
self.draw_text(x , y , w, h, text, align)
self.draw_text(x , y+2, w, h, text, align)
self.draw_text(x+2, y+2, w, h, text, align)
self.draw_text(x+2, y , w, h, text, align)
self.font.color = original_color
self.draw_text(x+1, y+1, w, h, text, align)
end
end
#-------------------------------------------------------------------------------
# ??????
#--------------------------------------------------------------------------

class Window_Help3 < Window_Base
def initialize
super(0, 0, 640, 100)
self.windowskin = RPG::Cache.windowskin(ZeroKB_Battle_Help3::SHBack)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = ZeroKB_Battle_Help3::SHFont
self.contents.font.size = 32
self.contents.font.bold = true
self.opacity = 255
self.z = 2000
$name_help = ""
end
def set_text(text, align = 0)
if text != @text
self.contents.clear
self.contents.font.size = 32
self.contents.font.color = Color.new(0,0,0,10)
self.contents.draw_text(2-15, -2, self.width, 32, text, 1)
self.contents.font.size = 36
self.contents.font.color = ZeroKB_Battle_Help3::SHSkillName
self.contents.draw_hemming_text(-15, 5, self.width, 32, text, 1)
      self.contents.font.size = 15  #21
      self.contents.font.name = "Tahoma"
self.contents.font.color = ZeroKB_Battle_Help3::SHBorder
self.contents.draw_text(-15, 15, self.width, 32, "___________________________________________",1)
self.contents.font.color = Color.new(0,0,0,200)
self.contents.draw_text(2-15, 17, self.width, 32, "___________________________________________",1)
      self.contents.font.size = 28
      self.contents.font.name = ZeroKB_Battle_Help3::SHFont
self.contents.font.color = Color.new(0,0,0,10)
self.contents.draw_text(1-15, 33, self.width, 32, $name_help,1)
self.contents.font.color = ZeroKB_Battle_Help3::SHInfo
self.contents.draw_hemming_text(-15, 32, self.width, 32, $name_help,1)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
end
This post was last modified: 07-11-2012, 07:25 PM by hengmana.
  
Users browsing this thread: 4 Guest(s)
Powered By MyBB, © 2002-2024 MyBB Group.
Made with by Curves UI.