Jump to content
Rpg²S Forum
  • 0

Ho due script utili da unire ma vanno in contrasto


leo
 Share

Question

Salve! Allora sarò breve e chiaro: cercavo due nuove funzioni per rpg e in qualche modo le ho trovate:

 

1-far sì che quando il bersaglio di una abilità è più bersagli, compaia il cursore su tutti i bersagli

2-poter passare da squadra nemica ad alleata e viceversa quando si sceglie il bersaglio di una abilità

 

1-la prima consiste in uno script unico

2-la seconda invece era una demo per cui mi sono segnato le differenze tra la demo e gli script di base

 

io ora chiedo un aiuto..posto qui le varie cose da modificare tra cui lo script e chiederei...se qualcuno è capace e ne ha tempo e voglia, di cercare di non creare errori. Sarò specifico: il solo problema riscontrato è quando scelgo di usare una abilità colpendo tutti i nemici o tutti gli alleati, mi dà errore su una parte di Scene_Battle_3 che ha a che fare con gli oggetti e sinceramente non capisco perchè, visto che gli oggetti non li ho ancora provati ad usare..

 

Script per la selezione di più bersagli:

 

 

#======================================================================

========

# ** XP: Night_Runner's MultiArrow Skill Choice

#-----------------------------------------------------------------------------

# History:

# Date Created: 11/Nov/2011

# Created for: leorob88

# @> http://www.rpgrevolution.com/forums/index....showtopic=53918

#

# Description:

# This script is designed for the default battle system, and changes it

# so that if you try to use a skill that should affect all the enemies

# or heroes, it will give you a section where it will highlight all

# the enemies/actors, as opposed to the default which automatically

# selects them all

#

# How to Install:

# Highlight and copy this entire script. In your game editor, select

# Tools >> Script Editor.

# Along the left, scroll all the way to the bottom, right click on

# 'Main' and select 'Insert'. Paste on the right

#

# Customisation:

# Line 47 shows the text when all the battlers are selected.

#

#==============================================================================

 

 

 

#==============================================================================

# ** Arrow_Base_Adv

#-----------------------------------------------------------------------------

# This array holds the arrows used to highlight enemies/actors in battle

#==============================================================================

 

class Arrow_Base_Adv

#--------------------------------------------------------------------------

# * Frame Update

#--------------------------------------------------------------------------

def update

@arrows.each { |arrow| arrow.update }

end

#--------------------------------------------------------------------------

# * Get Enemy Indicated by Cursor

#--------------------------------------------------------------------------

def update_help

if @select_all

@help_window.set_text("Tutti", 1)

else

@arrows[0].update_help

end

end

#--------------------------------------------------------------------------

# * Index

#--------------------------------------------------------------------------

def index

return @arrows[0].index

end

#--------------------------------------------------------------------------

# * Set Cursor Position

# index : new cursor position

#--------------------------------------------------------------------------

def index=(index)

return if @select_all

@index = index

update

end

#--------------------------------------------------------------------------

# * Set Help Window

# help_window : new help window

#--------------------------------------------------------------------------

def help_window=(help_window)

@help_window = help_window

if not @select_all

@arrows[0].help_window = @help_window

elsif @help_window != nil

update_help

end

end

#--------------------------------------------------------------------------

# * Dispose

#--------------------------------------------------------------------------

def dispose

@arrows.each { |arrow| arrow.dispose }

end

end

 

 

 

#==============================================================================

# ** Arrow_Enemy_Adv

#-----------------------------------------------------------------------------

# This array holds the arrows used to highlight actors in battle

#==============================================================================

 

class Arrow_Enemy_Adv < Arrow_Base_Adv

#--------------------------------------------------------------------------

# * Object Initialization ( viewport, selecting all enemies)

#--------------------------------------------------------------------------

def initialize(viewport, select_all = false)

@viewport = viewport

@select_all = select_all

@arrows = []

if @select_all

for i in 0...$game_troop.enemies.size

arrow = Arrow_Enemy.new(@viewport)

arrow.index = i

arrow.update

@arrows << arrow

end

else

@arrows = [Arrow_Enemy.new(@viewport)]

end

end

end

 

 

 

#==============================================================================

# ** Arrow_Actor_Adv

#-----------------------------------------------------------------------------

# This array holds the arrows used to highlight actors in battle

#==============================================================================

 

class Arrow_Actor_Adv < Arrow_Base_Adv

#--------------------------------------------------------------------------

# * Object Initialization ( viewport, selecting all enemies)

#--------------------------------------------------------------------------

def initialize(viewport, select_all = false)

@viewport = viewport

@select_all = select_all

@arrows = []

if @select_all

for i in 0...$game_party.actors.size

arrow = Arrow_Actor.new(@viewport)

arrow.index = i

arrow.update

@arrows << arrow

end

else

@arrows = [Arrow_Actor.new(@viewport)]

end

end

end

 

 

 

#==============================================================================

# ** Scene_Battle

#-----------------------------------------------------------------------------

# Edited to have highlight multiple enemies/actors if appropriate

#==============================================================================

 

class Scene_Battle

#--------------------------------------------------------------------------

# * Frame Update (actor command phase : skill selection)

#--------------------------------------------------------------------------

def update_phase3_skill_select

# Make skill window visible

@skill_window.visible = true

# Update skill window

@skill_window.update

# If B button was pressed

if Input.trigger?(Input::B)

# Play cancel SE

$game_system.se_play($data_system.cancel_se)

# End skill selection

end_skill_select

return

end

# If C button was pressed

if Input.trigger?(Input::C)

# Get currently selected data on the skill window

@skill = @skill_window.skill

# If it can't be used

if @skill == nil or not @active_battler.skill_can_use?(@skill.id)

# Play buzzer SE

$game_system.se_play($data_system.buzzer_se)

return

end

# Play decision SE

$game_system.se_play($data_system.decision_se)

# Set action

@active_battler.current_action.skill_id = @skill.id

# Make skill window invisible

@skill_window.visible = false

# If effect scope is single enemy

case @skill.scope

when 1, 2

# Start enemy selection

start_enemy_select

# If effect scope is single ally

when 3, 4, 5, 6

# Start actor selection

start_actor_select

# If effect scope is not single

else

# End skill selection

end_skill_select

# Go to command input for next actor

phase3_next_actor

end

return

end

end

#--------------------------------------------------------------------------

# * Frame Update (actor command phase : item selection)

#--------------------------------------------------------------------------

def update_phase3_item_select

# Make item window visible

@item_window.visible = true

# Update item window

@item_window.update

# If B button was pressed

if Input.trigger?(Input::B)

# Play cancel SE

$game_system.se_play($data_system.cancel_se)

# End item selection

end_item_select

return

end

# If C button was pressed

if Input.trigger?(Input::C)

# Get currently selected data on the item window

@item = @item_window.item

# If it can't be used

unless $game_party.item_can_use?(@item.id)

# Play buzzer SE

$game_system.se_play($data_system.buzzer_se)

return

end

# Play decision SE

$game_system.se_play($data_system.decision_se)

# Set action

@active_battler.current_action.item_id = @item.id

# Make item window invisible

@item_window.visible = false

# If effect scope is single enemy

case @item.scope

when 1, 2

# Start enemy selection

start_enemy_select

# If effect scope is single ally

when 3, 4, 5, 6

# Start actor selection

start_actor_select

# If effect scope is not single

else

# End item selection

