赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 6059 |
最后登录 | 2017-5-29 |
在线时间 | 274 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 274 小时
- 注册时间
- 2008-2-18
- 帖子
- 219
|
地图名:- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- #==============================================================================
- # ■ 地图名显示脚本
- # by Yuee
- #------------------------------------------------------------------------------
- # 在Main的上方插入一个页,将本脚本复制到那页中即可
- #==============================================================================
- #==============================================================================
- # ■ Window_MapName
- #------------------------------------------------------------------------------
- # 显示地图名字的窗口。
- #==============================================================================
- class Window_MapName < Window_Base
- #--------------------------------------------------------------------------
- # ● 类常量定义
- #--------------------------------------------------------------------------
- # 暂时屏蔽用的开关
- SWITCH = 35
-
- # 窗口位置设定
- NAME_X = 380 # 矩形左上顶点X坐标
- NAME_Y = 40 # 矩形左上顶点Y坐标
- NAME_W = 220 # 矩形宽
- NAME_H = 60 # 矩形高
-
- # 显示时间设置
- SHOW_TIME_0 = 10 # 地图名出现前等待的帧数
- SHOW_TIME_1 = 10 # 地图名从不可见变成可见的帧数
- SHOW_TIME_2 = 34 # 地图名完全可见的帧数
- SHOW_TIME_3 = 16 # 地图名从可见变成不可见的帧数
-
- # 完全可见时的透明度设置
- OPACITY_1 = 244 # 边框
- OPACITY_2 = 144 # 背景
- OPACITY_3 = 255 # 文字
-
- # 地图名字的颜色
- TEXT_COLOR = Color.new(255, 255, 255, 255)
-
- #--------------------------------------------------------------------------
- # ● 初始化状态
- #--------------------------------------------------------------------------
- def initialize
- super(NAME_X , NAME_Y, NAME_W, NAME_H)
- # 初始化窗口透明度
- self.opacity = 0
- self.back_opacity = 0
- self.contents_opacity = 0
- self.contents = Bitmap.new(width - 32, height - 32)
- # 剩余帧数初始化
- @show_time = 0
- end
- #--------------------------------------------------------------------------
- # ● 输出文字
- #--------------------------------------------------------------------------
- def setname
- unless $game_switches[SWITCH]==true
- # 获取地图ID
- newid = $game_map.map_id
- time = SHOW_TIME_1 + SHOW_TIME_2 + SHOW_TIME_3
- # 如果现在的地图的ID不是刚才显示的地图ID则开始显示
- if newid != @id
- @id = newid
- @show_time = SHOW_TIME_0 + SHOW_TIME_1 + SHOW_TIME_2 + SHOW_TIME_3
- # 剩余帧数为0是时,全部窗口透明
- elsif @show_time < 1
- self.opacity = 0
- self.back_opacity = 0
- self.contents_opacity = 0
- return
- end
- self.contents.clear
- self.contents.font.color = TEXT_COLOR
- # 描绘地图名
- self.contents.draw_text(4, 0 , width - 40, 32, $data_mapinfos[@id].name, 1)
- # 根本帧数设定窗口透明度
- if @show_time > (SHOW_TIME_2 + SHOW_TIME_3)
- self.opacity = @show_time < time ? (((OPACITY_1 / SHOW_TIME_1) * (time - @show_time)).to_i) : 0
- self.back_opacity = @show_time < time ? (((OPACITY_2 / SHOW_TIME_1 )* (time - @show_time)).to_i) : 0
- self.contents_opacity = @show_time < time ? (((OPACITY_3 / SHOW_TIME_1) * (time - @show_time)).to_i) : 0
- else
- self.opacity = @show_time < (SHOW_TIME_3 / 16 * 14) ? ((OPACITY_1 / SHOW_TIME_3) * @show_time).to_i : OPACITY_1
- self.back_opacity = @show_time < (SHOW_TIME_3 / 16 * 9) ? ((OPACITY_2 / SHOW_TIME_3) * @show_time).to_i : OPACITY_2
- self.contents_opacity = @show_time < SHOW_TIME_3 ? ((OPACITY_3 / SHOW_TIME_3)* @show_time).to_i : OPACITY_3
- end
- @show_time -= 1
- end
- end
- end
- #==============================================================================
- # ■ Scene_Map
- #------------------------------------------------------------------------------
- # 处理地图画面的类。(追加定义)
- #==============================================================================
- class Scene_Map
- alias smn_main main
- def main
- @mapname = Window_MapName.new
- smn_main
- @mapname.dispose
- end
-
- alias smn_update update
- def update
- @mapname.setname
- smn_update
- end
- end
- #==============================================================================
- # ■ Scene_Title
- #------------------------------------------------------------------------------
- # 处理标题画面的类。(追加定义)
- #==============================================================================
- class Scene_Title
- alias smn_main main
- def main
- # 读取地图信息文件
- $data_mapinfos = load_data("Data/MapInfos.rxdata")
- smn_main
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
-
复制代码
升及提示 http://rpg.blue/web/htm/news143.htm
"新游戏"在Scene_Title脚本中的 第37行 改改就行
然后显示敌人生命 魔法
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- #==============================================================================
- # ■ Window_Help
- #------------------------------------------------------------------------------
- # 重新定义的内容,可以显示敌人的HP\MP百分比
- # 你可以改脚本的开头部分定义生命、精神描述词。只和敌人描述有关,可随意修改
- #==============================================================================
- class Window_Help < Window_Base
- def set_enemy(actor)
- #--------------------------------------------------------------------
- # 在这里修改描述文字,比如@生命描述词="敌人生命"
- #--------------------------------------------------------------------
-
- @生命描述词 = $data_system.words.hp
- @精神描述词 = $data_system.words.sp
-
- #--------------------------------------------------------------------
- #--------------------------------------------------------------------
- self.contents.clear
- draw_actor_name(actor, 4, 0)
- draw_actor_state(actor, 140, 0)
- carol3_draw_hp_bar(actor, 284, 12)
- carol3_draw_sp_bar(actor, 460, 12)
- @text = nil
- self.visible = true
- end
- def carol3_draw_hp_bar(actor, x, y, width = 128, height = 14) #宽度可调
- w = width * actor.hp / [actor.maxhp,1].max
- hp_color_1 = Color.new(255, 0, 0, 192)
- hp_color_2 = Color.new(255, 255, 0, 192)
- self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
- x -= 1
- y += (height/4).floor
- self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
- self.contents.font.color = Color.new(0,0,0,255)
- self.contents.draw_text(x+2,-3,128,32,@生命描述词,1)
- self.contents.font.color = Color.new(255,255,255,255)
- self.contents.draw_text(x,-4,128,32,@生命描述词,1)
- end
- def carol3_draw_sp_bar(actor, x, y, width = 128, height=14)
- w = width * actor.sp / [actor.maxsp,1].max
- hp_color_1 = Color.new( 0, 0, 255, 192)
- hp_color_2 = Color.new( 0, 255, 255, 192)
- self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
- x -= 1
- y += (height/4).floor
- self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
- self.contents.font.color = Color.new(0,0,0,255)
- self.contents.draw_text(x+2,-3,128,32,@精神描述词,1)
- self.contents.font.color = Color.new(255,255,255,255)
- self.contents.draw_text(x,-4,128,32,@精神描述词,1)
- end
- #--------------------------------------------------------------------------
- # ● ライン描画 by 桜雅 在土
- #--------------------------------------------------------------------------
- def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
- # 描写距離の計算。大きめに直角時の長さ。
- distance = (start_x - end_x).abs + (start_y - end_y).abs
- # 描写開始
- if end_color == start_color
- for i in 1..distance
- x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
- y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
- if width == 1
- self.contents.set_pixel(x, y, start_color)
- else
- self.contents.fill_rect(x, y, width, width, start_color)
- end
- end
- else
- for i in 1..distance
- x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
- y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
- r = start_color.red * (distance-i)/distance + end_color.red * i/distance
- g = start_color.green * (distance-i)/distance + end_color.green * i/distance
- b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
- a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
- if width == 1
- self.contents.set_pixel(x, y, Color.new(r, g, b, a))
- else
- self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
- end
- end
- end
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 |
|