• Anmelden

1

Sonntag, 8. Februar 2009, 21:28

Frage zu Mausskript

Hai ma wieder also ich such nen Mausskript das man abfragen kann ob es
1. auf einem event ist (ohne zu drücken)
2. ob man auf ein event drückt

naja das 2. müssts bei fasst jedem geben^^

schonmal danke im voraus euer nicht allseits bekannter

RPG Nullchecker :D

:::::::::EDIT::::::::::

OK, ich hab jetzt ein mausskript aber ich weiß nicht wie man das zeug abfrägt

Spoiler: Script

Ruby 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
#==================================================================
# GMUS Guedez Mouse Use System
# Version: 1.0
# Released: 26/5/2006 Last Update: 1/6/2006
# Thx to: Cadafalso, Near Fantastica, and some guys from asylum!
#==================================================================
class Mouse_PositionCheck
 
  def initialize
  end
 
  def main   
	get_pos
  end
 
  def get_window_index(window)
	window.get_rect_positions
	return -1 if window.index == -1
	return -2 if window.index == -2
	for i in 0...window.get_rect.size
  	if window.get_rect[i][0] < $bg.x and
    	window.get_rect[i][1] < $bg.y and
    	window.get_rect[i][2] > $bg.x and
    	window.get_rect[i][3] > $bg.y
    	return i
  	end 	
	end
	return -999999
  end
 
  def set_pos(x,y)
	$setCursorPos.Call(x,y)
  end
 
#==============================Thx to: Cadafalso===================
  def get_pos
	lpPoint = " " * 8 # store two LONGs
	$getCursorPos.Call(lpPoint)
	$bg.x, $bg.y = lpPoint.unpack("LL") # get the actual values
 
  end
#==================================================================
end
 
class Window_Selectable < Window_Base
 
  def get_rect_positions
	index = self.index
	@rect_position = [] if @rect_position == nil
	if @rect_position == []
  	for i in 0...(self.row_max * @column_max)
    	self.index = i
    	update_cursor_rect
    	p = self.cursor_rect.to_s
    	p.gsub!("($1,$2,$3,$4):rect","");p.gsub!("(", ""); p.gsub!(")", "")
    	p = p.split(/,\s*/)
    	@rect_position[i] = [p[0].to_i + self.x + 16,
    	p[1].to_i - self.oy + self.y + 16,
    	p[0].to_i + p[2].to_i + self.x + 16,
    	p[1].to_i + p[3].to_i - self.oy + self.y + 16]
  	end
  	self.index = index
	end
  end
 
  def refresh_rect_positions
	@rect_position = []
	get_rect_positions
  end
 
  def get_rect
	return @rect_position
  end
 
  alias guedez_update update
 
  def update
	get_rect_positions
	if self.active == true
  	old_index = self.index
  	new_index = $mouse.get_window_index(self)
  	$game_system.se_play($data_system.cursor_se) if 
  	old_index != new_index and not new_index == -999999
  	@index = new_index if old_index != -1
  	self.cursor_rect.empty if new_index == -999999
  	self.index = new_index
	end
	guedez_update
  end
 
end
 
# Actualy my script only need the mouse stuff, but i dont think
# the rest will bring any trouble :D, so i let the full script
 