end_item_select

# Go to command input for next actor

phase3_next_actor

end

return

end

end

#--------------------------------------------------------------------------

# * Start Enemy Selection

#--------------------------------------------------------------------------

def start_enemy_select

# Determine if we are attaching all enemies

if not @skill.nil?

attack_all = [2, 4, 6].include?(@skill.scope)

elsif not @item.nil?

attack_all = [2, 4, 6].include?(@item.scope)

else

attack_all = false

end

# Make enemy arrow

@enemy_arrow = Arrow_Enemy_Adv.new(@spriteset.viewport1, attack_all)

# Associate help window

@enemy_arrow.help_window = @help_window

# Disable actor command window

@actor_command_window.active = false

@actor_command_window.visible = false

end

#--------------------------------------------------------------------------

# * Start Actor Selection

#--------------------------------------------------------------------------

def start_actor_select

# Determine if we are attaching all enemies

if not @skill.nil?

attack_all = [2, 4, 6].include?(@skill.scope)

elsif not @item.nil?

attack_all = [2, 4, 6].include?(@item.scope)

else

attack_all = false

end

# Make actor arrow

@actor_arrow = Arrow_Actor_Adv.new(@spriteset.viewport2, attack_all)

@actor_arrow.index = @actor_index

# Associate help window

@actor_arrow.help_window = @help_window

# Disable actor command window

@actor_command_window.active = false

@actor_command_window.visible = false

end

end

 

 

 

#==============================================================================

# ** End of Script

#==============================================================================

 

 

In Scene_Battle_2 sotto alla riga "exp += enemy.exp" aggiungere "exp *= enemy.resurrection"

 

Questo va a sostituire invece lo script Scene_Battle_3

 

 

#======================================================================

========

# ■ Scene_Battle (分割定義 3)

#------------------------------------------------------------------------------

#  バトル画面の処理を行うクラスです。

#==============================================================================

 

class Scene_Battle

#--------------------------------------------------------------------------

# ● アクターコマンドフェーズ開始

#--------------------------------------------------------------------------

def start_phase3

# フェーズ 3 に移行

@phase = 3

# アクターを非選択状態に設定

@actor_index = -1

@active_battler = nil

# 次のアクターのコマンド入力へ

phase3_next_actor

end

#--------------------------------------------------------------------------

# ● 次のアクターのコマンド入力へ

#--------------------------------------------------------------------------

def phase3_next_actor

# ループ

begin

# アクターの明滅エフェクト OFF

if @active_battler != nil

@active_battler.blink = false

end

# 最後のアクターの場合

if @actor_index == $game_party.actors.size-1

# メインフェーズ開始

start_phase4

return

end

# アクターのインデックスを進める

@actor_index += 1

@active_battler = $game_party.actors[@actor_index]

@active_battler.blink = true

# アクターがコマンド入力を受け付けない状態ならもう一度

end until @active_battler.inputable?

# アクターコマンドウィンドウをセットアップ

phase3_setup_command_window

end

#--------------------------------------------------------------------------

# ● 前のアクターのコマンド入力へ

#--------------------------------------------------------------------------

def phase3_prior_actor

# ループ

begin

# アクターの明滅エフェクト OFF

if @active_battler != nil

@active_battler.blink = false

end

# 最初のアクターの場合

if @actor_index == 0

# パーティコマンドフェーズ開始

start_phase2

return

end

# アクターのインデックスを戻す

@actor_index -= 1

@active_battler = $game_party.actors[@actor_index]

@active_battler.blink = true

# アクターがコマンド入力を受け付けない状態ならもう一度

end until @active_battler.inputable?

# アクターコマンドウィンドウをセットアップ

phase3_setup_command_window

end

#--------------------------------------------------------------------------

# ● アクターコマンドウィンドウのセットアップ

#--------------------------------------------------------------------------

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

# インデックスを 0 に設定

@actor_command_window.index = 0

end

#--------------------------------------------------------------------------

# ● フレーム更新 (アクターコマンドフェーズ)

#--------------------------------------------------------------------------

def update_phase3

# エネミーアローが有効の場合

if @all_dead_actors_arrow != nil

update_phase3_all_dead_actors_select

elsif @all_dead_enemies_arrow != nil

update_phase3_all_dead_enemies_select

elsif @all_actors_arrow != nil

update_phase3_all_actors_select

elsif @all_enemies_arrow != nil

update_phase3_all_enemies_select

elsif @enemy_arrow != nil

update_phase3_enemy_select

# アクターアローが有効の場合

elsif @actor_arrow != nil

update_phase3_actor_select

# スキルウィンドウが有効の場合

elsif @skill_window != nil

update_phase3_skill_select

# アイテムウィンドウが有効の場合

elsif @item_window != nil

update_phase3_item_select

# アクターコマンドウィンドウが有効の場合

elsif @actor_command_window.active

update_phase3_basic_command

end

end

#--------------------------------------------------------------------------

# ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)

#--------------------------------------------------------------------------

def update_phase3_basic_command

# B ボタンが押された場合

if Input.trigger?(Input::B)

# キャンセル SE を演奏

$game_system.se_play($data_system.cancel_se)

# 前のアクターのコマンド入力へ

phase3_prior_actor

return

end

# C ボタンが押された場合

if Input.trigger?(Input::C)

# アクターコマンドウィンドウのカーソル位置で分岐

case @actor_command_window.index

when 0 # 攻撃

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

# アクションを設定

@active_battler.current_action.kind = 0

@active_battler.current_action.basic = 0

# エネミーの選択を開始

start_enemy_select

when 1 # スキル

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

# アクションを設定

@active_battler.current_action.kind = 1

# スキルの選択を開始

start_skill_select

when 2 # 防御

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

# アクションを設定

@active_battler.current_action.kind = 0

@active_battler.current_action.basic = 1

# 次のアクターのコマンド入力へ

phase3_next_actor

when 3 # アイテム

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

# アクションを設定

@active_battler.current_action.kind = 2

# アイテムの選択を開始

start_item_select

end

return

end

end

#--------------------------------------------------------------------------

# ● フレーム更新 (アクターコマンドフェーズ : スキル選択)

#--------------------------------------------------------------------------

def update_phase3_skill_select

# スキルウィンドウを可視状態にする

@skill_window.visible = true

# スキルウィンドウを更新

@skill_window.update

# B ボタンが押された場合

if Input.trigger?(Input::B)

# キャンセル SE を演奏

$game_system.se_play($data_system.cancel_se)

# スキルの選択を終了

end_skill_select

return

end

# C ボタンが押された場合

if Input.trigger?(Input::C)

# スキルウィンドウで現在選択されているデータを取得

@skill = @skill_window.skill

# 使用できない場合

if @skill == nil or not @active_battler.skill_can_use?(@skill.id)

# ブザー SE を演奏

$game_system.se_play($data_system.buzzer_se)

return

end

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

# アクションを設定

@active_battler.current_action.skill_id = @skill.id

# スキルウィンドウを不可視状態にする

@skill_window.visible = false

# 効果範囲が敵単体の場合

if @skill.scope == 1 or @skill.scope == 3 or @skill.scope == 5 or @skill.scope == 25 or @skill.scope ==26 or @skill.scope==9

# エネミーの選択を開始

start_enemy_select

# 効果範囲が味方単体の場合

else

if @skill.scope == 4 or @skill.scope==12

start_all_enemies_select

 

