• Anmelden

1

Sonntag, 5. November 2006, 00:30

Hallo liebe Community!
In anderen Foren hatte ich keine Hilfe erhalten... mal sehen ob es hier nun anders verläuft. ;)
Ich habe mir jetzt eine HP- Anzeige (bzw. ein AKS) ins Spiel eingebaut, nur hab ich jetzt imme rdie HP- Anzeige im Spiel (auch im Intro, etc.). Soll heißen, das Script wird das ganze Spiel über verwendet. Wie kann ich das jetzt machen, dass ich diese Anzeige auf Kommando einschalten kann? Hier kann man die Leiste mit der Taste "E" an und ausschalten. Wie mache ich das aber nun, dass ich das mit nem Switch oder sowas an- und ausschalten kann? Hier mal der Code:

Quellcode

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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
#============================================================================== 
# ** HUD 
#------------------------------------------------------------------------------ 
# Mr.Mo "Muhammet Sivri" 
# Version 1 
# 10.01.06 
# Credit Prexus for the Hud back ground. 
#============================================================================== 
#------------------------------------------------------------------------------- 
# Begin SDK Enabled Check 
#------------------------------------------------------------------------------- 
if SDK.state("Mr.Mo's ABS") 
#-------------------------------------------------------------------------- 
# * Constants - MAKE YOUR EDITS HERE 
#-------------------------------------------------------------------------- 
HP_X = 77            # X POS of the HP Bar 
HP_Y = 3              # Y POS of the HP Bar 
HP_WIDTH = 55         # WIDTH of the HP Bar 
HP_HEIGHT = 40        # Height of the HP Bar 
#-------------------------------------------------------------------------- 
SP_X = 54             # X POS of the SP Bar 
SP_Y = 22             # Y POS of the SP Bar 
SP_WIDTH = 55         # WIDTH of the SP Bar 
SP_HEIGHT = 5         # Height of the SP Bar 
#-------------------------------------------------------------------------- 
EXP_X = 55            # X POS of the EXP Bar 
EXP_Y = 42            # Y POS of the EXP Bar 
EXP_WIDTH = 60        # WIDTH of the EXP Bar 
EXP_HEIGHT = 5        # Height of the EXP Bar 
#-------------------------------------------------------------------------- 
STATES_SHOW = true    # Show states? 
STATES_X = 170        # States X display 
STATES_Y = 430        # States Y display 
#-------------------------------------------------------------------------- 
SHOW_DASH = true      # Show dash bar? 
DASH_X = 490          # X POS of the DASH Bar 
DASH_Y = 430          # Y POS of the DASH Bar 
DASH_WIDTH = 120      # WIDTH of the DASH Bar 
DASH_HEIGHT = 10      # Height of the DASH Bar 
DASH_BAR = "018-Simple03" # The file used for gradient 
#-------------------------------------------------------------------------- 
SHOW_SNEAK = true      # Show SNEAK bar? 
SNEAK_X = 490          # X POS of the SNEAK Bar 
SNEAK_Y = 455          # Y POS of the SNEAK Bar 
SNEAK_WIDTH = 120      # WIDTH of the SNEAK Bar 
SNEAK_HEIGHT = 10      # Height of the SNEAK Bar 
SNEAK_BAR = "019-Simple04" # The file used for gradient 
#-------------------------------------------------------------------------- 
LOW_HP = 150          # What HP should the low HP icon be shown? 
#-------------------------------------------------------------------------- 
HP_ITEMID = 1         # POTION ITEM ID 
SP_ITEMID = 4         # SP Increase Item ID 
#-------------------------------------------------------------------------- 
CAN_TOGGLE = true 
TOGGLE_KEY = Input::Letters["E"] 
#-------------------------------------------------------------------------- 
class Window_MrMo_HUD < Window_Base 
  #-------------------------------------------------------------------------- 
  # * Object Initialization 
  #-------------------------------------------------------------------------- 
  def initialize 
    super(-16, -16, 700, 700) 
    #Record Old Data 
    @actor = $game_party.actors[0] 
    @old_hp = @actor.hp 
    @old_sp = @actor.sp 
    @old_exp = @actor.exp 
    @level = @actor.level 
    @hp_n = $game_party.item_number(HP_ITEMID) 
    @sp_n = $game_party.item_number(SP_ITEMID) 
    @gold_n = $game_party.gold 
    @states = @actor.states.to_s 
    @dash = $ABS.dash_min 
    @sneak = $ABS.sneak_min 
    #Create Bitmap 
    self.contents = Bitmap.new(width - 32, height - 32) 
    #Hide Window 
    self.opacity = 0 
    #Refresh 
    refresh 
  end 
  #-------------------------------------------------------------------------- 
  # * Refresh 
  #-------------------------------------------------------------------------- 
  def refresh 
    self.contents.clear 
    self.contents.font.color = system_color 
    self.contents.font.color = normal_color 
    self.contents.font.size = 12 
    #Record new data 
    @actor = $game_party.actors[0] 
    @old_hp = @actor.hp 
    @old_sp = @actor.sp 
    @old_exp = @actor.exp 
    @level = @actor.level 
    @hp_n = $game_party.item_number(HP_ITEMID) 
    @sp_n = $game_party.item_number(SP_ITEMID) 
    @gold_n = $game_party.gold 
    @states = @actor.states.to_s 
    @dash = $ABS.dash_min 
    @sneak = $ABS.sneak_min 
    #Show the Pictures 
    bitmap = RPG::Cache.picture("HUD Graphic") 
    self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 175, 175)) 
    bitmap = RPG::Cache.picture("HUD Display") 
    self.contents.blt(15, 380, bitmap, Rect.new(0, 0, 175, 175)) 
    #Show the HP Symbol 
    bitmap = RPG::Cache.icon("HP Symbol") 
    self.contents.blt(0, -2, bitmap, Rect.new(0, 0, 24, 24)) 
    self.contents.draw_text(35, -9, 640, 32, "HP") 
    #Draw the HP BAR 
    draw_gradient_bar(HP_X, HP_Y, @actor.hp, @actor.maxhp, HP_BAR, HP_WIDTH, HP_HEIGHT) 
    #Show the SP Symbol 
    bitmap = RPG::Cache.icon("SP Symbol") 
    self.contents.blt(0, 18, bitmap, Rect.new(0, 0, 24, 24)) 
    self.contents.draw_text(35, 11, 640, 32, "SP") 
    #Draw the SP Bar 
    draw_gradient_bar(SP_X, SP_Y, @actor.sp, @actor.maxsp, SP_BAR, SP_WIDTH, SP_HEIGHT) 
    #Show the EXP Symbol 
    bitmap = RPG::Cache.icon("EXP Symbol") 
    self.contents.blt(0, 37, bitmap, Rect.new(0, 0, 24, 24)) 
    self.contents.draw_text(35, 30, 640, 32, "EXP") 
    #Draw the EXP Bar 
    min = @actor.level == 99 ? 1 : @actor.now_exp 
    max = @actor.level == 99 ? 1 : @actor.next_exp 
    draw_gradient_bar(EXP_X, EXP_Y, min, max, EXP_BAR, EXP_WIDTH, EXP_HEIGHT) 
    #Show Hero Icon 
    bitmap = RPG::Cache.icon("Hero") 
    self.contents.blt(2, 59, bitmap, Rect.new(0, 0, 24, 24)) 
    self.contents.draw_text(35, 49, 640, 32, "Hero:") 
    self.contents.draw_text(30, 59, 640, 32, @actor.name.to_s) 
    #Show Level Icon 
    bitmap = RPG::Cache.icon("Level") 
    self.contents.blt(2, 81, bitmap, Rect.new(0, 0, 24, 24)) 
    self.contents.draw_text(33, 72, 640, 32, "Level:") 
    self.contents.draw_text(43, 82, 640, 32, @actor.level.to_s) 
    #Show Gold Icon 
    bitmap = RPG::Cache.icon("Gold") 
    self.contents.blt(35, 390, bitmap, Rect.new(0, 0, 24, 24)) 
    self.contents.draw_text(30, 400, 640, 32, $game_party.gold.to_s) 
    self.contents.draw_text(85, 430, 400, 32, $ats.clock.to_s) if SDK.state("ATS") 
    #If the HP is too low 
    if @actor.hp.to_i <= LOW_HP 
      bitmap = RPG::Cache.icon("Skull") 
      self.contents.blt(130, 0, bitmap, Rect.new(0, 0, 24, 24)) 
    end 
    #If the SP Item is more then 0 
    if $game_party.item_number(SP_ITEMID) > 0 
      bitmap = RPG::Cache.icon("SP Potion") 
      self.contents.blt(110, 20, bitmap, Rect.new(0, 0, 24, 24)) 
    end 
    #if the HP Item is more then 0 
    if $game_party.item_number(HP_ITEMID) > 0 
      bitmap = RPG::Cache.icon("HP Potion") 
      self.contents.blt(110, 0, bitmap, Rect.new(0, 0, 24, 24)) 
    end 
    return if !STATES_SHOW 
    #Draw States 
    n = 0 
    for id in @actor.states 
      state = $data_states[id] 
      next if state == nil 
      bitmap = RPG::Cache.icon(state.name+"_Icon") 
      x = (n*32) + STATES_X 
      self.contents.blt(x, STATES_Y, bitmap, Rect.new(0, 0, 24, 24)) 
      n += 1 
    end 
    #Change font size 
    self.contents.font.size = 20 
    #Dash Bar 
    self.contents.draw_text(DASH_X - 40, DASH_Y-10, 40, 32, "Dash: ") if SHOW_DASH 
    draw_gradient_bar(DASH_X, DASH_Y, $ABS.dash_min, $ABS.dash_max, DASH_BAR, DASH_WIDTH, DASH_HEIGHT) if SHOW_DASH 
    #SNEAK Bar 
    self.contents.draw_text(SNEAK_X - 40, SNEAK_Y-10, 40, 32, "Sneak: ") if SHOW_SNEAK 
    draw_gradient_bar(SNEAK_X, SNEAK_Y, $ABS.sneak_min, $ABS.sneak_max, SNEAK_BAR, SNEAK_WIDTH, SNEAK_HEIGHT) if SHOW_SNEAK 
  end 
  #-------------------------------------------------------------------------- 
  # * Update 
  #-------------------------------------------------------------------------- 
  def update 
    refresh if something_changed? 
  end 
  #-------------------------------------------------------------------------- 
  # * Something Changed? 
  #-------------------------------------------------------------------------- 
  def something_changed? 
    return false if Graphics.frame_count % 30 != 0 
    return true if @actor != $game_party.actors[0] 
    return true if @old_hp != @actor.hp or @old_sp != @actor.sp or @old_exp != @actor.exp 
    return true if @level != @actor.level 
    return true if @hp_n != $game_party.item_number(HP_ITEMID) or @sp_n != $game_party.item_number(SP_ITEMID) 
    return true if @gold_n != $game_party.gold 
    return true if @states.to_s != @actor.states.to_s 
    return true if @dash != $ABS.dash_min or @sneak != $ABS.sneak_min 
    return false 
  end 
  #-------------------------------------------------------------------------- 
  # * TOGGLE KEY 
  #-------------------------------------------------------------------------- 
  def TOGGLE_KEY 
    return TOGGLE_KEY 
  end 
  #-------------------------------------------------------------------------- 
  # * CAN TOGGLE 
  #-------------------------------------------------------------------------- 
  def CAN_TOGGLE 
    return CAN_TOGGLE 
  end 
end 
#============================================================================== 
# * Scene_Map 
#============================================================================== 
class Scene_Map 
  #-------------------------------------------------------------------------- 
  alias mrmo_hud_main_draw main_draw 
  alias mrmo_hud_main_dispose main_dispose 
  alias mrmo_hud_update_graphics update_graphics 
  #-------------------------------------------------------------------------- 
  # * Main Draw 
  #-------------------------------------------------------------------------- 
  def main_draw 
    @mrmo_hud = Window_MrMo_HUD.new 
    mrmo_hud_main_draw 
  end 
  #-------------------------------------------------------------------------- 
  # * Main Dispose 
  #-------------------------------------------------------------------------- 
  def main_dispose 
    @mrmo_hud.dispose 
    mrmo_hud_main_dispose 
  end 
  #-------------------------------------------------------------------------- 
  # * Update Graphics 
  #-------------------------------------------------------------------------- 
  def update_graphics 
    mrmo_hud_update_graphics 
    @mrmo_hud.update 
  end 
end 
#-------------------------------------------------------------------------- 
# * Load Gradient from RPG::Cache 
#-------------------------------------------------------------------------- 
module RPG 
  module Cache 
    def self.gradient(filename, hue = 0) 
      self.load_bitmap("Graphics/Gradients/", filename, hue) 
    end 
  end 