#==============================================================================
# ** Keyboard Input Module
#==============================================================================
# Near Fantastica
# Version 5
# 29.11.05
#==============================================================================
# The Keyboard Input Module is designed to function as the default Input module
# dose. It is better then other methods keyboard input because as a key is 
# tested it is not removed form the list. so you can test the same key multiple
# times the same loop.
#==============================================================================
 
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
#SDK.log("Keyboard Input", "Near Fantastica", 5, "29.11.05")
 
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
#if SDK.state("Keyboard Input") == true
 
  module Keyboard
	#--------------------------------------------------------------------------
	@keys = []
	@pressed = []
	Mouse_Left = 1
	Mouse_Right = 2
	Back= 8
	Tab = 9
	Enter = 13
	Shift = 16
	Ctrl = 17
	Alt = 18
	Esc = 27
	Space = 32
	Numberkeys = {}
	Numberkeys[0] = 48
	Numberkeys[1] = 49
	Numberkeys[2] = 50
	Numberkeys[3] = 51
	Numberkeys[4] = 52
	Numberkeys[5] = 53
	Numberkeys[6] = 54
	Numberkeys[7] = 55
	Numberkeys[8] = 56
	Numberkeys[9] = 57
	Numberpad = {}
	Numberpad[0] = 45
	Numberpad[1] = 35
	Numberpad[2] = 40
	Numberpad[3] = 34
	Numberpad[4] = 37
	Numberpad[5] = 12
	Numberpad[6] = 39
	Numberpad[7] = 36
	Numberpad[8] = 38
	Numberpad[9] = 33
	Letters = {}
	Letters["A"] = 65
	Letters["B"] = 66
	Letters["C"] = 67
	Letters["D"] = 68
	Letters["E"] = 69
	Letters["F"] = 70
	Letters["G"] = 71
	Letters["H"] = 72
	Letters["I"] = 73
	Letters["J"] = 74
	Letters["K"] = 75
	Letters["L"] = 76
	Letters["M"] = 77
	Letters["N"] = 78
	Letters["O"] = 79
	Letters["P"] = 80
	Letters["Q"] = 81
	Letters["R"] = 82
	Letters["S"] = 83
	Letters["T"] = 84
	Letters["U"] = 85
	Letters["V"] = 86
	Letters["W"] = 87
	Letters["X"] = 88
	Letters["Y"] = 89
	Letters["Z"] = 90
	Fkeys = {}
	Fkeys[1] = 112
	Fkeys[2] = 113
	Fkeys[3] = 114
	Fkeys[4] = 115
	Fkeys[5] = 116
	Fkeys[6] = 117
	Fkeys[7] = 118
	Fkeys[8] = 119
	Fkeys[9] = 120
	Fkeys[10] = 121
	Fkeys[11] = 122
	Fkeys[12] = 123
	Collon = 186
	Equal = 187
	Comma = 188
	Underscore = 189
	Dot = 190
	Backslash = 191
	Lb = 219
	Rb = 221
	Quote = 222
	State = Win32API.new("user32","GetKeyState",['i'],'i')
	Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
	#--------------------------------------------------------------------------  
	def Keyboard.getstate(key)
  	return true unless State.call(key).between?(0, 1)
  	return false
	end
	#--------------------------------------------------------------------------
	def Keyboard.testkey(key)
  	Key.call(key) & 0x01 == 1
	end
	#--------------------------------------------------------------------------
	def Keyboard.update
  	@keys = []
  	@keys.push(Keyboard::Mouse_Left) if Keyboard.testkey(Keyboard::Mouse_Left)
  	@keys.push(Keyboard::Mouse_Right) if Keyboard.testkey(Keyboard::Mouse_Right)
  	@keys.push(Keyboard::Back) if Keyboard.testkey(Keyboard::Back)
  	@keys.push(Keyboard::Tab) if Keyboard.testkey(Keyboard::Tab)
  	@keys.push(Keyboard::Enter) if Keyboard.testkey(Keyboard::Enter)
  	@keys.push(Keyboard::Shift) if Keyboard.testkey(Keyboard::Shift)
  	@keys.push(Keyboard::Ctrl) if Keyboard.testkey(Keyboard::Ctrl)
  	@keys.push(Keyboard::Alt) if Keyboard.testkey(Keyboard::Alt)
  	@keys.push(Keyboard::Esc) if Keyboard.testkey(Keyboard::Esc)
  	@keys.push(Keyboard::Space) if Keyboard.testkey(Keyboard::Space)
  	for key in Keyboard::Numberkeys.values
    	@keys.push(key) if Keyboard.testkey(key)
  	end
  	for key in Keyboard::Numberpad.values
    	@keys.push(key) if Keyboard.testkey(key)
  	end
  	for key in Keyboard::Letters.values
    	@keys.push(key) if Keyboard.testkey(key)
  	end
  	for key in Keyboard::Fkeys.values
    	@keys.push(key) if Keyboard.testkey(key)
  	end
  	@keys.push(Keyboard::Collon) if Keyboard.testkey(Keyboard::Collon)
  	@keys.push(Keyboard::Equal) if Keyboard.testkey(Keyboard::Equal)
  	@keys.push(Keyboard::Comma) if Keyboard.testkey(Keyboard::Comma)
  	@keys.push(Keyboard::Underscore) if Keyboard.testkey(Keyboard::Underscore)
  	@keys.push(Keyboard::Dot) if Keyboard.testkey(Keyboard::Dot)
  	@keys.push(Keyboard::Backslash) if Keyboard.testkey(Keyboard::Backslash)
  	@keys.push(Keyboard::Lb) if Keyboard.testkey(Keyboard::Lb)
  	@keys.push(Keyboard::Rb) if Keyboard.testkey(Keyboard::Rb)
  	@keys.push(Keyboard::Quote) if Keyboard.testkey(Keyboard::Quote)
  	@pressed = []
  	@pressed.push(Keyboard::Mouse_Left) if Keyboard.getstate(Keyboard::Mouse_Left)
  	@pressed.push(Keyboard::Mouse_Right) if Keyboard.getstate(Keyboard::Mouse_Right)
  	@pressed.push(Keyboard::Back) if Keyboard.getstate(Keyboard::Back)
  	@pressed.push(Keyboard::Tab) if Keyboard.getstate(Keyboard::Tab)
  	@pressed.push(Keyboard::Enter) if Keyboard.getstate(Keyboard::Enter)
  	@pressed.push(Keyboard::Shift) if Keyboard.getstate(Keyboard::Shift)
  	@pressed.push(Keyboard::Ctrl) if Keyboard.getstate(Keyboard::Ctrl)
  	@pressed.push(Keyboard::Alt) if Keyboard.getstate(Keyboard::Alt)
  	@pressed.push(Keyboard::Esc) if Keyboard.getstate(Keyboard::Esc)
  	@pressed.push(Keyboard::Space) if Keyboard.getstate(Keyboard::Space)
  	for key in Keyboard::Numberkeys.values
    	@pressed.push(key) if Keyboard.getstate(key)
  	end
  	for key in Keyboard::Numberpad.values
    	@pressed.push(key) if Keyboard.getstate(key)
  	end
  	for key in Keyboard::Letters.values
    	@pressed.push(key) if Keyboard.getstate(key)
  	end
  	for key in Keyboard::Fkeys.values
    	@pressed.push(key) if Keyboard.getstate(key)
  	end
  	@pressed.push(Keyboard::Collon) if Keyboard.getstate(Keyboard::Collon)
  	@pressed.push(Keyboard::Equal) if Keyboard.getstate(Keyboard::Equal)
  	@pressed.push(Keyboard::Comma) if Keyboard.getstate(Keyboard::Comma)
  	@pressed.push(Keyboard::Underscore) if Keyboard.getstate(Keyboard::Underscore)
  	@pressed.push(Keyboard::Dot) if Keyboard.getstate(Keyboard::Dot)
  	@pressed.push(Keyboard::Backslash) if Keyboard.getstate(Keyboard::Backslash)
  	@pressed.push(Keyboard::Lb) if Keyboard.getstate(Keyboard::Lb)
  	@pressed.push(Keyboard::Rb) if Keyboard.getstate(Keyboard::Rb)
  	@pressed.push(Keyboard::Quote) if Keyboard.getstate(Keyboard::Quote)  
	end
	#--------------------------------------------------------------------------
	def Keyboard.trigger?(key)
  	return true if @keys.include?(key)
  	return false
	end
	#--------------------------------------------------------------------------
	def Keyboard.pressed?(key)
  	return true if @pressed.include?(key)
  	return false
	end
  #end
 
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
 