else

if @skill.scope==6 or @skill.scope==13

start_all_dead_enemies_select

else

 

# スキルの選択を終了

end_skill_select

# 次のアクターのコマンド入力へ

phase3_next_actor

end

end

end

return

end

end

#--------------------------------------------------------------------------

# ● フレーム更新 (アクターコマンドフェーズ : アイテム選択)

#--------------------------------------------------------------------------

def update_phase3_item_select

# アイテムウィンドウを可視状態にする

@item_window.visible = true

# アイテムウィンドウを更新

@item_window.update

# B ボタンが押された場合

if Input.trigger?(Input::B)

# キャンセル SE を演奏

$game_system.se_play($data_system.cancel_se)

# アイテムの選択を終了

end_item_select

return

end

# C ボタンが押された場合

if Input.trigger?(Input::C)

# アイテムウィンドウで現在選択されているデータを取得

@item = @item_window.item

# 使用できない場合

unless $game_party.item_can_use?(@item.id)

# ブザー SE を演奏

$game_system.se_play($data_system.buzzer_se)

return

end

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

# アクションを設定

@active_battler.current_action.item_id = @item.id

# アイテムウィンドウを不可視状態にする

@item_window.visible = false

# 効果範囲が敵単体の場合

if @item.scope == 1 or @item.scope == 3 or @item.scope == 5 or @item.scope == 25 or @item.scope ==26 or @item.scope==9

# エネミーの選択を開始

start_enemy_select

# 効果範囲が味方単体の場合

else

if @item.scope == 4 or @item.scope==12

start_all_enemies_select

 

else

if @item.scope==6 or @item.scope==13

start_all_dead_enemies_select

else

# スキルの選択を終了

end_item_select

# 次のアクターのコマンド入力へ

phase3_next_actor

end

end

end

return

end

end

#--------------------------------------------------------------------------

# ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)

#--------------------------------------------------------------------------

 

def update_phase3_enemy_select

# エネミーアローを更新

@enemy_arrow.update

# B ボタンが押された場合

if Input.trigger?(Input::B)

# キャンセル SE を演奏

$game_system.se_play($data_system.cancel_se)

# エネミーの選択を終了

end_enemy_select

return

end

# C ボタンが押された場合

if Input.press?(Input::DOWN)

$game_system.se_play($data_system.cursor_se)

end_enemy_select

start_actor_select

update_phase3

end

if Input.trigger?(Input::C)

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

if @actor_command_window.index == 0

@active_battler.attack=true

elsif @skill.scope==1 or @skill.scope==3

@skill.scope=1

elsif @skill.scope == 25

@skill.scope = 25

elsif @skill.scope==5 or @skill.scope==9

@skill.scope=9

elsif @item.scope ==1 or @item.scope==3

@item.scope=1

elsif @item.scope==5 or @item.scope==9

@item.scope=9

end

# アクションを設定

@active_battler.current_action.target_index = @enemy_arrow.index

end_enemy_select

# エネミーの選択を終了

# スキルウィンドウ表示中の場合

if @skill_window != nil

# スキルの選択を終了

end_skill_select

end

# アイテムウィンドウ表示中の場合

if @item_window != nil

# アイテムの選択を終了

end_item_select

end

 

# 次のアクターのコマンド入力へ

phase3_next_actor

end

end

 

#--------------------------------------------------------------------------

# ● フレーム更新 (アクターコマンドフェーズ : アクター選択)

#--------------------------------------------------------------------------

def update_phase3_actor_select

# アクターアローを更新

@actor_arrow.update

# B ボタンが押された場合

if Input.trigger?(Input::B)

# キャンセル SE を演奏

$game_system.se_play($data_system.cancel_se)

# アクターの選択を終了

end_actor_select

return

end

# C ボタンが押された場合

if Input.press?(Input::UP)

$game_system.se_play($data_system.cursor_se)

end_actor_select

start_enemy_select

end

if Input.trigger?(Input::C)

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

if @actor_command_window.index == 0

@active_battler.attack=false

elsif @skill.scope==1 or @skill.scope==3

@skill.scope=3

elsif @skill.scope==5 or @skill.scope==9

@skill.scope=5

elsif @item.scope==1 or @item.scope==3

@item.scope=3

elsif @item.scope==5 or @item.scope==9

@item.scope=5

end

# アクションを設定

@active_battler.current_action.target_index = @actor_arrow.index

end_actor_select

 

# アクターの選択を終了

# スキルウィンドウ表示中の場合

if @skill_window != nil

# スキルの選択を終了

end_skill_select

end

# アイテムウィンドウ表示中の場合

if @item_window != nil

# アイテムの選択を終了

end_item_select

end

# 次のアクターのコマンド入力へ

phase3_next_actor

end

end

def update_phase3_all_enemies_select

# エネミーアローを更新

@all_enemies_arrow.update

# B ボタンが押された場合

if Input.trigger?(Input::B)

# キャンセル SE を演奏

$game_system.se_play($data_system.cancel_se)

# エネミーの選択を終了

end_all_enemies_select

return

end

# C ボタンが押された場合

if Input.press?(Input::DOWN)

$game_system.se_play($data_system.cursor_se)

start_all_actors_select

end_all_enemies_select

update_phase3

end

if Input.trigger?(Input::C)

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

if @skill.scope==4 or @skill.scope==12

@skill.scope=12

else

if @item.scope==4 or @item.scope==12

@item.scope=12

end

end

# アクションを設定

# エネミーの選択を終了

end_all_enemies_select

# スキルウィンドウ表示中の場合

if @skill_window != nil

# スキルの選択を終了

end_skill_select

end

# アイテムウィンドウ表示中の場合

if @item_window != nil

# アイテムの選択を終了

end_item_select

end

# 次のアクターのコマンド入力へ

phase3_next_actor

end

end

def update_phase3_all_dead_enemies_select

# エネミーアローを更新

@all_dead_enemies_arrow.update

# B ボタンが押された場合

if Input.trigger?(Input::B)

# キャンセル SE を演奏

$game_system.se_play($data_system.cancel_se)

# エネミーの選択を終了

end_all_dead_enemies_select

return

end

# C ボタンが押された場合

if Input.press?(Input::DOWN)

$game_system.se_play($data_system.cursor_se)

start_all_dead_actors_select

end_all_dead_enemies_select

update_phase3

end

if Input.trigger?(Input::C)

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

if @skill.scope==6 or @skill.scope==13

@skill.scope=13

else

if @item.scope==6 or @item.scope==13

@item.scope=13

end

end

# アクションを設定

# エネミーの選択を終了

end_all_dead_enemies_select

# スキルウィンドウ表示中の場合

if @skill_window != nil

# スキルの選択を終了

end_skill_select

end

# アイテムウィンドウ表示中の場合

if @item_window != nil

# アイテムの選択を終了

end_item_select

end

# 次のアクターのコマンド入力へ

phase3_next_actor

end

end

#--------------------------------------------------------------------------

# ● フレーム更新 (アクターコマンドフェーズ : アクター選択)

#--------------------------------------------------------------------------

def update_phase3_all_actors_select

# アクターアローを更新

@all_actors_arrow.update

# B ボタンが押された場合

if Input.trigger?(Input::B)

# キャンセル SE を演奏

$game_system.se_play($data_system.cancel_se)

# アクターの選択を終了

end_all_actors_select

return

end

# C ボタンが押された場合

if Input.press?(Input::UP)

$game_system.se_play($data_system.cursor_se)

start_all_enemies_select

end_all_actors_select

update_phase3

end

if Input.trigger?(Input::C)

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

if @skill.scope==4 or @skill.scope==12

@skill.scope=4

else

if @item.scope==4 or @item.scope==12

@item.scope=4

end

end

# アクションを設定

# アクターの選択を終了

end_all_actors_select

# スキルウィンドウ表示中の場合

if @skill_window != nil

# スキルの選択を終了

end_skill_select

end

# アイテムウィンドウ表示中の場合

if @item_window != nil

# アイテムの選択を終了

end_item_select

end

# 次のアクターのコマンド入力へ

phase3_next_actor

end

end

def update_phase3_all_dead_actors_select

# アクターアローを更新

@all_dead_actors_arrow.update

# B ボタンが押された場合

if Input.trigger?(Input::B)

# キャンセル SE を演奏

$game_system.se_play($data_system.cancel_se)

# アクターの選択を終了

end_all_dead_actors_select

return

end

# C ボタンが押された場合

if Input.press?(Input::UP)

$game_system.se_play($data_system.cursor_se)

start_all_dead_enemies_select

end_all_dead_actors_select

update_phase3

end

if Input.trigger?(Input::C)

# 決定 SE を演奏

$game_system.se_play($data_system.decision_se)

if @skill.scope==6 or @skill.scope==13

@skill.scope=6

else

if @item.scope==6 or @item.scope==13

@item.scope=6

end

end

# アクションを設定

# アクターの選択を終了

end_all_dead_actors_select

# スキルウィンドウ表示中の場合

if @skill_window != nil

# スキルの選択を終了

end_skill_select

end

# アイテムウィンドウ表示中の場合

if @item_window != nil

# アイテムの選択を終了

end_item_select

end

# 次のアクターのコマンド入力へ

phase3_next_actor

end

end

#--------------------------------------------------------------------------

# ● エネミー選択開始

#--------------------------------------------------------------------------

def start_enemy_select

# エネミーアローを作成

@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)

# ヘルプウィンドウを関連付け

@enemy_arrow.help_window = @help_window

# アクターコマンドウィンドウを無効化

@actor_command_window.active = false

@actor_command_window.visible = false

end

def start_all_enemies_select

# エネミーアローを作成

@all_enemies_arrow = Arrow_All_Enemies.new(@spriteset.viewport1)

# ヘルプウィンドウを関連付け

# アクターコマンドウィンドウを無効化

@actor_command_window.active = false

@actor_command_window.visible = false

end

def start_all_dead_enemies_select

# エネミーアローを作成

@all_dead_enemies_arrow = Arrow_All_Dead_Enemies.new(@spriteset.viewport1)

# ヘルプウィンドウを関連付け

# アクターコマンドウィンドウを無効化

@actor_command_window.active = false

@actor_command_window.visible = false

end

#--------------------------------------------------------------------------

# ● エネミー選択終了

#--------------------------------------------------------------------------

def end_enemy_select

# エネミーアローを解放

@enemy_arrow.dispose

@enemy_arrow = nil

# コマンドが [戦う] の場合

if @actor_command_window.index == 0

# アクターコマンドウィンドウを有効化

@actor_command_window.active = true

@actor_command_window.visible = true

# ヘルプウィンドウを隠す

end

@help_window.visible = false

end

def end_all_enemies_select

# エネミーアローを解放

@all_enemies_arrow.dispose

@all_enemies_arrow = nil

 

for enemy in $game_troop.enemies

if enemy != nil and enemy.exist?

enemy.blink = false

end

end

# コマンドが [戦う] の場合

end

def end_all_dead_enemies_select

# エネミーアローを解放

@all_dead_enemies_arrow.dispose

@all_dead_enemies_arrow = nil

 

for enemy in $game_troop.enemies

if enemy != nil and enemy.exist?

enemy.blink = false

end

end

# コマンドが [戦う] の場合

end

#--------------------------------------------------------------------------

# ● アクター選択開始

#--------------------------------------------------------------------------

def start_actor_select

# アクターアローを作成

@actor_arrow = Arrow_Actor.new(@spriteset.viewport2)

@actor_arrow.index = @actor_index

# ヘルプウィンドウを関連付け

# アクターコマンドウィンドウを無効化

@actor_command_window.active = false

@actor_command_window.visible = false

end

#--------------------------------------------------------------------------

# ● アクター選択終了

#--------------------------------------------------------------------------

def end_actor_select

# アクターアローを解放

@actor_arrow.dispose

@actor_arrow = nil

# コマンドが [戦う] の場合

if @actor_command_window.index == 0

# アクターコマンドウィンドウを有効化

@actor_command_window.active = true

@actor_command_window.visible = true

# ヘルプウィンドウを隠す

@help_window.visible = false

end

end

def start_all_actors_select

# アクターアローを作成

@all_actors_arrow = Arrow_All_Actors.new(@spriteset.viewport2)

# ヘルプウィンドウを関連付け

# アクターコマンドウィンドウを無効化

@actor_command_window.active = false

@actor_command_window.visible = false

end

def start_all_dead_actors_select

# アクターアローを作成

@all_dead_actors_arrow = Arrow_All_Dead_Actors.new(@spriteset.viewport2)

# ヘルプウィンドウを関連付け

# アクターコマンドウィンドウを無効化

@actor_command_window.active = false

@actor_command_window.visible = false

end

#--------------------------------------------------------------------------

# ● アクター選択終了

#--------------------------------------------------------------------------

def end_all_actors_select

# アクターアローを解放

@all_actors_arrow.dispose

@all_actors_arrow = nil

for actor in $game_party.actors

if actor != nil and actor.exist?

actor.blink = false

end

end

end

def end_all_dead_actors_select

# アクターアローを解放

@all_dead_actors_arrow.dispose

@all_dead_actors_arrow = nil

for actor in $game_party.actors

if actor != nil and actor.exist?

actor.blink = false

end

end

end

#--------------------------------------------------------------------------

# ● スキル選択開始

#--------------------------------------------------------------------------

def start_skill_select

# スキルウィンドウを作成

@skill_window = Window_Skill.new(@active_battler)

# ヘルプウィンドウを関連付け

@skill_window.help_window = @help_window

# アクターコマンドウィンドウを無効化

@actor_command_window.active = false

@actor_command_window.visible = false

end

#--------------------------------------------------------------------------

# ● スキル選択終了

#--------------------------------------------------------------------------

def end_skill_select

# スキルウィンドウを解放

@skill_window.dispose

@skill_window = nil

# ヘルプウィンドウを隠す

@help_window.visible = false

# アクターコマンドウィンドウを有効化

@actor_command_window.active = true

@actor_command_window.visible = true

end

#--------------------------------------------------------------------------

# ● アイテム選択開始

#--------------------------------------------------------------------------

def start_item_select

# アイテムウィンドウを作成

@item_window = Window_Item.new

# ヘルプウィンドウを関連付け

@item_window.help_window = @help_window

# アクターコマンドウィンドウを無効化

@actor_command_window.active = false

@actor_command_window.visible = false

end

#--------------------------------------------------------------------------

# ● アイテム選択終了

#--------------------------------------------------------------------------

def end_item_select

# アイテムウィンドウを解放

@item_window.dispose

@item_window = nil

# ヘルプウィンドウを隠す