end 
class Window_Base < Window 
  #-------------------------------------------------------------------------- 
  # * Constants Bar Types and Hues for parameters and parameter names 
  #-------------------------------------------------------------------------- 
  HP_BAR = "014-Reds01" 
  SP_BAR = "013-Blues01" 
  EXP_BAR = "015-Greens01" 
  ATK_BAR = "020-Metallic01" 
  PDEF_BAR = "020-Metallic01" 
  MDEF_BAR = "020-Metallic01" 
  STR_BAR = "020-Metallic01" 
  DEX_BAR = "020-Metallic01" 
  AGI_BAR = "020-Metallic01" 
  INT_BAR = "020-Metallic01" 
  HUES = [150,180,60,30,270,350,320] 
  STATS = ["atk","pdef","mdef","str","dex","agi","int"] 
  # leave this alone if you don't know what you are doing 
  OUTLINE = 1 
  BORDER = 1 
  #-------------------------------------------------------------------------- 
  # * Draw Gradient Bar 
  #-------------------------------------------------------------------------- 
  def draw_gradient_bar(x, y, min, max, file, width = nil, height = nil, hue = 0, back = "Back", back2 = "Back2") 
    bar = RPG::Cache.gradient(file, hue) 
    back = RPG::Cache.gradient(back) 
    back2 = RPG::Cache.gradient(back2) 
    cx = BORDER 
    cy = BORDER 
    dx = OUTLINE 
    dy = OUTLINE 
    zoom_x = width != nil ? width : back.width 
    zoom_y = height != nil ? height : back.height 
    percent = min / max.to_f if max != 0 
    percent = 0 if max == 0 
    back_dest_rect = Rect.new(x,y,zoom_x,zoom_y) 
    back2_dest_rect = Rect.new(x+dx,y+dy,zoom_x -dx*2,zoom_y-dy*2) 
    bar_dest_rect = Rect.new(x+cx,y+cy,zoom_x * percent-cx*2,zoom_y-cy*2) 
    back_source_rect = Rect.new(0,0,back.width,back.height) 
    back2_source_rect = Rect.new(0,0,back2.width,back2.height) 
    bar_source_rect = Rect.new(0,0,bar.width* percent,bar.height) 
    self.contents.stretch_blt(back_dest_rect, back, back_source_rect) 
    self.contents.stretch_blt(back2_dest_rect, back2, back2_source_rect) 
    self.contents.stretch_blt(bar_dest_rect, bar, bar_source_rect) 
  end   
 
  def draw_vertical_gradient_bar(x, y, min, max, file, width = nil, height = nil, hue = 0, back = "Back", back2 = "Back2") 
    bar = RPG::Cache.gradient(file, hue) 
    back = RPG::Cache.gradient(back) 
    back2 = RPG::Cache.gradient(back2) 
    cx = BORDER 
    cy = BORDER 
    dx = OUTLINE 
    dy = OUTLINE 
    zoom_x = width != nil ? width : back.width 
    zoom_y = height != nil ? height : back.height 
    percent = min / max.to_f if max != 0 
    percent = 0 if max == 0 
    bar_y = (zoom_y - zoom_y * percent).ceil 
    source_y = bar.height - bar.height * percent 
    back_dest_rect = Rect.new(x,y,zoom_x,zoom_y) 
    back2_dest_rect = Rect.new(x+dx,y+dy,zoom_x -dx*2,zoom_y-dy*2) 
    bar_dest_rect = Rect.new(x+cx,y+bar_y+cy,zoom_x-cx*2,(zoom_y * percent).to_i-cy*2) 
    back_source_rect = Rect.new(0,0,back.width,back.height) 
    back2_source_rect = Rect.new(0,0,back2.width,back2.height) 
    bar_source_rect = Rect.new(0,source_y,bar.width,bar.height * percent) 
    self.contents.stretch_blt(back_dest_rect, back, back_source_rect) 
    self.contents.stretch_blt(back2_dest_rect, back2, back2_source_rect) 
    self.contents.stretch_blt(bar_dest_rect, bar, bar_source_rect) 
  end   
  #-------------------------------------------------------------------------- 
  # * Draw HP 
  #     actor : actor 
  #     x     : draw spot x-coordinate 
  #     y     : draw spot y-coordinate 
  #     width : draw spot width 
  #-------------------------------------------------------------------------- 
  alias trick_draw_actor_hp draw_actor_hp 
  def draw_actor_hp(actor, x, y, width = 144) 
    # Calculate if there is draw space for MaxHP 
    if width - 32 >= 108 
      hp_x = x + width - 108 
      flag = true 
    elsif width - 32 >= 48 
      hp_x = x + width - 48 
      flag = false 
    end 
    width = hp_x - x 
    width += $game_temp.in_battle ? 50 : 100 
    # Draw HP 
    draw_gradient_bar(x, y + 16, actor.hp, actor.maxhp, HP_BAR, width, 8) 
    trick_draw_actor_hp(actor, x, y, width) 
  end 
  #-------------------------------------------------------------------------- 
  # * Draw SP 
  #     actor : actor 
  #     x     : draw spot x-coordinate 
  #     y     : draw spot y-coordinate 
  #     width : draw spot width 
  #-------------------------------------------------------------------------- 
  alias trick_draw_actor_sp draw_actor_sp 
  def draw_actor_sp(actor, x, y, width = 144) 
    # Calculate if there is draw space for MaxHP 
    if width - 32 >= 108 
      sp_x = x + width - 108 
      flag = true 
    elsif width - 32 >= 48 
      sp_x = x + width - 48 
      flag = false 
    end 
    width = sp_x - x 
    width += $game_temp.in_battle ? 50 : 100 
    # Draw SP 
    draw_gradient_bar(x, y + 16, actor.sp, actor.maxsp, SP_BAR, width, 8) 
    trick_draw_actor_sp(actor, x, y, width) 
  end 
  #-------------------------------------------------------------------------- 
  # * Draw Exp 
  #     actor : actor 
  #     x     : draw spot x-coordinate 
  #     y     : draw spot y-coordinate 
  #-------------------------------------------------------------------------- 
  alias trick_bars_base_exp draw_actor_exp 
  def draw_actor_exp(actor, x, y) 
    min = actor.level == 99 ? 1 : actor.now_exp 
    max = actor.level == 99 ? 1 : actor.next_exp 
    draw_gradient_bar(x, y + 16, min, max, EXP_BAR, 192, 8) 
    trick_bars_base_exp(actor, x, y) 
  end 
  #-------------------------------------------------------------------------- 
  # * Draw Parameter 
  #     actor : actor 
  #     x     : draw spot x-coordinate 
  #     y     : draw spot y-coordinate 
  #     type  : draw which parameter 
  #-------------------------------------------------------------------------- 
  alias trick_bars_base_parameter draw_actor_parameter 
  def draw_actor_parameter(actor, x, y, type) 
    hue = HUES[type] 
    stat = eval("actor.#{STATS[type]}") 
    bar_type = eval("#{STATS[type].upcase}_BAR") 
    draw_gradient_bar(x, y + 18, stat, 999, bar_type, 190, 8, hue) 
    trick_bars_base_parameter(actor, x, y, type) 
  end 
end 
 
class Game_Actor 
  #-------------------------------------------------------------------------- 
  # * Get the current EXP 
  #-------------------------------------------------------------------------- 
  def now_exp 
    return @exp - @exp_list[@level] 
  end 
  #-------------------------------------------------------------------------- 
  # * Get the next level's EXP 
  #-------------------------------------------------------------------------- 
  def next_exp 
    exp = @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 
    return exp 
  end 
end 
#============================================================================== 
# * Scene_Map 
#============================================================================== 
class Scene_Map 
  #-------------------------------------------------------------------------- 
  alias mrmo_keyhud_update update 
  #-------------------------------------------------------------------------- 
  # * Update 
  #-------------------------------------------------------------------------- 
  def update 
    mrmo_keyhud_update 
    if @mrmo_hud.CAN_TOGGLE and Input.trigger?(@mrmo_hud.TOGGLE_KEY) 
      return @mrmo_hud.visible = true if !@mrmo_hud.visible 
      return @mrmo_hud.visible = false if @mrmo_hud.visible 
    end 
  end 
end 
#-------------------------------------------------------------------------- 
# * SDK End 
#-------------------------------------------------------------------------- 
end 

Und noch ne Frage:
Ich hab ein Monsterbuch- Script gefunden (um Statuswerte der bisher getroffenen und besiegten Monster anzuzeigen). Ist toll, nur geht das dummerweise ausschließlich mit dem Standard KS. Und was mache ich nun, damit ich das auch mit meinem Action Kampfsystem hab?
(Der Code) :

Quellcode

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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
PHP-Code:
#============================================================================== 
 
# Advanced Monster Database 
 
#-------------------------------------------------------------------------- 
 
# Created By SephirothSpawn (11.18.05) 
 
# Last Updated 11.19.05 
 
#============================================================================== 
 
 
#============================================================================== 
 
#  Class Scene Title 
 
#============================================================================== 
 
class Scene_Title 
 
#-------------------------------------------------------------------------- 
 
#  Alias' New Game Method 
 
#-------------------------------------------------------------------------- 
 
alias new_game command_new_game 
 
#-------------------------------------------------------------------------- 
 
#  Adds Beastairy Game Variables 
 
#-------------------------------------------------------------------------- 
 
def command_new_game 
 
# Sets Up Smithery List 
 
$game_beastairy = Game_Beastairy.new 
 
new_game 
 
end 
 
end 
 
 
#============================================================================== 
 
#  Game_Temp 
 
#============================================================================== 
 
class Game_Temp 
 
#-------------------------------------------------------------------------- 
 
#  Public Instance Variables 
 
#-------------------------------------------------------------------------- 
 
attr_accessor beastairy_return 
 
#-------------------------------------------------------------------------- 
 
#  Alias Initialization 
 
#-------------------------------------------------------------------------- 
 
alias beastairy_initialize initialize 
 
#-------------------------------------------------------------------------- 
 
#  Object Initialization 
 
#-------------------------------------------------------------------------- 
 
def initialize 
 
beastairy_initialize 
 
@beastairy_return = false 
 
end 
 
end 
 
 
#============================================================================== 
 
#  Class Game Beastairy 
 
#============================================================================== 
 
class Game_Beastairy 
 
#-------------------------------------------------------------------------- 
 
#  Public Instance Variables 
 
#-------------------------------------------------------------------------- 
 
attr_accessor monster_groups 
 
#------------------------------------------------------------------#============================================================================== 
 
# Advanced Monster Database 
 
#-------------------------------------------------------------------------- 
 
#   Created By SephirothSpawn (11.18.05) 
 
#    Last Updated 11.19.05 
 
#============================================================================== 
 
 
#============================================================================== 
 
#  Class Scene Title 
 
#============================================================================== 
 
class Scene_Title 
 
  #-------------------------------------------------------------------------- 
 
  #  Alias' New Game Method 
 
  #-------------------------------------------------------------------------- 
 
  alias new_game command_new_game 
 
  #-------------------------------------------------------------------------- 
 
  #  Adds Beastairy Game Variables 
 
  #-------------------------------------------------------------------------- 
 
  def command_new_game 
 
    # Sets Up Smithery List 
 
    $game_beastairy = Game_Beastairy.new 
 
    new_game 
 
  end 
 
end 
 
 
#============================================================================== 
 
#  Game_Temp 
 
#============================================================================== 
 
class Game_Temp 
 
  #-------------------------------------------------------------------------- 
 
  #  Public Instance Variables 
 
  #-------------------------------------------------------------------------- 
 
  attr_accessor beastairy_return 
 
  #-------------------------------------------------------------------------- 
 
  #  Alias Initialization 
 
  #-------------------------------------------------------------------------- 
 
  alias beastairy_initialize initialize 
 
  #-------------------------------------------------------------------------- 
 
  #  Object Initialization 
 
  #-------------------------------------------------------------------------- 
 
  def initialize 
 
    beastairy_initialize 
 
    @beastairy_return = false 
 
  end 
 
end 
 
 
#============================================================================== 
 
#  Class Game Beastairy 
 
#============================================================================== 
 
class Game_Beastairy 
 
  #-------------------------------------------------------------------------- 
 
  #  Public Instance Variables 
 
  #-------------------------------------------------------------------------- 
 
  attr_accessor monster_groups 
 
  #-------------------------------------------------------------------------- 
 
  #  Object Initialization 
 
  #-------------------------------------------------------------------------- 
 
  def initialize 
 
    @monster_groups = [] 
 
    for i in 1...$data_enemies.size 
 
      $data_enemies[i].beastairy_setup 
 
      unless @monster_groups.include($data_enemies[i].group) 
 
        @monster_groups.push($data_enemies[i].group) 
 
      end 
 
    end 
 
  end 
 
end 
 
 
#============================================================================== 
 
#  Module RPG 
 
#============================================================================== 
 
module RPG 
 
  #========================================================================= 
 
  #  Class Enemy 
 
  #========================================================================= 
 
  class Enemy 
 
    #-------------------------------------------------------------------------- 
 
    #  Public Instance Variables 
 
    #-------------------------------------------------------------------------- 
 
    # Detectors 
 
    attr_accessor seen, defeated, group 
 
    # Counters 
 
    attr_accessor seen_times, defeated_times 
 
    #-------------------------------------------------------------------------- 
 
    #  Setup Beastairy 
 
    #-------------------------------------------------------------------------- 
 
    def beastairy_setup 
 
      @seen_times, @defeated_times = 0, 0 
 
      @seen, @defeated = false, false 
 
      if @name.include('(') 
 
        a, b = @name.index('('), @name.index(')') 
 
        @group = @name.slice!(a..b) 
 
        @group.delete!('(') 
 
        @group.delete!(')') 
 
      else 
 
        @group = Unclassified 
 
      end 
 
    end 
 
    #-------------------------------------------------------------------------- 
 
    #  See Enemy 
 
    #-------------------------------------------------------------------------- 
 
    def see 
 
      @seen = true 
 
      @seen_times += 1 
 
    end 
 
    #-------------------------------------------------------------------------- 
 
    #  Defeat Enemy 
 
    #-------------------------------------------------------------------------- 
 
    def defeat 
 
      @defeated = true 
 
      @defeated_times += 1 
 
    end 
 
  end 
 
end 
 
 
#============================================================================== 
 
#  Scene_Save 
 
#============================================================================== 
 
class Scene_Save  Scene_File 
 
  #-------------------------------------------------------------------------- 
 
  #  Alias Save Data 
 
  #-------------------------------------------------------------------------- 
 
  alias new_save write_save_data 
 
  #-------------------------------------------------------------------------- 
 
  #  Write Save Data 
 
  #-------------------------------------------------------------------------- 
 
  def write_save_data(file) 
 
    new_save(file) 
 
    Marshal.dump($game_beastairy, file) 
 
  end 
 
