Scripts miteinander verbinden?
Schönen guten Abend, liebes Forum :3
Ich bin neu hier im Forum und grüße euch zuerst mal xD *wink*
alles klärchen?=)
Also nur zu meiner Bitte, Frage what ever xD
Ich habe ein Laufscript für meinen Helden und ein script wo die anderen Helden ihm hinterherlaufen soll.^^ Aber wenn der Held rennt, kommen die Helden (logischerweise) nicht hinterher D:
Ist es möglich die Beiden zu verbinden?^^
Ganz liebe Grüße
Lady_Rinoa
Ich bin neu hier im Forum und grüße euch zuerst mal xD *wink*
alles klärchen?=)Also nur zu meiner Bitte, Frage what ever xD
Ich habe ein Laufscript für meinen Helden und ein script wo die anderen Helden ihm hinterherlaufen soll.^^ Aber wenn der Held rennt, kommen die Helden (logischerweise) nicht hinterher D:
Ist es möglich die Beiden zu verbinden?^^
Ganz liebe Grüße
Lady_Rinoa
Hallo, willkommen im Forum
theoretisch ja, allerdings müssten wir wissen welche Scripte das sind, ein Link zu ihnen, oder das du sie hier postest (natürlich mit Rubymarkierung und Spoiler drum, beides im Beitragseditor auswählbar) wäre nützlich.
Dann kann dir vermutlich hier jemand schnell eine Lösung bieten
theoretisch ja, allerdings müssten wir wissen welche Scripte das sind, ein Link zu ihnen, oder das du sie hier postest (natürlich mit Rubymarkierung und Spoiler drum, beides im Beitragseditor auswählbar) wäre nützlich.
Dann kann dir vermutlich hier jemand schnell eine Lösung bieten
Das große Scientia Wiki zur Spielentwicklung 
Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs
Musik von Shabraxxx für euch
Guide zu den Audioformaten
Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.

Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs

Musik von Shabraxxx für euch
Guide zu den Audioformaten

Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.
danke :3 und ok dann wollen wir mal
das 1. ist das renn-8weg skript das ich benutze :3 das 2. dann halt das folge-script
Thx im Vorraus
[/i]
das 1. ist das renn-8weg skript das ich benutze :3 das 2. dann halt das folge-script
#==============================================================================
# ¡ Game_Player
#------------------------------------------------------------------------------
# @ƒvƒŒƒCƒ„[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·BƒCƒxƒ“ƒg‚Ì‹N“®”»’è‚âAƒ}ƒbƒv‚̃XƒNƒ[ƒ‹‚ȂǂÌ
# ‹@”\‚ðŽ‚Á‚Ä‚¢‚Ü‚·B‚±‚̃Nƒ‰ƒX‚̃Cƒ“ƒXƒ^ƒ“ƒX‚Í $game_player ‚ÅŽQÆ‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# œ ’è”
#--------------------------------------------------------------------------
UP = 0 # ã•ûŒü‚Ì—]—T(0 <= UP <= 63)
SIDE = 0 # ¶‰E•ûŒü‚Ì—]—T(0 <= SIDE <= 63)
SLANT = false # ˆÚ“®ƒ‹[ƒg‚̎΂߈ړ®ŽžA‘¬“xC³
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_reader :walk # ƒvƒŒ[ƒ„[ˆÚ“®‘¬“x
attr_reader :event # ƒCƒxƒ“ƒgŽžˆÚ“®‘¬“x
attr_accessor :move_speed # ˆÚ“®‘¬“x
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
super
# @walk:•às‘¬“x @dash:ƒ_ƒbƒVƒ…ŽžˆÚ“®‘¬“x
# @event:ƒCƒxƒ“ƒgŽžˆÚ“®‘¬“xi0‚ÌŽž‚ÍAƒCƒxƒ“ƒgŽž‚É‘¬“x•ÏX‚ð‚µ‚È‚¢j
@walk = 4
@dash = 5
@event = 4
@dot_m = true
@revise_x = 0
@revise_y = 0
@move == false
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
alias :update_original :update
def update
#ƒ_ƒbƒVƒ…‹@”\BƒGƒ“ƒ^[ƒL[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚éŠÔAˆÚ“®‘¬“x‚ð•ÏX‚·‚éB
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if @walk != @dash
if Input.press?(Input::C)
if @move_speed != @dash
@move_speed = @dash
end
else
if @move_speed != @walk
@move_speed = @walk
end
end
end
end
if @revise_x == nil and @revise_y == nil
@revise_x = 0
@revise_y = 0
end
unless @dot_m
update_original
return
end
if @move_route_forcing
# ƒ[ƒJƒ‹•Ï”‚Ɉړ®’†‚©‚Ç‚¤‚©‚ð‹L‰¯
last_moving = moving?
# ƒ[ƒJƒ‹•Ï”‚ÉÀ•W‚ð‹L‰¯
last_real_x = @real_x
last_real_y = @real_y
# À•W‚ª‚¸‚ê‚Ä‚¢‚éê‡
if (@revise_x != 0 or @revise_y != 0) and not jumping? and @move == true
if @revise_x != @real_x - @x * 128 or @revise_y != @real_y - @y * 128
@revise_x = @real_x - @x * 128
@revise_y = @real_y - @y * 128
end
# ˆÚ“®‹——£distance1‚Æ–Ú•W‹——£distance2‚ðÝ’è
distance1 = 2 ** @move_speed
distance2 = Math.sqrt(@revise_x ** 2 + @revise_y ** 2)
# ˆÚ“®‹——£‚ª–Ú•W‹——£‚ð‰z‚¦‚½ê‡
if distance1 > distance2
# ‹§“I‚É•â³À•W‚ð—ë‚É‚·‚é
@real_x = @real_x - @revise_x
@real_y = @real_y - @revise_y
@revise_x = 0
@revise_y = 0
anime_update
# ˆÚ“®‹——£‚ª–Ú•W‹——£‚É’B‚µ‚È‚¢ê‡
else
# ˆÚ“®‹——£•ª–Ú•W‹——£‚ɋ߂Â
@real_x -= (distance1 * @revise_x / distance2).round
@real_y -= (distance1 * @revise_y / distance2).round
@revise_x = @real_x - @x * 128
@revise_y = @real_y - @y * 128
anime_update
end
else
super
end
else
@move = false
# ˆÚ“®’†AƒCƒxƒ“ƒgŽÀs’†AˆÚ“®ƒ‹[ƒg‹§’†A
# ƒƒbƒZ[ƒWƒEƒBƒ“ƒhƒE•\ަ’†‚Ì‚¢‚¸‚ê‚Å‚à‚È‚¢ê‡
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
@event_run = false
# •ûŒüƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ê‚Ä‚¢‚ê‚ÎA‚»‚Ì•ûŒü‚ÖƒvƒŒƒCƒ„[‚ðˆÚ“®
case Input.dir8
when 1
move_lower_left_p
when 2
move_down_p
when 3
move_lower_right_p
when 4
move_left_p
when 6
move_right_p
when 7
move_upper_left_p
when 8
move_up_p
when 9
move_upper_right_p
end
end
# ƒ[ƒJƒ‹•Ï”‚ÉÀ•W‚ð‹L‰¯
last_real_x = @real_x
last_real_y = @real_y
# ˆÚ“®ˆ—
@real_x = @x * 128 + @revise_x
@real_y = @y * 128 + @revise_y
# ƒ[ƒJƒ‹•Ï”‚Ɉړ®’†‚©‚Ç‚¤‚©‚ð‹L‰¯
last_moving = moving?
# ˥WXV
move_on
# Œ»Ý‚ÌÀ•W‚ƈȑO‚ÌÀ•W‚ªˆÙ‚È‚éê‡
if (last_real_x != @real_x or last_real_y != @real_y)
@move_distance = 0 if @move_distance == nil
@move_distance += Math.sqrt((last_real_x - @real_x) ** 2 +
(last_real_y - @real_y) ** 2)
if @move_distance >= 128
@move_distance %= 128
increase_steps
end
# ƒAƒjƒ[ƒVƒ‡ƒ“‚ðXV
anime_update
elsif @walk_anime
@pattern = @original_pattern
end
end
# ƒLƒƒƒ‰ƒNƒ^[‚ª‰º‚Ɉړ®‚µA‚©‚‰æ–Êã‚̈ʒu‚ª’†‰›‚æ‚艺‚Ìê‡
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
# ƒ}ƒbƒv‚ð‰º‚ÉƒXƒNƒ[ƒ‹
$game_map.scroll_down(@real_y - last_real_y)
end
# ƒLƒƒƒ‰ƒNƒ^[‚ª¶‚Ɉړ®‚µA‚©‚‰æ–Êã‚̈ʒu‚ª’†‰›‚æ‚è¶‚Ìê‡
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
# ƒ}ƒbƒv‚ð¶‚ɃXƒNƒ[ƒ‹
$game_map.scroll_left(last_real_x - @real_x)
end
# ƒLƒƒƒ‰ƒNƒ^[‚ª‰E‚Ɉړ®‚µA‚©‚‰æ–Êã‚̈ʒu‚ª’†‰›‚æ‚è‰E‚Ìê‡
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
# ƒ}ƒbƒv‚ð‰E‚ɃXƒNƒ[ƒ‹
$game_map.scroll_right(@real_x - last_real_x)
end
# ƒLƒƒƒ‰ƒNƒ^[‚ªã‚Ɉړ®‚µA‚©‚‰æ–Êã‚̈ʒu‚ª’†‰›‚æ‚èã‚Ìê‡
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
# ƒ}ƒbƒv‚ðã‚ɃXƒNƒ[ƒ‹
$game_map.scroll_up(last_real_y - @real_y)
end
# ‘O‰ñƒvƒŒƒCƒ„[‚ªˆÚ“®’†‚¾‚Á‚½ê‡
if last_moving
# “¯ˆÊ’u‚̃Cƒxƒ“ƒg‚Æ‚ÌÚG‚É‚æ‚éƒCƒxƒ“ƒg‹N“®”»’è
result = check_event_trigger_here([1,2])
if result == true
if (last_real_x / 128.0).round != @x and
(last_real_y / 128.0).round != @y
if @direction == 2 or @direction == 8
if (last_real_x / 128.0).round > @x
turn_left
else
turn_right
end
else
if (last_real_y / 128.0).round > @y
turn_up
else
turn_down
end
end
elsif (last_real_x / 128.0).round > @x
turn_left
elsif (last_real_x / 128.0).round < @x
turn_right
elsif (last_real_y / 128.0).round > @y
turn_up
elsif (last_real_y / 128.0).round < @y
turn_down
end
end
# ‹N“®‚µ‚½ƒCƒxƒ“ƒg‚ª‚È‚¢ê‡
if result == false
# ƒfƒoƒbƒOƒ‚[ƒh‚ª ON ‚©‚ CTRL ƒL[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚éꇂ𜂫
unless $DEBUG and Input.press?(Input::CTRL)
# ƒGƒ“ƒJƒEƒ“ƒg ƒJƒEƒ“ƒgƒ_ƒEƒ“
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# “¯ˆÊ’u‚¨‚æ‚ѳ–ʂ̃Cƒxƒ“ƒg‹N“®”»’è
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
#--------------------------------------------------------------------------
# œ ˆÚ“®”»’è
#--------------------------------------------------------------------------
def moving?
unless @dot_m
result = super
return result
end
# ‹§ˆÚ“®‚ÌꇃIƒŠƒWƒiƒ‹‚Ì”»’è‚ð‚³‚¹‚é
if @move_route_forcing
if @move == false
return false
end
super
# ’Ê펞‚ÍŒ»À•W‚ªŽÀÀ•W‚ƈقȂéꇂ݈̂ړ®’†‚Æ”»’è
else
return (@x != (@real_x / 128.0).round or @y != (@real_y / 128.0).round)
end
end
#--------------------------------------------------------------------------
# œ ˆÚ“®”»’è
#--------------------------------------------------------------------------
def moving_a?
if @move == false
if (@move_route.list[@move_route_index].code <= 14 or
@move_route.list[@move_route_index].code == 25)
@move = true
end
return false
end
moving?
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒWƒƒƒ“ƒv)
#--------------------------------------------------------------------------
def update_jump
# ƒWƒƒƒ“ƒvƒJƒEƒ“ƒg‚ð 1 Œ¸‚ç‚·
@jump_count -= 1
# V‚µ‚¢À•W‚ðŒvŽZ
@real_x = (@real_x * @jump_count + @x * 12
/ (@jump_count + 1)
@real_y = (@real_y * @jump_count + @y * 12
/ (@jump_count + 1)
if @jump_count == 0
@revise_x = 0
@revise_y = 0
end
end
#--------------------------------------------------------------------------
# œ ˆÚ“®ƒ^ƒCƒv : ƒJƒXƒ^ƒ€
#--------------------------------------------------------------------------
def move_type_custom
unless @dot_m
super
return
end
# ’âŽ~’†‚łȂ¯‚ê‚Î’†’f
if jumping? or moving_a?
return
end
# ˆÚ“®ƒRƒ}ƒ“ƒh‚ÌƒŠƒXƒg‚ÌÅŒã‚É“ž’B‚·‚é‚܂Ń‹[ƒv
while @move_route_index < @move_route.list.size
# ˆÚ“®ƒRƒ}ƒ“ƒh‚ðŽæ“¾
command = @move_route.list[@move_route_index]
# ƒRƒ}ƒ“ƒhƒR[ƒh 0 ”Ô (ƒŠƒXƒg‚ÌÅŒã) ‚Ìê‡
if command.code == 0
# ƒIƒvƒVƒ‡ƒ“ [“®ì‚ðŒJ‚è•Ô‚·] ‚ª ON ‚Ìê‡
if @move_route.repeat
# ˆÚ“®ƒ‹[ƒg‚̃Cƒ“ƒfƒbƒNƒX‚ðʼn‚É–ß‚·
@move_route_index = 0
end
# ƒIƒvƒVƒ‡ƒ“ [“®ì‚ðŒJ‚è•Ô‚·] ‚ª OFF ‚Ìê‡
unless @move_route.repeat
# ˆÚ“®ƒ‹[ƒg‹§’†‚Ìê‡
if @move_route_forcing and not @move_route.repeat
# ˆÚ“®ƒ‹[ƒg‚Ì‹§‚ð‰ðœ
@move_route_forcing = false
# ƒIƒŠƒWƒiƒ‹‚̈ړ®ƒ‹[ƒg‚𕜋A
@move_route = @original_move_route
@move_route_index = @original_move_route_index
@original_move_route = nil
end
# ’âŽ~ƒJƒEƒ“ƒg‚ðƒNƒŠƒA
@stop_count = 0
end
return
end
# ˆÚ“®ŒnƒRƒ}ƒ“ƒh (‰º‚Ɉړ®`ƒWƒƒƒ“ƒv) ‚Ìê‡
if command.code <= 14
# ƒRƒ}ƒ“ƒhƒR[ƒh‚Å•ªŠò
case command.code
when 1 # ‰º‚Ɉړ®
move_down
when 2 # ¶‚Ɉړ®
move_left
when 3 # ‰E‚Ɉړ®
move_right
when 4 # ã‚Ɉړ®
move_up
when 5 # ¶‰º‚Ɉړ®
move_lower_left
when 6 # ‰E‰º‚Ɉړ®
move_lower_right
when 7 # ¶ã‚Ɉړ®
move_upper_left
when 8 # ‰Eã‚Ɉړ®
move_upper_right
when 9 # ƒ‰ƒ“ƒ_ƒ€‚Ɉړ®
move_random
when 10 # ƒvƒŒƒCƒ„[‚ɋ߂Â
move_toward_player
when 11 # ƒvƒŒƒCƒ„[‚©‚牓‚´‚©‚é
move_away_from_player
when 12 # ˆê•à‘Oi
move_forward
when 13 # ˆê•àŒã‘Þ
move_backward
when 14 # ƒWƒƒƒ“ƒv
jump(command.parameters[0], command.parameters[1])
end
# ƒIƒvƒVƒ‡ƒ“ [ˆÚ“®‚Å‚«‚È‚¢ê‡‚Í–³Ž‹] ‚ª OFF ‚ÅAˆÚ“®Ž¸”s‚Ìê‡
if not @move_route.skippable and not moving? and not jumping?
return
end
@move_route_index += 1
return
end
# ƒEƒFƒCƒg‚Ìê‡
if command.code == 15
# ƒEƒFƒCƒgƒJƒEƒ“ƒg‚ðÝ’è
@wait_count = command.parameters[0] * 2 - 1
@move_route_index += 1
return
end
# Œü‚«•ÏXŒn‚̃Rƒ}ƒ“ƒh‚Ìê‡
if command.code >= 16 and command.code <= 26
# ƒRƒ}ƒ“ƒhƒR[ƒh‚Å•ªŠò
case command.code
when 16 # ‰º‚ðŒü‚
turn_down
when 17 # ¶‚ðŒü‚
turn_left
when 18 # ‰E‚ðŒü‚
turn_right
when 19 # ã‚ðŒü‚
turn_up
when 20 # ‰E‚É 90 “x‰ñ“]
turn_right_90
when 21 # ¶‚É 90 “x‰ñ“]
turn_left_90
when 22 # 180 “x‰ñ“]
turn_180
when 23 # ‰E‚©¶‚É 90 “x‰ñ“]
turn_right_or_left_90
when 24 # ƒ‰ƒ“ƒ_ƒ€‚É•ûŒü“]Š·
turn_random
when 25 # ƒvƒŒƒCƒ„[‚Ì•û‚ðŒü‚
turn_toward_player
when 26 # ƒvƒŒƒCƒ„[‚Ì‹t‚ðŒü‚
turn_away_from_player
end
@move_route_index += 1
return
end
# ‚»‚Ì‘¼‚̃Rƒ}ƒ“ƒh‚Ìê‡
if command.code >= 27
# ƒRƒ}ƒ“ƒhƒR[ƒh‚Å•ªŠò
case command.code
when 27 # ƒXƒCƒbƒ` ON
$game_switches[command.parameters[0]] = true
$game_map.need_refresh = true
when 28 # ƒXƒCƒbƒ` OFF
$game_switches[command.parameters[0]] = false
$game_map.need_refresh = true
when 29 # ˆÚ“®‘¬“x‚Ì•ÏX
@move_speed = command.parameters[0]
when 30 # ˆÚ“®•p“x‚Ì•ÏX
@move_frequency = command.parameters[0]
when 31 # ˆÚ“®ŽžƒAƒjƒ ON
@walk_anime = true
when 32 # ˆÚ“®ŽžƒAƒjƒ OFF
@walk_anime = false
when 33 # ’âŽ~ŽžƒAƒjƒ ON
@step_anime = true
when 34 # ’âŽ~ŽžƒAƒjƒ OFF
@step_anime = false
when 35 # Œü‚«ŒÅ’è ON
@direction_fix = true
when 36 # Œü‚«ŒÅ’è OFF
@direction_fix = false
when 37 # ‚·‚蔲‚¯ ON
@through = true
when 38 # ‚·‚蔲‚¯ OFF
@through = false
when 39 # Å‘O–ʂɕ\ަ ON
@always_on_top = true
when 40 # Å‘O–ʂɕ\ަ OFF
@always_on_top = false
when 41 # ƒOƒ‰ƒtƒBƒbƒN•ÏX
@tile_id = 0
@character_name = command.parameters[0]
@character_hue = command.parameters[1]
if @original_direction != command.parameters[2]
@direction = command.parameters[2]
@original_direction = @direction
@prelock_direction = 0
end
if @original_pattern != command.parameters[3]
@pattern = command.parameters[3]
@original_pattern = @pattern
end
when 42 # •s“§–¾“x‚Ì•ÏX
@opacity = command.parameters[0]
when 43 # ‡¬•û–@‚Ì•ÏX
@blend_type = command.parameters[0]
when 44 # SE ‚̉‰‘t
$game_system.se_play(command.parameters[0])
when 45 # ƒXƒNƒŠƒvƒg
result = eval(command.parameters[0])
end
@move_route_index += 1
return
end
end
end
#--------------------------------------------------------------------------
# œ ‰º‚Ɉړ®
#--------------------------------------------------------------------------
def move_down_p
# ‰º‚ðŒü‚
turn_down
# ˆÚ“®‹——£‚ðŽZo
distance = 2 ** @move_speed
down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
# œ ‰º‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚P
#--------------------------------------------------------------------------
def down1(x, y, distance, down = false)
result = down2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x, y+1)
return result
end
if @revise_x < -SIDE
result = down2(x, y + 1, distance, 4)
result &= down2(x - 1, y, distance)
if result == false
if down
move_lower_right_p
if @revise_x > SIDE
@revise_x = SIDE
end
end
return result
end
elsif @revise_x > SIDE
result = down2(x, y + 1, distance, 6)
result &= down2(x + 1, y, distance)
if result == false
if down
move_lower_left_p
if @revise_x < -SIDE
@revise_x = -SIDE
end
end
return result
end
end
# ‰º‚Ɉړ®‰Â”\‚È‚ç‚΋——£•ªˆÚ“®
@revise_y += distance
return result
end
#--------------------------------------------------------------------------
# œ ‰º‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚Q
#--------------------------------------------------------------------------
def down2(x, y, distance, d = 2)
if @revise_y + distance > 0
unless passable?(x, y, d)
if @revise_y < 0
@revise_y = 0
end
return false
end
end
return true
end
#--------------------------------------------------------------------------
# œ ¶‚Ɉړ®
#--------------------------------------------------------------------------
def move_left_p
# ¶‚ðŒü‚
turn_left
distance = 2 ** @move_speed
left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
# œ ¶‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚P
#--------------------------------------------------------------------------
def left1(x, y, distance, left = false)
result = left2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x-1, y)
return result
end
if @revise_y < -UP
result = left2(x - 1, y, distance,
result &= left2(x, y - 1, distance)
if result == false
if left
move_lower_left_p
if @revise_y > 0
@revise_y = 0
end
end
return result
end
elsif @revise_y > 0
result = left2(x - 1, y, distance, 2)
result &= left2(x, y + 1, distance)
if result == false
if left
move_upper_left_p
if @revise_y < -UP
@revise_y = -UP
end
end
return result
end
end
@revise_x -= distance
return result
end
#--------------------------------------------------------------------------
# œ ¶‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚Q
#--------------------------------------------------------------------------
def left2(x, y, distance, d = 4)
if @revise_x - distance < -SIDE
unless passable?(x, y, d)
if @revise_x > -SIDE
@revise_x = -SIDE
end
return false
end
end
return true
end
#--------------------------------------------------------------------------
# œ ‰E‚Ɉړ®
#--------------------------------------------------------------------------
def move_right_p
# ‰E‚ðŒü‚
turn_right
distance = 2 ** @move_speed
right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
# œ ‰E‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚P
#--------------------------------------------------------------------------
def right1(x, y, distance, right = false)
result = right2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x+1, y)
return result
end
if @revise_y < -UP
result = right2(x + 1, y, distance,
result &= right2(x, y - 1, distance)
if result == false
if right
move_lower_right_p
if @revise_y > 0
@revise_y = 0
end
end
return result
end
elsif @revise_y > 0
result = right2(x + 1, y, distance, 2)
result &= right2(x, y + 1, distance)
if result == false
if right
move_upper_right_p
if @revise_y < -UP
@revise_y = -UP
end
end
return result
end
end
@revise_x += distance
return result
end
#--------------------------------------------------------------------------
# œ ‰E‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚Q
#--------------------------------------------------------------------------
def right2(x, y, distance, d = 6)
if @revise_x + distance > SIDE
unless passable?(x, y, d)
if @revise_x < SIDE
@revise_x = SIDE
end
return false
end
end
return true
end
#--------------------------------------------------------------------------
# œ ã‚Ɉړ®
#--------------------------------------------------------------------------
def move_up_p
# ã‚ðŒü‚
turn_up
# ‰º‚Ɉړ®
distance = 2 ** @move_speed
up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
# œ ã‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚P
#--------------------------------------------------------------------------
def up1(x, y, distance, up = false)
result = up2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x, y-1)
return result
end
if @revise_x < -SIDE
result = up2(x, y - 1, distance, 4)
result &= up2(x - 1, y, distance)
if result == false
if up
move_upper_right_p
if @revise_x > SIDE
@revise_x = SIDE
end
end
return result
end
elsif @revise_x > SIDE
result = up2(x, y - 1, distance, 6)
result &= up2(x + 1, y, distance)
if result == false
if up
move_upper_left_p
if @revise_x < -SIDE
@revise_x = -SIDE
end
end
return result
end
end
@revise_y -= distance
return result
end
#--------------------------------------------------------------------------
# œ ã‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚Q
#--------------------------------------------------------------------------
def up2(x, y, distance, d =
if @revise_y - distance < -UP
unless passable?(x, y, d)
if @revise_y > -UP
@revise_y = -UP
end
return false
end
end
return true
end
#--------------------------------------------------------------------------
# œ ¶‰º‚Ɉړ®
#--------------------------------------------------------------------------
def move_lower_left_p
# Œü‚«ŒÅ’è‚łȂ¢ê‡
unless @direction_fix
# ‰EŒü‚«‚¾‚Á‚½ê‡‚Ͷ‚ðAãŒü‚«‚¾‚Á‚½ê‡‚͉º‚ðŒü‚
@direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
end
# ¶‰º‚Ɉړ®
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 2
turn_left unless down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 2, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_y > 0 and -UP > @revise_y - distance
@revise_y = 0
end
turn_down unless left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
end
else
turn_down unless left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 4, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_x + distance> SIDE and -SIDE > @revise_x
@revise_x = -SIDE
end
turn_left unless down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
end
end
end
#--------------------------------------------------------------------------
# œ ‰E‰º‚Ɉړ®
#--------------------------------------------------------------------------
def move_lower_right_p
# Œü‚«ŒÅ’è‚łȂ¢ê‡
unless @direction_fix
# ¶Œü‚«‚¾‚Á‚½ê‡‚͉E‚ðAãŒü‚«‚¾‚Á‚½ê‡‚͉º‚ðŒü‚
@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
end
# ‰E‰º‚Ɉړ®
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 2
turn_right unless down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 2, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_y > 0 and -UP > @revise_y - distance
@revise_y = 0
end
turn_down unless right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
end
else
turn_down unless right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 6, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_x > SIDE and -SIDE > @revise_x - distance
@revise_x = SIDE
end
turn_right unless down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
end
end
end
#--------------------------------------------------------------------------
# œ ¶ã‚Ɉړ®
#--------------------------------------------------------------------------
def move_upper_left_p
# Œü‚«ŒÅ’è‚łȂ¢ê‡
unless @direction_fix
# ‰EŒü‚«‚¾‚Á‚½ê‡‚Ͷ‚ðA‰ºŒü‚«‚¾‚Á‚½ê‡‚Íã‚ðŒü‚
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end
# ¶ã‚Ɉړ®
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 8
turn_left unless up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 8, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_y + distance > 0 and -UP > @revise_y
@revise_y = -UP
end
turn_up unless left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
end
else
turn_up unless left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 4, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_x > SIDE and -SIDE > @revise_x - distance
@revise_x = SIDE
end
turn_left unless up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
end
end
end
#--------------------------------------------------------------------------
# œ ‰Eã‚Ɉړ®
#--------------------------------------------------------------------------
def move_upper_right_p
# Œü‚«ŒÅ’è‚łȂ¢ê‡
unless @direction_fix
# ¶Œü‚«‚¾‚Á‚½ê‡‚͉E‚ðA‰ºŒü‚«‚¾‚Á‚½ê‡‚Íã‚ðŒü‚
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end
# ‰Eã‚Ɉړ®
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 8
turn_right unless up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 8, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_y + distance > 0 and -UP > @revise_y
@revise_y = -UP
end
turn_up unless right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
end
else
turn_up unless right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 6, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_x > SIDE and -SIDE > @revise_x - distance
@revise_x = SIDE
end
turn_right unless up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
end
end
end
#--------------------------------------------------------------------------
# œ “¯ˆÊ’u‚̃Cƒxƒ“ƒg‹N“®”»’è
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers, run = true)
result = false
# ƒCƒxƒ“ƒgŽÀs’†‚Ìê‡
if $game_system.map_interpreter.running?
return result
end
# ‘SƒCƒxƒ“ƒg‚̃‹[ƒv
for event in $game_map.events.values
# ƒCƒxƒ“ƒg‚ÌÀ•W‚ƃgƒŠƒK[‚ªˆê’v‚µ‚½ê‡
if event.x == ((@x * 128 + @revise_x) / 128.0).round and
event.y == ((@y * 128 + @revise_y) / 128.0).round and
triggers.include?(event.trigger)
# ƒWƒƒƒ“ƒv’†ˆÈŠO‚ÅA‹N“®”»’肪“¯ˆÊ’u‚̃Cƒxƒ“ƒg‚È‚ç
if not event.jumping? and event.over_trigger?
if event.list.size > 1
if run == true
event.start
end
result = true
end
end
end
end
return result
end
#--------------------------------------------------------------------------
# œ À•WC³
#--------------------------------------------------------------------------
def move_on
if @y < (@y + @revise_y / 128.0).round
@y += 1
@revise_y -= 128
end
if @x > (@x + @revise_x / 128.0).round
@x -= 1
@revise_x += 128
end
if @x < (@x + @revise_x / 128.0).round
@x += 1
@revise_x -= 128
end
if @y > (@y + @revise_y / 128.0).round
@y -= 1
@revise_y += 128
end
end
#--------------------------------------------------------------------------
# œ ƒAƒjƒ[ƒVƒ‡ƒ“ƒAƒbƒvƒf[ƒg
#--------------------------------------------------------------------------
def anime_update
# ˆÚ“®ŽžƒAƒjƒ‚ª ON ‚Ìê‡
if @walk_anime
# ƒAƒjƒƒJƒEƒ“ƒg‚ð 1.5 ‘‚â‚·
@anime_count += 1.5
# ˆÚ“®ŽžƒAƒjƒ‚ª OFF ‚ÅA’âŽ~ŽžƒAƒjƒ‚ª ON ‚Ìê‡
elsif @step_anime
# ƒAƒjƒƒJƒEƒ“ƒg‚ð 1 ‘‚â‚·
@anime_count += 1
end
# ƒAƒjƒƒJƒEƒ“ƒg‚ªÅ‘å’l‚ð’´‚¦‚½ê‡
# ¦Å‘å’l‚ÍAŠî–{’l 18 ‚©‚çˆÚ“®‘¬“x * 1 ‚ðˆø‚¢‚½’l
if @anime_count > 18 - @move_speed * 2
# ’âŽ~ŽžƒAƒjƒ‚ª OFF ‚©‚ ’âŽ~’†‚Ìê‡
if not @step_anime and @stop_count > 0
# ƒpƒ^[ƒ“‚ðƒIƒŠƒWƒiƒ‹‚É–ß‚·
@pattern = @original_pattern
# ’âŽ~ŽžƒAƒjƒ‚ª ON ‚Ü‚½‚Í ˆÚ“®’†‚Ìê‡
else
# ƒpƒ^[ƒ“‚ðXV
@pattern = (@pattern + 1) % 4
end
# ƒAƒjƒƒJƒEƒ“ƒg‚ðƒNƒŠƒA
@anime_count = 0
end
end
#--------------------------------------------------------------------------
# œ Žw’èˆÊ’u‚Ɉړ®
#--------------------------------------------------------------------------
# ƒIƒŠƒWƒiƒ‹‚̃Cƒxƒ“ƒg‚ð‰ü–¼
alias :moveto_original :moveto
def moveto(x, y)
# •â³À•W‚ð‰Šú‰»
@revise_x = 0
@revise_y = 0
# ƒIƒŠƒWƒiƒ‹‚̃Cƒxƒ“ƒg‚ðŒÄ‚Ño‚µ
moveto_original(x, y)
end
#--------------------------------------------------------------------------
# œ ˆÚ“®‚µ‚½‚©‚Ç‚¤‚©‚Ì”»’è
#--------------------------------------------------------------------------
def last_move?(x, y, direction, distance)
if direction == 2 or direction == 6
distance *= -1
end
if (direction == 2 or direction ==
and
(y / 128.0).round != ((y - distance) / 128.0).round
return true
end
if (direction == 4 or direction == 6) and
(x / 128.0).round != ((x - distance) / 128.0).round
return true
end
return false
end
end
#==============================================================================
# ¡ Game_Character (•ªŠ„’è‹` 1)
#------------------------------------------------------------------------------
# @ƒLƒƒƒ‰ƒNƒ^[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·B‚±‚̃Nƒ‰ƒX‚Í Game_Player ƒNƒ‰ƒX‚Æ Game_Event
# ƒNƒ‰ƒX‚̃X[ƒp[ƒNƒ‰ƒX‚Æ‚µ‚ÄŽg—p‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# œ ‰æ–Ê X À•W‚̎擾
#--------------------------------------------------------------------------
def screen_x
# ŽÀÀ•W‚ƃ}ƒbƒv‚Ì•\ަˆÊ’u‚©‚ç‰æ–ÊÀ•W‚ð‹‚ß‚é
return ((@real_x - $game_map.display_x) / 4).ceil + 16
end
#--------------------------------------------------------------------------
# œ ‰æ–Ê Y À•W‚̎擾
#--------------------------------------------------------------------------
def screen_y
# ŽÀÀ•W‚ƃ}ƒbƒv‚Ì•\ަˆÊ’u‚©‚ç‰æ–ÊÀ•W‚ð‹‚ß‚é
y = ((@real_y - $game_map.display_y) / 4).ceil + 32
# ƒWƒƒƒ“ƒvƒJƒEƒ“ƒg‚ɉž‚¶‚Ä Y À•W‚𬂳‚‚·‚é
if @jump_count >= @jump_peak
n = @jump_count - @jump_peak
else
n = @jump_peak - @jump_count
end
return y - (@jump_peak * @jump_peak - n * n) / 2
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ˆÚ“®)
#--------------------------------------------------------------------------
def update_move
# ˆÚ“®‘¬“x‚©‚çƒ}ƒbƒvÀ•WŒn‚ł̈ړ®‹——£‚ɕϊ·
distance = 2 ** @move_speed
if @x * 128 != @real_x and @y * 128 != @real_y and Game_Player::SLANT
distance /= Math.sqrt(2)
end
# ˜_—À•W‚ªŽÀÀ•W‚æ‚艺‚Ìê‡
if @y * 128 > @real_y
# ‰º‚Ɉړ®
@real_y = [@real_y + distance, @y * 128].min
end
# ˜_—À•W‚ªŽÀÀ•W‚æ‚è¶‚Ìê‡
if @x * 128 < @real_x
# ¶‚Ɉړ®
@real_x = [@real_x - distance, @x * 128].max
end
# ˜_—À•W‚ªŽÀÀ•W‚æ‚è‰E‚Ìê‡
if @x * 128 > @real_x
# ‰E‚Ɉړ®
@real_x = [@real_x + distance, @x * 128].min
end
# ˜_—À•W‚ªŽÀÀ•W‚æ‚èã‚Ìê‡
if @y * 128 < @real_y
# ã‚Ɉړ®
@real_y = [@real_y - distance, @y * 128].max
end
# ˆÚ“®ŽžƒAƒjƒ‚ª ON ‚Ìê‡
if @walk_anime
# ƒAƒjƒƒJƒEƒ“ƒg‚ð 1.5 ‘‚â‚·
@anime_count += 1.5
# ˆÚ“®ŽžƒAƒjƒ‚ª OFF ‚ÅA’âŽ~ŽžƒAƒjƒ‚ª ON ‚Ìê‡
elsif @step_anime
# ƒAƒjƒƒJƒEƒ“ƒg‚ð 1 ‘‚â‚·
@anime_count += 1
end
end
end
#==============================================================================
# ¡ Game_Event
#------------------------------------------------------------------------------
# @ƒCƒxƒ“ƒg‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·BðŒ”»’è‚É‚æ‚éƒCƒxƒ“ƒgƒy[ƒWØ‚è‘Ö‚¦‚âA•À—ñˆ—
# ƒCƒxƒ“ƒgŽÀs‚Ȃǂ̋@”\‚ðŽ‚Á‚Ä‚¨‚èAGame_Map ƒNƒ‰ƒX‚Ì“à•”‚ÅŽg—p‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# œ ƒCƒxƒ“ƒg‹N“®
#--------------------------------------------------------------------------
def start
# ŽÀs“à—e‚ª‹ó‚łȂ¢ê‡
if @list.size > 1
# $game_player.event ‚ª0‚łȂ¢ê‡
if $game_player.event != 0
# ˆÚ“®‘¬“x‚ð $game_player.event ‚É‚·‚é
$game_player.move_speed = $game_player.event
elsif self.trigger == 0
$game_player.move_speed = $game_player.walk
end
@starting = true
end
end
end
# ¡ Game_Player
#------------------------------------------------------------------------------
# @ƒvƒŒƒCƒ„[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·BƒCƒxƒ“ƒg‚Ì‹N“®”»’è‚âAƒ}ƒbƒv‚̃XƒNƒ[ƒ‹‚ȂǂÌ
# ‹@”\‚ðŽ‚Á‚Ä‚¢‚Ü‚·B‚±‚̃Nƒ‰ƒX‚̃Cƒ“ƒXƒ^ƒ“ƒX‚Í $game_player ‚ÅŽQÆ‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# œ ’è”
#--------------------------------------------------------------------------
UP = 0 # ã•ûŒü‚Ì—]—T(0 <= UP <= 63)
SIDE = 0 # ¶‰E•ûŒü‚Ì—]—T(0 <= SIDE <= 63)
SLANT = false # ˆÚ“®ƒ‹[ƒg‚̎΂߈ړ®ŽžA‘¬“xC³
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_reader :walk # ƒvƒŒ[ƒ„[ˆÚ“®‘¬“x
attr_reader :event # ƒCƒxƒ“ƒgŽžˆÚ“®‘¬“x
attr_accessor :move_speed # ˆÚ“®‘¬“x
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
super
# @walk:•às‘¬“x @dash:ƒ_ƒbƒVƒ…ŽžˆÚ“®‘¬“x
# @event:ƒCƒxƒ“ƒgŽžˆÚ“®‘¬“xi0‚ÌŽž‚ÍAƒCƒxƒ“ƒgŽž‚É‘¬“x•ÏX‚ð‚µ‚È‚¢j
@walk = 4
@dash = 5
@event = 4
@dot_m = true
@revise_x = 0
@revise_y = 0
@move == false
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
alias :update_original :update
def update
#ƒ_ƒbƒVƒ…‹@”\BƒGƒ“ƒ^[ƒL[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚éŠÔAˆÚ“®‘¬“x‚ð•ÏX‚·‚éB
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if @walk != @dash
if Input.press?(Input::C)
if @move_speed != @dash
@move_speed = @dash
end
else
if @move_speed != @walk
@move_speed = @walk
end
end
end
end
if @revise_x == nil and @revise_y == nil
@revise_x = 0
@revise_y = 0
end
unless @dot_m
update_original
return
end
if @move_route_forcing
# ƒ[ƒJƒ‹•Ï”‚Ɉړ®’†‚©‚Ç‚¤‚©‚ð‹L‰¯
last_moving = moving?
# ƒ[ƒJƒ‹•Ï”‚ÉÀ•W‚ð‹L‰¯
last_real_x = @real_x
last_real_y = @real_y
# À•W‚ª‚¸‚ê‚Ä‚¢‚éê‡
if (@revise_x != 0 or @revise_y != 0) and not jumping? and @move == true
if @revise_x != @real_x - @x * 128 or @revise_y != @real_y - @y * 128
@revise_x = @real_x - @x * 128
@revise_y = @real_y - @y * 128
end
# ˆÚ“®‹——£distance1‚Æ–Ú•W‹——£distance2‚ðÝ’è
distance1 = 2 ** @move_speed
distance2 = Math.sqrt(@revise_x ** 2 + @revise_y ** 2)
# ˆÚ“®‹——£‚ª–Ú•W‹——£‚ð‰z‚¦‚½ê‡
if distance1 > distance2
# ‹§“I‚É•â³À•W‚ð—ë‚É‚·‚é
@real_x = @real_x - @revise_x
@real_y = @real_y - @revise_y
@revise_x = 0
@revise_y = 0
anime_update
# ˆÚ“®‹——£‚ª–Ú•W‹——£‚É’B‚µ‚È‚¢ê‡
else
# ˆÚ“®‹——£•ª–Ú•W‹——£‚ɋ߂Â
@real_x -= (distance1 * @revise_x / distance2).round
@real_y -= (distance1 * @revise_y / distance2).round
@revise_x = @real_x - @x * 128
@revise_y = @real_y - @y * 128
anime_update
end
else
super
end
else
@move = false
# ˆÚ“®’†AƒCƒxƒ“ƒgŽÀs’†AˆÚ“®ƒ‹[ƒg‹§’†A
# ƒƒbƒZ[ƒWƒEƒBƒ“ƒhƒE•\ަ’†‚Ì‚¢‚¸‚ê‚Å‚à‚È‚¢ê‡
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
@event_run = false
# •ûŒüƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ê‚Ä‚¢‚ê‚ÎA‚»‚Ì•ûŒü‚ÖƒvƒŒƒCƒ„[‚ðˆÚ“®
case Input.dir8
when 1
move_lower_left_p
when 2
move_down_p
when 3
move_lower_right_p
when 4
move_left_p
when 6
move_right_p
when 7
move_upper_left_p
when 8
move_up_p
when 9
move_upper_right_p
end
end
# ƒ[ƒJƒ‹•Ï”‚ÉÀ•W‚ð‹L‰¯
last_real_x = @real_x
last_real_y = @real_y
# ˆÚ“®ˆ—
@real_x = @x * 128 + @revise_x
@real_y = @y * 128 + @revise_y
# ƒ[ƒJƒ‹•Ï”‚Ɉړ®’†‚©‚Ç‚¤‚©‚ð‹L‰¯
last_moving = moving?
# ˥WXV
move_on
# Œ»Ý‚ÌÀ•W‚ƈȑO‚ÌÀ•W‚ªˆÙ‚È‚éê‡
if (last_real_x != @real_x or last_real_y != @real_y)
@move_distance = 0 if @move_distance == nil
@move_distance += Math.sqrt((last_real_x - @real_x) ** 2 +
(last_real_y - @real_y) ** 2)
if @move_distance >= 128
@move_distance %= 128
increase_steps
end
# ƒAƒjƒ[ƒVƒ‡ƒ“‚ðXV
anime_update
elsif @walk_anime
@pattern = @original_pattern
end
end
# ƒLƒƒƒ‰ƒNƒ^[‚ª‰º‚Ɉړ®‚µA‚©‚‰æ–Êã‚̈ʒu‚ª’†‰›‚æ‚艺‚Ìê‡
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
# ƒ}ƒbƒv‚ð‰º‚ÉƒXƒNƒ[ƒ‹
$game_map.scroll_down(@real_y - last_real_y)
end
# ƒLƒƒƒ‰ƒNƒ^[‚ª¶‚Ɉړ®‚µA‚©‚‰æ–Êã‚̈ʒu‚ª’†‰›‚æ‚è¶‚Ìê‡
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
# ƒ}ƒbƒv‚ð¶‚ɃXƒNƒ[ƒ‹
$game_map.scroll_left(last_real_x - @real_x)
end
# ƒLƒƒƒ‰ƒNƒ^[‚ª‰E‚Ɉړ®‚µA‚©‚‰æ–Êã‚̈ʒu‚ª’†‰›‚æ‚è‰E‚Ìê‡
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
# ƒ}ƒbƒv‚ð‰E‚ɃXƒNƒ[ƒ‹
$game_map.scroll_right(@real_x - last_real_x)
end
# ƒLƒƒƒ‰ƒNƒ^[‚ªã‚Ɉړ®‚µA‚©‚‰æ–Êã‚̈ʒu‚ª’†‰›‚æ‚èã‚Ìê‡
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
# ƒ}ƒbƒv‚ðã‚ɃXƒNƒ[ƒ‹
$game_map.scroll_up(last_real_y - @real_y)
end
# ‘O‰ñƒvƒŒƒCƒ„[‚ªˆÚ“®’†‚¾‚Á‚½ê‡
if last_moving
# “¯ˆÊ’u‚̃Cƒxƒ“ƒg‚Æ‚ÌÚG‚É‚æ‚éƒCƒxƒ“ƒg‹N“®”»’è
result = check_event_trigger_here([1,2])
if result == true
if (last_real_x / 128.0).round != @x and
(last_real_y / 128.0).round != @y
if @direction == 2 or @direction == 8
if (last_real_x / 128.0).round > @x
turn_left
else
turn_right
end
else
if (last_real_y / 128.0).round > @y
turn_up
else
turn_down
end
end
elsif (last_real_x / 128.0).round > @x
turn_left
elsif (last_real_x / 128.0).round < @x
turn_right
elsif (last_real_y / 128.0).round > @y
turn_up
elsif (last_real_y / 128.0).round < @y
turn_down
end
end
# ‹N“®‚µ‚½ƒCƒxƒ“ƒg‚ª‚È‚¢ê‡
if result == false
# ƒfƒoƒbƒOƒ‚[ƒh‚ª ON ‚©‚ CTRL ƒL[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚éꇂ𜂫
unless $DEBUG and Input.press?(Input::CTRL)
# ƒGƒ“ƒJƒEƒ“ƒg ƒJƒEƒ“ƒgƒ_ƒEƒ“
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# “¯ˆÊ’u‚¨‚æ‚ѳ–ʂ̃Cƒxƒ“ƒg‹N“®”»’è
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
#--------------------------------------------------------------------------
# œ ˆÚ“®”»’è
#--------------------------------------------------------------------------
def moving?
unless @dot_m
result = super
return result
end
# ‹§ˆÚ“®‚ÌꇃIƒŠƒWƒiƒ‹‚Ì”»’è‚ð‚³‚¹‚é
if @move_route_forcing
if @move == false
return false
end
super
# ’Ê펞‚ÍŒ»À•W‚ªŽÀÀ•W‚ƈقȂéꇂ݈̂ړ®’†‚Æ”»’è
else
return (@x != (@real_x / 128.0).round or @y != (@real_y / 128.0).round)
end
end
#--------------------------------------------------------------------------
# œ ˆÚ“®”»’è
#--------------------------------------------------------------------------
def moving_a?
if @move == false
if (@move_route.list[@move_route_index].code <= 14 or
@move_route.list[@move_route_index].code == 25)
@move = true
end
return false
end
moving?
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒWƒƒƒ“ƒv)
#--------------------------------------------------------------------------
def update_jump
# ƒWƒƒƒ“ƒvƒJƒEƒ“ƒg‚ð 1 Œ¸‚ç‚·
@jump_count -= 1
# V‚µ‚¢À•W‚ðŒvŽZ
@real_x = (@real_x * @jump_count + @x * 12
/ (@jump_count + 1)@real_y = (@real_y * @jump_count + @y * 12
/ (@jump_count + 1)if @jump_count == 0
@revise_x = 0
@revise_y = 0
end
end
#--------------------------------------------------------------------------
# œ ˆÚ“®ƒ^ƒCƒv : ƒJƒXƒ^ƒ€
#--------------------------------------------------------------------------
def move_type_custom
unless @dot_m
super
return
end
# ’âŽ~’†‚łȂ¯‚ê‚Î’†’f
if jumping? or moving_a?
return
end
# ˆÚ“®ƒRƒ}ƒ“ƒh‚ÌƒŠƒXƒg‚ÌÅŒã‚É“ž’B‚·‚é‚܂Ń‹[ƒv
while @move_route_index < @move_route.list.size
# ˆÚ“®ƒRƒ}ƒ“ƒh‚ðŽæ“¾
command = @move_route.list[@move_route_index]
# ƒRƒ}ƒ“ƒhƒR[ƒh 0 ”Ô (ƒŠƒXƒg‚ÌÅŒã) ‚Ìê‡
if command.code == 0
# ƒIƒvƒVƒ‡ƒ“ [“®ì‚ðŒJ‚è•Ô‚·] ‚ª ON ‚Ìê‡
if @move_route.repeat
# ˆÚ“®ƒ‹[ƒg‚̃Cƒ“ƒfƒbƒNƒX‚ðʼn‚É–ß‚·
@move_route_index = 0
end
# ƒIƒvƒVƒ‡ƒ“ [“®ì‚ðŒJ‚è•Ô‚·] ‚ª OFF ‚Ìê‡
unless @move_route.repeat
# ˆÚ“®ƒ‹[ƒg‹§’†‚Ìê‡
if @move_route_forcing and not @move_route.repeat
# ˆÚ“®ƒ‹[ƒg‚Ì‹§‚ð‰ðœ
@move_route_forcing = false
# ƒIƒŠƒWƒiƒ‹‚̈ړ®ƒ‹[ƒg‚𕜋A
@move_route = @original_move_route
@move_route_index = @original_move_route_index
@original_move_route = nil
end
# ’âŽ~ƒJƒEƒ“ƒg‚ðƒNƒŠƒA
@stop_count = 0
end
return
end
# ˆÚ“®ŒnƒRƒ}ƒ“ƒh (‰º‚Ɉړ®`ƒWƒƒƒ“ƒv) ‚Ìê‡
if command.code <= 14
# ƒRƒ}ƒ“ƒhƒR[ƒh‚Å•ªŠò
case command.code
when 1 # ‰º‚Ɉړ®
move_down
when 2 # ¶‚Ɉړ®
move_left
when 3 # ‰E‚Ɉړ®
move_right
when 4 # ã‚Ɉړ®
move_up
when 5 # ¶‰º‚Ɉړ®
move_lower_left
when 6 # ‰E‰º‚Ɉړ®
move_lower_right
when 7 # ¶ã‚Ɉړ®
move_upper_left
when 8 # ‰Eã‚Ɉړ®
move_upper_right
when 9 # ƒ‰ƒ“ƒ_ƒ€‚Ɉړ®
move_random
when 10 # ƒvƒŒƒCƒ„[‚ɋ߂Â
move_toward_player
when 11 # ƒvƒŒƒCƒ„[‚©‚牓‚´‚©‚é
move_away_from_player
when 12 # ˆê•à‘Oi
move_forward
when 13 # ˆê•àŒã‘Þ
move_backward
when 14 # ƒWƒƒƒ“ƒv
jump(command.parameters[0], command.parameters[1])
end
# ƒIƒvƒVƒ‡ƒ“ [ˆÚ“®‚Å‚«‚È‚¢ê‡‚Í–³Ž‹] ‚ª OFF ‚ÅAˆÚ“®Ž¸”s‚Ìê‡
if not @move_route.skippable and not moving? and not jumping?
return
end
@move_route_index += 1
return
end
# ƒEƒFƒCƒg‚Ìê‡
if command.code == 15
# ƒEƒFƒCƒgƒJƒEƒ“ƒg‚ðÝ’è
@wait_count = command.parameters[0] * 2 - 1
@move_route_index += 1
return
end
# Œü‚«•ÏXŒn‚̃Rƒ}ƒ“ƒh‚Ìê‡
if command.code >= 16 and command.code <= 26
# ƒRƒ}ƒ“ƒhƒR[ƒh‚Å•ªŠò
case command.code
when 16 # ‰º‚ðŒü‚
turn_down
when 17 # ¶‚ðŒü‚
turn_left
when 18 # ‰E‚ðŒü‚
turn_right
when 19 # ã‚ðŒü‚
turn_up
when 20 # ‰E‚É 90 “x‰ñ“]
turn_right_90
when 21 # ¶‚É 90 “x‰ñ“]
turn_left_90
when 22 # 180 “x‰ñ“]
turn_180
when 23 # ‰E‚©¶‚É 90 “x‰ñ“]
turn_right_or_left_90
when 24 # ƒ‰ƒ“ƒ_ƒ€‚É•ûŒü“]Š·
turn_random
when 25 # ƒvƒŒƒCƒ„[‚Ì•û‚ðŒü‚
turn_toward_player
when 26 # ƒvƒŒƒCƒ„[‚Ì‹t‚ðŒü‚
turn_away_from_player
end
@move_route_index += 1
return
end
# ‚»‚Ì‘¼‚̃Rƒ}ƒ“ƒh‚Ìê‡
if command.code >= 27
# ƒRƒ}ƒ“ƒhƒR[ƒh‚Å•ªŠò
case command.code
when 27 # ƒXƒCƒbƒ` ON
$game_switches[command.parameters[0]] = true
$game_map.need_refresh = true
when 28 # ƒXƒCƒbƒ` OFF
$game_switches[command.parameters[0]] = false
$game_map.need_refresh = true
when 29 # ˆÚ“®‘¬“x‚Ì•ÏX
@move_speed = command.parameters[0]
when 30 # ˆÚ“®•p“x‚Ì•ÏX
@move_frequency = command.parameters[0]
when 31 # ˆÚ“®ŽžƒAƒjƒ ON
@walk_anime = true
when 32 # ˆÚ“®ŽžƒAƒjƒ OFF
@walk_anime = false
when 33 # ’âŽ~ŽžƒAƒjƒ ON
@step_anime = true
when 34 # ’âŽ~ŽžƒAƒjƒ OFF
@step_anime = false
when 35 # Œü‚«ŒÅ’è ON
@direction_fix = true
when 36 # Œü‚«ŒÅ’è OFF
@direction_fix = false
when 37 # ‚·‚蔲‚¯ ON
@through = true
when 38 # ‚·‚蔲‚¯ OFF
@through = false
when 39 # Å‘O–ʂɕ\ަ ON
@always_on_top = true
when 40 # Å‘O–ʂɕ\ަ OFF
@always_on_top = false
when 41 # ƒOƒ‰ƒtƒBƒbƒN•ÏX
@tile_id = 0
@character_name = command.parameters[0]
@character_hue = command.parameters[1]
if @original_direction != command.parameters[2]
@direction = command.parameters[2]
@original_direction = @direction
@prelock_direction = 0
end
if @original_pattern != command.parameters[3]
@pattern = command.parameters[3]
@original_pattern = @pattern
end
when 42 # •s“§–¾“x‚Ì•ÏX
@opacity = command.parameters[0]
when 43 # ‡¬•û–@‚Ì•ÏX
@blend_type = command.parameters[0]
when 44 # SE ‚̉‰‘t
$game_system.se_play(command.parameters[0])
when 45 # ƒXƒNƒŠƒvƒg
result = eval(command.parameters[0])
end
@move_route_index += 1
return
end
end
end
#--------------------------------------------------------------------------
# œ ‰º‚Ɉړ®
#--------------------------------------------------------------------------
def move_down_p
# ‰º‚ðŒü‚
turn_down
# ˆÚ“®‹——£‚ðŽZo
distance = 2 ** @move_speed
down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
# œ ‰º‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚P
#--------------------------------------------------------------------------
def down1(x, y, distance, down = false)
result = down2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x, y+1)
return result
end
if @revise_x < -SIDE
result = down2(x, y + 1, distance, 4)
result &= down2(x - 1, y, distance)
if result == false
if down
move_lower_right_p
if @revise_x > SIDE
@revise_x = SIDE
end
end
return result
end
elsif @revise_x > SIDE
result = down2(x, y + 1, distance, 6)
result &= down2(x + 1, y, distance)
if result == false
if down
move_lower_left_p
if @revise_x < -SIDE
@revise_x = -SIDE
end
end
return result
end
end
# ‰º‚Ɉړ®‰Â”\‚È‚ç‚΋——£•ªˆÚ“®
@revise_y += distance
return result
end
#--------------------------------------------------------------------------
# œ ‰º‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚Q
#--------------------------------------------------------------------------
def down2(x, y, distance, d = 2)
if @revise_y + distance > 0
unless passable?(x, y, d)
if @revise_y < 0
@revise_y = 0
end
return false
end
end
return true
end
#--------------------------------------------------------------------------
# œ ¶‚Ɉړ®
#--------------------------------------------------------------------------
def move_left_p
# ¶‚ðŒü‚
turn_left
distance = 2 ** @move_speed
left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
# œ ¶‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚P
#--------------------------------------------------------------------------
def left1(x, y, distance, left = false)
result = left2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x-1, y)
return result
end
if @revise_y < -UP
result = left2(x - 1, y, distance,

result &= left2(x, y - 1, distance)
if result == false
if left
move_lower_left_p
if @revise_y > 0
@revise_y = 0
end
end
return result
end
elsif @revise_y > 0
result = left2(x - 1, y, distance, 2)
result &= left2(x, y + 1, distance)
if result == false
if left
move_upper_left_p
if @revise_y < -UP
@revise_y = -UP
end
end
return result
end
end
@revise_x -= distance
return result
end
#--------------------------------------------------------------------------
# œ ¶‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚Q
#--------------------------------------------------------------------------
def left2(x, y, distance, d = 4)
if @revise_x - distance < -SIDE
unless passable?(x, y, d)
if @revise_x > -SIDE
@revise_x = -SIDE
end
return false
end
end
return true
end
#--------------------------------------------------------------------------
# œ ‰E‚Ɉړ®
#--------------------------------------------------------------------------
def move_right_p
# ‰E‚ðŒü‚
turn_right
distance = 2 ** @move_speed
right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
# œ ‰E‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚P
#--------------------------------------------------------------------------
def right1(x, y, distance, right = false)
result = right2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x+1, y)
return result
end
if @revise_y < -UP
result = right2(x + 1, y, distance,

result &= right2(x, y - 1, distance)
if result == false
if right
move_lower_right_p
if @revise_y > 0
@revise_y = 0
end
end
return result
end
elsif @revise_y > 0
result = right2(x + 1, y, distance, 2)
result &= right2(x, y + 1, distance)
if result == false
if right
move_upper_right_p
if @revise_y < -UP
@revise_y = -UP
end
end
return result
end
end
@revise_x += distance
return result
end
#--------------------------------------------------------------------------
# œ ‰E‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚Q
#--------------------------------------------------------------------------
def right2(x, y, distance, d = 6)
if @revise_x + distance > SIDE
unless passable?(x, y, d)
if @revise_x < SIDE
@revise_x = SIDE
end
return false
end
end
return true
end
#--------------------------------------------------------------------------
# œ ã‚Ɉړ®
#--------------------------------------------------------------------------
def move_up_p
# ã‚ðŒü‚
turn_up
# ‰º‚Ɉړ®
distance = 2 ** @move_speed
up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
# œ ã‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚P
#--------------------------------------------------------------------------
def up1(x, y, distance, up = false)
result = up2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x, y-1)
return result
end
if @revise_x < -SIDE
result = up2(x, y - 1, distance, 4)
result &= up2(x - 1, y, distance)
if result == false
if up
move_upper_right_p
if @revise_x > SIDE
@revise_x = SIDE
end
end
return result
end
elsif @revise_x > SIDE
result = up2(x, y - 1, distance, 6)
result &= up2(x + 1, y, distance)
if result == false
if up
move_upper_left_p
if @revise_x < -SIDE
@revise_x = -SIDE
end
end
return result
end
end
@revise_y -= distance
return result
end
#--------------------------------------------------------------------------
# œ ã‚Ɉړ®‰Â”\‚©‚Ç‚¤‚©‚Ì”»’è‚Q
#--------------------------------------------------------------------------
def up2(x, y, distance, d =

if @revise_y - distance < -UP
unless passable?(x, y, d)
if @revise_y > -UP
@revise_y = -UP
end
return false
end
end
return true
end
#--------------------------------------------------------------------------
# œ ¶‰º‚Ɉړ®
#--------------------------------------------------------------------------
def move_lower_left_p
# Œü‚«ŒÅ’è‚łȂ¢ê‡
unless @direction_fix
# ‰EŒü‚«‚¾‚Á‚½ê‡‚Ͷ‚ðAãŒü‚«‚¾‚Á‚½ê‡‚͉º‚ðŒü‚
@direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
end
# ¶‰º‚Ɉړ®
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 2
turn_left unless down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 2, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_y > 0 and -UP > @revise_y - distance
@revise_y = 0
end
turn_down unless left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
end
else
turn_down unless left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 4, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_x + distance> SIDE and -SIDE > @revise_x
@revise_x = -SIDE
end
turn_left unless down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
end
end
end
#--------------------------------------------------------------------------
# œ ‰E‰º‚Ɉړ®
#--------------------------------------------------------------------------
def move_lower_right_p
# Œü‚«ŒÅ’è‚łȂ¢ê‡
unless @direction_fix
# ¶Œü‚«‚¾‚Á‚½ê‡‚͉E‚ðAãŒü‚«‚¾‚Á‚½ê‡‚͉º‚ðŒü‚
@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
end
# ‰E‰º‚Ɉړ®
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 2
turn_right unless down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 2, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_y > 0 and -UP > @revise_y - distance
@revise_y = 0
end
turn_down unless right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
end
else
turn_down unless right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 6, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_x > SIDE and -SIDE > @revise_x - distance
@revise_x = SIDE
end
turn_right unless down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
end
end
end
#--------------------------------------------------------------------------
# œ ¶ã‚Ɉړ®
#--------------------------------------------------------------------------
def move_upper_left_p
# Œü‚«ŒÅ’è‚łȂ¢ê‡
unless @direction_fix
# ‰EŒü‚«‚¾‚Á‚½ê‡‚Ͷ‚ðA‰ºŒü‚«‚¾‚Á‚½ê‡‚Íã‚ðŒü‚
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end
# ¶ã‚Ɉړ®
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 8
turn_left unless up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 8, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_y + distance > 0 and -UP > @revise_y
@revise_y = -UP
end
turn_up unless left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
end
else
turn_up unless left1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 4, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_x > SIDE and -SIDE > @revise_x - distance
@revise_x = SIDE
end
turn_left unless up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
end
end
end
#--------------------------------------------------------------------------
# œ ‰Eã‚Ɉړ®
#--------------------------------------------------------------------------
def move_upper_right_p
# Œü‚«ŒÅ’è‚łȂ¢ê‡
unless @direction_fix
# ¶Œü‚«‚¾‚Á‚½ê‡‚͉E‚ðA‰ºŒü‚«‚¾‚Á‚½ê‡‚Íã‚ðŒü‚
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end
# ‰Eã‚Ɉړ®
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 8
turn_right unless up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 8, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_y + distance > 0 and -UP > @revise_y
@revise_y = -UP
end
turn_up unless right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
end
else
turn_up unless right1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
unless @event_run
if last_move?(@real_x, @real_y, 6, distance)
result = check_event_trigger_here([1,2], false)
if result == true
return
end
end
move_on
if @revise_x > SIDE and -SIDE > @revise_x - distance
@revise_x = SIDE
end
turn_right unless up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
end
end
end
#--------------------------------------------------------------------------
# œ “¯ˆÊ’u‚̃Cƒxƒ“ƒg‹N“®”»’è
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers, run = true)
result = false
# ƒCƒxƒ“ƒgŽÀs’†‚Ìê‡
if $game_system.map_interpreter.running?
return result
end
# ‘SƒCƒxƒ“ƒg‚̃‹[ƒv
for event in $game_map.events.values
# ƒCƒxƒ“ƒg‚ÌÀ•W‚ƃgƒŠƒK[‚ªˆê’v‚µ‚½ê‡
if event.x == ((@x * 128 + @revise_x) / 128.0).round and
event.y == ((@y * 128 + @revise_y) / 128.0).round and
triggers.include?(event.trigger)
# ƒWƒƒƒ“ƒv’†ˆÈŠO‚ÅA‹N“®”»’肪“¯ˆÊ’u‚̃Cƒxƒ“ƒg‚È‚ç
if not event.jumping? and event.over_trigger?
if event.list.size > 1
if run == true
event.start
end
result = true
end
end
end
end
return result
end
#--------------------------------------------------------------------------
# œ À•WC³
#--------------------------------------------------------------------------
def move_on
if @y < (@y + @revise_y / 128.0).round
@y += 1
@revise_y -= 128
end
if @x > (@x + @revise_x / 128.0).round
@x -= 1
@revise_x += 128
end
if @x < (@x + @revise_x / 128.0).round
@x += 1
@revise_x -= 128
end
if @y > (@y + @revise_y / 128.0).round
@y -= 1
@revise_y += 128
end
end
#--------------------------------------------------------------------------
# œ ƒAƒjƒ[ƒVƒ‡ƒ“ƒAƒbƒvƒf[ƒg
#--------------------------------------------------------------------------
def anime_update
# ˆÚ“®ŽžƒAƒjƒ‚ª ON ‚Ìê‡
if @walk_anime
# ƒAƒjƒƒJƒEƒ“ƒg‚ð 1.5 ‘‚â‚·
@anime_count += 1.5
# ˆÚ“®ŽžƒAƒjƒ‚ª OFF ‚ÅA’âŽ~ŽžƒAƒjƒ‚ª ON ‚Ìê‡
elsif @step_anime
# ƒAƒjƒƒJƒEƒ“ƒg‚ð 1 ‘‚â‚·
@anime_count += 1
end
# ƒAƒjƒƒJƒEƒ“ƒg‚ªÅ‘å’l‚ð’´‚¦‚½ê‡
# ¦Å‘å’l‚ÍAŠî–{’l 18 ‚©‚çˆÚ“®‘¬“x * 1 ‚ðˆø‚¢‚½’l
if @anime_count > 18 - @move_speed * 2
# ’âŽ~ŽžƒAƒjƒ‚ª OFF ‚©‚ ’âŽ~’†‚Ìê‡
if not @step_anime and @stop_count > 0
# ƒpƒ^[ƒ“‚ðƒIƒŠƒWƒiƒ‹‚É–ß‚·
@pattern = @original_pattern
# ’âŽ~ŽžƒAƒjƒ‚ª ON ‚Ü‚½‚Í ˆÚ“®’†‚Ìê‡
else
# ƒpƒ^[ƒ“‚ðXV
@pattern = (@pattern + 1) % 4
end
# ƒAƒjƒƒJƒEƒ“ƒg‚ðƒNƒŠƒA
@anime_count = 0
end
end
#--------------------------------------------------------------------------
# œ Žw’èˆÊ’u‚Ɉړ®
#--------------------------------------------------------------------------
# ƒIƒŠƒWƒiƒ‹‚̃Cƒxƒ“ƒg‚ð‰ü–¼
alias :moveto_original :moveto
def moveto(x, y)
# •â³À•W‚ð‰Šú‰»
@revise_x = 0
@revise_y = 0
# ƒIƒŠƒWƒiƒ‹‚̃Cƒxƒ“ƒg‚ðŒÄ‚Ño‚µ
moveto_original(x, y)
end
#--------------------------------------------------------------------------
# œ ˆÚ“®‚µ‚½‚©‚Ç‚¤‚©‚Ì”»’è
#--------------------------------------------------------------------------
def last_move?(x, y, direction, distance)
if direction == 2 or direction == 6
distance *= -1
end
if (direction == 2 or direction ==
and(y / 128.0).round != ((y - distance) / 128.0).round
return true
end
if (direction == 4 or direction == 6) and
(x / 128.0).round != ((x - distance) / 128.0).round
return true
end
return false
end
end
#==============================================================================
# ¡ Game_Character (•ªŠ„’è‹` 1)
#------------------------------------------------------------------------------
# @ƒLƒƒƒ‰ƒNƒ^[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·B‚±‚̃Nƒ‰ƒX‚Í Game_Player ƒNƒ‰ƒX‚Æ Game_Event
# ƒNƒ‰ƒX‚̃X[ƒp[ƒNƒ‰ƒX‚Æ‚µ‚ÄŽg—p‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# œ ‰æ–Ê X À•W‚̎擾
#--------------------------------------------------------------------------
def screen_x
# ŽÀÀ•W‚ƃ}ƒbƒv‚Ì•\ަˆÊ’u‚©‚ç‰æ–ÊÀ•W‚ð‹‚ß‚é
return ((@real_x - $game_map.display_x) / 4).ceil + 16
end
#--------------------------------------------------------------------------
# œ ‰æ–Ê Y À•W‚̎擾
#--------------------------------------------------------------------------
def screen_y
# ŽÀÀ•W‚ƃ}ƒbƒv‚Ì•\ަˆÊ’u‚©‚ç‰æ–ÊÀ•W‚ð‹‚ß‚é
y = ((@real_y - $game_map.display_y) / 4).ceil + 32
# ƒWƒƒƒ“ƒvƒJƒEƒ“ƒg‚ɉž‚¶‚Ä Y À•W‚𬂳‚‚·‚é
if @jump_count >= @jump_peak
n = @jump_count - @jump_peak
else
n = @jump_peak - @jump_count
end
return y - (@jump_peak * @jump_peak - n * n) / 2
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ˆÚ“®)
#--------------------------------------------------------------------------
def update_move
# ˆÚ“®‘¬“x‚©‚çƒ}ƒbƒvÀ•WŒn‚ł̈ړ®‹——£‚ɕϊ·
distance = 2 ** @move_speed
if @x * 128 != @real_x and @y * 128 != @real_y and Game_Player::SLANT
distance /= Math.sqrt(2)
end
# ˜_—À•W‚ªŽÀÀ•W‚æ‚艺‚Ìê‡
if @y * 128 > @real_y
# ‰º‚Ɉړ®
@real_y = [@real_y + distance, @y * 128].min
end
# ˜_—À•W‚ªŽÀÀ•W‚æ‚è¶‚Ìê‡
if @x * 128 < @real_x
# ¶‚Ɉړ®
@real_x = [@real_x - distance, @x * 128].max
end
# ˜_—À•W‚ªŽÀÀ•W‚æ‚è‰E‚Ìê‡
if @x * 128 > @real_x
# ‰E‚Ɉړ®
@real_x = [@real_x + distance, @x * 128].min
end
# ˜_—À•W‚ªŽÀÀ•W‚æ‚èã‚Ìê‡
if @y * 128 < @real_y
# ã‚Ɉړ®
@real_y = [@real_y - distance, @y * 128].max
end
# ˆÚ“®ŽžƒAƒjƒ‚ª ON ‚Ìê‡
if @walk_anime
# ƒAƒjƒƒJƒEƒ“ƒg‚ð 1.5 ‘‚â‚·
@anime_count += 1.5
# ˆÚ“®ŽžƒAƒjƒ‚ª OFF ‚ÅA’âŽ~ŽžƒAƒjƒ‚ª ON ‚Ìê‡
elsif @step_anime
# ƒAƒjƒƒJƒEƒ“ƒg‚ð 1 ‘‚â‚·
@anime_count += 1
end
end
end
#==============================================================================
# ¡ Game_Event
#------------------------------------------------------------------------------
# @ƒCƒxƒ“ƒg‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·BðŒ”»’è‚É‚æ‚éƒCƒxƒ“ƒgƒy[ƒWØ‚è‘Ö‚¦‚âA•À—ñˆ—
# ƒCƒxƒ“ƒgŽÀs‚Ȃǂ̋@”\‚ðŽ‚Á‚Ä‚¨‚èAGame_Map ƒNƒ‰ƒX‚Ì“à•”‚ÅŽg—p‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# œ ƒCƒxƒ“ƒg‹N“®
#--------------------------------------------------------------------------
def start
# ŽÀs“à—e‚ª‹ó‚łȂ¢ê‡
if @list.size > 1
# $game_player.event ‚ª0‚łȂ¢ê‡
if $game_player.event != 0
# ˆÚ“®‘¬“x‚ð $game_player.event ‚É‚·‚é
$game_player.move_speed = $game_player.event
elsif self.trigger == 0
$game_player.move_speed = $game_player.walk
end
@starting = true
end
end
end
zum Lesen den Text mit der Maus markieren
#==============================================================================
# ** Trailing Characters
#==============================================================================
# SephirothSpawn
# Version 1
# 2006-05-24
#------------------------------------------------------------------------------
# * Instructions:
#
# ~ Adding Trailing Character:
# <game_character>.add_trailing_character(<name>, <hue>)
#
# ~ Deleting Trailing Character at a index
# <game_character>.delete_trailing_character(<index>)
#
# ~ Delete Last Trailing Character
# <game_character>.pop_trailing_character
#
# ~ Get Last Trailing Character
# <game_character>.last_trailing_character
#
# ~ Get Number of Trailing Characters
# <game_character>.number_of_trailing_characters
#
# * For Events, Replace <game_character> with
# $game_map.events[<event_id>]
#
# * For Player, Replace <game_character> with
# $game_player
#
# ~ Enable or Disable Caterpillar
# $game_player.enable_caterpillar = True (On) or False (Off)
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Trailing Characters', 'SephirothSpawn', 1, '2006-05-24')
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Trailing Characters') == true
#==============================================================================
# ** Game_TrailingCharacter
#==============================================================================
class Game_TrailingCharacter < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :trail_number
attr_accessor :character_hue
attr_accessor :character_name
attr_accessor :x, :y, :direction
#--------------------------------------------------------------------------
# * Screen Z
#--------------------------------------------------------------------------
def screen_z(height = 0)
# Get Original Z Value
n = super(height)
# Decrease Z By 1 and return
return n - @trail_number
end
#--------------------------------------------------------------------------
# * Setup Initialization
#--------------------------------------------------------------------------
def setup(parent_character, character_name, character_hue)
# Set X & Y Coordinates
@x, @y = parent_character.x, parent_character.y
@real_x, @real_y = @x * 128, @y * 128
@direction = parent_character.direction
# Sets Character Sprite Information
@character_name = character_name
@character_hue = character_hue
# Turns Through On
@through = true
# If Parent Character is a Trailing Character
if parent_character.is_a?(Game_TrailingCharacter)
# Sets Trailing Number + 1
@trail_number = parent_character.trail_number + 1
else
# Sets 1 to Trailing Number
@trail_number = 1
end
end
#--------------------------------------------------------------------------
# * Delete
#--------------------------------------------------------------------------
def delete
# Return No Trailing Sprite
return if @trailing_character.nil?
# Switch Properties with trailing sprite
@character_name = @trailing_character.character_name
@character_hue = @trailing_character.character_hue
@trail_number = @trailing_character.trail_number
# Delete Trail Sprite
@trailing_character.delete
end
end
#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Trailing Character Movements
#--------------------------------------------------------------------------
Trailing_Character_Movements = [[], [], [], [], []]
Trailing_Character_Movements[0][2] = '@trailing_character.move_right'
Trailing_Character_Movements[1][1] =
'@direction == 2 ? @trailing_character.move_right : @trailing_character.move_down'
Trailing_Character_Movements[1][2] =
'@trailing_character.turn_right unless @trailing_character.direction == 6'
Trailing_Character_Movements[1][3] =
'@direction == 8 ? @trailing_character.move_right : @trailing_character.move_up'
Trailing_Character_Movements[2][0] = '@trailing_character.move_down'
Trailing_Character_Movements[2][1] =
'@trailing_character.turn_down unless @trailing_character.direction == 2'
Trailing_Character_Movements[2][3] =
'@trailing_character.turn_up unless @trailing_character.direction == 8'
Trailing_Character_Movements[2][4] = '@trailing_character.move_up'
Trailing_Character_Movements[3][1] =
'@direction == 2 ? @trailing_character.move_left : @trailing_character.move_down'
Trailing_Character_Movements[3][2] =
'@trailing_character.turn_left unless @trailing_character.direction == 4'
Trailing_Character_Movements[3][3] =
'@direction == 8 ? @trailing_character.move_left : @trailing_character.move_up'
Trailing_Character_Movements[4][2] = '@trailing_character.move_left'
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :trailing_character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_trailingchara_gmchar_init initialize
alias seph_trailingchara_gmchar_update update
alias seph_trailingchara_gmchar_jump jump
alias seph_trailingchara_gmchar_mt moveto
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_trailingchara_gmchar_init
# Create Nil Trailing Character
@trailing_character = nil
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Original Frame Update
seph_trailingchara_gmchar_update
# If Trailing Sprite Exist
unless @trailing_character.nil?
# Update Trailing Character
@trailing_character.update
# Update Trailing Character Movements
update_trailing_character_movements
end
end
#--------------------------------------------------------------------------
# * Jump
#--------------------------------------------------------------------------
def jump(x_plus, y_plus)
# Original Jump Method
seph_trailingchara_gmchar_jump(x_plus, y_plus)
# Return if No Trailing Character
return if @trailing_character.nil?
# If Jumping
if self.jumping?
x_plus = @x - @trailing_character.x
y_plus = @y - @trailing_character.y
# Jump Trialing Character
@trailing_character.jump(x_plus, y_plus)
end
end
#--------------------------------------------------------------------------
# * Move to Designated Position
#--------------------------------------------------------------------------
def moveto(x, y)
# Original Moveto Method
seph_trailingchara_gmchar_mt(x, y)
# Move Trailing Sprite
unless @trailing_character.nil?
# Move Trailing Character
@trailing_character.moveto(x, y)
end
end
#--------------------------------------------------------------------------
# * Frame Update : Trailing Sprite Movements
#--------------------------------------------------------------------------
def update_trailing_character_movements
# Return if Trailing Character is Moving or Jumping
return if @trailing_character.moving? || @trailing_character.jumping?
# Calculate X & Y Difference
x_diff = @trailing_character.x - @x + 2
y_diff = @trailing_character.y - @y + 2
# Trailing Character Movements
unless Trailing_Character_Movements[x_diff][y_diff].nil?
eval Trailing_Character_Movements[x_diff][y_diff]
end
end
#--------------------------------------------------------------------------
# * Add Trailing Character
#--------------------------------------------------------------------------
def add_trailing_character(name = '', hue = 0)
# Add Trailing Character
if @trailing_character.nil?
@trailing_character = Game_TrailingCharacter.new
@trailing_character.setup(self, name, hue)
# Adds Sprite to Spriteset
if $scene.is_a?(Scene_Map)
$scene.spriteset.add_trailing_character(@trailing_character)
end
# Add Trailing Character to Trailing Sprite
else
@trailing_character.add_trailing_character(name, hue)
end
end
#--------------------------------------------------------------------------
# * Delete Trailing Character
#--------------------------------------------------------------------------
def delete_trailing_character(index = 0)
# Return if No Trailing Character
return if @trailing_character.nil?
# Start Indexing
n = 0
tc = @trailing_character
# Gets Trialing Character Index
while n < index
# Return if No Trailing Character
return if tc.trailing_character.nil?
# Add Index
n += 1
# Get Next Trailing Character
tc = tc.trailing_character
end
# Delete all Trailing Characters
tc.delete
# Pop Last Character
pop_trailing_character
end
#--------------------------------------------------------------------------
# * Pop Trailing Character
#--------------------------------------------------------------------------
def pop_trailing_character
# Return if No Trailing Character
return nil if @trailing_character.nil?
# If Trailing Sprite has a trailing Sprite
if @trailing_character.trailing_character != nil
@trailing_character.pop_trailing_character
# Delete Trailing Character
else
# Remove from Spriteset
$scene.spriteset.pop_trailing_character(@trailing_character)
# Delete Trailing Sprite
@trailing_character = nil
end
end
#--------------------------------------------------------------------------
# * Last Trailing Character
#--------------------------------------------------------------------------
def last_trailing_character
# Return nil if no trailing character
return nil if @trailing_character.nil?
# Fetches Last Character
tc = @trailing_character
until tc.trailing_character.nil?
tc = tc.trailing_character
end
return tc
end
#--------------------------------------------------------------------------
# * Number of Trailing Character
#--------------------------------------------------------------------------
def number_of_trailing_characters
# Returns 0 if no Trailing Character
return 0 if @trailing_character.nil?
# Starts Counter
n = 1
tc = @trailing_character
# Adds to Counter when more Trailing Characters
until tc.trailing_character.nil?
n += 1
tc = tc.trailing_character
end
# Return Counter
return n
end
end
#==============================================================================
# ** Game_Player
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :enable_caterpillar
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_catapillar_gmplyr_init initialize
alias seph_catapillar_gmplyr_refresh refresh
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_catapillar_gmplyr_init
# Enables Catapillar
@enable_caterpillar = true
end
#--------------------------------------------------------------------------
# * Enable Caterpiller
#--------------------------------------------------------------------------
def enable_caterpillar=(boolean)
# If Enabling
if boolean
@enable_caterpillar = true
else
# Deletes Party Members
($game_party.actors.size - 1).times do
delete_trailing_character
end
@enable_caterpillar = false
end
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Original Refresh
seph_catapillar_gmplyr_refresh
# Delete all Trailing Characters
until number_of_trailing_characters <
(@enable_caterpillar ? $game_party.actors.size : 1)
pop_trailing_character
end
# Return unless Caterpillar Disabled
return unless @enable_caterpillar
# Refreshes Actors
unless @trailing_character.nil?
tc, i = @trailing_character, 0
loop do
i += 1
actor = $game_party.actors
tc.character_name = actor.character_name
tc.character_hue = actor.character_hue
tc.trailing_character.nil? ? break : tc = tc.trailing_character
end
end
# Add Party Characters
for i in (number_of_trailing_characters + 1)...$game_party.actors.size
# Gets Actor
actor = $game_party.actors[i]
# Adds Actor
add_trailing_character(actor.character_name, actor.character_hue)
end
end
#--------------------------------------------------------------------------
# * Pop Trailing Character
#--------------------------------------------------------------------------
def pop_trailing_character
# If Caterpillar Enabled
if @enable_caterpillar
# If No Extra Trailing Characters
return if number_of_trailing_characters < $game_party.actors.size
end
super
end
#--------------------------------------------------------------------------
# * Delete Trailing Character
#--------------------------------------------------------------------------
def delete_trailing_character(index = 0)
# If Caterpillar Enabled
if @enable_caterpillar
# Return if trying to delete a party member
return if (index + 1) < $game_party.actors.size
end
super(index)
end
end
#==============================================================================
# ** Spriteset_Map
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_trailingchara_ssetm_init initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_trailingchara_ssetm_init
# Adds Trailing Characters (Player)
unless $game_player.trailing_character.nil?
trailing_character = $game_player.trailing_character
add_trailing_character(trailing_character)
until trailing_character.trailing_character.nil?
trailing_character = trailing_character.trailing_character
add_trailing_character(trailing_character)
end
end
# Adds Trailing Characters (Events)
for event in $game_map.events.values
unless event.trailing_character.nil?
trailing_character = event.trailing_character
add_trailing_character(trailing_character)
until trailing_character.trailing_character.nil?
trailing_character = trailing_character.trailing_character
add_trailing_character(trailing_character)
end
end
end
end
#--------------------------------------------------------------------------
# * Add Trailing Character
#--------------------------------------------------------------------------
def add_trailing_character(character = nil)
# Return if nil Character
return if character.nil?
# Adds Character Sprite
@character_sprites.push(Sprite_Character.new(@viewport1, character))
end
#--------------------------------------------------------------------------
# * Pop Trailing Character
#--------------------------------------------------------------------------
def pop_trailing_character(character)
# Return if nil character
return if character.nil?
# Passes through all Character Sprites
for sprite in @character_sprites
# Pops Sprites Character
if sprite.character == character
# Disposes Sprite
sprite.dispose
# Deletes from Character Sprites
@character_sprites.delete(sprite)
return
end
end
end
end
#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map
attr_accessor :spriteset
end
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
# ** Trailing Characters
#==============================================================================
# SephirothSpawn
# Version 1
# 2006-05-24
#------------------------------------------------------------------------------
# * Instructions:
#
# ~ Adding Trailing Character:
# <game_character>.add_trailing_character(<name>, <hue>)
#
# ~ Deleting Trailing Character at a index
# <game_character>.delete_trailing_character(<index>)
#
# ~ Delete Last Trailing Character
# <game_character>.pop_trailing_character
#
# ~ Get Last Trailing Character
# <game_character>.last_trailing_character
#
# ~ Get Number of Trailing Characters
# <game_character>.number_of_trailing_characters
#
# * For Events, Replace <game_character> with
# $game_map.events[<event_id>]
#
# * For Player, Replace <game_character> with
# $game_player
#
# ~ Enable or Disable Caterpillar
# $game_player.enable_caterpillar = True (On) or False (Off)
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Trailing Characters', 'SephirothSpawn', 1, '2006-05-24')
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Trailing Characters') == true
#==============================================================================
# ** Game_TrailingCharacter
#==============================================================================
class Game_TrailingCharacter < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :trail_number
attr_accessor :character_hue
attr_accessor :character_name
attr_accessor :x, :y, :direction
#--------------------------------------------------------------------------
# * Screen Z
#--------------------------------------------------------------------------
def screen_z(height = 0)
# Get Original Z Value
n = super(height)
# Decrease Z By 1 and return
return n - @trail_number
end
#--------------------------------------------------------------------------
# * Setup Initialization
#--------------------------------------------------------------------------
def setup(parent_character, character_name, character_hue)
# Set X & Y Coordinates
@x, @y = parent_character.x, parent_character.y
@real_x, @real_y = @x * 128, @y * 128
@direction = parent_character.direction
# Sets Character Sprite Information
@character_name = character_name
@character_hue = character_hue
# Turns Through On
@through = true
# If Parent Character is a Trailing Character
if parent_character.is_a?(Game_TrailingCharacter)
# Sets Trailing Number + 1
@trail_number = parent_character.trail_number + 1
else
# Sets 1 to Trailing Number
@trail_number = 1
end
end
#--------------------------------------------------------------------------
# * Delete
#--------------------------------------------------------------------------
def delete
# Return No Trailing Sprite
return if @trailing_character.nil?
# Switch Properties with trailing sprite
@character_name = @trailing_character.character_name
@character_hue = @trailing_character.character_hue
@trail_number = @trailing_character.trail_number
# Delete Trail Sprite
@trailing_character.delete
end
end
#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Trailing Character Movements
#--------------------------------------------------------------------------
Trailing_Character_Movements = [[], [], [], [], []]
Trailing_Character_Movements[0][2] = '@trailing_character.move_right'
Trailing_Character_Movements[1][1] =
'@direction == 2 ? @trailing_character.move_right : @trailing_character.move_down'
Trailing_Character_Movements[1][2] =
'@trailing_character.turn_right unless @trailing_character.direction == 6'
Trailing_Character_Movements[1][3] =
'@direction == 8 ? @trailing_character.move_right : @trailing_character.move_up'
Trailing_Character_Movements[2][0] = '@trailing_character.move_down'
Trailing_Character_Movements[2][1] =
'@trailing_character.turn_down unless @trailing_character.direction == 2'
Trailing_Character_Movements[2][3] =
'@trailing_character.turn_up unless @trailing_character.direction == 8'
Trailing_Character_Movements[2][4] = '@trailing_character.move_up'
Trailing_Character_Movements[3][1] =
'@direction == 2 ? @trailing_character.move_left : @trailing_character.move_down'
Trailing_Character_Movements[3][2] =
'@trailing_character.turn_left unless @trailing_character.direction == 4'
Trailing_Character_Movements[3][3] =
'@direction == 8 ? @trailing_character.move_left : @trailing_character.move_up'
Trailing_Character_Movements[4][2] = '@trailing_character.move_left'
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :trailing_character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_trailingchara_gmchar_init initialize
alias seph_trailingchara_gmchar_update update
alias seph_trailingchara_gmchar_jump jump
alias seph_trailingchara_gmchar_mt moveto
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_trailingchara_gmchar_init
# Create Nil Trailing Character
@trailing_character = nil
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Original Frame Update
seph_trailingchara_gmchar_update
# If Trailing Sprite Exist
unless @trailing_character.nil?
# Update Trailing Character
@trailing_character.update
# Update Trailing Character Movements
update_trailing_character_movements
end
end
#--------------------------------------------------------------------------
# * Jump
#--------------------------------------------------------------------------
def jump(x_plus, y_plus)
# Original Jump Method
seph_trailingchara_gmchar_jump(x_plus, y_plus)
# Return if No Trailing Character
return if @trailing_character.nil?
# If Jumping
if self.jumping?
x_plus = @x - @trailing_character.x
y_plus = @y - @trailing_character.y
# Jump Trialing Character
@trailing_character.jump(x_plus, y_plus)
end
end
#--------------------------------------------------------------------------
# * Move to Designated Position
#--------------------------------------------------------------------------
def moveto(x, y)
# Original Moveto Method
seph_trailingchara_gmchar_mt(x, y)
# Move Trailing Sprite
unless @trailing_character.nil?
# Move Trailing Character
@trailing_character.moveto(x, y)
end
end
#--------------------------------------------------------------------------
# * Frame Update : Trailing Sprite Movements
#--------------------------------------------------------------------------
def update_trailing_character_movements
# Return if Trailing Character is Moving or Jumping
return if @trailing_character.moving? || @trailing_character.jumping?
# Calculate X & Y Difference
x_diff = @trailing_character.x - @x + 2
y_diff = @trailing_character.y - @y + 2
# Trailing Character Movements
unless Trailing_Character_Movements[x_diff][y_diff].nil?
eval Trailing_Character_Movements[x_diff][y_diff]
end
end
#--------------------------------------------------------------------------
# * Add Trailing Character
#--------------------------------------------------------------------------
def add_trailing_character(name = '', hue = 0)
# Add Trailing Character
if @trailing_character.nil?
@trailing_character = Game_TrailingCharacter.new
@trailing_character.setup(self, name, hue)
# Adds Sprite to Spriteset
if $scene.is_a?(Scene_Map)
$scene.spriteset.add_trailing_character(@trailing_character)
end
# Add Trailing Character to Trailing Sprite
else
@trailing_character.add_trailing_character(name, hue)
end
end
#--------------------------------------------------------------------------
# * Delete Trailing Character
#--------------------------------------------------------------------------
def delete_trailing_character(index = 0)
# Return if No Trailing Character
return if @trailing_character.nil?
# Start Indexing
n = 0
tc = @trailing_character
# Gets Trialing Character Index
while n < index
# Return if No Trailing Character
return if tc.trailing_character.nil?
# Add Index
n += 1
# Get Next Trailing Character
tc = tc.trailing_character
end
# Delete all Trailing Characters
tc.delete
# Pop Last Character
pop_trailing_character
end
#--------------------------------------------------------------------------
# * Pop Trailing Character
#--------------------------------------------------------------------------
def pop_trailing_character
# Return if No Trailing Character
return nil if @trailing_character.nil?
# If Trailing Sprite has a trailing Sprite
if @trailing_character.trailing_character != nil
@trailing_character.pop_trailing_character
# Delete Trailing Character
else
# Remove from Spriteset
$scene.spriteset.pop_trailing_character(@trailing_character)
# Delete Trailing Sprite
@trailing_character = nil
end
end
#--------------------------------------------------------------------------
# * Last Trailing Character
#--------------------------------------------------------------------------
def last_trailing_character
# Return nil if no trailing character
return nil if @trailing_character.nil?
# Fetches Last Character
tc = @trailing_character
until tc.trailing_character.nil?
tc = tc.trailing_character
end
return tc
end
#--------------------------------------------------------------------------
# * Number of Trailing Character
#--------------------------------------------------------------------------
def number_of_trailing_characters
# Returns 0 if no Trailing Character
return 0 if @trailing_character.nil?
# Starts Counter
n = 1
tc = @trailing_character
# Adds to Counter when more Trailing Characters
until tc.trailing_character.nil?
n += 1
tc = tc.trailing_character
end
# Return Counter
return n
end
end
#==============================================================================
# ** Game_Player
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :enable_caterpillar
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_catapillar_gmplyr_init initialize
alias seph_catapillar_gmplyr_refresh refresh
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_catapillar_gmplyr_init
# Enables Catapillar
@enable_caterpillar = true
end
#--------------------------------------------------------------------------
# * Enable Caterpiller
#--------------------------------------------------------------------------
def enable_caterpillar=(boolean)
# If Enabling
if boolean
@enable_caterpillar = true
else
# Deletes Party Members
($game_party.actors.size - 1).times do
delete_trailing_character
end
@enable_caterpillar = false
end
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Original Refresh
seph_catapillar_gmplyr_refresh
# Delete all Trailing Characters
until number_of_trailing_characters <
(@enable_caterpillar ? $game_party.actors.size : 1)
pop_trailing_character
end
# Return unless Caterpillar Disabled
return unless @enable_caterpillar
# Refreshes Actors
unless @trailing_character.nil?
tc, i = @trailing_character, 0
loop do
i += 1
actor = $game_party.actors
tc.character_name = actor.character_name
tc.character_hue = actor.character_hue
tc.trailing_character.nil? ? break : tc = tc.trailing_character
end
end
# Add Party Characters
for i in (number_of_trailing_characters + 1)...$game_party.actors.size
# Gets Actor
actor = $game_party.actors[i]
# Adds Actor
add_trailing_character(actor.character_name, actor.character_hue)
end
end
#--------------------------------------------------------------------------
# * Pop Trailing Character
#--------------------------------------------------------------------------
def pop_trailing_character
# If Caterpillar Enabled
if @enable_caterpillar
# If No Extra Trailing Characters
return if number_of_trailing_characters < $game_party.actors.size
end
super
end
#--------------------------------------------------------------------------
# * Delete Trailing Character
#--------------------------------------------------------------------------
def delete_trailing_character(index = 0)
# If Caterpillar Enabled
if @enable_caterpillar
# Return if trying to delete a party member
return if (index + 1) < $game_party.actors.size
end
super(index)
end
end
#==============================================================================
# ** Spriteset_Map
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_trailingchara_ssetm_init initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_trailingchara_ssetm_init
# Adds Trailing Characters (Player)
unless $game_player.trailing_character.nil?
trailing_character = $game_player.trailing_character
add_trailing_character(trailing_character)
until trailing_character.trailing_character.nil?
trailing_character = trailing_character.trailing_character
add_trailing_character(trailing_character)
end
end
# Adds Trailing Characters (Events)
for event in $game_map.events.values
unless event.trailing_character.nil?
trailing_character = event.trailing_character
add_trailing_character(trailing_character)
until trailing_character.trailing_character.nil?
trailing_character = trailing_character.trailing_character
add_trailing_character(trailing_character)
end
end
end
end
#--------------------------------------------------------------------------
# * Add Trailing Character
#--------------------------------------------------------------------------
def add_trailing_character(character = nil)
# Return if nil Character
return if character.nil?
# Adds Character Sprite
@character_sprites.push(Sprite_Character.new(@viewport1, character))
end
#--------------------------------------------------------------------------
# * Pop Trailing Character
#--------------------------------------------------------------------------
def pop_trailing_character(character)
# Return if nil character
return if character.nil?
# Passes through all Character Sprites
for sprite in @character_sprites
# Pops Sprites Character
if sprite.character == character
# Disposes Sprite
sprite.dispose
# Deletes from Character Sprites
@character_sprites.delete(sprite)
return
end
end
end
end
#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map
attr_accessor :spriteset
end
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
zum Lesen den Text mit der Maus markieren
Thx im Vorraus
[/i]
Ähnliche Themen
-
Skript-Anfragen »-
Mapsverbindungsscript
(1. März 2009, 17:48)
-
Skript-Anfragen »-
2 MAIN-Scripts miteinander kombinieren (PokemonStarterKit+HüpfendeKokosnuss-MinispielScript)
(26. Dezember 2008, 23:28)
-
Skript-Anfragen »-
Ist es möglich...
(7. Oktober 2008, 21:12)
-
Events & Technik »-
Verbindung zweier Maps
(24. August 2006, 17:36)
-
Maker-Talk »-
Eine Frage des Stils...
(8. Januar 2005, 19:29)