#=========================Game_Fixes=============================
 
$showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
$showm.call(18,0,0,0) #(18,0,0,0)
$showm.call(13,0,0,0)#13
$showm.call(13,0,2,0)#13
$showm.call(18,0,2,0)
$mouse = Mouse_PositionCheck.new
$getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
$setCursorPos = Win32API.new("user32", "SetCursorPos", ['I','I'], 'V')
$bg = Sprite.new
$bg.bitmap = RPG::Cache.icon('001-Weapon01')
$bg.z = 99999
$bg.y = 0
$bg.x = 0
 
module Input
 
  if @self_update == nil
	@self_update = method('update')
	@self_press = method('press?')
	@self_rep = method('repeat?')
  end
 
  def self.update
	@self_update.call
	$mouse.main
	Keyboard.update
  end
 
  def self.trigger?(key_code)
	if @self_press.call(key_code)
  	return true
	end
	if key_code == C
  	return Keyboard.trigger?(Keyboard::Mouse_Left)
	elsif key_code == B
  	return Keyboard.trigger?(Keyboard::Mouse_Right)
	else
  	return @self_press.call(key_code)
	end
  end
 
  def self.repeat?(key_code)
	if @self_rep.call(key_code)
  	return true
	end
	if key_code == C
  	return Keyboard.pressed?(Keyboard::Mouse_Left)
	elsif key_code == B
  	return Keyboard.pressed?(Keyboard::Mouse_Right)
	else
  	return @self_rep.call(key_code)
	end
  end
 