@help_window.visible = false

# アクターコマンドウィンドウを有効化

@actor_command_window.active = true

@actor_command_window.visible = true

end

end

 

 

 

Chiudo qui e apro un altro topic perchè dice che se no c'è troppa roba scritta..

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Bastava fare un secondo post.

Cancello l'altro topic e metto il tuo secondo post nello spoiler qui sotto.

 

 

Sotto ai 3 script Arrow_base, _actor e _enemy, incollare questi 4:

 

Arrow_ALL_Actors

 

 

#======================================================================

========

# ■ Arrow_Actor

#------------------------------------------------------------------------------

#  アクターを選択させるためのアローカーソルです。このクラスは Arrow_Base クラ

# スを継承します。

#==============================================================================

 

class Arrow_All_Actors

#--------------------------------------------------------------------------

# ● カーソルが指しているアクターの取得

#--------------------------------------------------------------------------

def actor

return $game_party.actors

end

#--------------------------------------------------------------------------

# ● フレーム更新

#--------------------------------------------------------------------------

def update

super

for enemy in $game_troop.enemies

if enemy != nil and enemy.exist?

enemy.blink =false

end

end

for actor in $game_party.actors

if actor != nil and actor.exist?

actor.blink = true

end

end

end

#--------------------------------------------------------------------------

# ● ヘルプテキスト更新

#--------------------------------------------------------------------------

end

 

 

 

Arrow_All_Dead_Actors

 

 

#======================================================================

========

# ■ Arrow_Actor

#------------------------------------------------------------------------------

#  アクターを選択させるためのアローカーソルです。このクラスは Arrow_Base クラ

# スを継承します。

#==============================================================================

 

class Arrow_All_Dead_Actors

#--------------------------------------------------------------------------

# ● カーソルが指しているアクターの取得

#--------------------------------------------------------------------------

def actor

return $game_party.actors

end

#--------------------------------------------------------------------------

# ● フレーム更新

#--------------------------------------------------------------------------

def update

super

for enemy in $game_troop.enemies

if enemy != nil and enemy.exist?

enemy.blink =false

end

end

for actor in $game_party.actors

if actor != nil and actor.exist?

actor.blink = true

end

end

end

#--------------------------------------------------------------------------

# ● ヘルプテキスト更新

#--------------------------------------------------------------------------

end

 

 

 

Arrow_All_Enemies

 

 

#======================================================================

========

# ■ Arrow_Enemy

#------------------------------------------------------------------------------

#  エネミーを選択させるためのアローカーソルです。このクラスは Arrow_Base クラ

# スを継承します。

#==============================================================================

 

class Arrow_All_Enemies

#--------------------------------------------------------------------------

# ● カーソルが指しているエネミーの取得

#--------------------------------------------------------------------------

#--------------------------------------------------------------------------

# ● フレーム更新

#--------------------------------------------------------------------------

def update

super

for actor in $game_party.actors

if actor != nil and actor.exist?

actor.blink = false

end

end

for enemy in $game_troop.enemies

if enemy != nil and enemy.exist?

enemy.blink = true

end

end

end

#--------------------------------------------------------------------------

# ● ヘルプテキスト更新

#--------------------------------------------------------------------------

end

 

 

 

Arrow_All_Dead_Enemies

 

 

#======================================================================

========

# ■ Arrow_Enemy

#------------------------------------------------------------------------------

#  エネミーを選択させるためのアローカーソルです。このクラスは Arrow_Base クラ

# スを継承します。

#==============================================================================

 

class Arrow_All_Dead_Enemies

#--------------------------------------------------------------------------

# ● カーソルが指しているエネミーの取得

#--------------------------------------------------------------------------

#--------------------------------------------------------------------------

# ● フレーム更新

#--------------------------------------------------------------------------

def update

super

for actor in $game_party.actors

if actor != nil and actor.exist?

actor.blink = false

end

end

for enemy in $game_troop.enemies

if enemy != nil and enemy.exist?

enemy.blink = true

end

end

end

#--------------------------------------------------------------------------

# ● ヘルプテキスト更新

#--------------------------------------------------------------------------

end

 

 

 