end 
 
 
#============================================================================== 
 
#  Scene_Load 
 
#============================================================================== 
 
class Scene_Load  Scene_File 
 
  #-------------------------------------------------------------------------- 
 
  #  Alias Read Save Data 
 
  #-------------------------------------------------------------------------- 
 
  alias new_load read_save_data 
 
  #-------------------------------------------------------------------------- 
 
  #  Read Save Data 
 
  #-------------------------------------------------------------------------- 
 
  def read_save_data(file) 
 
    new_load(file) 
 
    $game_beastairy = Marshal.load(file) 
 
  end 
 
end 
 
 
#============================================================================== 
 
#  Class Window Base 
 
#============================================================================== 
 
class Window_Base  Window 
 
  #-------------------------------------------------------------------------- 
 
  #  Draw Enemy Sprite 
 
  #-------------------------------------------------------------------------- 
 
  def draw_enemy_sprite(x, y, enemy_name, enemy_hue, pose, frame) 
 
    bitmap = RPGCache.character(enemy_name, enemy_hue) 
 
    cw = bitmap.width  4 
 
    ch = bitmap.height  4 
 
    # Facing Direction 
 
    case pose 
 
      when 0    ;a = 0             # Down 
 
      when 1    ;a = ch           # Left 
 
      when 2    ;a = ch  3      # Up 
 
      when 3    ;a = ch  2      # Right 
 
    end 
 
    # Current Animation Slide 
 
    case frame 
 
      when 0    ;b = 0 
 
      when 1    ;b = cw 
 
      when 2    ;b = cw  2 
 
      when 3    ;b = cw  3 
 
    end 
 
    # Bitmap Rectange 
 
    src_rect = Rect.new(b, a, cw, ch) 
 
    # Draws Bitmap 
 
    self.contents.blt(x - cw  2, y - ch, bitmap, src_rect) 
 
  end 
 
end 
 
 
#============================================================================== 
 
# Window Monster Group Info 
 
#============================================================================== 
 
