Advertisement
Guest User

Untitled

a guest
Jan 29th, 2019
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.85 KB | None | 0 0
  1. # http://members.jcom.home.ne.jp/cogwheel/
  2. #==============================================================================
  3. # Game_Player
  4. #==============================================================================
  5. class Game_Player < Game_Character
  6. UP = 0
  7. DOWN = 0
  8. SIDE = 0
  9. SLANT = false
  10. #--------------------------------------------------------------------------
  11. attr_reader :event
  12. attr_accessor :move_speed
  13. #--------------------------------------------------------------------------
  14. alias :update_original :update
  15. def update
  16. @walk = 5.1
  17. @dash = 5
  18. @event = 4
  19. @dot_m = true
  20. center_x = (Graphics.width/2 - Game_Map::TILEWIDTH/2) * 4
  21. center_y = (Graphics.height/2 - Game_Map::TILEHEIGHT/2) * 4
  22. unless moving? or $game_system.map_interpreter.running? or
  23. @move_route_forcing or $game_temp.message_window_showing or
  24. $PokemonTemp.miniupdate or jumping?
  25. if @walk != @dash
  26. if Input.press?(Input::C)
  27. if @move_speed != @dash
  28. @move_speed = @dash
  29. end
  30. else
  31. if @move_speed != @walk
  32. @move_speed = @walk
  33. end
  34. end
  35. end
  36. end
  37. if @revise_x == nil and @revise_y == nil
  38. @revise_x = 0
  39. @revise_y = 0
  40. end
  41. unless @dot_m
  42. update_original
  43. return
  44. end
  45. if @move_route_forcing
  46. last_moving = moving?
  47. last_real_x = @real_x
  48. last_real_y = @real_y
  49. if (@revise_x != 0 or @revise_y != 0) and not jumping? and @move == true
  50. if @revise_x != @real_x - @x * 128 or @revise_y != @real_y - @y * 128
  51. @revise_x = @real_x - @x * 128
  52. @revise_y = @real_y - @y * 128
  53. end
  54. distance1 = 2 ** @move_speed
  55. distance2 = Math.sqrt(@revise_x ** 2 + @revise_y ** 2)
  56. if distance1 > distance2
  57. @real_x = @real_x - @revise_x
  58. @real_y = @real_y - @revise_y
  59. @revise_x = 0
  60. @revise_y = 0
  61. anime_update
  62. else
  63. @real_x -= (distance1 * @revise_x / distance2).round
  64. @real_y -= (distance1 * @revise_y / distance2).round
  65. @revise_x = @real_x - @x * 128
  66. @revise_y = @real_y - @y * 128
  67. anime_update
  68. end
  69. else
  70. super
  71. end
  72. else
  73. @move = false
  74. unless moving? or $game_system.map_interpreter.running? or
  75. @move_route_forcing or $game_temp.message_window_showing or
  76. $PokemonTemp.miniupdate or jumping?
  77. case Input.dir8
  78. when 1
  79. move_lower_left_p
  80. when 2
  81. move_down_p
  82. when 3
  83. move_lower_right_p
  84. when 4
  85. move_left_p
  86. when 6
  87. move_right_p
  88. when 7
  89. move_upper_left_p
  90. when 8
  91. move_up_p
  92. when 9
  93. move_upper_right_p
  94. end
  95. end
  96. last_real_x = @real_x
  97. last_real_y = @real_y
  98. unless jumping?
  99. @real_x = @x * 128 + @revise_x
  100. @real_y = @y * 128 + @revise_y
  101. else
  102. update_jump
  103. end
  104. last_moving = moving?
  105. move_on
  106. if (last_real_x != @real_x or last_real_y != @real_y)
  107. @move_distance = 0 if @move_distance == nil
  108. @move_distance += Math.sqrt((last_real_x - @real_x) ** 2 +
  109. (last_real_y - @real_y) ** 2)
  110. if @move_distance >= 128
  111. @move_distance %= 128
  112. increase_steps
  113. end
  114. anime_update
  115. else
  116. @pattern = 0
  117. end
  118. end
  119.  
  120. if @real_y > last_real_y and @real_y - $game_map.display_y > center_y
  121. # Scroll map down
  122. $game_map.scroll_down(@real_y - last_real_y)
  123. end
  124. # If character moves left and is positioned more left on-screen than
  125. # center
  126. if @real_x < last_real_x and @real_x - $game_map.display_x < center_x
  127. # Scroll map left
  128. $game_map.scroll_left(last_real_x - @real_x)
  129. end
  130. # If character moves right and is positioned more right on-screen than
  131. # center
  132. if @real_x > last_real_x and @real_x - $game_map.display_x > center_x
  133. # Scroll map right
  134. $game_map.scroll_right(@real_x - last_real_x)
  135. end
  136. # If character moves up and is positioned higher than the center
  137. # of the screen
  138. if @real_y < last_real_y and @real_y - $game_map.display_y < center_y
  139. # Scroll map up
  140. $game_map.scroll_up(last_real_y - @real_y)
  141. end
  142. if last_moving
  143. result = check_event_trigger_here([1,2])
  144. if result == false
  145. unless $DEBUG and Input.press?(Input::CTRL)
  146. if @encounter_count > 0
  147. @encounter_count -= 1
  148. end
  149. end
  150. end
  151. end
  152. if Input.trigger?(Input::C)
  153. check_event_trigger_here([0])
  154. check_event_trigger_there([0,1,2])
  155. end
  156. if Input.trigger?(Input::SPC) && $game_switches[200]
  157. case direction
  158. when 2 # down
  159. jump(0,2)
  160. when 4 # left
  161. jump(-2,0)
  162. when 6 # right
  163. jump(2,0)
  164. when 8 # up
  165. jump(0,-2)
  166. end
  167. end
  168. end
  169. #--------------------------------------------------------------------------
  170. def initialize
  171. @revise_x = 0
  172. @revise_y = 0
  173. @move == false
  174. super
  175. end
  176. #--------------------------------------------------------------------------
  177. def moving?
  178. unless @dot_m
  179. result = super
  180. return result
  181. end
  182. if @move_route_forcing
  183. if @move == false
  184. return false
  185. end
  186. super
  187. else
  188. return (@x != (@real_x / 128.0).round or @y != (@real_y / 128.0).round)
  189. end
  190. end
  191. #--------------------------------------------------------------------------
  192. def moving_a?
  193. if @move == false
  194. if (@move_route.list[@move_route_index].code <= 14 or
  195. @move_route.list[@move_route_index].code == 25)
  196. @move = true
  197. end
  198. return false
  199. end
  200. moving?
  201. end
  202. #--------------------------------------------------------------------------
  203. def update_jump
  204. @jump_count -= 1
  205. @real_x = (@real_x * @jump_count + @x * 128) / (@jump_count + 1)
  206. @real_y = (@real_y * @jump_count + @y * 128) / (@jump_count + 1)
  207. if @jump_count == 0
  208. @revise_x = 0
  209. @revise_y = 0
  210. end
  211. end
  212. #--------------------------------------------------------------------------
  213. def jump(x_plus, y_plus)
  214. if x_plus != 0 or y_plus != 0
  215. if x_plus.abs > y_plus.abs
  216. x_plus < 0 ? turn_left : turn_right
  217. else
  218. y_plus < 0 ? turn_up : turn_down
  219. end
  220. end
  221. new_x = @x + x_plus
  222. new_y = @y + y_plus
  223. oldX=@x
  224. oldY=@y
  225. if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
  226. straighten
  227. @x = new_x
  228. @y = new_y
  229. distance = [4, x_plus * x_plus + y_plus * y_plus].max
  230. @jump_peak = 6 + distance - @move_speed
  231. @jump_peak = @jump_peak.floor
  232. @jump_count = @jump_peak * 2
  233. @stop_count = 0
  234. if self.is_a?(Game_Player)
  235. $PokemonTemp.dependentEvents.pbMoveDependentEvents
  236. end
  237. triggerLeaveTile()
  238. end
  239. end
  240. #--------------------------------------------------------------------------
  241. def move_type_custom
  242. unless @dot_m
  243. super
  244. return
  245. end
  246. if jumping? or moving_a?
  247. return
  248. end
  249. while @move_route_index < @move_route.list.size
  250. command = @move_route.list[@move_route_index]
  251. if command.code == 0
  252. if @move_route.repeat
  253. @move_route_index = 0
  254. end
  255. unless @move_route.repeat
  256. if @move_route_forcing and not @move_route.repeat
  257. @move_route_forcing = false
  258. @move_route = @original_move_route
  259. @move_route_index = @original_move_route_index
  260. @original_move_route = nil
  261. end
  262. @stop_count = 0
  263. end
  264. return
  265. end
  266. if command.code <= 14
  267. case command.code
  268. when 1
  269. move_down
  270. when 2
  271. move_left
  272. when 3
  273. move_right
  274. when 4
  275. move_up
  276. when 5
  277. move_lower_left
  278. when 6
  279. move_lower_right
  280. when 7
  281. move_upper_left
  282. when 8
  283. move_upper_right
  284. when 9
  285. move_random
  286. when 10
  287. move_toward_player
  288. when 11
  289. move_away_from_player
  290. when 12
  291. move_forward
  292. when 13
  293. move_backward
  294. when 14
  295. jump(command.parameters[0], command.parameters[1])
  296. end
  297. if not @move_route.skippable and not moving? and not jumping?
  298. return
  299. end
  300. @move_route_index += 1
  301. return
  302. end
  303. if command.code == 15
  304. @wait_count = command.parameters[0] * 2 - 1
  305. @move_route_index += 1
  306. return
  307. end
  308. if command.code >= 16 and command.code <= 26
  309. case command.code
  310. when 16
  311. turn_down
  312. when 17
  313. turn_left
  314. when 18
  315. turn_right
  316. when 19
  317. turn_up
  318. when 20
  319. turn_right_90
  320. when 21
  321. turn_left_90
  322. when 22
  323. turn_180
  324. when 23
  325. turn_right_or_left_90
  326. when 24
  327. turn_random
  328. when 25
  329. turn_toward_player
  330. when 26
  331. turn_away_from_player
  332. end
  333. @move_route_index += 1
  334. return
  335. end
  336. if command.code >= 27
  337. case command.code
  338. when 27
  339. $game_switches[command.parameters[0]] = true
  340. $game_map.need_refresh = true
  341. when 28
  342. $game_switches[command.parameters[0]] = false
  343. $game_map.need_refresh = true
  344. when 29
  345. @move_speed = command.parameters[0]
  346. when 30
  347. @move_frequency = command.parameters[0]
  348. when 31
  349. @walk_anime = true
  350. when 32
  351. @walk_anime = false
  352. when 33
  353. @step_anime = true
  354. when 34
  355. @step_anime = false
  356. when 35
  357. @direction_fix = true
  358. when 36
  359. @direction_fix = false
  360. when 37
  361. @through = true
  362. when 38
  363. @through = false
  364. when 39
  365. @always_on_top = true
  366. when 40
  367. @always_on_top = false
  368. when 41
  369. @tile_id = 0
  370. @character_name = command.parameters[0]
  371. @character_hue = command.parameters[1]
  372. if @original_direction != command.parameters[2]
  373. @direction = command.parameters[2]
  374. @original_direction = @direction
  375. @prelock_direction = 0
  376. end
  377. if @original_pattern != command.parameters[3]
  378. @pattern = command.parameters[3]
  379. @original_pattern = @pattern
  380. end
  381. when 42
  382. @opacity = command.parameters[0]
  383. when 43
  384. @blend_type = command.parameters[0]
  385. when 44
  386. $game_system.se_play(command.parameters[0])
  387. when 45
  388. result = eval(command.parameters[0])
  389. end
  390. @move_route_index += 1
  391. return
  392. end
  393. end
  394. end
  395. #--------------------------------------------------------------------------
  396. def move_down_p
  397. turn_down
  398. distance = 2 ** @move_speed
  399. down1(((@x * 128 + @revise_x) / 128.0).round,
  400. ((@y * 128 + @revise_y) / 128.0).round, distance, true)
  401. end
  402. #--------------------------------------------------------------------------
  403. def down1(x, y, distance, down = false)
  404. result = down2(x, y, distance)
  405. if result == false
  406. @event_run = check_event_trigger_touch(x, y+1)
  407. return result
  408. end
  409. if @revise_x < -SIDE
  410. result = down2(x, y + 1, distance, 4)
  411. result &= down2(x - 1, y, distance)
  412. if result == false
  413. if down
  414. move_lower_right_p
  415. if @revise_x > SIDE
  416. @revise_x = SIDE
  417. end
  418. end
  419. return result
  420. end
  421. elsif @revise_x > SIDE
  422. result = down2(x, y + 1, distance, 6)
  423. result &= down2(x + 1, y, distance)
  424. if result == false
  425. if down
  426. move_lower_left_p
  427. if @revise_x < -SIDE
  428. @revise_x = -SIDE
  429. end
  430. end
  431. return result
  432. end
  433. end
  434. @revise_y += distance
  435. return result
  436. end
  437. #--------------------------------------------------------------------------
  438. def down2(x, y, distance, d = 2)
  439. if @revise_y + distance > DOWN
  440. unless passable?(x, y, d)
  441. if @revise_y < DOWN
  442. @revise_y = DOWN
  443. end
  444. return false
  445. end
  446. end
  447. return true
  448. end
  449. #--------------------------------------------------------------------------
  450. def move_left_p
  451. turn_left
  452. distance = 2 ** @move_speed
  453. left1(((@x * 128 + @revise_x) / 128.0).round,
  454. ((@y * 128 + @revise_y) / 128.0).round, distance, true)
  455. end
  456. #--------------------------------------------------------------------------
  457. def left1(x, y, distance, left = false)
  458. result = left2(x, y, distance)
  459. if result == false
  460. @event_run = check_event_trigger_touch(x-1, y)
  461. return result
  462. end
  463. if @revise_y < -UP
  464. result = left2(x - 1, y, distance, 8)
  465. result &= left2(x, y - 1, distance)
  466. if result == false
  467. if left
  468. move_lower_left_p
  469. if @revise_y > DOWN
  470. @revise_y = DOWN
  471. end
  472. end
  473. return result
  474. end
  475. elsif @revise_y > DOWN
  476. result = left2(x - 1, y, distance, 2)
  477. result &= left2(x, y + 1, distance)
  478. if result == false
  479. if left
  480. move_upper_left_p
  481. if @revise_y < -UP
  482. @revise_y = -UP
  483. end
  484. end
  485. return result
  486. end
  487. end
  488. @revise_x -= distance
  489. return result
  490. end
  491. #--------------------------------------------------------------------------
  492. def left2(x, y, distance, d = 4)
  493. if @revise_x - distance < -SIDE
  494. unless passable?(x, y, d)
  495. if @revise_x > -SIDE
  496. @revise_x = -SIDE
  497. end
  498. return false
  499. end
  500. end
  501. return true
  502. end
  503. #--------------------------------------------------------------------------
  504. def move_right_p
  505. turn_right
  506. distance = 2 ** @move_speed
  507. right1(((@x * 128 + @revise_x) / 128.0).round,
  508. ((@y * 128 + @revise_y) / 128.0).round, distance, true)
  509. end
  510. #--------------------------------------------------------------------------
  511. def right1(x, y, distance, right = false)
  512. result = right2(x, y, distance)
  513. if result == false
  514. @event_run = check_event_trigger_touch(x+1, y)
  515. return result
  516. end
  517. if @revise_y < -UP
  518. result = right2(x + 1, y, distance, 8)
  519. result &= right2(x, y - 1, distance)
  520. if result == false
  521. if right
  522. move_lower_right_p
  523. if @revise_y > DOWN
  524. @revise_y = DOWN
  525. end
  526. end
  527. return result
  528. end
  529. elsif @revise_y > DOWN
  530. result = right2(x + 1, y, distance, 2)
  531. result &= right2(x, y + 1, distance)
  532. if result == false
  533. if right
  534. move_upper_right_p
  535. if @revise_y < -UP
  536. @revise_y = -UP
  537. end
  538. end
  539. return result
  540. end
  541. end
  542. @revise_x += distance
  543. return result
  544. end
  545. #--------------------------------------------------------------------------
  546. def right2(x, y, distance, d = 6)
  547. if @revise_x + distance > SIDE
  548. unless passable?(x, y, d)
  549. if @revise_x < SIDE
  550. @revise_x = SIDE
  551. end
  552. return false
  553. end
  554. end
  555. return true
  556. end
  557. #--------------------------------------------------------------------------
  558. def move_up_p
  559. turn_up
  560. distance = 2 ** @move_speed
  561. up1(((@x * 128 + @revise_x) / 128.0).round,
  562. ((@y * 128 + @revise_y) / 128.0).round, distance, true)
  563. end
  564. #--------------------------------------------------------------------------
  565. def up1(x, y, distance, up = false)
  566. result = up2(x, y, distance)
  567. if result == false
  568. @event_run = check_event_trigger_touch(x, y-1)
  569. return result
  570. end
  571. if @revise_x < -SIDE
  572. result = up2(x, y - 1, distance, 4)
  573. result &= up2(x - 1, y, distance)
  574. if result == false
  575. if up
  576. move_upper_right_p
  577. if @revise_x > SIDE
  578. @revise_x = SIDE
  579. end
  580. end
  581. return result
  582. end
  583. elsif @revise_x > SIDE
  584. result = up2(x, y - 1, distance, 6)
  585. result &= up2(x + 1, y, distance)
  586. if result == false
  587. if up
  588. move_upper_left_p
  589. if @revise_x < -SIDE
  590. @revise_x = -SIDE
  591. end
  592. end
  593. return result
  594. end
  595. end
  596. @revise_y -= distance
  597. return result
  598. end
  599. #--------------------------------------------------------------------------
  600. def up2(x, y, distance, d = 8)
  601. if @revise_y - distance < -UP
  602. unless passable?(x, y, d)
  603. if @revise_y > -UP
  604. @revise_y = -UP
  605. end
  606. return false
  607. end
  608. end
  609. return true
  610. end
  611. #--------------------------------------------------------------------------
  612. def move_lower_left_p
  613. unless @direction_fix
  614. @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
  615. end
  616. distance = (2 ** @move_speed) / Math.sqrt(2)
  617. turn_left unless down1(((@x * 128 + @revise_x) / 128.0).round,
  618. ((@y * 128 + @revise_y) / 128.0).round, distance)
  619. turn_down if @event_run
  620. unless @event_run
  621. if last_move?(@real_x, @real_y, 2, distance)
  622. result = check_event_trigger_here([1,2], false)
  623. if result == true
  624. return
  625. end
  626. end
  627. move_on
  628. if @revise_y > DOWN and -UP > @revise_y - distance
  629. @revise_y = DOWN
  630. end
  631. turn_down unless left1(((@x * 128 + @revise_x) / 128.0).round,
  632. ((@y * 128 + @revise_y) / 128.0).round, distance)
  633. turn_left if @event_run
  634. end
  635. end
  636. #--------------------------------------------------------------------------
  637. def move_lower_right_p
  638. unless @direction_fix
  639. @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
  640. end
  641. distance = (2 ** @move_speed) / Math.sqrt(2)
  642. turn_right unless down1(((@x * 128 + @revise_x) / 128.0).round,
  643. ((@y * 128 + @revise_y) / 128.0).round, distance)
  644. turn_down if @event_run
  645. unless @event_run
  646. if last_move?(@real_x, @real_y, 2, distance)
  647. result = check_event_trigger_here([1,2], false)
  648. if result == true
  649. return
  650. end
  651. end
  652. move_on
  653. if @revise_y > DOWN and -UP > @revise_y - distance
  654. @revise_y = DOWN
  655. end
  656. turn_down unless right1(((@x * 128 + @revise_x) / 128.0).round,
  657. ((@y * 128 + @revise_y) / 128.0).round, distance)
  658. turn_right if @event_run
  659. end
  660. end
  661. #--------------------------------------------------------------------------
  662. def move_upper_left_p
  663. unless @direction_fix
  664. @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
  665. end
  666. distance = (2 ** @move_speed) / Math.sqrt(2)
  667. turn_left unless up1(((@x * 128 + @revise_x) / 128.0).round,
  668. ((@y * 128 + @revise_y) / 128.0).round, distance)
  669. turn_up if @event_run
  670. unless @event_run
  671. if last_move?(@real_x, @real_y, 8, distance)
  672. result = check_event_trigger_here([1,2], false)
  673. if result == true
  674. return
  675. end
  676. end
  677. move_on
  678. if @revise_y + distance > DOWN and -UP > @revise_y
  679. @revise_y = -UP
  680. end
  681. turn_up unless left1(((@x * 128 + @revise_x) / 128.0).round,
  682. ((@y * 128 + @revise_y) / 128.0).round, distance)
  683. turn_left if @event_run
  684. end
  685. end
  686. #--------------------------------------------------------------------------
  687. def move_upper_right_p
  688. unless @direction_fix
  689. @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
  690. end
  691. distance = (2 ** @move_speed) / Math.sqrt(2)
  692. turn_right unless up1(((@x * 128 + @revise_x) / 128.0).round,
  693. ((@y * 128 + @revise_y) / 128.0).round, distance)
  694. turn_up if @event_run
  695. unless @event_run
  696. if last_move?(@real_x, @real_y, 8, distance)
  697. result = check_event_trigger_here([1,2], false)
  698. if result == true
  699. return
  700. end
  701. end
  702. move_on
  703. if @revise_y + distance > DOWN and -UP > @revise_y
  704. @revise_y = -UP
  705. end
  706. turn_up unless right1(((@x * 128 + @revise_x) / 128.0).round,
  707. ((@y * 128 + @revise_y) / 128.0).round, distance)
  708. turn_right if @event_run
  709. end
  710. end
  711. #--------------------------------------------------------------------------
  712. def check_event_trigger_here(triggers, run = true)
  713. result = false
  714. if $game_system.map_interpreter.running?
  715. return result
  716. end
  717. for event in $game_map.events.values
  718. if event.x == ((@x * 128 + @revise_x) / 128.0).round and
  719. event.y == ((@y * 128 + @revise_y) / 128.0).round and
  720. triggers.include?(event.trigger)
  721. if not event.jumping? and event.over_trigger?
  722. if event.list.size > 1
  723. if run == true
  724. event.start
  725. end
  726. result = true
  727. end
  728. end
  729. end
  730. end
  731. return result
  732. end
  733. #--------------------------------------------------------------------------
  734. def move_on
  735. if @y < (@y + @revise_y / 128.0).round
  736. @y += 1
  737. @revise_y -= 128
  738. end
  739. if @x > (@x + @revise_x / 128.0).round
  740. @x -= 1
  741. @revise_x += 128
  742. end
  743. if @x < (@x + @revise_x / 128.0).round
  744. @x += 1
  745. @revise_x -= 128
  746. end
  747. if @y > (@y + @revise_y / 128.0).round
  748. @y -= 1
  749. @revise_y += 128
  750. end
  751. end
  752. #--------------------------------------------------------------------------
  753. def anime_update
  754. if @walk_anime
  755. @anime_count += 1.5
  756. elsif @step_anime
  757. @anime_count += 1
  758. end
  759. if @anime_count > 18 - @move_speed * 2
  760. if not @step_anime and @stop_count > 0
  761. @pattern = @original_pattern
  762. else
  763. @pattern = (@pattern + 1) % 4
  764. end
  765. @anime_count = 0
  766. end
  767. end
  768. #--------------------------------------------------------------------------
  769. alias :moveto_original :moveto
  770. def moveto(x, y)
  771. @revise_x = 0
  772. @revise_y = 0
  773. moveto_original(x, y)
  774. end
  775. #--------------------------------------------------------------------------
  776. def last_move?(x, y, direction, distance)
  777. if direction == 2 or direction == 6
  778. distance *= -1
  779. end
  780. if (direction == 2 or direction == 8) and
  781. (y / 128.0).round != ((y - distance) / 128.0).round
  782. return true
  783. end
  784. if (direction == 4 or direction == 6) and
  785. (x / 128.0).round != ((x - distance) / 128.0).round
  786. return true
  787. end
  788. return false
  789. end
  790. end
  791.  
  792. #==============================================================================
  793. # Game_Character
  794. #==============================================================================
  795. class Game_Character
  796. def update_move
  797. distance = 2 ** @move_speed
  798. if @x * 128 < @real_x
  799. @real_x = [@real_x - distance, @x * realResX].max
  800. end
  801. if @x * 128> @real_x
  802. @real_x = [@real_x + distance, @x * realResX].min
  803. end
  804. if @y * 128> @real_y
  805. @real_y = [@real_y + distance, @y * realResY].min
  806. end
  807. if @y * 128 < @real_y
  808. @real_y = [@real_y - distance, @y * realResY].max
  809. end
  810. if !jumping? && !moving?
  811. Events.onStepTakenFieldMovement.trigger(self,self)
  812. end
  813. if @walk_anime
  814. @anime_count += 1.5
  815. elsif @step_anime
  816. @anime_count += 1
  817. end
  818. end
  819. end
  820. #==============================================================================
  821. # Game_Event
  822. #==============================================================================
  823. class Game_Event < Game_Character
  824. def start
  825. if @list.size > 1
  826. if $game_player.event != 0
  827. $game_player.move_speed = $game_player.event
  828. end
  829. @starting = true
  830. end
  831. end
  832. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement