赞 | 7 |
VIP | 866 |
好人卡 | 185 |
积分 | 32 |
经验 | 130059 |
最后登录 | 2024-11-27 |
在线时间 | 3618 小时 |
Lv3.寻梦者 双子人
- 梦石
- 0
- 星屑
- 3190
- 在线时间
- 3618 小时
- 注册时间
- 2009-4-4
- 帖子
- 4154
|
- #———————————————————————————————————————
- # Game_Character
- #———————————————————————————————————————
- class Game_Character
- alias:md:move_down
- def move_down(turn_enabled = true,bot=true)
- unless bot
- speed = (2**@move_speed).to_f/128
- if passable?(@x.to_i, (@y+speed).to_i, 2)
- if @x.to_i != @x
- if passable?((@x+0.9).to_i,(@y+speed).to_i, 2)
- turn_down if turn_enabled
- @y += speed
- else
- unless check_event_trigger_touch(@x.to_i+1, (@y+speed).to_i+1)
- @y = (@y+speed).to_i
- @x -= speed
- turn_down if turn_enabled
- else
- turn_down if turn_enabled
- end
- end
- else
- turn_down if turn_enabled
- @y += speed
- end
- else
- if passable?((@x+0.9).to_i,(@y+speed).to_i, 2)
- unless check_event_trigger_touch(@x.to_i, (@y+speed).to_i+1)
- @y = (@y+speed).to_i
- @x += speed
- turn_down if turn_enabled
- else
- turn_down if turn_enabled
- end
- else
- turn_down if turn_enabled
- @y = (@y+speed).to_i
- check_event_trigger_touch(@x.to_i, @y.to_i+1)
- end
- end
- else
- md(turn_enabled)
- end
- end
- alias:ml:move_left
- def move_left(turn_enabled = true,bot=true)
- unless bot
- speed = (2**@move_speed).to_f/128
- if passable?((@x-speed+0.9).to_i,@y.to_i, 4)
- if @y.to_i != @y
- if passable?((@x-speed+0.9).to_i,(@y+0.9).to_i, 4)
- turn_left if turn_enabled
- @x -= speed
- else
- unless check_event_trigger_touch(@x.to_i-1, @y.to_i+1)
- @x = @x.to_i
- @y -= speed
- turn_left if turn_enabled
- else
- turn_left if turn_enabled
- end
- end
- else
- turn_left if turn_enabled
- @x -= speed
- end
- else
- if passable?((@x-speed+0.9).to_i,(@y+0.9).to_i, 4)
- unless check_event_trigger_touch(@x.to_i-1, @y.to_i)
- @x = @x.to_i
- @y += speed
- turn_left if turn_enabled
- else
- turn_left if turn_enabled
- end
- else
- turn_left if turn_enabled
- @x = @x.to_i
- check_event_trigger_touch(@x.to_i-1, @y.to_i)
- end
- end
- else
- ml(turn_enabled)
- end
- end
- alias:mr:move_right
- def move_right(turn_enabled = true,bot=true)
- unless bot
- speed = (2**@move_speed).to_f/128
- if passable?((@x+speed).to_i,@y.to_i, 6)
- if @y.to_i != @y
- if passable?((@x+speed).to_i,(@y+0.9).to_i, 6)
- turn_right if turn_enabled
- @x += speed
- else
- unless check_event_trigger_touch((@x+speed).to_i+1, @y.to_i+1)
- @x = (@x+speed).to_i
- @y -= speed
- turn_right if turn_enabled
- else
- @x = (@x+speed).to_i
- turn_right if turn_enabled
- end
- end
- else
- turn_right if turn_enabled
- @x += speed
- end
- else
- if passable?((@x+speed).to_i,(@y+0.9).to_i, 6)
- unless check_event_trigger_touch((@x+speed).to_i+1, @y.to_i)
- @x = (@x+speed).to_i
- @y += speed
- turn_right if turn_enabled
- else
- @x = (@x+speed).to_i
- turn_right if turn_enabled
- end
- else
- turn_right if turn_enabled
- @x = (@x+speed).to_i
- check_event_trigger_touch(@x.to_i+1, @y.to_i)
- end
- end
- else
- mr(turn_enabled)
- end
- end
- alias:mu:move_up
- def move_up(turn_enabled = true,bot=true)
- unless bot
- speed = (2**@move_speed).to_f/128
- if passable?(@x.to_i, (@y-speed+0.9).to_i, 8)
- if @x.to_i != @x
- if passable?((@x+0.9).to_i,(@y-speed+0.9).to_i, 8)
- turn_up if turn_enabled
- @y -= speed
- else
- unless check_event_trigger_touch(@x.to_i+1, @y.to_i-1)
- @y = @y.to_i
- @x -= speed
- turn_up if turn_enabled
- else
- turn_up if turn_enabled
- end
- end
- else
- turn_up if turn_enabled
- @y -= speed
- end
- else
- if passable?((@x+0.9).to_i,(@y-speed+0.9).to_i, 8)
- unless check_event_trigger_touch(@x.to_i, @y.to_i-1)
- @y = @y.to_i
- @x += speed
- turn_up if turn_enabled
- else
- turn_up if turn_enabled
- end
- else
- turn_up if turn_enabled
- @y = @y.to_i
- check_event_trigger_touch(@x.to_i, @y.to_i-1)
- end
- end
- else
- mu(turn_enabled)
- end
- end
- # hys 添加部分——————————————————
- alias:mll:move_lower_left
- def move_lower_left(bot=true)
- unless bot
- move_down(true,false)
- move_left(true,false)
- else
- mll
- end
- end
-
- alias:mlr:move_lower_right
- def move_lower_right(bot=true)
- unless bot
- move_down(true,false)
- move_right(true,false)
- else
- mlr
- end
- end
-
- alias:mul:move_upper_left
- def move_upper_left(bot=true)
- unless bot
- move_up(true,false)
- move_left(true,false)
- else
- mul
- end
- end
-
- alias:mur:move_upper_right
- def move_upper_right(bot=true)
- unless bot
- move_up(true,false)
- move_right(true,false)
- else
- mur
- end
- end
- # hys 添加部分——————————————————
- end
- #———————————————————————————————————————
- # Game_Player
- #———————————————————————————————————————
- class Game_Player < Game_Character
- def check_event_trigger_here(triggers)
- result = false
- if $game_system.map_interpreter.running?
- return result
- end
- for event in $game_map.events.values
- if (event.x+0.5).between?(@x,@x+1) and (event.y+0.5).between?(@y,@y+1)and triggers.include?(event.trigger)
- if not event.jumping? and event.over_trigger?
- event.start
- result = true
- end
- end
- end
- return result
- end
- def check_event_trigger_there(triggers)
- result = false
- if $game_system.map_interpreter.running?
- return result
- end
- new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
- new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
- for event in $game_map.events.values
- if (event.x+0.5).between?(new_x,new_x+1) and (event.y+0.5).between?(new_y,new_y+1)and triggers.include?(event.trigger)
- if not event.jumping? and not event.over_trigger?
- event.start
- result = true
- end
- end
- end
- return result
- end
-
- def update
- last_moving = moving?
- unless moving? or $game_system.map_interpreter.running? or
- @move_route_forcing or $game_temp.message_window_showing or
- $game_map.scrolling?
- #————————————————————八方向
- if $game_temp.disable._8_direction
- case Input.dir8
- when 2
- move_down(true,$game_temp.disable.pixel_move)
- when 4
- move_left(true,$game_temp.disable.pixel_move)
- when 6
- move_right(true,$game_temp.disable.pixel_move)
- when 8
- move_up(true,$game_temp.disable.pixel_move)
- end
- else
- case Input.dir8
- when 2
- move_down(true,$game_temp.disable.pixel_move)
- when 4
- move_left(true,$game_temp.disable.pixel_move)
- when 6
- move_right(true,$game_temp.disable.pixel_move)
- when 8
- move_up(true,$game_temp.disable.pixel_move)
- when 1
- move_lower_left($game_temp.disable.pixel_move)
- when 3
- move_lower_right($game_temp.disable.pixel_move)
- when 7
- move_upper_left($game_temp.disable.pixel_move)
- when 9
- move_upper_right($game_temp.disable.pixel_move)
- end
- end
- #————————————————————八方向
- end
- last_real_x = @real_x
- last_real_y = @real_y
- super
-
-
- if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
- $game_map.scroll_down(@real_y - last_real_y)
- end
- if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
- $game_map.scroll_left(last_real_x - @real_x)
- end
- if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
- $game_map.scroll_right(@real_x - last_real_x)
- end
- if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
- $game_map.scroll_up(last_real_y - @real_y)
- end
- unless moving?
- if last_moving
- result = check_event_trigger_here([1,2])
- if result == false
- unless $DEBUG and Input.press?(Input::CTRL)
- if @encounter_count > 0
- @encounter_count -= 1
- end
- end
- end
- end
- if Input.trigger?(Input::C)
- check_event_trigger_there([0,1,2]) unless check_event_trigger_here([0])
- end
- end
- end
-
- end
复制代码 这东西我都整合过的啊…… |
|