class Window_Monster_Group_Info  Window_Base 
 
  #-------------------------------------------------------------------------- 
 
  #  Object Initialization 
 
  #-------------------------------------------------------------------------- 
 
  def initialize 
 
    super(200, 0, 440, 480) 
 
    self.contents = Bitmap.new(width - 32, height - 32) 
 
    refresh(0, 0, 0) 
 
  end 
 
  #-------------------------------------------------------------------------- 
 
  #  Refresh 
 
  #     index   Index of Group From Game_Beastairy.Groups 
 
  #     pose    Enemy Character Pose 
 
  #     frame   Frame of Pose 
 
  #-------------------------------------------------------------------------- 
 
  def refresh(index, pose, frame) 
 
    # Clears Window 
 
    contents.clear 
 
    # Sets Up Group Name 
 
    group_name = $game_beastairy.monster_groups[index] 
 
    # Sets Up Enemies In Group 
 
    enemies = [] 
 
    for i in 1...$data_enemies.size 
 
      if $data_enemies[i].group == group_name 
 
        enemies.push($data_enemies[i]) 
 
      end 
 
    end 
 
    group_name = Exit if index == $game_beastairy.monster_groups.size 
 
    # Draws Enemy Group Name 
 
    contents.font.color = system_color 
 
    contents.draw_text(0, 0, self.width - 32, 32, group_name, 1) 
 
    unless index == $game_beastairy.monster_groups.size 
 
      # Offsets Graphics X Position 
 
      graphics_offset = contents.width  (enemies.size + 1) 
 
      # Draws Enemies Graphics 
 
      for i in 0...enemies.size 
 
        draw_enemy_sprite(graphics_offset  (i + 1), 124, enemies[i].battler_name , enemies[i].battler_hue , pose, frame) 
 
      end 
 
      # HP, SP, and Gold Word 
 
      hp_word = $data_system.words.hp 
 
      sp_word = $data_system.words.sp 
 
      gold_word = $data_system.words.gold 
 
      # Draws Table Headings 
 
      contents.draw_text(4, 128, width, 24, Name) 
 
      contents.draw_text(0, 128, 200, 24, Max #{hp_word}, 2) 
 
      contents.draw_text(0, 128, 300, 24, Max #{sp_word}, 2) 
 
      contents.draw_text(-4, 128, contents.width, 24, #{gold_word} Award, 2) 
 
      # Draws Enemies Stats 
 
      contents.font.color = normal_color 
 
      for i in 0...enemies.size 
 
        # Sets Enemy Stats 
 
        name, hp, sp, gold = , , , 
 
        name, hp, sp = enemies[i].name, enemies[i].maxhp, enemies[i].maxsp if enemies[i].seen 
 
        gold = enemies[i].gold if enemies[i].defeated 
 
        # Draws Stats 
 
        contents.draw_text(4, 152 + (i  24), width, 24, name) 
 
        contents.draw_text(0, 152 + (i  24), 200, 24, #{hp}, 2) 
 
        contents.draw_text(0, 152 + (i  24), 300, 24, #{sp}, 2) 
 
        contents.draw_text(-4, 152 + (i  24), contents.width, 24, #{gold}, 2) 
 
      end 
 
    end 
 
  end 
 
end 
 
 
#============================================================================== 
 
# Window Monster Info 
 
#============================================================================== 
 
class Window_Monster_Info  Window_Base 
 
  #-------------------------------------------------------------------------- 
 
  #  Object Initialization 
 
  #-------------------------------------------------------------------------- 
 
  def initialize 
 
    super(200, 0, 440, 480) 
 
    self.contents = Bitmap.new(width - 32, height - 32) 
 
  end 
 
  #-------------------------------------------------------------------------- 
 
  #  Refresh 
 
  #     index   Index of enemy From $data_enemies 
 
  #     pose    Enemy Character Pose 
 
  #     frame   Frame of Pose 
 
  #-------------------------------------------------------------------------- 
 
  def refresh(index, pose, frame) 
 
    # Clears Window 
 
    contents.clear 
 
    # Enemy 
 
    enemy = $data_enemies[index] 
 
    # Graphic Image 
 
    draw_enemy_sprite(52, 100, enemy.battler_name , enemy.battler_hue, pose, frame) 
 
    # Default Stats Set 
 
    name = 
 
    maxhp = maxsp =  str = dex = agi = int = atk = pdef = mdef = eva = 
 
    exp = gold = item_id = weapon_id = armor_id = treasure_prob = 
 
    item_icon = weapon_icon = armor_icon = 049-Skill06 
 
    armor_type = 2 
 
    # If the Enemy has been seen 
 
    if enemy.seen 
 
      name = enemy.name 
 
      maxhp = enemy.maxhp.to_s 
 
      maxsp =  enemy.maxsp.to_s 
 
      str = enemy.str.to_s 
 
      dex = enemy.dex.to_s 
 
      agi = enemy.agi.to_s 
 
      int = enemy.int.to_s 
 
      atk = enemy.atk.to_s 
 
      pdef = enemy.pdef.to_s 
 
      mdef = enemy.mdef.to_s 
 
      eva = enemy.eva.to_s 
 
    end 
 
    # If the Enemy has been Defeated 
 
    if enemy.defeated 
 
      exp = enemy.exp.to_s 
 
      gold = enemy.gold.to_s 
 
      if enemy.item_id == 0 
 
        item_id = Nothing 
 
        item_icon = 032-Item01 
 
      else 
 
        item_id = $data_items[enemy.item_id].name 
 
        item_icon = $data_items[enemy.item_id].icon_name 
 
      end 
 
      if enemy.weapon_id == 0 
 
        weapon_id = Nothing 
 
        weapon_icon = 032-Item01 
 
      else 
 
        weapon_id = $data_weapons[enemy.weapon_id].name 
 
        weapon_icon = $data_weapons[enemy.weapon_id].icon_name 
 
      end 
 
      if enemy.armor_id == 0 
 
        armor_id = Nothing 
 
        armor_icon = 032-Item01 
 
      else 
 
        armor_id = $data_armors[enemy.armor_id].name 
 
        armor_icon = $data_armors[enemy.armor_id].icon_name 
 
        armor_type = $data_armors[enemy.armor_id].type 
 
      end 
 
      treasure_prob = enemy.treasure_prob.to_s 
 
    end 
 
    # System Words 
 
    g_word = $data_system.words.gold 
 
    hp_word = $data_system.words.hp 
 
    sp_word = $data_system.words.sp 
 
    str_word = $data_system.words.str 
 
    dex_word = $data_system.words.dex 
 
    agi_word = $data_system.words.agi 
 
    int_word = $data_system.words.int 
 
    atk_word = $data_system.words.atk 
 
    pdef_word = $data_system.words.pdef 
 
    mdef_word = $data_system.words.mdef 
 
    weapon_word = $data_system.words.weapon 
 
    case armor_type 
 
      when 0     ;armor_type = $data_system.words.armor1 
 
      when 1     ;armor_type = $data_system.words.armor2 
 
      when 2     ;armor_type = $data_system.words.armor3 
 
      when 3     ;armor_type = $data_system.words.armor4 
 
    end 
 
    item_word = $data_system.words.item 
 
    # Draws Name 
 
    contents.font.color = normal_color 
 
    contents.draw_text(116, 0, contents.width - 116, 32, name) 
 
    # Draws Times Seen & Defeated 
 
    contents.font.color = system_color 
 
    contents.draw_text(116, 32, contents.width - 116, 32, Times Seen) 
 
    contents.draw_text(116, 64, contents.width - 116, 32, Times Defeated) 
 
    contents.font.color = normal_color 
 
    contents.draw_text(0, 32, contents.width, 32, #{enemy.seen_times}, 2) 
 
    contents.draw_text(0, 64, contents.width, 32, #{enemy.defeated_times}, 2) 
 
    # Organizes Stats 
 
    colomn_a_left = [Max #{hp_word}, Max #{sp_word}, str_word, dex_word, 
 
                     agi_word, int_word, atk_word, pdef_word, mdef_word, Evasion] 
 
    colomn_a_right = [maxhp, maxsp, str,dex , agi, int, atk, pdef, mdef, eva] 
 
    # Organized Victory Settings 
 
    column_b_left = [Experience Given, #{g_word} Dropped, #{item_word} Dropped, , 
 
          #{weapon_word} Dropped, , #{armor_type} Dropped, , Drop Pobabilty] 
 
    column_b_right = [exp, gold, , item_id, , weapon_id, , armor_id, treasure_prob] 
 
    # Draws Stats 
 
    for i in 0...colomn_a_left.size 
 
      contents.font.color = system_color 
 
      contents.draw_text(4, 160 + i  32, 160, 32, colomn_a_left[i]) 
 
      contents.font.color = normal_color 
 
      contents.draw_text(-4, 160 + i  32, 160, 32, colomn_a_right[i], 2) 
 
    end 
 
    # Draws Victory Settings 
 
    for i in 0...column_b_left.size 
 
      contents.font.color = system_color 
 
      contents.draw_text(168, 160 + i  32, contents.width, 32, column_b_left[i]) 
 
      x = -4 
 
      x = -30 if i == 3 or i == 5 or i == 7 
 
      contents.font.color = normal_color 
 
      contents.draw_text(x, 160 + i  32, contents.width, 32, column_b_right[i], 2) 
 
    end 
 
    # Draws Item Icons 
 
    bitmap = RPGCache.icon(item_icon) 
 
    self.contents.blt(contents.width - 24, 260, bitmap, Rect.new(0, 0, 24, 24)) 
 
    bitmap = RPGCache.icon(weapon_icon) 
 
    self.contents.blt(contents.width - 24, 324, bitmap, Rect.new(0, 0, 24, 24)) 
 
    bitmap = RPGCache.icon(armor_icon) 
 
    self.contents.blt(contents.width - 24, 388, bitmap, Rect.new(0, 0, 24, 24)) 
 
  end 
 
end 
 
 
#============================================================================== 
 
# Window Beastairy Controls 
 
#============================================================================== 
 
class Window_Beastairy_Controls  Window_Base 
 
  #-------------------------------------------------------------------------- 
 
  #  Object Initialization 
 
  #-------------------------------------------------------------------------- 
 
  def initialize 
 
    super(0, 288, 200, 192) 
 
    self.contents = Bitmap.new(width - 32, height - 32) 
 
    self.z = 999 
 
    refresh(0) 
 
  end 
 
  #-------------------------------------------------------------------------- 
 
  #  Refresh 
 
  #-------------------------------------------------------------------------- 
 
  def refresh(phase) 
 
    # Clears Window 
 
    contents.clear 
 
    disabled_system_color = Color.new(192, 224, 255, 128) 
 
    contents.font.color = normal_color 
 
    contents.draw_text(0, 0, contents.width, 24, L  R  Change Pose) 
 
    # Main Phase Controls 
 
    contents.font.color = phase == 0  system_color  disabled_system_color 
 
    contents.draw_text(4, 24, contents.width, 24, Main) 
 
    contents.font.color = phase == 0  normal_color  disabled_color 
 
    contents.draw_text(8, 48, contents.width, 24, B  Return to Map) 
 
    contents.draw_text(8, 72, contents.width, 24, C  Select Group) 
 
    # Enemy Select Controls 
 
    contents.font.color = phase == 1  system_color  disabled_system_color 
 
    contents.draw_text(4, 96, contents.width, 24, Enemy Select) 
 
    contents.font.color = phase == 1  normal_color  disabled_color 
 
    contents.draw_text(8, 120, contents.width, 24, B  Return to Main) 
 
    contents.draw_text(8, 140, contents.width, 24, C  Test Battle) 
 
  end 
 
end 
 
 
#============================================================================== 
 
#  Class Scene Beastairy 
 
#============================================================================== 
 
class Scene_Beastairy 
 
  #-------------------------------------------------------------------------- 
 
  #  Main Processing 
 
  #-------------------------------------------------------------------------- 
 
  def main 
 
    # Sets Main Phase 
 
    @phase = 0 
 
    # Enemies Graphic Animation 
 
    @pose, @frame, @counting_frame= 0, 0, 0 
 
    # Current Phase Window 
 
    @phase_window = Window_Base.new(0, 0, width = 200, height = 64) 
 
      @phase_window.contents = contents = Bitmap.new(width - 32, height - 32) 
 
      @phase_window.contents.draw_text(0, 0, 168, 32, Main Phase, 1) 
 
    # Main Window (Enemy Groups) 
 
    commands = $game_beastairy.monster_groups.dup 
 
    commands.push(Exit) 
 
    @enemy_groups = Window_Command.new(200, commands) 
 
      @enemy_groups.y = 64 
 
      @enemy_groups.height = 224 
 
    # Controls Window 
 
    @controls = Window_Beastairy_Controls.new 
 
    # Monster Group Information Window 
 
    @monster_window = Window_Monster_Group_Info.new 
 
      @monster_window.refresh(0, 0, 0) 
 
    # Enemy Information Window 
 
    @enemy_window = Window_Monster_Info.new 
 
      @enemy_window.visible = false 
 
    # Scene Objects 
 
    @objects = [@phase_window, @enemy_groups, @controls, @monster_window, @enemy_window] 
 
    # Execute transition 
 
    Graphics.transition 
 
    # Main loop 
 
    loop do 
 
      # Update game screen 
 
      Graphics.update 
 
      # Update input information 
 
      Input.update 
 
      # Update Objects Information 
 
      @objects.each {x x.update} 
 
      # Frame update 
 
      update 
 
      # Abort loop if screen is changed 
 
      break if $scene != self 
 
    end 
 
    # Prepare for transition 
 
    Graphics.freeze 
 
    # Dispose of Objects 
 
    @objects.each {x x.dispose unless x.disposed} 
 
  end 
 
  #-------------------------------------------------------------------------- 
 
  #  Frame Update 
 
  #-------------------------------------------------------------------------- 
 
  def update 
 
    # Visiblity Changes Between Methods 
 
    case @phase 
 
    # Main Phase 
 
    when 0 
 
      [@enemy_window].each {x x.visible = false if x.visible} 
 
      [@enemy_groups, @monster_window].each {x x.visible = true unless x.visible} 
 
      @enemy_groups.active = true 
 
    when 1 
 
      [@enemy_window].each {x x.visible = true unless x.visible} 
 
      [@enemy_groups, @monster_window].each {x x.visible = false if x.visible} 
 
      @enemy_groups.active = false 
 
    end 
 
    # Updates Enemy Animation 
 
    @counting_frame += 1 
 
    if @counting_frame == 8 
 
      @counting_frame = 0 
 
      @frame += 1 
 
      @frame = 0 if @frame == 4 
 
      if @phase == 0 
 
        @monster_window.refresh(@enemy_groups.index, @pose, @frame) 
 
      else 
 
        enemy_id = @enemies[@groups_enemies.index].id 
 
        @enemy_window.refresh(enemy_id, @pose, @frame) 
 
      end 
 
    end 
 
    # Current Phase Update 
 
    case @phase 
 
      when 0; main_update 
 
      when 1; enemy_select 
 
    end 
 
  end 
 
  #-------------------------------------------------------------------------- 
 
  #  Main Frame Update 
 
  #-------------------------------------------------------------------------- 
 
  def main_update 
 
    # Exit Scene 
 
    if Input.trigger(InputB) 
 
      $game_system.se_play($data_system.cancel_se) 
 
      $game_temp.beastairy_return = false 
 
      $scene = Scene_Map.new 
 
    # Enemy Select 
 
    elsif Input.trigger(InputC) 
 
      $game_system.se_play($data_system.decision_se) 
 
      if @enemy_groups.index == $game_beastairy.monster_groups.size 
 
        $game_temp.beastairy_return = false 
 
        $scene = Scene_Map.new 
 
      else 
 
        commands, @enemies = [], [] 
 
        group = $game_beastairy.monster_groups[@enemy_groups.index] 
 
        for i in 1...$data_enemies.size 
 
           if $data_enemies[i].group == group 
 
             commands.push($data_enemies[i].seen  $data_enemies[i].name  ) 
 
            @enemies.push($data_enemies[i]) 
 
          end 
 
        end 
 
        @groups_enemies = Window_Command.new(200, commands) 
 
          @groups_enemies.y = 64 
 
          @groups_enemies.height = 224 
 
        # Phase Window Update 
 
        @phase_window.contents.clear 
 
        @phase_window.contents.draw_text(0, 0, 168, 32, Enemy Select, 1) 
 
        # Adds Object (For Updating) 
 
        @objects.push(@groups_enemies) 
 
        # Updates Controls Window 
 
        @controls.refresh(1) 
 
        enemy_id = @enemies[@groups_enemies.index].id 
 
        @enemy_window.refresh(enemy_id, @pose, @frame) 
 
        # Changes Phase 
 
        @phase = 1 
 
      end 
 
    # Changes Pose 
 
    elsif Input.trigger(InputLEFT) 
 
      $game_system.se_play($data_system.cursor_se) 
 
      @pose == 0  @pose = 3  @pose -= 1 
 
    elsif Input.trigger(InputRIGHT) 
 
      $game_system.se_play($data_system.cursor_se) 
 
      @pose == 3  @pose = 0  @pose += 1 
 
    end 
 
  end 
 
  #-------------------------------------------------------------------------- 
 
  #  Enemy Frame Update 
 
  #-------------------------------------------------------------------------- 
 
  def enemy_select 
 
    # Exit Phase 
 
    if Input.trigger(InputB) 
 
      $game_system.se_play($data_system.cancel_se) 
 
      @groups_enemies.dispose 
 
      @objects.delete(@groups_enemies) 
 
      # Phase Window Update 
 
      @phase_window.contents.clear 
 
      @phase_window.contents.draw_text(0, 0, 168, 32, Main Phase, 1) 
 
      # Updates Controls Window 
 
      @controls.refresh(0) 
 
      # Changes Phase 
 
      @phase = 0 
 
    # Enemy Select 
 
    elsif Input.trigger(InputC) 
 
      enemy  = @enemies[@groups_enemies.index] 
 
      if enemy.seen 
 
        $game_system.se_play($data_system.decision_se) 
 
        enemy_name = enemy.name 
 
        for i in 1...$data_troops.size 
 
          if $data_troops[i].name == enemy_name 
 
            $game_temp.beastairy_return = true 
 
            $game_temp.battle_troop_id = i 
 
            $game_temp.battle_can_escape = true 
 
            $game_temp.battle_can_lose = false 
 
            $game_temp.battle_proc = nil 
 
            # Memorize map BGM and stop BGM 
 
            $game_temp.map_bgm = $game_system.playing_bgm 
 
            $game_system.bgm_stop 
 
            # Play battle start SE 
 
            $game_system.se_play($data_system.battle_start_se) 
 
            # Play battle BGM 
 
            $game_system.bgm_play($game_system.battle_bgm) 
 
            # Straighten player position 
 
            $game_player.straighten 
 
            # Switch to battle screen 
 
            $scene = Scene_Battle.new 
 
          end 
 
        end 
 
      else 
 
        $game_system.se_play($data_system.buzzer_se) 
 
      end 
 
    elsif Input.trigger(InputLEFT) 
 
      $game_system.se_play($data_system.cursor_se) 
 
      @pose == 0  @pose = 3  @pose -= 1 
 
    elsif Input.trigger(InputRIGHT) 
 
      $game_system.se_play($data_system.cursor_se) 
 
      @pose == 3  @pose = 0  @pose += 1 
 
    end 
 
  end 
 
end 
 
 
#============================================================================== 
 
#  Scene_Battle 
 
#============================================================================== 
 
class Scene_Battle 
 
  #-------------------------------------------------------------------------- 
 
  #  Alias Main Processing 
 
  #-------------------------------------------------------------------------- 
 
  alias beastairy_main main 
 
  #-------------------------------------------------------------------------- 
 
  #  Main Processing 
 
  #-------------------------------------------------------------------------- 
 
  def main 
 
    unless $game_temp.beastairy_return 
 
      @beastairy_troop = [] 
 
      troop = $data_troops[$game_temp.battle_troop_id] 
 
      for i in 0...troop.members.size 
 
        enemy = $data_enemies[troop.members[i].enemy_id] 
 
        @beastairy_troop.push(enemy) 
 
        enemy.see 
 
      end 
 
    else 
 
      @beastairy_troop = [] 
 
    end 
 
    beastairy_main 
 
  end 
 
  #-------------------------------------------------------------------------- 
 
  #  Battle Ends 
 
  #     result  results (0win 1lose 2escape) 
 
  #-------------------------------------------------------------------------- 
 
  def battle_end(result) 
 
    # Clear in battle flag 
 
    $game_temp.in_battle = false 
 
    # Clear entire party actions flag 
 
    $game_party.clear_actions 
 
    # Remove battle states 
 
    for actor in $game_party.actors 
 
      actor.remove_states_battle 
 
    end 
 
    # Clear enemies 
 
    $game_troop.enemies.clear 
 
    # Call battle callback 
 
    if $game_temp.battle_proc != nil 
 
      $game_temp.battle_proc.call(result) 
 
      $game_temp.battle_proc = nil 
 
    end 
 
    if $game_temp.beastairy_return 
 
      $scene = Scene_Beastairy.new 
 
    else 
 
      if result == 0 
 
        for enemy in @beastairy_troop 
 
          enemy.defeat 
 
        end 
 
      end 
 
      $scene = Scene_Map.new 
 
    end 
 
  end 
 
  #-------------------------------------------------------------------------- 
 
  #  Frame Update 
 
  #-------------------------------------------------------------------------- 
 
  def update 
 
    # If battle event is running 
 
    if $game_system.battle_interpreter.running 
 
      # Update interpreter 
 
      $game_system.battle_interpreter.update 
 
      # If a battler which is forcing actions doesn't exist 
 
      if $game_temp.forcing_battler == nil 
 
        # If battle event has finished running 
 
        unless $game_system.battle_interpreter.running 
 
          # Rerun battle event set up if battle continues 
 
          unless judge 
 
            setup_battle_event 
 
          end 
 
        end 
 
        # If not after battle phase 
 
        if @phase != 5 
 
          # Refresh status window 
 
          @status_window.refresh 
 
        end 
 
      end 
 
    end 
 
    # Update system (timer) and screen 
 
    $game_system.update 
 
    $game_screen.update 
 
    # If timer has reached 0 
 
    if $game_system.timer_working and $game_system.timer == 0 
 
      # Abort battle 
 
      $game_temp.battle_abort = true 
 
    end 
 
    # Update windows 
 
    @help_window.update 
 
    @party_command_window.update 
 
    @actor_command_window.update 
 
    @status_window.update 
 
    @message_window.update 
 
    # Update sprite set 
 
    @spriteset.update 
 
    # If transition is processing 
 
    if $game_temp.transition_processing 
 
      # Clear transition processing flag 
 
      $game_temp.transition_processing = false 
 
      # Execute transition 
 
      if $game_temp.transition_name == 
 
        Graphics.transition(20) 
 
      else 
 
        Graphics.transition(40, GraphicsTransitions + 
 
          $game_temp.transition_name) 
 
      end 
 
    end 
 
    # If message window is showing 
 
    if $game_temp.message_window_showing 
 
      return 
 
    end 
 
    # If effect is showing 
 
    if @spriteset.effect 
 
      return 
 
    end 
 
    # If game over 
 
    if $game_temp.gameover 
 
      # Switch to game over screen 
 
      if $game_temp.beastairy_return 
 
        $scene = Scene_Beastairy.new 
 
      else 
 
        $scene = Scene_Gameover.new 
 
      end 
 
    end 
 
    # If returning to title screen 
 
    if $game_temp.to_title 
 
      # Switch to title screen 
 
      $scene = Scene_Title.new 
 
      return 
 
    end 
 
    # If battle is aborted 
 
    if $game_temp.battle_abort 
 
      # Return to BGM used before battle started 
 
      $game_system.bgm_play($game_temp.map_bgm) 
 
      # Battle ends 
 
      battle_end(1) 
 
      return 
 
    end 
 
    # If waiting 
 
    if @wait_count  0 
 
      # Decrease wait count 
 
      @wait_count -= 1 
 
      return 
 
    end 
 
    # If battler forcing an action doesn't exist, 
 
    # and battle event is running 
 
    if $game_temp.forcing_battler == nil and 
 
       $game_system.battle_interpreter.running 
 
      return 
 
    end 
 
    # Branch according to phase 
 
    case @phase 
 
    when 1  # pre-battle phase 
 
      update_phase1 
 
    when 2  # party command phase 
 
      update_phase2 
 
    when 3  # actor command phase 
 
      update_phase3 
 
    when 4  # main phase 
 
      update_phase4 
 
    when 5  # after battle phase 
 
      update_phase5 
 
    end 
 
  end   
 
  #-------------------------------------------------------------------------- 
 
  #  Start After Battle Phase 
 
  #-------------------------------------------------------------------------- 
 
  def start_phase5 
 
    # Shift to phase 5 
 
    @phase = 5 
 
    # Play battle end ME 
 
    $game_system.me_play($game_system.battle_end_me) 
 
    # Return to BGM before battle started 
 
    $game_system.bgm_play($game_temp.map_bgm) 
 
    # Initialize EXP, amount of gold, and treasure 
 
    exp = 0 
 
    gold = 0 
 
    treasures = [] 
 
    # Loop 
 
    for enemy in $game_troop.enemies 
 
      # If enemy is not hidden 
 
      unless enemy.hidden 
 
        unless $game_temp.beastairy_return 
 
          # Add EXP and amount of gold obtained 
 
          exp += enemy.exp 
 
          gold += enemy.gold 
 
          # Determine if treasure appears 
 
          if rand(100)  enemy.treasure_prob 
 
            if enemy.item_id  0 
 
              treasures.push($data_items[enemy.item_id]) 
 
            end 
 
            if enemy.weapon_id  0 
 
              treasures.push($data_weapons[enemy.weapon_id]) 
 
            end 
 
            if enemy.armor_id  0 
 
              treasures.push($data_armors[enemy.armor_id]) 
 
            end 
 
          end 
 
        end 
 
      end 
 
    end 
 
    # Treasure is limited to a maximum of 6 items 
 
    treasures = treasures[0..5] 
 
    # Obtaining EXP 
 
    for i in 0...$game_party.actors.size 
 
      actor = $game_party.actors[i] 
 
      if actor.cant_get_exp == false 
 
        last_level = actor.level 
 
        actor.exp += exp 
 
        if actor.level  last_level 
 
          @status_window.level_up(i) 
 
        end 
 
      end 
 
    end 
 
    # Obtaining gold 
 
    $game_party.gain_gold(gold) 
 
    # Obtaining treasure 
 
    for item in treasures 
 
      case item 
 
      when RPGItem 
 
        $game_party.gain_item(item.id, 1) 
 
      when RPGWeapon 
 
        $game_party.gain_weapon(item.id, 1) 
 
      when RPGArmor 
 
        $game_party.gain_armor(item.id, 1) 
 
      end 
 
    end 
 
    # Make battle result window 
 
    @result_window = Window_BattleResult.new(exp, gold, treasures) 
 
    # Set wait count 
 
    @phase5_wait_count = 100 
 
  end 
 
end 

2

Sonntag, 5. November 2006, 00:52

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#============================================================================== 
# * Scene_Map 
#============================================================================== 
class Scene_Map 
  #-------------------------------------------------------------------------- 
  alias mrmo_keyhud_update update 
  #-------------------------------------------------------------------------- 
  # * Update 
  #-------------------------------------------------------------------------- 
  def update 
    mrmo_keyhud_update 
    if @mrmo_hud.CAN_TOGGLE and Input.trigger?(@mrmo_hud.TOGGLE_KEY) 
      return @mrmo_hud.visible = true if !@mrmo_hud.visible 
      return @mrmo_hud.visible = false if @mrmo_hud.visible 
    end 
  end 
end 


Das im HUD Script mit diesem hier ersetzen :

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#============================================================================== 
# * Scene_Map 
#============================================================================== 
class Scene_Map 
  #-------------------------------------------------------------------------- 
  alias mrmo_keyhud_update update 
  #-------------------------------------------------------------------------- 
  # * Update 
  #-------------------------------------------------------------------------- 
  def update 
    mrmo_keyhud_update 
    if @mrmo_hud.CAN_TOGGLE and $game_switches[1] == 1 
      return @mrmo_hud.visible = true
    end 
    if @mrmo_hud.CAN_TOGGLE and $game_switches[1] == 0 
      return @mrmo_hud.visible = false
    end 
  end 
end 


Nun kannst du mit dem Switch mit der ID 0001 das HUD sichtbat, bzw. unsichtbar machen ;D

Hoffe es funktioniert, wenn nicht, schrieb hier wieder rein ..

3

Sonntag, 5. November 2006, 02:44

Hm...hatte mich schon gefreut...aber nein, es funzt leider nicht....=(

4

Sonntag, 5. November 2006, 09:01

Warum, was passiert, wir eine Fehlermeldung angezeigt ?

Das würde bestimmt helfen, wenn man dir helfen will ;D

5

Sonntag, 5. November 2006, 09:24

Nun ich hab ein eigenes Script das geht an wenn ich es aufrufe mit Scene...new und das bleibt nur auf der Map wo ich bin wenn ich die MAp verlasse ist die Scene beendet^^

Bei dir versuch doch mal diesen code:
Scene_deinescene.end

vieleicht klappts^^

6

Sonntag, 5. November 2006, 14:46

Nein es wird keine Fehlermeldung angezeigt...aber ich kann durch den Switch 1 die HP Anzeige nicht ausschalten. Auch die E Taste funktioniert somit nichtmehr... oder muss ich den Switch anders an oder ausschalten?(*)

Habt ihr ne Theorie zum zweiten? (Btw. das Scrip t könnt ihr ja so einmal in ein Project einfügen, das funktioniert. ;) )

7

Sonntag, 5. November 2006, 19:28

ich schätze mal, das Script von F!o stimmt schon, bloß muss man noch irgendwas aktualisieren, das Problem hatte cih auch schonmal... weiß nur nimmer wie ichs gelöst habe ;)

Probier mal das da:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#============================================================================== 
# * Scene_Map 
#============================================================================== 
class Scene_Map 
  #-------------------------------------------------------------------------- 
  alias mrmo_keyhud_update update 
  #-------------------------------------------------------------------------- 
  # * Update 
  #-------------------------------------------------------------------------- 
  def update 
    mrmo_keyhud_update 
    $game_map.need_refresh = true
    if @mrmo_hud.CAN_TOGGLE and $game_switches[1] == true or @mrmo_hud.CAN_TOGGLE and Input.trigger?(@mrmo_hud.TOGGLE_KEY)
      return @mrmo_hud.visible = true
    end 
    if @mrmo_hud.CAN_TOGGLE and $game_switches[1] == false
      return @mrmo_hud.visible = false
    end 
  end 
end


Jetzt sollte das rein theoretiscvh funzen... ich hab auch wieder eingebaut, dass du das mit der taste wieder umstellen kannst...

Drag-On

8

Sonntag, 5. November 2006, 22:22

Wow, danke danke danke es geht! =))) *überglücklich binz*

Und was meint ihr zum 2.? Mit dem Monsterbuch? Kann man in einem Event vielleicht anzeigen lassen ja man hat das Monster besiegt, damit man die Infos sehen kann? Oder wie würdet ihr das machen?

9

Montag, 6. November 2006, 15:58

Schau mal hier:Link
Jaja, was man so alles mit der [COLOR="green"]SuFu[/COLOR] findet...

Drag-On

10

Montag, 6. November 2006, 16:27

Ah danke...
nur...wie mach ich das jetzt? Per CALL SCRIPT das aufzurufen geht nicht... Was genau muss ich aufrufen? (Hab die ID 1 angegeben)

11

Montag, 6. November 2006, 16:49

das liegt vermutlich daran, dass du nicht das gleiche Script benutzt wie dort gezeigt wird. Wenn du nicht umbedingt das, was du gepostet hast benutzen willst, nimm doch einfach das von dem Link.

Edit: Ansonsten liegt das ganze wohl hier drin:

Quellcode

1
2
3
enemy = $data_enemies[troop.members[i].enemy_id] 
        @beastairy_troop.push(enemy) 
        enemy.see 

da gibt es allerdings das problem, dass @beastairy_troop lokal ist...

Drag-On

12

Montag, 6. November 2006, 17:10

Doch möchte ich schon...was heißt lokal? Das alle Gegner dann angezeigt werden?
Wie genau kann ich das denn machen?

13

Montag, 6. November 2006, 20:09

das heißt, du willst das Script behalten? Na gut, bedeutet mehr Arbeit^^

Lokal... Also, @beastairy_troop ist eine Variable, aber sie ist nur lokal definiert, das heißt, dass man nur aus dem Script selber auf sie zugreifen kann... das muss man ändern, so dass sie nachher global ist, also man von überall auf sie zugreifen kann. Das @ in @beastairy_troop bedeutet übrigens, dass sie lokal ist, mit einem $ davor ist sie global...

Ich schau mir das ganze mal an...

Edit: Ähmm, sicher das das Bestiary-Script stimmt, das du gepostet hast? Bei mir geht das noch nichtmal ohne veränderung...

Drag-On

14

Montag, 6. November 2006, 21:22

Hab dich in ICQ geaddet, hab noch keine Autorisation von dir. Aber der code dürfte stimmen:
Nochmal:

Quellcode

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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
#==============================================================================
# Beastairy System
#--------------------------------------------------------------------------
#   Created By SephirothSpawn (11.18.05)
#    Last Updated: 11.18.05
#==============================================================================
 
#==============================================================================
# ** Class Scene Title
#==============================================================================
class Scene_Title
  #--------------------------------------------------------------------------
  # * Alias' New Game Method
  #--------------------------------------------------------------------------
  alias new_game command_new_game
  #--------------------------------------------------------------------------
  # * Adds Beastairy Game Variables
  #--------------------------------------------------------------------------
  def command_new_game
    # Sets Up Smithery List
    $game_beastairy = Game_Beastairy.new
    new_game
  end
end
 
#==============================================================================
# ** Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :beastairy_return
  #--------------------------------------------------------------------------
  # * Alias Initialization
  #--------------------------------------------------------------------------
  alias beastairy_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    beastairy_initialize
    @beastairy_return = false
  end
end
 
#==============================================================================
# ** Class Game Beastairy
#==============================================================================
class Game_Beastairy
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :monster_groups
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @monster_groups = []
    for i in 1...$data_enemies.size
      $data_enemies[i].beastairy_setup
      unless @monster_groups.include?($data_enemies[i].group)
        @monster_groups.push($data_enemies[i].group)
      end
    end
  end
end
 
#==============================================================================
# ** Module RPG
#==============================================================================
module RPG
  #=========================================================================
  # ** Class Enemy
  #=========================================================================
  class Enemy
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    # Detectors
    attr_accessor :seen, :defeated, :group
    # Counters
    attr_accessor :seen_times, :defeated_times
    #--------------------------------------------------------------------------
    # * Setup Beastairy
    #--------------------------------------------------------------------------
    def beastairy_setup
      @seen_times, @defeated_times = 0, 0
      @seen, @defeated = false, false
      if @name.include?('(')
        a, b = @name.index('('), @name.index(')')
        @group = @name.slice!(a..b)
        @group.delete!('(')
        @group.delete!(')')
      else
        @group = "Unclassified"
      end
    end
    #--------------------------------------------------------------------------
    # * See Enemy
    #--------------------------------------------------------------------------
    def see
      @seen = true
      @seen_times += 1
    end
    #--------------------------------------------------------------------------
    # * Defeat Enemy
    #--------------------------------------------------------------------------
    def defeat
      @defeated = true
      @defeated_times += 1
    end
  end
end
 
#==============================================================================
# ** Scene_Save
#==============================================================================
class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Save Data
  #--------------------------------------------------------------------------
  alias new_save write_save_data
  #--------------------------------------------------------------------------
  # * Write Save Data
  #--------------------------------------------------------------------------
  def write_save_data(file)
    new_save(file)
    Marshal.dump($game_beastairy, file)
  end
end
 
#==============================================================================
# ** Scene_Load
#==============================================================================
class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Read Save Data
  #--------------------------------------------------------------------------
  alias new_load read_save_data
  #--------------------------------------------------------------------------
  # * Read Save Data
  #--------------------------------------------------------------------------
  def read_save_data(file)
    new_load(file)
    $game_beastairy = Marshal.load(file)
  end
end
 
#==============================================================================
# ** Class Window Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Enemy Sprite
  #--------------------------------------------------------------------------
  def draw_enemy_sprite(x, y, enemy_name, enemy_hue, pose, frame)
    bitmap = RPG::Cache.character(enemy_name, enemy_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    # Facing Direction
    case pose
      when 0    ;a = 0             # Down
      when 1    ;a = ch           # Left
      when 2    ;a = ch * 3      # Up
      when 3    ;a = ch * 2      # Right
    end
    # Current Animation Slide
    case frame
      when 0    ;b = 0
      when 1    ;b = cw
      when 2    ;b = cw * 2
      when 3    ;b = cw * 3
    end
    # Bitmap Rectange
    src_rect = Rect.new(b, a, cw, ch)
    # Draws Bitmap
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
end
 
#==============================================================================
# Window Monster Group Info
#==============================================================================
class Window_Monster_Group_Info < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(200, 0, 440, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh(0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #     index  : Index of Group From Game_Beastairy.Groups
  #     pose   : Enemy Character Pose
  #     frame  : Frame of Pose
  #--------------------------------------------------------------------------
  def refresh(index, pose, frame)
    # Clears Window
    contents.clear
    # Sets Up Group Name
    group_name = $game_beastairy.monster_groups[index]
    # Sets Up Enemies In Group
    enemies = []
    for i in 1...$data_enemies.size
      if $data_enemies[i].group == group_name
        enemies.push($data_enemies[i])
      end
    end
    group_name = "Exit" if index == $game_beastairy.monster_groups.size
    # Draws Enemy Group Name
    contents.font.color = system_color
    contents.draw_text(0, 0, self.width - 32, 32, group_name, 1)
    unless index == $game_beastairy.monster_groups.size
      # Offsets Graphics X Position
      graphics_offset = contents.width / (enemies.size + 1)
      # Draws Enemies Graphics
      for i in 0...enemies.size
        draw_enemy_sprite(graphics_offset * (i + 1), 124, enemies[i].battler_name , enemies[i].battler_hue , pose, frame)
      end
      # HP, SP, and Gold Word
      hp_word = $data_system.words.hp
      sp_word = $data_system.words.sp
      gold_word = $data_system.words.gold
      # Draws Table Headings
      contents.draw_text(4, 128, width, 24, "Name")
      contents.draw_text(0, 128, 200, 24, "Max #{hp_word}", 2)
      contents.draw_text(0, 128, 300, 24, "Max #{sp_word}", 2)
      contents.draw_text(-4, 128, contents.width, 24, "#{gold_word} Award", 2)
      # Draws Enemies Stats
      contents.font.color = normal_color
      for i in 0...enemies.size
        # Sets Enemy Stats
        name, hp, sp, gold = "??????????", "???", "???", "?????"
        name, hp, sp = enemies[i].name, enemies[i].maxhp, enemies[i].maxsp if enemies[i].seen
        gold = enemies[i].gold if enemies[i].defeated
        # Draws Stats
        contents.draw_text(4, 152 + (i * 24), width, 24, name)
        contents.draw_text(0, 152 + (i * 24), 200, 24, "#{hp}", 2)
        contents.draw_text(0, 152 + (i * 24), 300, 24, "#{sp}", 2)
        contents.draw_text(-4, 152 + (i * 24), contents.width, 24, "#{gold}", 2)
      end
    end
  end
end
 
#==============================================================================
# Window Monster Info
#==============================================================================
class Window_Monster_Info < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(200, 0, 440, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #     index  : Index of enemy From $data_enemies
  #     pose   : Enemy Character Pose
  #     frame  : Frame of Pose
  #--------------------------------------------------------------------------
  def refresh(index, pose, frame)
    # Clears Window
    contents.clear
    # Enemy
    enemy = $data_enemies[index]
    # Graphic Image
    draw_enemy_sprite(52, 100, enemy.battler_name , enemy.battler_hue, pose, frame)
    # Default Stats Set
    name = "??????????"
    maxhp = maxsp =  str = dex = agi = int = atk = pdef = mdef = eva = "???"
    exp = gold = item_id = weapon_id = armor_id = treasure_prob = "?????"
    item_icon = weapon_icon = armor_icon = "049-Skill06"
    armor_type = 2
    # If the Enemy has been seen
    if enemy.seen
      name = enemy.name
      maxhp = enemy.maxhp.to_s
      maxsp =  enemy.maxsp.to_s
      str = enemy.str.to_s
      dex = enemy.dex.to_s
      agi = enemy.agi.to_s
      int = enemy.int.to_s
      atk = enemy.atk.to_s
      pdef = enemy.pdef.to_s
      mdef = enemy.mdef.to_s
      eva = enemy.eva.to_s
    end
    # If the Enemy has been Defeated
    if enemy.defeated
      exp = enemy.exp.to_s
      gold = enemy.gold.to_s
      if enemy.item_id == 0
        item_id = "Nothing"
        item_icon = "032-Item01"
      else
        item_id = $data_items[enemy.item_id].name
        item_icon = $data_items[enemy.item_id].icon_name
      end
      if enemy.weapon_id == 0
        weapon_id = "Nothing"
        weapon_icon = "032-Item01"
      else
        weapon_id = $data_weapons[enemy.weapon_id].name
        weapon_icon = $data_weapons[enemy.weapon_id].icon_name
      end
      if enemy.armor_id == 0
        armor_id = "Nothing"
        armor_icon = "032-Item01"
      else
        armor_id = $data_armors[enemy.armor_id].name
        armor_icon = $data_armors[enemy.armor_id].icon_name
        armor_type = $data_armors[enemy.armor_id].type
      end
      treasure_prob = enemy.treasure_prob.to_s
    end
    # System Words
    g_word = $data_system.words.gold 
    hp_word = $data_system.words.hp 
    sp_word = $data_system.words.sp 
    str_word = $data_system.words.str 
    dex_word = $data_system.words.dex 
    agi_word = $data_system.words.agi 
    int_word = $data_system.words.int 
    atk_word = $data_system.words.atk 
    pdef_word = $data_system.words.pdef 
    mdef_word = $data_system.words.mdef 
    weapon_word = $data_system.words.weapon
    case armor_type
      when 0     ;armor_type = $data_system.words.armor1
      when 1     ;armor_type = $data_system.words.armor2
      when 2     ;armor_type = $data_system.words.armor3
      when 3     ;armor_type = $data_system.words.armor4
    end
    item_word = $data_system.words.item 
    # Draws Name
    contents.font.color = normal_color
    contents.draw_text(116, 0, contents.width - 116, 32, name)
    # Draws Times Seen & Defeated
    contents.font.color = system_color
    contents.draw_text(116, 32, contents.width - 116, 32, "Times Seen:")
    contents.draw_text(116, 64, contents.width - 116, 32, "Times Defeated:")
    contents.font.color = normal_color
    contents.draw_text(0, 32, contents.width, 32, "#{enemy.seen_times}", 2)
    contents.draw_text(0, 64, contents.width, 32, "#{enemy.defeated_times}", 2)
    # Organizes Stats
    colomn_a_left = ["Max #{hp_word}", "Max #{sp_word}", str_word, dex_word, 
                     agi_word, int_word, atk_word, pdef_word, mdef_word, "Evasion"]
    colomn_a_right = [maxhp, maxsp, str,dex , agi, int, atk, pdef, mdef, eva]
    # Organized Victory Settings
    column_b_left = ["Experience Given:", "#{g_word} Dropped:", "#{item_word} Dropped:", "",
          "#{weapon_word} Dropped:", "", "#{armor_type} Dropped:", "", "Drop Pobabilty:"]
    column_b_right = [exp, gold, "", item_id, "", weapon_id, "", armor_id, treasure_prob]
    # Draws Stats
    for i in 0...colomn_a_left.size
      contents.font.color = system_color
      contents.draw_text(4, 160 + i * 32, 160, 32, colomn_a_left[i])
      contents.font.color = normal_color
      contents.draw_text(-4, 160 + i * 32, 160, 32, colomn_a_right[i], 2)
    end
    # Draws Victory Settings
    for i in 0...column_b_left.size
      contents.font.color = system_color
      contents.draw_text(168, 160 + i * 32, contents.width, 32, column_b_left[i])
      x = -4
      x = -30 if i == 3 or i == 5 or i == 7
      contents.font.color = normal_color
      contents.draw_text(x, 160 + i * 32, contents.width, 32, column_b_right[i], 2)
    end
    # Draws Item Icons
    bitmap = RPG::Cache.icon(item_icon)
    self.contents.blt(contents.width - 24, 260, bitmap, Rect.new(0, 0, 24, 24))
    bitmap = RPG::Cache.icon(weapon_icon)
    self.contents.blt(contents.width - 24, 324, bitmap, Rect.new(0, 0, 24, 24))
    bitmap = RPG::Cache.icon(armor_icon)
    self.contents.blt(contents.width - 24, 388, bitmap, Rect.new(0, 0, 24, 24))
  end
end
 
#==============================================================================
# Window Beastairy Controls
#==============================================================================
class Window_Beastairy_Controls < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 288, 200, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z = 999
    refresh(0)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(phase)
    # Clears Window
    contents.clear
    disabled_system_color = Color.new(192, 224, 255, 128)
    contents.font.color = normal_color
    contents.draw_text(0, 0, contents.width, 24, "L / R : Change Pose")
    # Main Phase Controls
    contents.font.color = phase == 0 ? system_color : disabled_system_color
    contents.draw_text(4, 24, contents.width, 24, "Main")
    contents.font.color = phase == 0 ? normal_color : disabled_color
    contents.draw_text(8, 48, contents.width, 24, "B : Return to Map")
    contents.draw_text(8, 72, contents.width, 24, "C : Select Group")
    # Enemy Select Controls
    contents.font.color = phase == 1 ? system_color : disabled_system_color
    contents.draw_text(4, 96, contents.width, 24, "Enemy Select")
    contents.font.color = phase == 1 ? normal_color : disabled_color
    contents.draw_text(8, 120, contents.width, 24, "B : Return to Main")
    contents.draw_text(8, 140, contents.width, 24, "C : Test Battle")
  end
end
 
#==============================================================================
# ** Class Scene Beastairy
#==============================================================================
class Scene_Beastairy
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Sets Main Phase
    @phase = 0
    # Enemies Graphic Animation
    @pose, @frame, @counting_frame= 0, 0, 0
    # Current Phase Window
    @phase_window = Window_Base.new(0, 0, width = 200, height = 64)
      @phase_window.contents = contents = Bitmap.new(width - 32, height - 32)
      @phase_window.contents.draw_text(0, 0, 168, 32, "Main Phase", 1)
    # Main Window (Enemy Groups)
    commands = $game_beastairy.monster_groups.dup
    commands.push("Exit")
    @enemy_groups = Window_Command.new(200, commands)
      @enemy_groups.y = 64
      @enemy_groups.height = 224
    # Controls Window
    @controls = Window_Beastairy_Controls.new
    # Monster Group Information Window
    @monster_window = Window_Monster_Group_Info.new
      @monster_window.refresh(0, 0, 0)
    # Enemy Information Window
    @enemy_window = Window_Monster_Info.new
      @enemy_window.visible = false
    # Scene Objects
    @objects = [@phase_window, @enemy_groups, @controls, @monster_window, @enemy_window]
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Update Objects Information
      @objects.each {|x| x.update}
      # Frame update
      update
      # Abort loop if screen is changed
      break if $scene != self
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of Objects
    @objects.each {|x| x.dispose unless x.disposed?}
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Visiblity Changes Between Methods
    case @phase
    # Main Phase
    when 0
      [@enemy_window].each {|x| x.visible = false if x.visible}
      [@enemy_groups, @monster_window].each {|x| x.visible = true unless x.visible}
      @enemy_groups.active = true
    when 1
      [@enemy_window].each {|x| x.visible = true unless x.visible}
      [@enemy_groups, @monster_window].each {|x| x.visible = false if x.visible}
      @enemy_groups.active = false
    end
    # Updates Enemy Animation
    @counting_frame += 1
    if @counting_frame == 8
      @counting_frame = 0
      @frame += 1
      @frame = 0 if @frame == 4
      if @phase == 0
        @monster_window.refresh(@enemy_groups.index, @pose, @frame)
      else
        enemy_id = @enemies[@groups_enemies.index].id
        @enemy_window.refresh(enemy_id, @pose, @frame)
      end
    end
    # Current Phase Update
    case @phase
      when 0; main_update
      when 1; enemy_select
    end
  end
  #--------------------------------------------------------------------------
  # * Main Frame Update
  #--------------------------------------------------------------------------
  def main_update
    # Exit Scene
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $game_temp.beastairy_return = false
      $scene = Scene_Map.new
    # Enemy Select
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      if @enemy_groups.index == $game_beastairy.monster_groups.size
        $game_temp.beastairy_return = false
        $scene = Scene_Map.new
      else
        commands, @enemies = [], []
        group = $game_beastairy.monster_groups[@enemy_groups.index]
        for i in 1...$data_enemies.size
           if $data_enemies[i].group == group
            commands.push($data_enemies[i].name)
            @enemies.push($data_enemies[i])
          end
        end
        @groups_enemies = Window_Command.new(200, commands)
          @groups_enemies.y = 64
          @groups_enemies.height = 224
        # Phase Window Update
        @phase_window.contents.clear
        @phase_window.contents.draw_text(0, 0, 168, 32, "Enemy Select", 1)
        # Adds Object (For Updating)
        @objects.push(@groups_enemies)
        # Updates Controls Window
        @controls.refresh(1)
        enemy_id = @enemies[@groups_enemies.index].id
        @enemy_window.refresh(enemy_id, @pose, @frame)
        # Changes Phase
        @phase = 1
      end
    # Changes Pose
    elsif Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 0 ? @pose = 3 : @pose -= 1
    elsif Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 3 ? @pose = 0 : @pose += 1
    end
  end
  #--------------------------------------------------------------------------
  # * Enemy Frame Update
  #--------------------------------------------------------------------------
  def enemy_select
    # Exit Phase
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @groups_enemies.dispose
      @objects.delete(@groups_enemies)
      # Phase Window Update
      @phase_window.contents.clear
      @phase_window.contents.draw_text(0, 0, 168, 32, "Main Phase", 1)
      # Updates Controls Window
      @controls.refresh(0)
      # Changes Phase
      @phase = 0
    # Enemy Select
    elsif Input.trigger?(Input::C)
      enemy  = @enemies[@groups_enemies.index]
      if enemy.seen
        $game_system.se_play($data_system.decision_se)
        enemy_name = enemy.name
        for i in 1...$data_troops.size
          if $data_troops[i].name == enemy_name
            $game_temp.beastairy_return = true
            $game_temp.battle_troop_id = i
            $game_temp.battle_can_escape = true
            $game_temp.battle_can_lose = false
            $game_temp.battle_proc = nil
            # Memorize map BGM and stop BGM
            $game_temp.map_bgm = $game_system.playing_bgm
            $game_system.bgm_stop
            # Play battle start SE
            $game_system.se_play($data_system.battle_start_se)
            # Play battle BGM
            $game_system.bgm_play($game_system.battle_bgm)
            # Straighten player position
            $game_player.straighten
            # Switch to battle screen
            $scene = Scene_Battle.new
          end
        end
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 0 ? @pose = 3 : @pose -= 1
    elsif Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 3 ? @pose = 0 : @pose += 1
    end
  end
end
 
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Main Processing
  #--------------------------------------------------------------------------
  alias beastairy_main main
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    unless $game_temp.beastairy_return
      @beastairy_troop = []
      troop = $data_troops[$game_temp.battle_troop_id]
      for i in 0...troop.members.size
        enemy = $data_enemies[troop.members[i].enemy_id]
        @beastairy_troop.push(enemy)
        enemy.see
      end
    else
      @beastairy_troop = []
    end
    beastairy_main
  end
  #--------------------------------------------------------------------------
  # * Battle Ends
  #     result : results (0:win 1:lose 2:escape)
  #--------------------------------------------------------------------------
  def battle_end(result)
    # Clear in battle flag
    $game_temp.in_battle = false
    # Clear entire party actions flag
    $game_party.clear_actions
    # Remove battle states
    for actor in $game_party.actors
      actor.remove_states_battle
    end
    # Clear enemies
    $game_troop.enemies.clear
    # Call battle callback
    if $game_temp.battle_proc != nil
      $game_temp.battle_proc.call(result)
      $game_temp.battle_proc = nil
    end
    if $game_temp.beastairy_return
      $scene = Scene_Beastairy.new
    else
      if result == 0
        for enemy in @beastairy_troop
          enemy.defeat
        end
      end
      $scene = Scene_Map.new
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If battle event is running
    if $game_system.battle_interpreter.running?
      # Update interpreter
      $game_system.battle_interpreter.update
      # If a battler which is forcing actions doesn't exist
      if $game_temp.forcing_battler == nil
        # If battle event has finished running
        unless $game_system.battle_interpreter.running?
          # Rerun battle event set up if battle continues
          unless judge
            setup_battle_event
          end
        end
        # If not after battle phase
        if @phase != 5
          # Refresh status window
          @status_window.refresh
        end
      end
    end
    # Update system (timer) and screen
    $game_system.update
    $game_screen.update
    # If timer has reached 0
    if $game_system.timer_working and $game_system.timer == 0
      # Abort battle
      $game_temp.battle_abort = true
    end
    # Update windows
    @help_window.update
    @party_command_window.update
    @actor_command_window.update
    @status_window.update
    @message_window.update
    # Update sprite set
    @spriteset.update
    # If transition is processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If message window is showing
    if $game_temp.message_window_showing
      return
    end
    # If effect is showing
    if @spriteset.effect?
      return
    end
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      if $game_temp.beastairy_return
        $scene = Scene_Beastairy.new
      else
        $scene = Scene_Gameover.new
      end
    end
    # If returning to title screen
    if $game_temp.to_title
      # Switch to title screen
      $scene = Scene_Title.new
      return
    end
    # If battle is aborted
    if $game_temp.battle_abort
      # Return to BGM used before battle started
      $game_system.bgm_play($game_temp.map_bgm)
      # Battle ends
      battle_end(1)
      return
    end
    # If waiting
    if @wait_count > 0
      # Decrease wait count
      @wait_count -= 1
      return
    end
    # If battler forcing an action doesn't exist,
    # and battle event is running
    if $game_temp.forcing_battler == nil and
       $game_system.battle_interpreter.running?
      return
    end
    # Branch according to phase
    case @phase
    when 1  # pre-battle phase
      update_phase1
    when 2  # party command phase
      update_phase2
    when 3  # actor command phase
      update_phase3
    when 4  # main phase
      update_phase4
    when 5  # after battle phase
      update_phase5
    end
  end  
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  def start_phase5
    # Shift to phase 5
    @phase = 5
    # Play battle end ME
    $game_system.me_play($game_system.battle_end_me)
    # Return to BGM before battle started
    $game_system.bgm_play($game_temp.map_bgm)
    # Initialize EXP, amount of gold, and treasure
    exp = 0
    gold = 0
    treasures = []
    # Loop
    for enemy in $game_troop.enemies
      # If enemy is not hidden
      unless enemy.hidden
        unless $game_temp.beastairy_return
          # Add EXP and amount of gold obtained
          exp += enemy.exp
          gold += enemy.gold
          # Determine if treasure appears
          if rand(100) < enemy.treasure_prob
            if enemy.item_id > 0
              treasures.push($data_items[enemy.item_id])
            end
            if enemy.weapon_id > 0
              treasures.push($data_weapons[enemy.weapon_id])
            end
            if enemy.armor_id > 0
              treasures.push($data_armors[enemy.armor_id])
            end
          end
        end
      end
    end
    # Treasure is limited to a maximum of 6 items
    treasures = treasures[0..5]
    # Obtaining EXP
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    # Obtaining gold
    $game_party.gain_gold(gold)
    # Obtaining treasure
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # Make battle result window
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # Set wait count
    @phase5_wait_count = 100
  end
end

Und dann nen Kampf gegen nen Geist oder so halt machen...bei mir funktionierts o.O

15

Mittwoch, 8. November 2006, 20:03

So, ich hab das ganze jetzt geschafft: ersetzen deinen Code mit dem hier:

Quellcode

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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
#==============================================================================
# Beastairy System
#--------------------------------------------------------------------------
#   Created By SephirothSpawn (11.18.05)
#    Last Updated: 11.18.05
#==============================================================================
 
#==============================================================================
# ** Class Scene Title
#==============================================================================
class Scene_Title
  #--------------------------------------------------------------------------
  # * Alias' New Game Method
  #--------------------------------------------------------------------------
  alias new_game command_new_game
  #--------------------------------------------------------------------------
  # * Adds Beastairy Game Variables
  #--------------------------------------------------------------------------
  def command_new_game
    # Sets Up Smithery List
    $game_beastairy = Game_Beastairy.new
    new_game
  end
end
 
#==============================================================================
# ** Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :beastairy_return
  #--------------------------------------------------------------------------
  # * Alias Initialization
  #--------------------------------------------------------------------------
  alias beastairy_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    beastairy_initialize
    @beastairy_return = false
  end
end
 
#==============================================================================
# ** Class Game Beastairy
#==============================================================================
class Game_Beastairy
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :monster_groups
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @monster_groups = []
    for i in 1...$data_enemies.size
      $data_enemies[i].beastairy_setup
      unless @monster_groups.include?($data_enemies[i].group)
        @monster_groups.push($data_enemies[i].group)
      end
    end
  end
end
 
#==============================================================================
# ** Module RPG
#==============================================================================
module RPG
  #=========================================================================
  # ** Class Enemy
  #=========================================================================
  class Enemy
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    # Detectors
    attr_accessor :seen, :defeated, :group
    # Counters
    attr_accessor :seen_times, :defeated_times
    #--------------------------------------------------------------------------
    # * Setup Beastairy
    #--------------------------------------------------------------------------
    def beastairy_setup
      @seen_times, @defeated_times = 0, 0
      @seen, @defeated = false, false
      if @name.include?('(')
        a, b = @name.index('('), @name.index(')')
        @group = @name.slice!(a..b)
        @group.delete!('(')
        @group.delete!(')')
      else
        @group = "Unclassified"
      end
    end
    #--------------------------------------------------------------------------
    # * See Enemy
    #--------------------------------------------------------------------------
    def see
      @seen = true
      @seen_times += 1
    end
    #--------------------------------------------------------------------------
    # * Defeat Enemy
    #--------------------------------------------------------------------------
    def defeat
      @defeated = true
      @defeated_times += 1
    end
  end
end
 
#==============================================================================
# ** Scene_Save
#==============================================================================
class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Save Data
  #--------------------------------------------------------------------------
  alias new_save write_save_data
  #--------------------------------------------------------------------------
  # * Write Save Data
  #--------------------------------------------------------------------------
  def write_save_data(file)
    new_save(file)
    Marshal.dump($game_beastairy, file)
  end
end
 
#==============================================================================
# ** Scene_Load
#==============================================================================
class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Read Save Data
  #--------------------------------------------------------------------------
  alias new_load read_save_data
  #--------------------------------------------------------------------------
  # * Read Save Data
  #--------------------------------------------------------------------------
  def read_save_data(file)
    new_load(file)
    $game_beastairy = Marshal.load(file)
  end
end
 
#==============================================================================
# ** Class Window Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Enemy Sprite
  #--------------------------------------------------------------------------
  def draw_enemy_sprite(x, y, enemy_name, enemy_hue, pose, frame)
    bitmap = RPG::Cache.character(enemy_name, enemy_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    # Facing Direction
    case pose
      when 0    ;a = 0             # Down
      when 1    ;a = ch           # Left
      when 2    ;a = ch * 3      # Up
      when 3    ;a = ch * 2      # Right
    end
    # Current Animation Slide
    case frame
      when 0    ;b = 0
      when 1    ;b = cw
      when 2    ;b = cw * 2
      when 3    ;b = cw * 3
    end
    # Bitmap Rectange
    src_rect = Rect.new(b, a, cw, ch)
    # Draws Bitmap
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
end
 
#==============================================================================
# Window Monster Group Info
#==============================================================================
class Window_Monster_Group_Info < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(200, 0, 440, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh(0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #     index  : Index of Group From Game_Beastairy.Groups
  #     pose   : Enemy Character Pose
  #     frame  : Frame of Pose
  #--------------------------------------------------------------------------
  def refresh(index, pose, frame)
    # Clears Window
    contents.clear
    # Sets Up Group Name
    group_name = $game_beastairy.monster_groups[index]
    # Sets Up Enemies In Group
    enemies = []
    for i in 1...$data_enemies.size
      if $data_enemies[i].group == group_name
        enemies.push($data_enemies[i])
      end
    end
    group_name = "Exit" if index == $game_beastairy.monster_groups.size
    # Draws Enemy Group Name
    contents.font.color = system_color
    contents.draw_text(0, 0, self.width - 32, 32, group_name, 1)
    unless index == $game_beastairy.monster_groups.size
      # Offsets Graphics X Position
      graphics_offset = contents.width / (enemies.size + 1)
      # Draws Enemies Graphics
      for i in 0...enemies.size
        draw_enemy_sprite(graphics_offset * (i + 1), 124, enemies[i].battler_name , enemies[i].battler_hue , pose, frame)
      end
      # HP, SP, and Gold Word
      hp_word = $data_system.words.hp
      sp_word = $data_system.words.sp
      gold_word = $data_system.words.gold
      # Draws Table Headings
      contents.draw_text(4, 128, width, 24, "Name")
      contents.draw_text(0, 128, 200, 24, "Max #{hp_word}", 2)
      contents.draw_text(0, 128, 300, 24, "Max #{sp_word}", 2)
      contents.draw_text(-4, 128, contents.width, 24, "#{gold_word} Award", 2)
      # Draws Enemies Stats
      contents.font.color = normal_color
      for i in 0...enemies.size
        # Sets Enemy Stats
        name, hp, sp, gold = "??????????", "???", "???", "?????"
        name, hp, sp = enemies[i].name, enemies[i].maxhp, enemies[i].maxsp if enemies[i].seen
        gold = enemies[i].gold if enemies[i].defeated
        # Draws Stats
        contents.draw_text(4, 152 + (i * 24), width, 24, name)
        contents.draw_text(0, 152 + (i * 24), 200, 24, "#{hp}", 2)
        contents.draw_text(0, 152 + (i * 24), 300, 24, "#{sp}", 2)
        contents.draw_text(-4, 152 + (i * 24), contents.width, 24, "#{gold}", 2)
      end
    end
  end
end
 
#==============================================================================
# Window Monster Info
#==============================================================================
class Window_Monster_Info < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(200, 0, 440, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #     index  : Index of enemy From $data_enemies
  #     pose   : Enemy Character Pose
  #     frame  : Frame of Pose
  #--------------------------------------------------------------------------
  def refresh(index, pose, frame)
    # Clears Window
    contents.clear
    # Enemy
    enemy = $data_enemies[index]
    # Graphic Image
    draw_enemy_sprite(52, 100, enemy.battler_name , enemy.battler_hue, pose, frame)
    # Default Stats Set
    name = "??????????"
    maxhp = maxsp =  str = dex = agi = int = atk = pdef = mdef = eva = "???"
    exp = gold = item_id = weapon_id = armor_id = treasure_prob = "?????"
    item_icon = weapon_icon = armor_icon = "049-Skill06"
    armor_type = 2
    # If the Enemy has been seen
    if enemy.seen
      name = enemy.name
      maxhp = enemy.maxhp.to_s
      maxsp =  enemy.maxsp.to_s
      str = enemy.str.to_s
      dex = enemy.dex.to_s
      agi = enemy.agi.to_s
      int = enemy.int.to_s
      atk = enemy.atk.to_s
      pdef = enemy.pdef.to_s
      mdef = enemy.mdef.to_s
      eva = enemy.eva.to_s
    end
    # If the Enemy has been Defeated
    if enemy.defeated
      exp = enemy.exp.to_s
      gold = enemy.gold.to_s
      if enemy.item_id == 0
        item_id = "Nothing"
        item_icon = "032-Item01"
      else
        item_id = $data_items[enemy.item_id].name
        item_icon = $data_items[enemy.item_id].icon_name
      end
      if enemy.weapon_id == 0
        weapon_id = "Nothing"
        weapon_icon = "032-Item01"
      else
        weapon_id = $data_weapons[enemy.weapon_id].name
        weapon_icon = $data_weapons[enemy.weapon_id].icon_name
      end
      if enemy.armor_id == 0
        armor_id = "Nothing"
        armor_icon = "032-Item01"
      else
        armor_id = $data_armors[enemy.armor_id].name
        armor_icon = $data_armors[enemy.armor_id].icon_name
        armor_type = $data_armors[enemy.armor_id].type
      end
      treasure_prob = enemy.treasure_prob.to_s
    end
    # System Words
    g_word = $data_system.words.gold 
    hp_word = $data_system.words.hp 
    sp_word = $data_system.words.sp 
    str_word = $data_system.words.str 
    dex_word = $data_system.words.dex 
    agi_word = $data_system.words.agi 
    int_word = $data_system.words.int 
    atk_word = $data_system.words.atk 
    pdef_word = $data_system.words.pdef 
    mdef_word = $data_system.words.mdef 
    weapon_word = $data_system.words.weapon
    case armor_type
      when 0     ;armor_type = $data_system.words.armor1
      when 1     ;armor_type = $data_system.words.armor2
      when 2     ;armor_type = $data_system.words.armor3
      when 3     ;armor_type = $data_system.words.armor4
    end
    item_word = $data_system.words.item 
    # Draws Name
    contents.font.color = normal_color
    contents.draw_text(116, 0, contents.width - 116, 32, name)
    # Draws Times Seen & Defeated
    contents.font.color = system_color
    contents.draw_text(116, 32, contents.width - 116, 32, "Times Seen:")
    contents.draw_text(116, 64, contents.width - 116, 32, "Times Defeated:")
    contents.font.color = normal_color
    contents.draw_text(0, 32, contents.width, 32, "#{enemy.seen_times}", 2)
    contents.draw_text(0, 64, contents.width, 32, "#{enemy.defeated_times}", 2)
    # Organizes Stats
    colomn_a_left = ["Max #{hp_word}", "Max #{sp_word}", str_word, dex_word, 
                     agi_word, int_word, atk_word, pdef_word, mdef_word, "Evasion"]
    colomn_a_right = [maxhp, maxsp, str,dex , agi, int, atk, pdef, mdef, eva]
    # Organized Victory Settings
    column_b_left = ["Experience Given:", "#{g_word} Dropped:", "#{item_word} Dropped:", "",
          "#{weapon_word} Dropped:", "", "#{armor_type} Dropped:", "", "Drop Pobabilty:"]
    column_b_right = [exp, gold, "", item_id, "", weapon_id, "", armor_id, treasure_prob]
    # Draws Stats
    for i in 0...colomn_a_left.size
      contents.font.color = system_color
      contents.draw_text(4, 160 + i * 32, 160, 32, colomn_a_left[i])
      contents.font.color = normal_color
      contents.draw_text(-4, 160 + i * 32, 160, 32, colomn_a_right[i], 2)
    end
    # Draws Victory Settings
    for i in 0...column_b_left.size
      contents.font.color = system_color
      contents.draw_text(168, 160 + i * 32, contents.width, 32, column_b_left[i])
      x = -4
      x = -30 if i == 3 or i == 5 or i == 7
      contents.font.color = normal_color
      contents.draw_text(x, 160 + i * 32, contents.width, 32, column_b_right[i], 2)
    end
    # Draws Item Icons
    bitmap = RPG::Cache.icon(item_icon)
    self.contents.blt(contents.width - 24, 260, bitmap, Rect.new(0, 0, 24, 24))
    bitmap = RPG::Cache.icon(weapon_icon)
    self.contents.blt(contents.width - 24, 324, bitmap, Rect.new(0, 0, 24, 24))
    bitmap = RPG::Cache.icon(armor_icon)
    self.contents.blt(contents.width - 24, 388, bitmap, Rect.new(0, 0, 24, 24))
  end
end
 
#==============================================================================
# Window Beastairy Controls
#==============================================================================
class Window_Beastairy_Controls < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 288, 200, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z = 999
    refresh(0)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(phase)
    # Clears Window
    contents.clear
    disabled_system_color = Color.new(192, 224, 255, 128)
    contents.font.color = normal_color
    contents.draw_text(0, 0, contents.width, 24, "L / R : Change Pose")
    # Main Phase Controls
    contents.font.color = phase == 0 ? system_color : disabled_system_color
    contents.draw_text(4, 24, contents.width, 24, "Main")
    contents.font.color = phase == 0 ? normal_color : disabled_color
    contents.draw_text(8, 48, contents.width, 24, "B : Return to Map")
    contents.draw_text(8, 72, contents.width, 24, "C : Select Group")
    # Enemy Select Controls
    contents.font.color = phase == 1 ? system_color : disabled_system_color
    contents.draw_text(4, 96, contents.width, 24, "Enemy Select")
    contents.font.color = phase == 1 ? normal_color : disabled_color
    contents.draw_text(8, 120, contents.width, 24, "B : Return to Main")
    contents.draw_text(8, 140, contents.width, 24, "C : Test Battle")
  end
end
 
#==============================================================================
# ** Class Scene Beastairy
#==============================================================================
class Scene_Beastairy
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Sets Main Phase
    @phase = 0
    # Enemies Graphic Animation
    @pose, @frame, @counting_frame= 0, 0, 0
    # Current Phase Window
    @phase_window = Window_Base.new(0, 0, width = 200, height = 64)
      @phase_window.contents = contents = Bitmap.new(width - 32, height - 32)
      @phase_window.contents.draw_text(0, 0, 168, 32, "Main Phase", 1)
    # Main Window (Enemy Groups)
    commands = $game_beastairy.monster_groups.dup
    commands.push("Exit")
    @enemy_groups = Window_Command.new(200, commands)
      @enemy_groups.y = 64
      @enemy_groups.height = 224
    # Controls Window
    @controls = Window_Beastairy_Controls.new
    # Monster Group Information Window
    @monster_window = Window_Monster_Group_Info.new
      @monster_window.refresh(0, 0, 0)
    # Enemy Information Window
    @enemy_window = Window_Monster_Info.new
      @enemy_window.visible = false
    # Scene Objects
    @objects = [@phase_window, @enemy_groups, @controls, @monster_window, @enemy_window]
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Update Objects Information
      @objects.each {|x| x.update}
      # Frame update
      update
      # Abort loop if screen is changed
      break if $scene != self
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of Objects
    @objects.each {|x| x.dispose unless x.disposed?}
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Visiblity Changes Between Methods
    case @phase
    # Main Phase
    when 0
      [@enemy_window].each {|x| x.visible = false if x.visible}
      [@enemy_groups, @monster_window].each {|x| x.visible = true unless x.visible}
      @enemy_groups.active = true
    when 1
      [@enemy_window].each {|x| x.visible = true unless x.visible}
      [@enemy_groups, @monster_window].each {|x| x.visible = false if x.visible}
      @enemy_groups.active = false
    end
    # Updates Enemy Animation
    @counting_frame += 1
    if @counting_frame == 8
      @counting_frame = 0
      @frame += 1
      @frame = 0 if @frame == 4
      if @phase == 0
        @monster_window.refresh(@enemy_groups.index, @pose, @frame)
      else
        enemy_id = @enemies[@groups_enemies.index].id
        @enemy_window.refresh(enemy_id, @pose, @frame)
      end
    end
    # Current Phase Update
    case @phase
      when 0; main_update
      when 1; enemy_select
    end
  end
  #--------------------------------------------------------------------------
  # * Main Frame Update
  #--------------------------------------------------------------------------
  def main_update
    # Exit Scene
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $game_temp.beastairy_return = false
      $scene = Scene_Map.new
    # Enemy Select
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      if @enemy_groups.index == $game_beastairy.monster_groups.size
        $game_temp.beastairy_return = false
        $scene = Scene_Map.new
      else
        commands, @enemies = [], []
        group = $game_beastairy.monster_groups[@enemy_groups.index]
        for i in 1...$data_enemies.size
           if $data_enemies[i].group == group
            commands.push($data_enemies[i].name)
            @enemies.push($data_enemies[i])
          end
        end
        @groups_enemies = Window_Command.new(200, commands)
          @groups_enemies.y = 64
          @groups_enemies.height = 224
        # Phase Window Update
        @phase_window.contents.clear
        @phase_window.contents.draw_text(0, 0, 168, 32, "Enemy Select", 1)
        # Adds Object (For Updating)
        @objects.push(@groups_enemies)
        # Updates Controls Window
        @controls.refresh(1)
        enemy_id = @enemies[@groups_enemies.index].id
        @enemy_window.refresh(enemy_id, @pose, @frame)
        # Changes Phase
        @phase = 1
      end
    # Changes Pose
    elsif Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 0 ? @pose = 3 : @pose -= 1
    elsif Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 3 ? @pose = 0 : @pose += 1
    end
  end
  #--------------------------------------------------------------------------
  # * Enemy Frame Update
  #--------------------------------------------------------------------------
  def enemy_select
    # Exit Phase
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @groups_enemies.dispose
      @objects.delete(@groups_enemies)
      # Phase Window Update
      @phase_window.contents.clear
      @phase_window.contents.draw_text(0, 0, 168, 32, "Main Phase", 1)
      # Updates Controls Window
      @controls.refresh(0)
      # Changes Phase
      @phase = 0
    # Enemy Select
    elsif Input.trigger?(Input::C)
      enemy  = @enemies[@groups_enemies.index]
      if enemy.seen
        $game_system.se_play($data_system.decision_se)
        enemy_name = enemy.name
        for i in 1...$data_troops.size
          if $data_troops[i].name == enemy_name
            $game_temp.beastairy_return = true
            $game_temp.battle_troop_id = i
            $game_temp.battle_can_escape = true
            $game_temp.battle_can_lose = false
            $game_temp.battle_proc = nil
            # Memorize map BGM and stop BGM
            $game_temp.map_bgm = $game_system.playing_bgm
            $game_system.bgm_stop
            # Play battle start SE
            $game_system.se_play($data_system.battle_start_se)
            # Play battle BGM
            $game_system.bgm_play($game_system.battle_bgm)
            # Straighten player position
            $game_player.straighten
            # Switch to battle screen
            $scene = Scene_Battle.new
          end
        end
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 0 ? @pose = 3 : @pose -= 1
    elsif Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @pose == 3 ? @pose = 0 : @pose += 1
    end
  end
end
 
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Main Processing
  #--------------------------------------------------------------------------
  alias beastairy_main main
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    unless $game_temp.beastairy_return
      $beastairy_troop = []
      troop = $data_troops[$game_temp.battle_troop_id]
      for i in 0...troop.members.size
        enemy = $data_enemies[troop.members[i].enemy_id]
        $beastairy_troop.push(enemy)
        enemy.see
      end
    else
      $beastairy_troop = []
    end
    beastairy_main
  end
  #--------------------------------------------------------------------------
  # * Battle Ends
  #     result : results (0:win 1:lose 2:escape)
  #--------------------------------------------------------------------------
  def battle_end(result)
    # Clear in battle flag
    $game_temp.in_battle = false
    # Clear entire party actions flag
    $game_party.clear_actions
    # Remove battle states
    for actor in $game_party.actors
      actor.remove_states_battle
    end
    # Clear enemies
    $game_troop.enemies.clear
    # Call battle callback
    if $game_temp.battle_proc != nil
      $game_temp.battle_proc.call(result)
      $game_temp.battle_proc = nil
    end
    if $game_temp.beastairy_return
      $scene = Scene_Beastairy.new
    else
      if result == 0
        for enemy in $beastairy_troop
          enemy.defeat
        end
      end
      $scene = Scene_Map.new
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If battle event is running
    if $game_system.battle_interpreter.running?
      # Update interpreter
      $game_system.battle_interpreter.update
      # If a battler which is forcing actions doesn't exist
      if $game_temp.forcing_battler == nil
        # If battle event has finished running
        unless $game_system.battle_interpreter.running?
          # Rerun battle event set up if battle continues
          unless judge
            setup_battle_event
          end
        end
        # If not after battle phase
        if @phase != 5
          # Refresh status window
          @status_window.refresh
        end
      end
    end
    # Update system (timer) and screen
    $game_system.update
    $game_screen.update
    # If timer has reached 0
    if $game_system.timer_working and $game_system.timer == 0
      # Abort battle
      $game_temp.battle_abort = true
    end
    # Update windows
    @help_window.update
    @party_command_window.update
    @actor_command_window.update
    @status_window.update
    @message_window.update
    # Update sprite set
    @spriteset.update
    # If transition is processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If message window is showing
    if $game_temp.message_window_showing
      return
    end
    # If effect is showing
    if @spriteset.effect?
      return
    end
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      if $game_temp.beastairy_return
        $scene = Scene_Beastairy.new
      else
        $scene = Scene_Gameover.new
      end
    end
    # If returning to title screen
    if $game_temp.to_title
      # Switch to title screen
      $scene = Scene_Title.new
      return
    end
    # If battle is aborted
    if $game_temp.battle_abort
      # Return to BGM used before battle started
      $game_system.bgm_play($game_temp.map_bgm)
      # Battle ends
      battle_end(1)
      return
    end
    # If waiting
    if @wait_count > 0
      # Decrease wait count
      @wait_count -= 1
      return
    end
    # If battler forcing an action doesn't exist,
    # and battle event is running
    if $game_temp.forcing_battler == nil and
       $game_system.battle_interpreter.running?
      return
    end
    # Branch according to phase
    case @phase
    when 1  # pre-battle phase
      update_phase1
    when 2  # party command phase
      update_phase2
    when 3  # actor command phase
      update_phase3
    when 4  # main phase
      update_phase4
    when 5  # after battle phase
      update_phase5
    end
  end  
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  def start_phase5
    # Shift to phase 5
    @phase = 5
    # Play battle end ME
    $game_system.me_play($game_system.battle_end_me)
    # Return to BGM before battle started
    $game_system.bgm_play($game_temp.map_bgm)
    # Initialize EXP, amount of gold, and treasure
    exp = 0
    gold = 0
    treasures = []
    # Loop
    for enemy in $game_troop.enemies
      # If enemy is not hidden
      unless enemy.hidden
        unless $game_temp.beastairy_return
          # Add EXP and amount of gold obtained
          exp += enemy.exp
          gold += enemy.gold
          # Determine if treasure appears
          if rand(100) < enemy.treasure_prob
            if enemy.item_id > 0
              treasures.push($data_items[enemy.item_id])
            end
            if enemy.weapon_id > 0
              treasures.push($data_weapons[enemy.weapon_id])
            end
            if enemy.armor_id > 0
              treasures.push($data_armors[enemy.armor_id])
            end
          end
        end
      end
    end
    # Treasure is limited to a maximum of 6 items
    treasures = treasures[0..5]
    # Obtaining EXP
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    # Obtaining gold
    $game_party.gain_gold(gold)
    # Obtaining treasure
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # Make battle result window
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # Set wait count
    @phase5_wait_count = 100
  end
end
 
# Edit by Drag-On
# On Map, you can add a Monster to Beastairy by using this code:
# $scene.add_to_bestiary (enemy_id)
class Scene_Map
 
  def add_to_bestiary (monsterid)
    @enemy = $data_enemies[monsterid]
    $beastairy_troop = [] if $beastairy_troop == nil
    $beastairy_troop.push(@enemy)
    @enemy.see
  end
 
end


So, mit

Quellcode

1
$scene.add_to_bestiary (enemy_id)
kannst du auf der Map ein Monster zum Buch hinzufügen. Das wars eigentlich^^

Drag-On

Social Bookmarks