end
 
class Arrow_Enemy < Arrow_Base  
 
  def update
	super
	$game_troop.enemies.size.times do
  	break if self.enemy.exist?
  	@index += 1
  	@index %= $game_troop.enemies.size
	end
	size = 0
	for i in 0...$game_troop.enemies.size
  	size += 1 if $game_troop.enemies[i].hp > 0
	end
	size = $game_troop.enemies.size if size == nil
	@index = ((size / 640.0) * $bg.x.to_f).to_i
	if self.enemy != nil
  	self.x = self.enemy.screen_x
  	self.y = self.enemy.screen_y
	end
  end
 
end
 
class Arrow_Actor < Arrow_Base
 
  def update
	super
	@index = 0 if $bg.x > 0 and $bg.x <= 160 and 0 <= ($game_party.actors.size - 1)     	
	@index = 1 if $bg.x > 160 and $bg.x <= 320 and 1 <= ($game_party.actors.size - 1) 	
	@index = 2 if $bg.x > 320 and $bg.x <= 480 and 2 <= ($game_party.actors.size - 1) 	
	@index = 3 if $bg.x > 480 and $bg.x <= 640 and 3 <= ($game_party.actors.size - 1) 	
	if self.actor != nil
  	self.x = self.actor.screen_x
  	self.y = self.actor.screen_y
	end
  end
 
end
 
class Window_Target < Window_Selectable
 
  alias gupdate update
 
  def update
	@defaultx = 0 if @defaultx == nil
	if @defaultx != self.x 
  	@defaultx = self.x
  	self.refresh_rect_positions
  	return
	else
	gupdate
	end
  end
 
  def update_cursor_rect
	if @index == -1
  	self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
	else
  	self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
	end
  end
 
end
 
class Scene_Battle
 
  def phase3_setup_command_window
	@party_command_window.active = false
	@party_command_window.visible = false
	@actor_command_window.active = true
	@actor_command_window.visible = true
	@actor_command_window.x = @actor_index * 160
	@actor_command_window.refresh_rect_positions
	@actor_command_window.index = 0
  end
 
end
 
class Scene_Equip
 
  def initialize(actor_index = 0, equip_index = 0)
	@actor_index = actor_index
	@equip_index = equip_index
	@actor = $game_party.actors[@actor_index]
  end
 
  alias gmain main
 
  def main
	@dummy = Window_EquipItem.new(@actor, 99)
	gmain
	@dummy.dispose
  end
 
  alias gupdate_right update_right
 
  def update_right
	if @right_window.index == -999999
  	if Input.trigger?(Input::C)
    	$game_system.se_play($data_system.buzzer_se)
  	end
	else
  	gupdate_right
	end
  end
 
	def refresh
	@item_window1.visible = (@right_window.index == 0)
	@item_window2.visible = (@right_window.index == 1)
	@item_window3.visible = (@right_window.index == 2)
	@item_window4.visible = (@right_window.index == 3)
	@item_window5.visible = (@right_window.index == 4)
	@dummy.visible = (@right_window.index == -999999)
	item1 = @right_window.item
	case @right_window.index
	when 0
  	@item_window = @item_window1
	when 1
  	@item_window = @item_window2
	when 2
  	@item_window = @item_window3
	when 3
  	@item_window = @item_window4
	when 4
  	@item_window = @item_window5
	when -999999
  	return
	end
	if @right_window.active
  	@left_window.set_new_parameters(nil, nil, nil)
	end
	if @item_window.active
  	item2 = @item_window.item
  	last_hp = @actor.hp
  	last_sp = @actor.sp
  	@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  	new_atk = @actor.atk
  	new_pdef = @actor.pdef
  	new_mdef = @actor.mdef
  	@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  	@actor.hp = last_hp
  	@actor.sp = last_sp
  	@left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
	end
  end
 
end
 
