赞 | 77 |
VIP | 0 |
好人卡 | 0 |
积分 | 146 |
经验 | 0 |
最后登录 | 2024-11-22 |
在线时间 | 2152 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 14624
- 在线时间
- 2152 小时
- 注册时间
- 2016-9-20
- 帖子
- 861
|
本帖最后由 ppspssss 于 2020-2-1 19:00 编辑
# 地图通行度显示 by @fux2 ,http://rpg.blue/?65553
# XP,VX通用,游戏中按F5开启通行显示,可以自由修改 $showpass = false $fuxver = self module Fux2 BUTTON = "F5" # 快捷键,在游戏中按下开启本脚本功能 VER = $fuxver ? "VX" : "XP" OPACITY = 150 # 显示通行度图层的透明度(0-255) # 下面请勿随意修改 BLOCK = {"XP"=>{2=>["↓",8,8],4=>["←",0,0],6=>["→",16,0],8=>["↑",8,-8]}, "VX"=>{2=>["",0,0],4=>["",0,0],6=>["",0,0],0x08=>["",0,0]}} SET = {"VX"=>[8,Color.new(255,0,0,OPACITY),[1]],"XP"=>[4,Color.new(100,0,100,OPACITY),[2,4,6,8]]} end class Spriteset_Map include Fux2 alias:ini:initialize def initialize @passble = Sprite.new @passble.z = 99999999 @passble.x = -$game_map.display_x/4 @passble.y = -$game_map.display_y/4 @passble.bitmap = Bitmap.new($game_map.width*32,$game_map.height*32) @passble.bitmap.font.size = 16 @passble.bitmap.font.color = Color.new(255,255,255,200) for px in 0...$game_map.width for py in 0...$game_map.height temp = [] SET[VER][2].each do |i| temp << i if $game_map.passable?(px,py,i) end if temp == SET[VER][2] @passble.bitmap.fill_rect(px*32,py*32,32,32,Color.new(0,0,255,OPACITY)) elsif temp == [] @passble.bitmap.fill_rect(px*32,py*32,32,32,Color.new(255,0,0,OPACITY)) else @passble.bitmap.fill_rect(px*32,py*32,32,32,SET[VER][1]) temp.each do |j| @passble.bitmap.draw_text(px*32+BLOCK[VER][j][1],py*32+BLOCK[VER][j][2],32,32,BLOCK[VER][j][0]) end end end end ini end alias:ud:update def update ud @passble.visible = $showpass @passble.x = -$game_map.display_x/SET[VER][0] @passble.y = -$game_map.display_y/SET[VER][0] @passble.update end alias:dis:dispose def dispose dis @passble.dispose end end class Scene_Map alias:ud:update def update ud eval("$showpass = !$showpass if Input.trigger?(Input::#{Fux2::BUTTON})") end end # rpg.blue
# XP,VX通用,游戏中按F5开启通行显示,可以自由修改
$showpass = false
$fuxver = self
module Fux2
BUTTON = "F5" # 快捷键,在游戏中按下开启本脚本功能
VER = $fuxver ? "VX" : "XP"
OPACITY = 150 # 显示通行度图层的透明度(0-255)
# 下面请勿随意修改
BLOCK = {"XP"=>{2=>["↓",8,8],4=>["←",0,0],6=>["→",16,0],8=>["↑",8,-8]},
"VX"=>{2=>["",0,0],4=>["",0,0],6=>["",0,0],0x08=>["",0,0]}}
SET = {"VX"=>[8,Color.new(255,0,0,OPACITY),[1]],"XP"=>[4,Color.new(100,0,100,OPACITY),[2,4,6,8]]}
end
class Spriteset_Map
include Fux2
alias:ini:initialize
def initialize
@passble = Sprite.new
@passble.z = 99999999
@passble.x = -$game_map.display_x/4
@passble.y = -$game_map.display_y/4
@passble.bitmap = Bitmap.new($game_map.width*32,$game_map.height*32)
@passble.bitmap.font.size = 16
@passble.bitmap.font.color = Color.new(255,255,255,200)
for px in 0...$game_map.width
for py in 0...$game_map.height
temp = []
SET[VER][2].each do |i|
temp << i if $game_map.passable?(px,py,i)
end
if temp == SET[VER][2]
@passble.bitmap.fill_rect(px*32,py*32,32,32,Color.new(0,0,255,OPACITY))
elsif temp == []
@passble.bitmap.fill_rect(px*32,py*32,32,32,Color.new(255,0,0,OPACITY))
else
@passble.bitmap.fill_rect(px*32,py*32,32,32,SET[VER][1])
temp.each do |j|
@passble.bitmap.draw_text(px*32+BLOCK[VER][j][1],py*32+BLOCK[VER][j][2],32,32,BLOCK[VER][j][0])
end
end
end
end
ini
end
alias:ud:update
def update
ud
@passble.visible = $showpass
@passble.x = -$game_map.display_x/SET[VER][0]
@passble.y = -$game_map.display_y/SET[VER][0]
@passble.update
end
alias:dis:dispose
def dispose
dis
@passble.dispose
end
end
class Scene_Map
alias:ud:update
def update
ud
eval("$showpass = !$showpass if Input.trigger?(Input::#{Fux2::BUTTON})")
end
end
# rpg.blue
|
|