-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrawli-character.rb
More file actions
194 lines (186 loc) · 4.54 KB
/
crawli-character.rb
File metadata and controls
194 lines (186 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
class Game_Character
def update
return if $game_temp.menu_calling
#cass note: pulled from Walk_Run
if @dependentEvents
for i in 0...@dependentEvents.length
if @dependentEvents[i][0]==$game_map.map_id &&
@dependentEvents[i][1]==self.id
@move_speed=$game_player.move_speed
break
end
end
end
if jumping?
update_jump
elsif moving?
update_move
elsif !(self==$game_player && $PokemonGlobal.fishing)
update_stop
end
### MODDED/
Blindstep.character_update() if BlindstepActive && self == $game_player
### /MODDED
update_pattern unless self==$game_player && $PokemonGlobal.fishing
if @wait_count > 0
@wait_count -= 1
return
end
if @move_route_forcing
move_type_custom
return
end
if @starting || @locked
return
end
if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
case @move_type
### MODDED/
when 1 then move_type_random unless BlindstepActive
### /MODDED
when 2 then move_type_toward_player
when 3 then move_type_custom
end
end
end
end
class Game_Player
def move_down(turn_enabled = true)
if turn_enabled
turn_down
end
if passable?(@x, @y, 2)
if !@direction_fix
return if pbLedge(0,1)
end
return if pbEndSurf(0,1)
return if pbEndLavaSurf(0,1)
turn_down if turn_enabled
@y += 1
### MODDED/
Blindstep.player_move(2) if BlindstepActive
### /MODDED
if turn_enabled || $PokemonGlobal.sliding
$PokemonTemp.dependentEvents.pbMoveDependentEvents(@x, @y-1)
end
increase_steps
else
if !check_event_trigger_touch(@x, @y+1)
if !@bump_se || @bump_se<=0
### MODDED/
if self.respond_to?("playBumpSE")
playBumpSE
else
pbSEPlay("bump")
end
### /MODDED
@bump_se=10
end
end
end
end
def move_left(turn_enabled = true)
if turn_enabled
turn_left
end
if passable?(@x, @y, 4)
if !@direction_fix
return if pbLedge(-1,0)
end
return if pbEndSurf(-1,0)
return if pbEndLavaSurf(-1,0)
turn_left if turn_enabled
@x -= 1
### MODDED/
Blindstep.player_move(4) if BlindstepActive
### /MODDED
if turn_enabled || $PokemonGlobal.sliding
$PokemonTemp.dependentEvents.pbMoveDependentEvents(@x+1, @y)
end
increase_steps
else
if !check_event_trigger_touch(@x-1, @y)
if !@bump_se || @bump_se<=0
### MODDED/
if self.respond_to?("playBumpSE")
playBumpSE
else
pbSEPlay("bump")
end
### /MODDED
@bump_se=10
end
end
end
end
def move_right(turn_enabled = true)
if turn_enabled
turn_right
end
if passable?(@x, @y, 6)
if !@direction_fix
return if pbLedge(1,0)
end
return if pbEndSurf(-1,0)
return if pbEndLavaSurf(-1,0)
turn_right if turn_enabled
@x += 1
### MODDED/
Blindstep.player_move(6) if BlindstepActive
### /MODDED
if turn_enabled || $PokemonGlobal.sliding
$PokemonTemp.dependentEvents.pbMoveDependentEvents(@x-1, @y)
end
increase_steps
else
if !check_event_trigger_touch(@x+1, @y)
if !@bump_se || @bump_se<=0
### MODDED/
if self.respond_to?("playBumpSE")
playBumpSE
else
pbSEPlay("bump")
end
### /MODDED
@bump_se=10
end
end
end
end
def move_up(turn_enabled = true)
if turn_enabled
turn_up
end
if passable?(@x, @y, 8)
if !@direction_fix
return if pbLedge(0,-1)
end
return if pbEndSurf(0,-1)
return if pbEndSurf(-1,0)
return if pbEndLavaSurf(0,-1)
return if pbEndLavaSurf(-1,0)
turn_up if turn_enabled
@y -= 1
### MODDED/
Blindstep.player_move(8) if BlindstepActive
### /MODDED
if turn_enabled || $PokemonGlobal.sliding
$PokemonTemp.dependentEvents.pbMoveDependentEvents(@x, @y+1)
end
increase_steps
else
if !check_event_trigger_touch(@x, @y-1)
if !@bump_se || @bump_se<=0
### MODDED/
if self.respond_to?("playBumpSE")
playBumpSE
else
pbSEPlay("bump")
end
### /MODDED
@bump_se=10
end
end
end
end
end