class Scene_Skill
 
	def update_target
	if Input.trigger?(Input::B)
  	$game_system.se_play($data_system.cancel_se)
  	@skill_window.active = true
  	@target_window.visible = false
  	@target_window.active = false
  	return
	end
	if Input.trigger?(Input::C)
  	unless @actor.skill_can_use?(@skill.id)
    	$game_system.se_play($data_system.buzzer_se)
    	return
  	end
  	if @target_window.index == -1
    	used = false
    	for i in $game_party.actors
      	used |= i.skill_effect(@actor, @skill)
    	end
  	end
  	if @target_window.index == -2
    	target = $game_party.actors[@target_window.index + 10]
    	used = target.skill_effect(@actor, @skill)
  	end
  	if @target_window.index <= -3
    	$game_system.se_play($data_system.buzzer_se)
    	return
  	end
  	if @target_window.index >= 0
    	target = $game_party.actors[@target_window.index]
    	used = target.skill_effect(@actor, @skill)
  	end
  	if used
    	$game_system.se_play(@skill.menu_se)
    	@actor.sp -= @skill.sp_cost
    	@status_window.refresh
    	@skill_window.refresh
    	@target_window.refresh
    	if $game_party.all_dead?
      	$scene = Scene_Gameover.new
      	return
    	end
    	if @skill.common_event_id > 0
      	$game_temp.common_event_id = @skill.common_event_id
      	$scene = Scene_Map.new
      	return
    	end
  	end
  	unless used
    	$game_system.se_play($data_system.buzzer_se)
  	end
  	return
	end
  end
 
end
 
class Scene_File
 
  def update
	@help_window.update
	for i in @savefile_windows
  	i.update
	end
	if Input.trigger?(Input::C)
  	if @file_index == -1
    	$game_system.se_play($data_system.buzzer_se)
  	else
    	on_decision(make_filename(@file_index))
    	$game_temp.last_file_index = @file_index
    	return
  	end
	end
	if Input.trigger?(Input::B)
  	on_cancel
  	return
	end
	if $bg.y > 64 and $bg.y < 168
  	if @savefile_windows[0].selected == false
    	$game_system.se_play($data_system.cursor_se)
  	end
  	@savefile_windows[0].selected = true
  	@savefile_windows[1].selected = false
  	@savefile_windows[2].selected = false
  	@savefile_windows[3].selected = false
  	@file_index = 0
	elsif $bg.y > 168 and $bg.y < 272
  	if @savefile_windows[1].selected == false
    	$game_system.se_play($data_system.cursor_se)
  	end
  	@savefile_windows[0].selected = false
  	@savefile_windows[1].selected = true
  	@savefile_windows[2].selected = false
  	@savefile_windows[3].selected = false
  	@file_index = 1
	elsif $bg.y > 272 and $bg.y < 376
  	if @savefile_windows[2].selected == false
    	$game_system.se_play($data_system.cursor_se)
  	end
  	@savefile_windows[0].selected = false
  	@savefile_windows[1].selected = false
  	@savefile_windows[2].selected = true
  	@savefile_windows[3].selected = false
  	@file_index = 2
	elsif $bg.y > 376 and $bg.y < 480
  	if @savefile_windows[3].selected == false
    	$game_system.se_play($data_system.cursor_se)
  	end
  	@savefile_windows[0].selected = false
  	@savefile_windows[1].selected = false
  	@savefile_windows[2].selected = false
  	@savefile_windows[3].selected = true
  	@file_index = 3
	else
  	@file_index = -1 
  	@savefile_windows[0].selected = false
  	@savefile_windows[1].selected = false
  	@savefile_windows[2].selected = false
  	@savefile_windows[3].selected = false
	end
  end
 
 
end
class Scene_Menu
 
  def update_status
	if Input.trigger?(Input::B)
  	$game_system.se_play($data_system.cancel_se)
  	@command_window.active = true
  	@status_window.active = false
  	@status_window.index = -1
  	return
	end
	if Input.trigger?(Input::C)
  	unless @status_window.index < 0
    	case @command_window.index
    	when 1 
      	if $game_party.actors[@status_window.index].restriction >= 2
        	$game_system.se_play($data_system.buzzer_se)
        	return
      	end
      	$game_system.se_play($data_system.decision_se)
      	$scene = Scene_Skill.new(@status_window.index)
    	when 2 
      	$game_system.se_play($data_system.decision_se)
      	$scene = Scene_Equip.new(@status_window.index)
    	when 3 
      	$game_system.se_play($data_system.decision_se)
      	$scene = Scene_Status.new(@status_window.index)
    	end
    	return
  	end
	end
  end
 
end
 