Non mancano molte altre cose, quasi finito! Andate in Scene_Battle_4 e sostituite con questo (le differenze sono, in questo nuovo script, a riga 206 e righe sottostanti e a riga 324 e un po' di righe sottostanti)

 

 

#======================================================================

========

# ■ Scene_Battle (分割定義 4)

#------------------------------------------------------------------------------

#  バトル画面の処理を行うクラスです。

#==============================================================================

 

class Scene_Battle

#--------------------------------------------------------------------------

# ● メインフェーズ開始

#--------------------------------------------------------------------------

def start_phase4

# フェーズ 4 に移行

@phase = 4

# ターン数カウント

$game_temp.battle_turn += 1

# バトルイベントの全ページを検索

for index in 0...$data_troops[@troop_id].pages.size

# イベントページを取得

page = $data_troops[@troop_id].pages[index]

# このページのスパンが [ターン] の場合

if page.span == 1

# 実行済みフラグをクリア

$game_temp.battle_event_flags[index] = false

end

end

# アクターを非選択状態に設定

@actor_index = -1

@active_battler = nil

# パーティコマンドウィンドウを有効化

@party_command_window.active = false

@party_command_window.visible = false

# アクターコマンドウィンドウを無効化

@actor_command_window.active = false

@actor_command_window.visible = false

# メインフェーズフラグをセット

$game_temp.battle_main_phase = true

# エネミーアクション作成

for enemy in $game_troop.enemies

enemy.make_action

end

# 行動順序作成

make_action_orders

# ステップ 1 に移行

@phase4_step = 1

end

#--------------------------------------------------------------------------

# ● 行動順序作成

#--------------------------------------------------------------------------

def make_action_orders

# 配列 @action_battlers を初期化

@action_battlers = []

# エネミーを配列 @action_battlers に追加

for enemy in $game_troop.enemies

@action_battlers.push(enemy)

end

# アクターを配列 @action_battlers に追加

for actor in $game_party.actors

@action_battlers.push(actor)

end

# 全員のアクションスピードを決定

for battler in @action_battlers

battler.make_action_speed

end

# アクションスピードの大きい順に並び替え

@action_battlers.sort! {|a,b|

b.current_action.speed - a.current_action.speed }

end

#--------------------------------------------------------------------------

# ● フレーム更新 (メインフェーズ)

#--------------------------------------------------------------------------

def update_phase4

case @phase4_step

when 1

update_phase4_step1

when 2

update_phase4_step2

when 3

update_phase4_step3

when 4

update_phase4_step4

when 5

update_phase4_step5

when 6

update_phase4_step6

end

end

#--------------------------------------------------------------------------

# ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)

#--------------------------------------------------------------------------

def update_phase4_step1

# ヘルプウィンドウを隠す

@help_window.visible = false

# 勝敗判定

if judge

# 勝利または敗北の場合 : メソッド終了

return

end

# アクションを強制されているバトラーが存在しない場合

if $game_temp.forcing_battler == nil

# バトルイベントをセットアップ

setup_battle_event

# バトルイベント実行中の場合

if $game_system.battle_interpreter.running?

return

end

end

# アクションを強制されているバトラーが存在する場合

if $game_temp.forcing_battler != nil

# 先頭に追加または移動

@action_battlers.delete($game_temp.forcing_battler)

@action_battlers.unshift($game_temp.forcing_battler)

end

# 未行動バトラーが存在しない場合 (全員行動した)

if @action_battlers.size == 0

# パーティコマンドフェーズ開始

start_phase2

return

end

# アニメーション ID およびコモンイベント ID を初期化

@animation1_id = 0

@animation2_id = 0

@common_event_id = 0

# 未行動バトラー配列の先頭からシフト

@active_battler = @action_battlers.shift

# すでに戦闘から外されている場合

if @active_battler.index == nil

return

end

# スリップダメージ

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

# ステータスウィンドウをリフレッシュ

@status_window.refresh

# ステップ 2 に移行

@phase4_step = 2

end

#--------------------------------------------------------------------------

# ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)

#--------------------------------------------------------------------------

def update_phase4_step2

# 強制アクションでなければ

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

# ステップ 1 に移行

@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

# ステップ 3 に移行

if @phase4_step == 2

@phase4_step = 3

end

end

#--------------------------------------------------------------------------

# ● 基本アクション 結果作成

#--------------------------------------------------------------------------

def make_basic_action_result

# 攻撃の場合

if @active_battler.current_action.basic == 0

# アニメーション ID を設定

@animation1_id = @active_battler.animation1_id

@animation2_id = @active_battler.animation2_id

# 行動側バトラーがエネミーの場合

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

# 行動側バトラーがアクターの場合

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

if @active_battler.attack == true

target = $game_troop.smooth_target_enemy(index)

else

target = $game_party.smooth_target_actor(index)

end

end

end

# 対象側バトラーの配列を設定

@target_battlers = [target]

# 通常攻撃の効果を適用

for target in @target_battlers

target.attack_effect(@active_battler)

end

return

end

# 防御の場合

if @active_battler.current_action.basic == 1

# ヘルプウィンドウに "防御" を表示

@help_window.set_text($data_system.words.guard, 1)

return

end

# 逃げるの場合

if @active_battler.is_a?(Game_Enemy) and

@active_battler.current_action.basic == 2

# ヘルプウィンドウに "逃げる" を表示

@help_window.set_text("Escape", 1)

# 逃げる

@active_battler.escape

return

end

# 何もしないの場合

if @active_battler.current_action.basic == 3

# アクション強制対象のバトラーをクリア

$game_temp.forcing_battler = nil

# ステップ 1 に移行

@phase4_step = 1

return

end

end

#--------------------------------------------------------------------------

# ● スキルまたはアイテムの対象側バトラー設定

# scope : スキルまたはアイテムの効果範囲

#--------------------------------------------------------------------------

def set_target_battlers(scope)

# 行動側バトラーがエネミーの場合

if @active_battler.is_a?(Game_Enemy)

# 効果範囲で分岐

case scope

when 1 # 敵単体

index = @active_battler.current_action.target_index

@target_battlers.push($game_party.smooth_target_actor(index))

when 2 # 敵全体

for actor in $game_party.actors

if actor.exist?

@target_battlers.push(actor)

end

end

when 3 # 味方単体

index = @active_battler.current_action.target_index

@target_battlers.push($game_troop.smooth_target_enemy(index))

when 4 # 味方全体

for enemy in $game_troop.enemies

if enemy.exist?

@target_battlers.push(enemy)

end

end

when 5 # 味方単体 (HP 0)

index = @active_battler.current_action.target_index

enemy = $game_troop.enemies[index]

if enemy != nil and enemy.hp0?

@target_battlers.push(enemy)

end

when 6 # 味方全体 (HP 0)

for enemy in $game_troop.enemies

if enemy != nil and enemy.hp0?

@target_battlers.push(enemy)

end

end

when 7 # 使用者

@target_battlers.push(@active_battler)

end

end

# 行動側バトラーがアクターの場合

if @active_battler.is_a?(Game_Actor)

# 効果範囲で分岐

case scope

when 1 # 敵単体

index = @active_battler.current_action.target_index

@target_battlers.push($game_troop.smooth_target_enemy(index))

when 2 # 敵全体

for enemy in $game_troop.enemies

if enemy.exist?

@target_battlers.push(enemy)

end

end

when 3 # 味方単体

index = @active_battler.current_action.target_index

@target_battlers.push($game_party.smooth_target_actor(index))

when 4 # 味方全体

for actor in $game_party.actors

if actor.exist?

@target_battlers.push(actor)

end

end

when 5 # 味方単体 (HP 0)

index = @active_battler.current_action.target_index

actor = $game_party.actors[index]

if actor != nil and actor.hp0?

@target_battlers.push(actor)

end

when 6 # 味方全体 (HP 0)

for actor in $game_party.actors

if actor != nil and actor.hp0?

@target_battlers.push(actor)

end

end

when 7 # 使用者

@target_battlers.push(@active_battler)

when 9

index = @active_battler.current_action.target_index

enemy = $game_troop.enemies[index]

if enemy != nil and enemy.hp0?

enemy.resurrection+=1

@target_battlers.push(enemy)

end

when 10

for actor in $game_party.actors

if actor != nil and actor.hp0?

@target_battlers.push(actor)

end

end

for enemy in $game_troop.enemies

if enemy != nil and enemy.hp0?

enemy.resurrection+=1

@target_battlers.push(enemy)

end

end

 

when 11

for enemy in $game_troop.enemies

if enemy.exist?

@target_battlers.push(enemy)

end

end

for actor in $game_party.actors

if actor.exist?

@target_battlers.push(actor)

end

end

when 12

for enemy in $game_troop.enemies

if enemy.exist?

@target_battlers.push(enemy)

end

end

when 13

for enemy in $game_troop.enemies

if enemy != nil and enemy.hp0?

enemy.resurrection+=1

@target_battlers.push(enemy)

end

end

when 25

index = @active_battler.current_action.target_index

@target_battlers.push($game_troop.smooth_target_enemy(index))

when 26

index = @active_battler.current_action.target_index

@target_battlers.push($game_party.smooth_target_actor(index))

end

end

end

#--------------------------------------------------------------------------

# ● スキルアクション 結果作成

#--------------------------------------------------------------------------

def make_skill_action_result

# スキルを取得

@skill = $data_skills[@active_battler.current_action.skill_id]

# 強制アクションでなければ

unless @active_battler.current_action.forcing

# SP 切れなどで使用できなくなった場合

unless @active_battler.skill_can_use?(@skill.id)

# アクション強制対象のバトラーをクリア

$game_temp.forcing_battler = nil

# ステップ 1 に移行

@phase4_step = 1

return

end

end

# SP 消費

@active_battler.sp -= @skill.sp_cost

# ステータスウィンドウをリフレッシュ

@status_window.refresh

# ヘルプウィンドウにスキル名を表示

@help_window.set_text(@skill.name, 1)

# アニメーション ID を設定

@animation1_id = @skill.animation1_id

@animation2_id = @skill.animation2_id

# コモンイベント ID を設定

@common_event_id = @skill.common_event_id

# 対象側バトラーを設定

set_target_battlers(@skill.scope)

# スキルの効果を適用

for target in @target_battlers

target.skill_effect(@active_battler, @skill)

end

end

#--------------------------------------------------------------------------

# ● アイテムアクション 結果作成

#--------------------------------------------------------------------------

def make_item_action_result

# アイテムを取得

@item = $data_items[@active_battler.current_action.item_id]

# アイテム切れなどで使用できなくなった場合

unless $game_party.item_can_use?(@item.id)

# ステップ 1 に移行

@phase4_step = 1

return

end

# 消耗品の場合

if @item.consumable

# 使用したアイテムを 1 減らす

$game_party.lose_item(@item.id, 1)

end

# ヘルプウィンドウにアイテム名を表示

@help_window.set_text(@item.name, 1)

# アニメーション ID を設定

@animation1_id = @item.animation1_id

@animation2_id = @item.animation2_id

# コモンイベント ID を設定

@common_event_id = @item.common_event_id

# 対象を決定

index = @active_battler.current_action.target_index

target = $game_party.smooth_target_actor(index)

# 対象側バトラーを設定

set_target_battlers(@item.scope)

# アイテムの効果を適用

for target in @target_battlers

target.item_effect(@item)

end

end

#--------------------------------------------------------------------------

# ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)

#--------------------------------------------------------------------------

def update_phase4_step3

# 行動側アニメーション (ID が 0 の場合は白フラッシュ)

if @animation1_id == 0

@active_battler.white_flash = true

else

@active_battler.animation_id = @animation1_id

@active_battler.animation_hit = true

end

# ステップ 4 に移行

@phase4_step = 4

end

#--------------------------------------------------------------------------

# ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)

#--------------------------------------------------------------------------

def update_phase4_step4

# 対象側アニメーション

for target in @target_battlers

target.animation_id = @animation2_id

target.animation_hit = (target.damage != "Miss")

end

# アニメーションの長さにかかわらず、最低 8 フレーム待つ

@wait_count = 8

# ステップ 5 に移行

@phase4_step = 5

end

#--------------------------------------------------------------------------

# ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)

#--------------------------------------------------------------------------

def update_phase4_step5

# ヘルプウィンドウを隠す

@help_window.visible = false

# ステータスウィンドウをリフレッシュ

@status_window.refresh

# ダメージ表示

for target in @target_battlers

if target.damage != nil

target.damage_pop = true

end

end

# ステップ 6 に移行

@phase4_step = 6

end

#--------------------------------------------------------------------------

# ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)

#--------------------------------------------------------------------------

def update_phase4_step6

# アクション強制対象のバトラーをクリア

$game_temp.forcing_battler = nil

# コモンイベント ID が有効の場合

if @common_event_id > 0

# イベントをセットアップ

common_event = $data_common_events[@common_event_id]

$game_system.battle_interpreter.setup(common_event.list, 0)

end

# ステップ 1 に移行

@phase4_step = 1

end

end

 

 

 

In Game_Battler_1 sotto a "attr_accessor :blink" inserite

 

attr_accessor :resurrection

attr_accessor :attack

 

e nel paragrafo Initialize inserite sotto a "@blink = false"

 

@resurrection=1

@attack = false

 

Ora, ultima cosa, andate in Game_Battler_3 e sostituite il tutto con questo ( le differenze sono a riga 118 e sottostanti e 132 e sottostanti)

 

 

#======================================================================

========

# ■ Game_Battler (分割定義 3)

#------------------------------------------------------------------------------

#  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ

# スのスーパークラスとして使用されます。

#==============================================================================

 

class Game_Battler

#--------------------------------------------------------------------------

# ● スキルの使用可能判定

# skill_id : スキル ID

#--------------------------------------------------------------------------

def skill_can_use?(skill_id)

# SP が足りない場合は使用不可

if $data_skills[skill_id].sp_cost > self.sp

return false

end

# 戦闘不能の場合は使用不可

if dead?

return false

end

# 沈黙状態の場合、物理スキル以外は使用不可

if $data_skills[skill_id].atk_f == 0 and self.restriction == 1

return false

end

# 使用可能時を取得

occasion = $data_skills[skill_id].occasion

# 戦闘中の場合

if $game_temp.in_battle

# [常時] または [バトルのみ] なら使用可

return (occasion == 0 or occasion == 1)

# 戦闘中ではない場合

else

# [常時] または [メニューのみ] なら使用可

return (occasion == 0 or occasion == 2)

end

end

#--------------------------------------------------------------------------

# ● 通常攻撃の効果適用

# attacker : 攻撃者 (バトラー)

#--------------------------------------------------------------------------

def attack_effect(attacker)

# クリティカルフラグをクリア

self.critical = false

# 第一命中判定

hit_result = (rand(100)

# 命中の場合

if hit_result == true

# 基本ダメージを計算

atk = [attacker.atk - self.pdef / 2, 0].max

self.damage = atk * (20 + attacker.str) / 20

# 属性修正

self.damage *= elements_correct(attacker.element_set)

self.damage /= 100

# ダメージの符号が正の場合

if self.damage > 0

# クリティカル修正

if rand(100)

self.damage *= 2

self.critical = true

end

# 防御修正

if self.guarding?

self.damage /= 2

end

end

# 分散

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

hit = self.cant_evade? ? 100 : hit

hit_result = (rand(100)

end

# 命中の場合

if hit_result == true

# ステート衝撃解除

remove_states_shock

# HP からダメージを減算

self.hp -= self.damage

# ステート変化

@state_changed = false

states_plus(attacker.plus_state_set)

states_minus(attacker.minus_state_set)

# ミスの場合

else

# ダメージに "Miss" を設定

self.damage = "Miss"

# クリティカルフラグをクリア

self.critical = false

end

# メソッド終了

return true

end

#--------------------------------------------------------------------------

# ● スキルの効果適用

# user : スキルの使用者 (バトラー)

# skill : スキル

#--------------------------------------------------------------------------

def skill_effect(user, skill)

# クリティカルフラグをクリア

self.critical = false

# スキルの効果範囲が HP 1 以上の味方で、自分の HP が 0、

# またはスキルの効果範囲が HP 0 の味方で、自分の 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)

# メソッド終了

return false

end

# 有効フラグをクリア

effective = false

# コモンイベント ID が有効の場合は有効フラグをセット

effective |= skill.common_event_id > 0

# 第一命中判定

if self.element_rate(9)==200 and skill.scope==25

hit = -(skill.power)

else

hit = skill.hit

if skill.atk_f > 0

hit *= user.hit / 100

end

end

hit_result = (rand(100)

# 不確実なスキルの場合は有効フラグをセット

effective |= hit

# 命中の場合

if hit_result == true

# 威力を計算

if self.element_rate(9)==200 and skill.scope==25

power = -(skill.power + user.atk * skill.atk_f / 100)

else

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

end

# 倍率を計算

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)

# 基本ダメージを計算

self.damage = power * rate / 20

# 属性修正

self.damage *= elements_correct(skill.element_set)

self.damage /= 100

# ダメージの符号が正の場合

if self.damage > 0

# 防御修正

if self.guarding?

self.damage /= 2

end

end

# 分散

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

hit = self.cant_evade? ? 100 : hit

hit_result = (rand(100)

# 不確実なスキルの場合は有効フラグをセット

effective |= hit

end

# 命中の場合

if hit_result == true

# 威力 0 以外の物理攻撃の場合

if skill.power != 0 and skill.atk_f > 0

# ステート衝撃解除

remove_states_shock

# 有効フラグをセット

effective = true

end

# HP からダメージを減算

last_hp = self.hp

self.hp -= self.damage

effective |= self.hp != last_hp

# ステート変化

@state_changed = false

effective |= states_plus(skill.plus_state_set)

effective |= states_minus(skill.minus_state_set)

# 威力が 0 の場合

if skill.power == 0

# ダメージに空文字列を設定

self.damage = ""

# ステートに変化がない場合

unless @state_changed

# ダメージに "Miss" を設定

self.damage = "Miss"

end

end

# ミスの場合

else

# ダメージに "Miss" を設定

self.damage = "Miss"

end

# 戦闘中でない場合

unless $game_temp.in_battle

# ダメージに nil を設定

self.damage = nil

end

# メソッド終了

return effective

end

#--------------------------------------------------------------------------

# ● アイテムの効果適用

# item : アイテム

#--------------------------------------------------------------------------

def item_effect(item)

# クリティカルフラグをクリア

self.critical = false

# アイテムの効果範囲が HP 1 以上の味方で、自分の HP が 0、

# またはアイテムの効果範囲が HP 0 の味方で、自分の 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)

# メソッド終了

return false

end

# 有効フラグをクリア

effective = false

# コモンイベント ID が有効の場合は有効フラグをセット

effective |= item.common_event_id > 0

# 命中判定

hit_result = (rand(100)

# 不確実なスキルの場合は有効フラグをセット

effective |= item.hit

# 命中の場合

if hit_result == true

# 回復量を計算

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

recover_hp += self.pdef * item.pdef_f / 20

recover_hp += self.mdef * item.mdef_f / 20

recover_hp = [recover_hp, 0].min

end

# 属性修正

recover_hp *= elements_correct(item.element_set)

recover_hp /= 100

recover_sp *= elements_correct(item.element_set)

recover_sp /= 100

# 分散

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

# 防御修正

if self.guarding?

recover_hp /= 2

end

end

# HP 回復量の符号を反転し、ダメージの値に設定

self.damage = -recover_hp

# HP および SP を回復

last_hp = self.hp

last_sp = self.sp

self.hp += recover_hp

self.sp += recover_sp

effective |= self.hp != last_hp

effective |= self.sp != last_sp

# ステート変化

@state_changed = false

effective |= states_plus(item.plus_state_set)

effective |= states_minus(item.minus_state_set)

# パラメータ上昇値が有効の場合

if item.parameter_type > 0 and item.parameter_points != 0

# パラメータで分岐

case item.parameter_type

when 1 # MaxHP

@maxhp_plus += item.parameter_points

when 2 # MaxSP

@maxsp_plus += item.parameter_points

when 3 # 腕力

@str_plus += item.parameter_points

when 4 # 器用さ

@dex_plus += item.parameter_points

when 5 # 素早さ

@agi_plus += item.parameter_points

when 6 # 魔力

@int_plus += item.parameter_points

end

# 有効フラグをセット

effective = true

end

# HP 回復率と回復量が 0 の場合

if item.recover_hp_rate == 0 and item.recover_hp == 0

# ダメージに空文字列を設定

self.damage = ""

# SP 回復率と回復量が 0、パラメータ上昇値が無効の場合

if item.recover_sp_rate == 0 and item.recover_sp == 0 and

(item.parameter_type == 0 or item.parameter_points == 0)

# ステートに変化がない場合

unless @state_changed

# ダメージに "Miss" を設定

self.damage = "Miss"

end

end

end

# ミスの場合

else

# ダメージに "Miss" を設定

self.damage = "Miss"

end

# 戦闘中でない場合

unless $game_temp.in_battle

# ダメージに nil を設定

self.damage = nil

end

# メソッド終了

return effective

end

#--------------------------------------------------------------------------

# ● スリップダメージの効果適用

#--------------------------------------------------------------------------

def slip_damage_effect

# ダメージを設定

self.damage = self.maxhp / 10

# 分散

if self.damage.abs > 0

amp = [self.damage.abs * 15 / 100, 1].max

self.damage += rand(amp+1) + rand(amp+1) - amp

end

# HP からダメージを減算

self.hp -= self.damage

# メソッド終了

return true

end

#--------------------------------------------------------------------------

# ● 属性修正の計算

# element_set : 属性

#--------------------------------------------------------------------------

def elements_correct(element_set)

# 無属性の場合

if element_set == []

# 100 を返す

return 100

end

# 与えられた属性の中で最も弱いものを返す

# ※メソッド element_rate は、このクラスから継承される Game_Actor

# および Game_Enemy クラスで定義される

weakest = -100

for i in element_set

weakest = [weakest, self.element_rate(i)].max

end

return weakest

end

end

 

 

 

Questo è tutto. Se provate il primo script da solo, funziona. Se provate tutto senza il primo script, funziona. Insieme danno errore quando si esegue un colpo che va su tutti, alleati o nemici. Spero riusciate a metterli insieme e risolvere. Grazie anticipatamente!

 

http://fc09.deviantart.net/fs46/i/2009/222/c/9/Grammar_Nazi_by_NachtElf.gif Proud Grammar Nazi - Piango a ogni vostro errore http://fc09.deviantart.net/fs46/i/2009/222/c/9/Grammar_Nazi_by_NachtElf.gif

Bacacca:

http://www.rpg2s.net/img/fablecontest2nd.pnghttp://www.rpg2s.net/cover_contest/icons/cc_2.png http://www.rpg2s.net/cover_contest/icons/cc_special.png http://www.rpg2s.net/images/shortgame_2.png http://www.rpg2s.net/forum/uploads/monthly_08_2014/post-6-0-68253800-1408714049.gif http://rpg2s.net/gif/SCContest3Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif

http://backloggery.com/janus/sig.gif

 

http://www.freankexpo.net/signature/790.pnghttp://www.freankexpo.net/signature/76.png

RPG BY FORUM



http://i.imgur.com/WupVN.png

Nome -> Arlette Smierc
Età -> 28
Razza -> Umana
Descrizione -> Una ragazza magra e con pochissime curve, alta non più di 1,65 metri e con carnagione molto pallida. Ha i capelli castani tendenti al rosso, con frangia, più lunghi ai lati e sempre raccolti per comodità. La praticità è il suo stile di vita, guardando il vestiario: una semplice armatura a ricoprire una semplice camicia nera, un paio di pantaloni bianchi e degli stivaloni di cuoio. L'espressione è perennemente severa e gli occhi marroni spenti, come a dire "Tudellavitanonhaicapitouncazzo". La sua arma di scelta è una spada Falcione dall''impugnatura rossa, alla quale tiene moltissimo.

Equip:
Equip:

-Borsa Comune (4/10)
-Spada comune (rotta)
-Armatura in bronzo (equip)
-Cappuccio (equip)
-Scudo di ferro (in borsa)
-Elmo da battaglia (in borsa)
-Penna e Calamaio (in borsa)
-Lama Distruttrice (equip)
Spada ad una mano con la lama leggermente curva fatta di un metallo azzurro che risplende di una lieve luce propria.

1)Ogni attacco dichiara danno magico
2)Dichiara danno doppio contro i demoni e altre creature di natura negromantica
3)Una volta a combattimento, se colpisce un mago o una creatura magica dotata di un qualche potere , può assorbire un incantesimo dalla vittima e replicarlo a patto che sia tra il grado 1 e il grado 2. (chiarimento: la spada può assorbire e replicare solo le magie dei primi due gradi di magie)
4) Se il totale dello spadaccino che usa la lama distruttrice è superiore di 2 rispetto al totale del suo avversario, la lama distruttrice dichiara automaticamente " arma distrutta" (funziona solo contro le armi normali).

Monete rimaste:35


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...