Startseite »
Forum »
RPG-Studio.org - Community »
Community-Forum »
Öffentliches Archiv »
RGSS Archiv »
*moved nach RGSS Fragen*
Du siehst doch standartmäßig die HP da unten... Naja, falls du Balken meinst:
Einfach ein neues Script über Main erstellen und dieses Script da rein kopieren.
Ach ja, bitte benutze nächstes Mal die
Suchen- Funktion, auf die du schon mal hingewiesen wurdest, bevor du fragst. Ich habe das passende Thema innerhalb 10 Sekunden gefunden.
Ach ja, hier der Thread: http://forum.rpgxp.de/viewtopic.php?t=4313&highlight=balken
Du siehst doch standartmäßig die HP da unten... Naja, falls du Balken meinst:
|
|
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 |
#==============================================================================
# ¡ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_hp_meter(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
draw_actor_sp_meter(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
end
#==============================================================================
# ¡ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y+28, width * actor.hp / actor.maxhp,4, Color.new(255, 0, 0, 255))
end
#--------------------------------------------------------------------------
def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y+28, width * actor.sp / actor.maxsp,4, Color.new(0, 255, 255, 255))
end
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
attr_accessor :now_guarding # Œ»Ý–hŒä'†ƒtƒ‰ƒO
attr_accessor :cp # Œ»ÝCP
attr_accessor :hate # hate value
#--------------------------------------------------------------------------
# initialize objects
#--------------------------------------------------------------------------
def initialize
@battler_name = ""
@battler_hue = 0
@hp = 0
@sp = 0
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
@hidden = false
@immortal = false
@damage_pop = false
@damage = nil
@critical = false
@animation_id = 0
@animation_hit = false
@white_flash = false
@blink = false
@current_action = Game_BattleAction.new
# edeted!
@hate = 100 # init-value is 100
@cp = 0
@now_guarding = false
# end of edited
end
#--------------------------------------------------------------------------
def attack_effect(attacker)
# ƒNƒŠƒeƒBƒJƒ‹ƒtƒ‰ƒO‚ðƒNƒŠƒA
self.critical = false
# 'æˆê–½'†"»'è
hit_result = (rand(100) < attacker.hit)
# –½'†‚Ìê‡
if hit_result == true
# Šî–{ƒ_ƒ[ƒW‚ðŒvŽZ
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
# '®«C³
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# ƒ_ƒ[ƒW‚Ì•„†‚ª³‚Ìê‡
if self.damage > 0
# ƒNƒŠƒeƒBƒJƒ‹C³
if rand(100) < 4 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end
# –hŒäC³
if self.now_guarding
self.damage /= 2
end
end
# •ªŽU
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# 'æ"ñ–½'†"»'è
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
# –½'†‚Ìê‡
if hit_result == true
# ƒXƒe[ƒgÕŒ‚‰ðœ
remove_states_shock
# edited!
last_hp = self.hp
# HP ‚©‚çƒ_ƒ[ƒW‚ðŒ¸ŽZ
self.hp -= self.damage
damage = last_hp - self.hp # damage
if attacker.instance_of?(Game_Actor) then
if self.instance_of?(Game_Enemy) then
attacker.hate += damage
self.hate -= damage
else
attacker.hate -= damage
end
else
if self.instance_of?(Game_Enemy) then
attacker.hate -= damage
else
attacker.hate += damage
self.hate -= damage
end
end
# end of edited
# ƒXƒe[ƒg•ω»
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# ƒ~ƒX‚Ìê‡
else
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ'è
self.damage = "Miss"
# ƒNƒŠƒeƒBƒJƒ‹ƒtƒ‰ƒO‚ðƒNƒŠƒA
self.critical = false
end
# ƒƒ\ƒbƒhI—¹
return true
end
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# ƒNƒŠƒeƒBƒJƒ‹ƒtƒ‰ƒO‚ðƒNƒŠƒA
self.critical = false
# ƒXƒLƒ‹‚ÌŒø‰Ê"͈͂ª HP 1 ˆÈã‚Ì–¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 0A
# ‚Ü‚½‚̓XƒLƒ‹‚ÌŒø‰Ê"͈͂ª HP 0 ‚Ì–¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 1 ˆÈã‚Ìê‡
if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
# ƒƒ\ƒbƒhI—¹
return false
end
# —LŒøƒtƒ‰ƒO‚ðƒNƒŠƒA
effective = false
# ƒRƒ‚ƒ"ƒCƒxƒ"ƒg ID ‚ª—LŒø‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= skill.common_event_id > 0
# 'æˆê–½'†"»'è
hit = skill.hit
if skill.atk_f > 0
hit *= user.hit / 100
end
hit_result = (rand(100) < hit)
# •sŠmŽÀ‚ȃXƒLƒ‹‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= hit < 100
# –½'†‚Ìê‡
if hit_result == true
# ˆÐ—Í‚ðŒvŽZ
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# "{—¦‚ðŒvŽZ
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# Šî–{ƒ_ƒ[ƒW‚ðŒvŽZ
self.damage = power * rate / 20
# '®«C³
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
# ƒ_ƒ[ƒW‚Ì•„†‚ª³‚Ìê‡
if self.damage > 0
# –hŒäC³
if self.now_guarding
self.damage /= 2
end
end
# •ªŽU
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# 'æ"ñ–½'†"»'è
eva = 8 * self.agi / user.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
# •sŠmŽÀ‚ȃXƒLƒ‹‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= hit < 100
end
# –½'†‚Ìê‡
if hit_result == true
# ˆÐ—Í 0 ˆÈŠO‚Ì•¨—UŒ‚‚Ìê‡
if skill.power != 0 and skill.atk_f > 0
# ƒXƒe[ƒgÕŒ‚‰ðœ
remove_states_shock
# —LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective = true
end
# HP ‚©‚çƒ_ƒ[ƒW‚ðŒ¸ŽZ
last_hp = self.hp
self.hp -= self.damage
effective |= self.hp != last_hp
# edited!
damage = last_hp - self.hp # damage
if user.instance_of?(Game_Actor) then
if self.instance_of?(Game_Enemy) then
user.hate += damage
self.hate -= damage
else
user.hate -= damage
end
else
if self.instance_of?(Game_Enemy) then
user.hate -= damage
else
user.hate += damage
self.hate -= damage
end
end
# end of edited
# ƒXƒe[ƒg•ω»
@state_changed = false
effective |= states_plus(skill.plus_state_set)
effective |= states_minus(skill.minus_state_set)
# ˆÐ—Í‚ª 0 ‚Ìê‡
if skill.power == 0
# ƒ_ƒ[ƒW‚ɋ󕶎š—ñ‚ðÝ'è
self.damage = ""
# ƒXƒe[ƒg‚ɕω»‚ª‚È‚¢ê‡
unless @state_changed
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ'è
self.damage = "Miss"
end
end
# ƒ~ƒX‚Ìê‡
else
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ'è
self.damage = "Miss"
end
# í"¬'†‚łȂ¢ê‡
unless $game_temp.in_battle
# ƒ_ƒ[ƒW‚É nil ‚ðÝ'è
self.damage = nil
end
# ƒƒ\ƒbƒhI—¹
return effective
end
#--------------------------------------------------------------------------
def item_effect(user,item) # edited argment
# ƒNƒŠƒeƒBƒJƒ‹ƒtƒ‰ƒO‚ðƒNƒŠƒA
self.critical = false
# ƒAƒCƒeƒ€‚ÌŒø‰Ê"͈͂ª HP 1 ˆÈã‚Ì–¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 0A
# ‚Ü‚½‚̓AƒCƒeƒ€‚ÌŒø‰Ê"͈͂ª HP 0 ‚Ì–¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 1 ˆÈã‚Ìê‡
if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
((item.scope == 5 or item.scope == 6) and self.hp >= 1)
# ƒƒ\ƒbƒhI—¹
return false
end
# —LŒøƒtƒ‰ƒO‚ðƒNƒŠƒA
effective = false
# ƒRƒ‚ƒ"ƒCƒxƒ"ƒg ID ‚ª—LŒø‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= item.common_event_id > 0
# –½'†"»'è
hit_result = (rand(100) < item.hit)
# •sŠmŽÀ‚ȃXƒLƒ‹‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= item.hit < 100
# –½'†‚Ìê‡
if hit_result == true
# ‰ñ•œ—Ê‚ðŒvŽZ
recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp
recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp
if recover_hp < 0
recover_hp += self.pdef * item.pdef_f / 20
recover_hp += self.mdef * item.mdef_f / 20
recover_hp = [recover_hp, 0].min
end
# '®«C³
recover_hp *= elements_correct(item.element_set)
recover_hp /= 100
recover_sp *= elements_correct(item.element_set)
recover_sp /= 100
# •ªŽU
if item.variance > 0 and recover_hp.abs > 0
amp = [recover_hp.abs * item.variance / 100, 1].max
recover_hp += rand(amp+1) + rand(amp+1) - amp
end
if item.variance > 0 and recover_sp.abs > 0
amp = [recover_sp.abs * item.variance / 100, 1].max
recover_sp += rand(amp+1) + rand(amp+1) - amp
end
# ‰ñ•œ—ʂ̕„†‚ª•‰‚Ìê‡
if recover_hp < 0
# –hŒäC³
if self.guarding?
recover_hp /= 2
end
end
# HP ‰ñ•œ—ʂ̕„†‚ð"½"]‚µAƒ_ƒ[ƒW‚Ì'l‚ÉÝ'è
self.damage = -recover_hp
# HP ‚¨‚æ‚Ñ SP ‚ð‰ñ•œ
last_hp = self.hp
last_sp = self.sp
self.hp += recover_hp
self.sp += recover_sp
# edited!
sub = self.hp - last_hp # recovery
if user.instance_of?(Game_Actor) then
if self.instance_of?(Game_Enemy) then
user.hate -= sub
self.hate += sub
else
user.hate += sub
end
else
if self.instance_of?(Game_Enemy) then
user.hate += sub
else
self.hate += sub
user.hate -= sub
end
end
# end of edited
effective |= self.hp != last_hp
effective |= self.sp != last_sp
# ƒXƒe[ƒg•ω»
@state_changed = false
effective |= states_plus(item.plus_state_set)
effective |= states_minus(item.minus_state_set)
# ƒpƒ‰ƒ[ƒ^ã¸'l‚ª—LŒø‚Ìê‡
if item.parameter_type > 0 and item.parameter_points != 0
# ƒpƒ‰ƒ[ƒ^‚Å•ªŠò
case item.parameter_type
when 1 # MaxHP
@maxhp_plus += item.parameter_points
when 2 # MaxSP
@maxsp_plus += item.parameter_points
when 3 # ˜r—Í
@str_plus += item.parameter_points
when 4 # Ší—p‚³
@dex_plus += item.parameter_points
when 5 # 'f'‚³
@agi_plus += item.parameter_points
when 6 # –‚—Í
@int_plus += item.parameter_points
end
# —LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective = true
end
# HP ‰ñ•œ—¦‚Ɖñ•œ—Ê‚ª 0 ‚Ìê‡
if item.recover_hp_rate == 0 and item.recover_hp == 0
# ƒ_ƒ[ƒW‚ɋ󕶎š—ñ‚ðÝ'è
self.damage = ""
# SP ‰ñ•œ—¦‚Ɖñ•œ—Ê‚ª 0Aƒpƒ‰ƒ[ƒ^ã¸'l‚ª–³Œø‚Ìê‡
if item.recover_sp_rate == 0 and item.recover_sp == 0 and
(item.parameter_type == 0 or item.parameter_points == 0)
# ƒXƒe[ƒg‚ɕω»‚ª‚È‚¢ê‡
unless @state_changed
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ'è
self.damage = "Miss"
end
end
end
# ƒ~ƒX‚Ìê‡
else
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ'è
self.damage = "Miss"
end
# í"¬'†‚łȂ¢ê‡
unless $game_temp.in_battle
# ƒ_ƒ[ƒW‚É nil ‚ðÝ'è
self.damage = nil
end
# ƒƒ\ƒbƒhI—¹
return effective
end
end
#==============================================================================
# ¡ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_hp_meter(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
draw_actor_sp_meter(actor, actor_x, 64, 120)
draw_actor_cp_meter(actor, actor_x, 96, 120, 0)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
#--------------------------------------------------------------------------
# œ CPƒ[ƒ^[ ‚Ì•`‰æ
#--------------------------------------------------------------------------
def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
if actor.cp == nil
actor.cp = 0
end
self.contents.fill_rect(x, y+28, width * actor.cp / 1024,4, Color.new(255, 255, 0, 255))
end
end
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y+28, width * actor.hp / actor.maxhp,4, Color.new(255, 0, 0, 255))
end
#--------------------------------------------------------------------------
def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y+28, width * actor.sp / actor.maxsp,4, Color.new(0, 255, 255, 255))
end
end
#==============================================================================
# ¡ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
def start_phase1
# ƒtƒF[ƒY 1 ‚ɈÚs
@phase = 1
# ƒp[ƒeƒB'Sˆõ‚̃AƒNƒVƒ‡ƒ"‚ðƒNƒŠƒA
$game_party.clear_actions
# ƒoƒgƒ‹ƒCƒxƒ"ƒg‚ðƒZƒbƒgƒAƒbƒv
setup_battle_event
# "z—ñ @all_battlers ‚ð‰Šú‰»
@all_battlers = []
# ƒGƒlƒ~[‚ð"z—ñ @all_battlers ‚É'ljÁ
for enemy in $game_troop.enemies
@all_battlers.push(enemy)
end
# ƒAƒNƒ^[‚ð"z—ñ @all_battlers ‚É'ljÁ
for actor in $game_party.actors
@all_battlers.push(actor)
end
@agi_total = 0
# 'Sˆõ‚ÌCP0‰»
for battler in @all_battlers
battler.cp = 0
battler.hate = 100
battler.now_guarding = false
@agi_total += battler.agi
end
# SP‰ñ•œ‹@"\‚ªÝ'肳‚ê‚ĂȂ¯‚ê‚Îfalse‚É‚·‚é
if $sp_recover_in_guard == nil then
$sp_recover_in_guard = false
end
end
#--------------------------------------------------------------------------
def start_phase2
# ƒtƒF[ƒY 2 ‚ɈÚs
@phase = 2
# ƒAƒNƒ^[‚ð"ñ'I'ðó'Ô‚ÉÝ'è
@actor_index = -1
@active_battler = nil
# ƒAƒNƒ^[ƒRƒ}ƒ"ƒhƒEƒBƒ"ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
# ƒƒCƒ"ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒNƒŠƒA
$game_temp.battle_main_phase = false
# ƒp[ƒeƒB'Sˆõ‚̃AƒNƒVƒ‡ƒ"‚ðƒNƒŠƒA
$game_party.clear_actions
# ƒRƒ}ƒ"ƒh"ü—Í•s‰Â"\‚Èê‡
unless $game_party.inputable?
# ƒƒCƒ"ƒtƒF[ƒYŠJŽn
start_phase4
end
# ƒp[ƒeƒBƒRƒ}ƒ"ƒhƒEƒBƒ"ƒhƒE‚ð—LŒø‰»
if @party_command_done != true
@party_command_window.active = true
@party_command_window.visible = true
@party_command_done = true
else
# 'Sˆõ‚ÌCP‰ÁŽZ
for battler in @all_battlers
if battler.dead? == false
# ‚±‚±‚Ì 1.0 ‚ð•Ï‚¦‚邱‚ƂŠ« ƒXƒs[ƒh‚ð•ÏX‰Â"\B
battler.cp = [[battler.cp + 1.0 * 1024 * battler.agi / @agi_total / 2, 0].max, 1024].min
end
# –hŒä'†SP‰ñ•œƒtƒ‰ƒO‚ª—§‚Á‚Ä‚¢‚Ä–hŒä'†‚È‚ç
if $sp_recover_in_guard == true and battler.now_guarding == true then
# SP‰ñ•œ
battler.sp += 10 # ©‰ñ•œ—Ê‚Í"K"–‚ɕς¦‚Ä‚‚¾‚³‚¢
end
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ"ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
@status_window.refresh
# ŽŸ‚Ö
start_phase3
return
end
end
#--------------------------------------------------------------------------
def start_phase3
# ƒtƒF[ƒY 3 ‚ɈÚs
@phase = 3
# ƒAƒNƒ^[‚ð"ñ'I'ðó'Ô‚ÉÝ'è
@actor_index = -1
@active_battler = nil
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ"ƒh"ü—Í‚Ö
phase3_next_actor
end
#--------------------------------------------------------------------------
def phase3_next_actor
# ƒ‹[ƒv
begin
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_battler != nil
@active_battler.blink = false
end
# ÅŒã‚̃AƒNƒ^[‚Ìê‡
if @actor_index == $game_party.actors.size-1
# ƒƒCƒ"ƒtƒF[ƒYŠJŽn
start_phase4
return
end
# ƒAƒNƒ^[‚̃Cƒ"ƒfƒbƒNƒX‚ði‚ß‚é
@actor_index += 1
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
# ƒAƒNƒ^[‚ªƒRƒ}ƒ"ƒh"ü—Í‚ðŽó‚¯•t‚¯‚È‚¢ó'Ô‚È‚ç‚à‚¤ˆê"x
end until @active_battler.inputable?
# CP‚Ì"»'è
if @active_battler.cp < 1024
phase3_next_actor
else
# ƒAƒNƒ^[ƒRƒ}ƒ"ƒhƒEƒBƒ"ƒhƒE‚ðƒZƒbƒgƒAƒbƒv
@active_battler.now_guarding = false
phase3_setup_command_window
end
end
#--------------------------------------------------------------------------
def phase3_prior_actor
# ƒ‹[ƒv
begin
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_battler != nil
@active_battler.blink = false
end
# ʼn‚̃AƒNƒ^[‚Ìê‡
if @actor_index == 0
# ʼn‚Ö–ß‚é
start_phase3
return
end
# ƒAƒNƒ^[‚̃Cƒ"ƒfƒbƒNƒX‚ð–ß‚·
@actor_index -= 1
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
# ƒAƒNƒ^[‚ªƒRƒ}ƒ"ƒh"ü—Í‚ðŽó‚¯•t‚¯‚È‚¢ó'Ô‚È‚ç‚à‚¤ˆê"x
end until @active_battler.inputable?
# CP‚Ì"»'è
if @active_battler.cp < 1024
phase3_prior_actor
else
# ƒAƒNƒ^[ƒRƒ}ƒ"ƒhƒEƒBƒ"ƒhƒE‚ðƒZƒbƒgƒAƒbƒv
@active_battler.now_guarding = false
phase3_setup_command_window
end
end
#--------------------------------------------------------------------------
def start_phase4
# ƒtƒF[ƒY 4 ‚ɈÚs
@phase = 4
# ƒ^[ƒ""ƒJƒEƒ"ƒg
$game_temp.battle_turn += 1
# ƒoƒgƒ‹ƒCƒxƒ"ƒg‚Ì'Sƒy[ƒW‚ðŒŸõ
for index in 0...$data_troops[@troop_id].pages.size
# ƒCƒxƒ"ƒgƒy[ƒW‚ðŽæ"¾
page = $data_troops[@troop_id].pages[index]
# ‚±‚̃y[ƒW‚̃Xƒpƒ"‚ª [ƒ^[ƒ"] ‚Ìê‡
if page.span == 1
# ŽÀsς݃tƒ‰ƒO‚ðƒNƒŠƒA
$game_temp.battle_event_flags[index] = false
end
end
# ƒAƒNƒ^[‚ð"ñ'I'ðó'Ô‚ÉÝ'è
@actor_index = -1
@active_battler = nil
# ƒp[ƒeƒBƒRƒ}ƒ"ƒhƒEƒBƒ"ƒhƒE‚ð—LŒø‰»
@party_command_window.active = false
@party_command_window.visible = false
# ƒAƒNƒ^[ƒRƒ}ƒ"ƒhƒEƒBƒ"ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
# ƒƒCƒ"ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒZƒbƒg
$game_temp.battle_main_phase = true
# ƒGƒlƒ~[ƒAƒNƒVƒ‡ƒ"ì¬
for enemy in $game_troop.enemies
if enemy.cp < 1024
enemy.current_action.clear
next
end
enemy.make_action
end
# s"®‡˜ì¬
make_action_orders
# ƒXƒeƒbƒv 1 ‚ɈÚs
@phase4_step = 1
end
#--------------------------------------------------------------------------
def update_phase4_step1
# ƒwƒ‹ƒvƒEƒBƒ"ƒhƒE‚ð‰B‚·
@help_window.visible = false
# Ÿ"s"»'è
if judge
# Ÿ—˜‚Ü‚½‚Í"s–k‚Ìê‡ : ƒƒ\ƒbƒhI—¹
return
end
# ƒAƒNƒVƒ‡ƒ"‚ð‹§‚³‚ê‚Ä‚¢‚éƒoƒgƒ‰[‚ª'¶Ý‚µ‚È‚¢ê‡
if $game_temp.forcing_battler == nil
# ƒoƒgƒ‹ƒCƒxƒ"ƒg‚ðƒZƒbƒgƒAƒbƒv
setup_battle_event
# ƒoƒgƒ‹ƒCƒxƒ"ƒgŽÀs'†‚Ìê‡
if $game_system.battle_interpreter.running?
return
end
end
# ƒAƒNƒVƒ‡ƒ"‚ð‹§‚³‚ê‚Ä‚¢‚éƒoƒgƒ‰[‚ª'¶Ý‚·‚éê‡
if $game_temp.forcing_battler != nil
# æ"ª‚É'ljÁ‚Ü‚½‚͈Ú"®
@action_battlers.delete($game_temp.forcing_battler)
@action_battlers.unshift($game_temp.forcing_battler)
end
# –¢s"®ƒoƒgƒ‰[‚ª'¶Ý‚µ‚È‚¢ê‡ ('Sˆõs"®‚µ‚½)
if @action_battlers.size == 0
# ƒp[ƒeƒBƒRƒ}ƒ"ƒhƒtƒF[ƒYŠJŽn
start_phase2
return
end
# ƒAƒjƒ[ƒVƒ‡ƒ" ID ‚¨‚æ‚уRƒ‚ƒ"ƒCƒxƒ"ƒg ID ‚ð‰Šú‰»
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
# –¢s"®ƒoƒgƒ‰["z—ñ‚Ìæ"ª‚©‚çƒVƒtƒg
@active_battler = @action_battlers.shift
# ‚·‚Å‚Éí"¬‚©‚çŠO‚³‚ê‚Ä‚¢‚éê‡
if @active_battler.index == nil
return
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ"ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
@status_window.refresh
# ƒXƒeƒbƒv 2 ‚ɈÚs
@phase4_step = 2
end
#--------------------------------------------------------------------------
def update_phase4_step2
# ‹§ƒAƒNƒVƒ‡ƒ"‚łȂ¯‚ê‚Î
unless @active_battler.current_action.forcing
if @active_battler.restriction == 2 or @active_battler.restriction == 3
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
if @active_battler.restriction == 4
$game_temp.forcing_battler = nil
if @active_battler.cp >= 1024
@active_battler.remove_states_auto
@active_battler.cp = [(@active_battler.cp - 1024),0].max
@status_window.refresh
end
@phase4_step = 1
return
end
end
@target_battlers = []
case @active_battler.current_action.kind
when 0
make_basic_action_result
when 1
make_skill_action_result
when 2
make_item_action_result
end
if @phase4_step == 2
@phase4_step = 3
end
end
#--------------------------------------------------------------------------
def make_basic_action_result
# UŒ‚‚Ìê‡
if @active_battler.current_action.basic == 0
# ƒAƒjƒ[ƒVƒ‡ƒ" ID ‚ðÝ'è
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
# s"®'¤ƒoƒgƒ‰[‚ªƒGƒlƒ~[‚Ìê‡
if @active_battler.is_a?(Game_Enemy)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
end
# s"®'¤ƒoƒgƒ‰[‚ªƒAƒNƒ^[‚Ìê‡
if @active_battler.is_a?(Game_Actor)
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
end
# 'ÎÛ'¤ƒoƒgƒ‰[‚Ì"z—ñ‚ðÝ'è
@target_battlers = [target]
# 'ÊíUŒ‚‚ÌŒø‰Ê‚ð"K—p
for target in @target_battlers
target.attack_effect(@active_battler)
end
return
end
# –hŒä‚Ìê‡
if @active_battler.current_action.basic == 1
@help_window.set_text($data_system.words.guard, 1)
@active_battler.now_guarding = true
return
end
# "¦‚°‚é‚Ìê‡
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
@help_window.set_text("¦‚°‚é", 1)
# "¦‚°‚é
@active_battler.escape
return
end
# ‰½‚à‚µ‚È‚¢‚Ìê‡
if @active_battler.current_action.basic == 3
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
#--------------------------------------------------------------------------
def make_item_action_result
@item = $data_items[@active_battler.current_action.item_id]
unless $game_party.item_can_use?(@item.id)
# ƒXƒeƒbƒv 1 ‚ɈÚs
@phase4_step = 1
return
end
# Á–Õ•i‚Ìê‡
if @item.consumable
# Žg—p‚µ‚½ƒAƒCƒeƒ€‚ð 1 Œ¸‚ç‚·
$game_party.lose_item(@item.id, 1)
end
# ƒwƒ‹ƒvƒEƒBƒ"ƒhƒE‚ɃAƒCƒeƒ€–¼‚ð•\ަ
@help_window.set_text(@item.name, 1)
# ƒAƒjƒ[ƒVƒ‡ƒ" ID ‚ðÝ'è
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
# ƒRƒ‚ƒ"ƒCƒxƒ"ƒg ID ‚ðÝ'è
@common_event_id = @item.common_event_id
# 'ÎÛ‚ðŒˆ'è
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
# 'ÎÛ'¤ƒoƒgƒ‰[‚ðÝ'è
set_target_battlers(@item.scope)
# ƒAƒCƒeƒ€‚ÌŒø‰Ê‚ð"K—p
for target in @target_battlers
target.item_effect(@active_battler,@item)
end
end
#--------------------------------------------------------------------------
def update_phase4_step5
@help_window.visible = false
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
@active_battler.remove_states_auto
@active_battler.cp = [(@active_battler.cp - 1024),0].max
@status_window.refresh
# ƒ_ƒ[ƒW•\ަ
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
end
end
# ƒXƒeƒbƒv 6 ‚ɈÚs
@phase4_step = 6
end
end
class Scene_Item
#--------------------------------------------------------------------------
def update_target
# B ƒ{ƒ^ƒ"‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ"ƒZƒ‹ SE ‚ð‰‰'t
$game_system.se_play($data_system.cancel_se)
# ƒAƒCƒeƒ€Ø‚ê‚ȂǂŎg—p‚Å‚«‚È‚‚È‚Á‚½ê‡
unless $game_party.item_can_use?(@item.id)
# ƒAƒCƒeƒ€ƒEƒBƒ"ƒhƒE‚Ì"à—e‚ðÄì¬
@item_window.refresh
end
# ƒ^[ƒQƒbƒgƒEƒBƒ"ƒhƒE‚ðÁ‹Ž
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
# C ƒ{ƒ^ƒ"‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒAƒCƒeƒ€‚ðŽg‚¢Ø‚Á‚½ê‡
if $game_party.item_number(@item.id) == 0
# ƒuƒU[ SE ‚ð‰‰'t
$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.item_effect(nil,@item)
end
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.item_effect(nil,@item)
end
if used
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @item.common_event_id > 0
$game_temp.common_event_id = @item.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 Game_Party
#--------------------------------------------------------------------------
def random_target_actor(hp0 = false)
roulette = []
hate_max = -100 # hate'l"äŠr—p use compare hate
for actor in @actors
if (not hp0 and actor.exist?) or (hp0 and actor.hp0?)
if hate_max > actor.hate then
next
end
if hate_max < actor.hate then
roulette = []
hate_max = actor.hate
end
position = $data_classes[actor.class_id].position
n = 4 - position
n.times do
roulette.push(actor)
end
end
end
if roulette.size == 0
return nil
end
return roulette[rand(roulette.size)]
end
end |
Einfach ein neues Script über Main erstellen und dieses Script da rein kopieren.
Ach ja, bitte benutze nächstes Mal die
Ach ja, hier der Thread: http://forum.rpgxp.de/viewtopic.php?t=4313&highlight=balken