class Game_Player
 
  def update
	last_moving = moving?
	unless moving? or $game_system.map_interpreter.running? or
       	@move_route_forcing or $game_temp.message_window_showing or
       	@cant_move
  	case Input.dir4
  	when 2
    	move_down
  	when 4
    	move_left
  	when 6
    	move_right
  	when 8
    	move_up
  	end
	end
	last_real_x = @real_x
	last_real_y = @real_y
	super
	if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
  	$game_map.scroll_down(@real_y - last_real_y)
	end
	if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
  	$game_map.scroll_left(last_real_x - @real_x)
	end
	if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
  	$game_map.scroll_right(@real_x - last_real_x)
	end
	if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
  	$game_map.scroll_up(last_real_y - @real_y)
	end
	unless moving?
  	if last_moving
    	result = check_event_trigger_here([1,2])
    	if result == false
      	unless $DEBUG and Input.press?(Input::CTRL)
        	if @encounter_count > 0
          	@encounter_count -= 1
        	end
      	end
    	end
  	end
  	if Input.trigger?(Input::C)
    	check_curor_field
    	if (@field_x == self.x + 1 and @field_y == self.y and 
      	self.direction == 6) or (@field_x == self.x - 1 and 
      	@field_y == self.y and self.direction == 4) or 
      	(@field_x == self.x and @field_y == self.y + 1 and 
      	self.direction == 2) or (@field_x == self.x and 
      	@field_y == self.y - 1 and self.direction == 8)
      	check_event_trigger_there([0,1,2])
    	end    	
  	end
  	if Input.repeat?(Input::C)
    	check_curor_field
    	unless moving? or $game_system.map_interpreter.running? or
       	@move_route_forcing or $game_temp.message_window_showing or
       	@cant_move and not (@field_x == self.x and @field_y == self.y)
      	move_by_mouse
    	end
    	check_event_trigger_here([0])
  	end
	end
  end
 
  def check_curor_field
	dummyx = $game_map.display_x > 0 ? $bg.x + 16 : $bg.x
	@field_x = dummyx / 32 + $game_map.display_x / 128
	@field_y = $bg.y / 32 + $game_map.display_y / 128
  end
 
  def move_by_mouse
	dy = @field_x - self.x
	dx = self.y - @field_y
	if dx > 0 and dy > 0 #quarter 1
  	if dx > dy
    	if passable?(self.x, self.y, 8)
      	move_up
    	else
      	move_right
    	end
    	return
  	elsif dx < dy
    	if passable?(self.x, self.y, 6)
      	move_right
    	else
      	move_up
    	end
    	return
  	elsif dx == dy
    	if passable?(self.x, self.y, 8)
      	move_up
    	else
      	move_right
    	end
    	return
  	end
	elsif dx > 0 and dy < 0 #quarter 2
  	if dx > -dy
    	if passable?(self.x, self.y, 8)
      	move_up
    	else
      	move_left
    	end
    	return
  	elsif dx < -dy
    	if passable?(self.x, self.y, 4)
      	move_left
    	else
      	move_up
    	end
    	return
  	elsif dx == -dy
    	if passable?(self.x, self.y, 8)
      	move_up
    	else
      	move_left
    	end
    	return
  	end
	elsif dx < 0 and dy < 0 #quarter 2
  	if -dx > -dy
    	if passable?(self.x, self.y, 2)
      	move_down
    	else
      	move_left
    	end
    	return
  	elsif -dx < -dy
    	if passable?(self.x, self.y, 4)
      	move_left
    	else
      	move_down
    	end
    	return
  	elsif -dx == -dy
    	if passable?(self.x, self.y, 2)
      	move_down
    	else
      	move_left
    	end
    	return
  	end
	elsif dx < 0 and dy > 0 #quarter 4
  	if -dx > dy
    	if passable?(self.x, self.y, 2)
      	move_down
    	else
      	move_right
    	end
    	return
  	elsif -dx < dy
    	if passable?(self.x, self.y, 6)
      	move_right
    	else
      	move_down
    	end
    	return
  	elsif -dx == dy
    	if passable?(self.x, self.y, 2)
      	move_down
    	else
      	move_right
    	end
    	return
  	end
	elsif dx == 0 and dy < 0
  	move_left
	elsif dx == 0 and dy > 0
  	move_right
	elsif dx < 0 and dy == 0
  	move_down
	elsif dx > 0 and dy == 0
  	move_up
	end
  end
end
zum Lesen den Text mit der Maus markieren


Dieser Beitrag wurde bereits so oft editiert, dass der Zähler sich in die Luft gesprengt hat.

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »RPG Nullchecker« (9. Februar 2009, 11:44)


Ähnliche Themen

Social Bookmarks