|
|||||||
![]() |
|
|
Herramientas | Desplegado |
|
#71
|
||||
|
||||
|
El moderador legend of host no podria hacer una recopilacion de
todos los scrips en el tema principal...? de los que llevan?. tendran algun scrip para que se puedan tener mas de 4 personajes a la hora de pelear?. |
|
|
|||
|
|||
|
Aportes de Scripts RPG-Maker
|
|
#72
|
||||
|
||||
|
aki aportare con algunos scripts
Script de plataformas estilo mario bros: Este script sirve para hacer que el juego sea en sentido lateral al estilo mario bros y ademas puedes saltar. instrucciones:crear una nueva categoria sobre main y coloca
Spoiler
Código:
# ▼▲▼ XRXS50. Action-Maps XC. ▼▲▼ built 033010 # by 桜雅 在土 #===================================================== # □ カスタマイズポイント #===================================================== class XRXS50 # # Action-Maps を稼動させるマップIDの配列 # ENABLE_FULL_ACTY_MAPS = [1, 2]# # 「斜め降下」 # ENABLE_SLIDE_DESCENT = true # # 向きジャンプ(true : 向いている方向へジャンプ。 # false : キーが押されている方向へジャンプ。) # JUMP_AS_KEY = false end #======================================================= # ■ Game_Player #======================================================= class Game_Player < Game_Character #------------------------------------------------------- # ○ 公開インスタンス変数 #-------------------------------------------------------- # 既存 attr_writer :direction_fix attr_accessor :walk_anime # 新規 attr_accessor :now_jumps attr_writer :xrxs50_direction_sidefix #------------------------------------------------------- # ○ 最大ジャンプ回数 #-------------------------------------------------------- def max_jumps return 1 end #-------------------------------------------------------- # ● 左を向く #-------------------------------------------------------- alias xrxs50_turn_left turn_left def turn_left if @xrxs50_direction_sidefix @direction = 4 else xrxs50_turn_left end end #------------------------------------------------------- # ● 右を向く #------------------------------------------------------ alias xrxs50_turn_right turn_right def turn_right if @xrxs50_direction_sidefix @direction = 6 else xrxs50_turn_right end end end #======================================================== # ■ Scene_Map #======================================================== class Scene_Map #-------------------------------------------------------- # ● メイン処理 #---------------------------------------------------------- alias xrxs50_main main def main # チェック xrxs50_enable_check # 呼び戻す xrxs50_main end #--------------------------------------------------------- # ● フレーム更新 #--------------------------------------------------------- alias xrxs50_update update def update # 呼び戻す xrxs50_update # フレーム更新 (座標系更新) if @xrxs50_enable update_coordinates end end #------------------------------------------------------------ # ○ フレーム更新 (座標系更新) #------------------------------------------------------------ def update_coordinates if $game_player.passable?($game_player.x,$game_player.y,2) unless $game_player.moving? if XRXS50::ENABLE_SLIDE_DESCENT and Input.press?(Input::RIGHT) and $game_player.passable?($game_player.x,$game_player.y+1,6) $game_player.move_lower_right elsif XRXS50::ENABLE_SLIDE_DESCENT and Input.press?(Input::LEFT) and $game_player.passable?($game_player.x,$game_player.y+1,4) $game_player.move_lower_left else $game_player.move_down end end else $game_player.move_down $game_player.walk_anime = true unless $game_player.walk_anime $game_player.now_jumps = 0 if Input.trigger?(Input::X) and $game_player.now_jumps < $game_player.max_jumps if XRXS50::JUMP_AS_KEY direction = $game_player.direction == 4 ? -1 : 1 else if Input.press?(Input::RIGHT) direction = 1 elsif Input.press?(Input::LEFT) direction = -1 else direction = 0 end end $game_player.jump(direction, -2) $game_player.now_jumps += 1 $game_player.walk_anime = false end end end #------------------------------------------------------- # ● プレイヤーの場所移動 #------------------------------------------------------- alias xrxs50_transfer_player transfer_player def transfer_player # 呼び戻す xrxs50_transfer_player # チェック xrxs50_enable_check end #-------------------------------------------------------- # ○ XRXS50 が稼動するか判定 #--------------------------------------------------------- def xrxs50_enable_check if XRXS50::ENABLE_FULL_ACTY_MAPS.include?($game_map.map_id) $game_player.now_jumps = 0 if $game_player.now_jumps.nil? @xrxs50_enable = true $game_player.direction_fix = true $game_player.xrxs50_direction_sidefix = true else @xrxs50_enable = false $game_player.direction_fix = false $game_player.xrxs50_direction_sidefix = false end end end flechas isquierda y derecha: mover Flecha arriba: saltar [script]Ventana emergente antes de jugar como su nombre lo indica, este script sirve para que al abrir el juego salga una ventana diciendo algo que tu ayas escito instrucciones: crear uno nuevo encima de main y coloca
Spoiler
Código:
#---Script para mensaje al principio del juego--# begin print "tu mensaje" end en donde dice 'tu mensaje' cambialo por el texto que tu quieras. [script]resalto de opciones si se entiende, este script sirve para que cuando uno pone el marco sobre una opcion esta resalte solo crear uno nuevo encima de main y colocar
Spoiler
Código:
#============================================================================== # Reruri-Chan : don't forgett the credits -.- # Gato : 0.o it would be really better for you if you don't forgett them XD # Carol13 : yes! >.< #============================================================================== # ■ Make a new event call it like you want.. for # example RgC # Reruri-Chan Gato Carol # Roling Games Cops *löl* #------------------------------------------------------------------------------ # Shouting! >.< # By Reruri-Chan , Gato , and Carol13 #============================================================================== class Window_Command < Window_Selectable def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) @item = [] self.index = 0 refresh @oldindex = 0 end #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max if i != self.index draw_item_dis(i) else draw_item_active(i,@item[i]) end end end #-------------------------------------------------------------------------- # colors and font name etc. #-------------------------------------------------------------------------- def draw_item_dis(index) self.contents.font.name = "Arial" self.contents.font.size -= 2 self.contents.font.color = disabled_color rect = Rect.new(4+16, 32 * index, self.contents.width - 24, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index]) self.contents.font.size += 2 end def draw_item_active(index, type) self.contents.font.name = "Arial" self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index]) if type==1 self.contents.font.color = disabled_color else self.contents.font.color = Color.new(255,255,220,255) end self.contents.draw_text(4,32*index,self.contents.width,32, @commands[index]) end #-------------------------------------------------------------------------- # index #-------------------------------------------------------------------------- def disable_item(index) @item[index] = 1 end #-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- def update super #——refresh if self.index != @oldindex @oldindex = self.index refresh end end end Última edición por The_Virus_X fecha: 27-abr-2008 a las 08:12. |
|
#73
|
||||
|
||||
|
Bueno, aquí con 3 scripts más:
1- Menú pricipal totalmente animado: http://www.atelier-rgss.com/RGSS/Dem...Scene_Menu.exe 2- Menú de estado con imágenes de animación: http://www.atelier-rgss.com/RGSS/Dem...ene_Status.zip 3- Menú de habilidades totalmente animado: http://www.atelier-rgss.com/RGSS/Dem...cene_Skill.zip The Virus: Ese script..... no está mal, pero me preguntaba si hay alguna demo por ahí que expliquea la perfección el script.... ¿Saves si hay? Bueno, hasta la próxima... |
|
#74
|
||||
|
||||
|
bueno aqui traigo otro script para XP
zoom batallas explicacion
Spoiler
este script es para que en las batallas tenga un zoom,osea,que se acerque al enemigo al atacar haciendo un efecto muy wapo,aqui esta el script que va como siempre encima de main
script:
Spoiler
Código:
# Momo Camera Script
# Zoom battle effect
# Modificado por Soramaro para La Compañia Nodws
# 基本的に導入するだけで大丈夫です。
#
# 2005.5.18 バグ修正
# Arrow_Actor 修正
# self.enemy → self.actor
# アホなミスを犯してました。
#
# 2005.11.5 更新
# 設定項目を増やしました。
# いくつかの項目は、デフォルト(アクターがバトルフィールド上にいない)状態だと
# 変になるので、適切設定してください。
# (デフォ状態でtrueにするとマズイものには★をつけてます)
module MoMo_Camera
# カメラの移動にかけるフレーム数の初期値
MOVE_SPEED_INI = 8
# カメラのズームにかけるフレーム数の初期値
ZOOM_SPEED_INI = 8
# バトルバック引き伸ばし率追加値(0.0で引き伸ばし無し)
BATTLEBACK_ZOOM = 1.0
# アクターもカメラの影響を受けるようにする ★
# (★のついている項目を true にする場合などはこちらも true にして下さい)
CAMERA_UPDATE_ACTOR = false
# エネミー通常攻撃時、行動者を注視する
ACTIVE_LOOK_ENEMY_NOMAL_ATTACK = true
# エネミー防御時、行動者を注視する
ACTIVE_LOOK_ENEMY_GUARD = true
# エネミー逃走時、行動者を注視する
ACTIVE_LOOK_ENEMY_ESCAPE = true
# エネミースキル使用時、行動者を注視する
ACTIVE_LOOK_ENEMY_SKILL = true
# エネミー選択時、選択エネミーを注視する
ACTIVE_LOOK_ENEMY_SELECT = true
# エネミー通常攻撃時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ACTOR = false
# エネミー通常攻撃時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ENEMY = true
# エネミースキル使用時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ENEMY_SKILL_TR_ACTOR = false
# エネミースキル使用時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ENEMY_SKILL_TR_ENEMY = true
# エネミークリティカル発生時は問答無用で対象を注視する(対象がアクターの時) ★
CLITICAL_LOOK_ENEMY_TR_ACTOR = false
# エネミークリティカル発生時は問答無用で対象を注視する(対象がエネミーの時)
CLITICAL_LOOK_ENEMY_TR_ENEMY = true
# エネミークリティカル発生時のズーム倍率(ズームしたくない時は0.0を設定)
CRITICAL_ZOOM_ENEMY = 0.3
# アクター通常攻撃時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_NOMAL_ATTACK = false
# アクター防御時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_GUARD = false
# アクター逃走時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_ESCAPE = false
# アクタースキル使用時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_SKILL = false
# アクターアイテム使用時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_ITEM = false
# アクター選択時、選択アクターを注視する ★
ACTIVE_LOOK_ACTOR_SELECT = false
# アクター通常攻撃時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ACTOR = false
# アクター通常攻撃時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ENEMY = true
# アクタースキル使用時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ACTOR_SKILL_TR_ACTOR = false
# アクタースキル使用時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ACTOR_SKILL_TR_ENEMY = true
# アクターアイテム使用時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ACTOR_ITEM_TR_ACTOR = false
# アクターアイテム使用時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ACTOR_ITEM_TR_ENEMY = true
# アクタークリティカル発生時は問答無用で対象を注視する(対象がアクターの時) ★
CLITICAL_LOOK_ACTOR_TR_ACTOR = true
# アクタークリティカル発生時は問答無用で対象を注視する(対象がエネミーの時)
CLITICAL_LOOK_ACTOR_TR_ENEMY = true
# アクタークリティカル発生時のズーム倍率(ズームしたくない時は0.0を設定)
CRITICAL_ZOOM_ACTOR = 0.3
# エネミースリップダメージ時に注視する
LOOK_ENEMY_SLIP_DAMAGE = true
# アクタースリップダメージ時に注視する ★
LOOK_ACTOR_SLIP_DAMAGE = false
# コマンド入力時に、アクターを注視 ★
LOOK_ACTOR_COMMAND_INPUT = false
# 行動終了毎にカメラをセンタリング
EACH_ACTION_CENTERING = true
# 全体攻撃時のズーム率
ALL_ATTACK_ZOOM = 0.6
end
class Battle_Camera
attr_accessor :x
attr_accessor :y
attr_accessor :zoom
attr_accessor :new_x
attr_accessor :new_y
attr_accessor :new_zoom
def initialize
@x = 320
@y = 160
@zoom = 1.0
@new_x = @x
@new_y = @y
@dis_x = 0
@dis_y = 0
@dis_zoom = 0.0
@new_zoom = @zoom
@move_speed = MoMo_Camera::MOVE_SPEED_INI
@zoom_speed = MoMo_Camera::ZOOM_SPEED_INI
end
# 新しい移動先設定
def new_x=(newx)
@new_x = newx
@dis_x = (@x - @new_x).abs
end
def new_y=(newy)
@new_y = newy
@dis_y = (@y - @new_y).abs
end
def new_zoom=(newz)
@new_zoom = newz
@dis_zoom = (@zoom - @new_zoom).abs
end
# カメラセット
def set(x, y, zoom=nil, speed=nil)
unless speed.nil?
@move_speed = speed
@zoom_speed = speed
end
self.new_x = x
self.new_y = y
self.new_zoom = zoom unless zoom.nil?
end
# カメラを真ん中に
def center(zoom=1.0)
self.new_x = 320
self.new_y = 160
self.new_zoom = zoom
end
# バトラー注視
def battler_look(battler)
hei = get_battler_height(battler)
zoom = [160.0 / hei, 0.8].max
self.new_zoom = zoom
self.new_x = battler.screen_x
self.new_y = (battler.screen_y - hei / 2 * [[@new_zoom, 1.0].max, 1.5].min).truncate
end
# バトラーの計算色々
def battler_x_plus(battler)
dis = battler.screen_x - @x
val = dis * (@zoom - 1.0)
return val
end
def pos_battler_x(battler)
return battler.screen_x - (@x - 320)
end
def battler_x(battler)
return pos_battler_x(battler) + battler_x_plus(battler)
end
def battler_y_plus(battler)
dis = battler.screen_y - @y
val = dis * (@zoom - 1.0)
return val
end
def pos_battler_y(battler)
return battler.screen_y - (@y - 160)
end
def battler_y(battler)
return pos_battler_y(battler) + battler_y_plus(battler)
end
# 更新
def update
if @x != @new_x
if @new_x - @x > 0
@x = [@x + move_speed_x, @new_x].min
else
@x = [@x - move_speed_x, @new_x].max
end
end
if @y != @new_y
if @new_y - @y > 0
@y = [@y + move_speed_y, @new_y].min
else
@y = [@y - move_speed_y, @new_y].max
end
end
if @zoom != @new_zoom
if @new_zoom - @zoom > 0
@zoom = [@zoom + zoom_speed, @new_zoom].min
else
@zoom = [@zoom - zoom_speed, @new_zoom].max
end
end
end
# 移動距離計算
def move_speed_x
return [(@dis_x / @move_speed).to_i, 1].max
end
def move_speed_y
return [(@dis_y / @move_speed).to_i, 1].max
end
# ズーム倍率計算
def zoom_speed
return [(@dis_zoom / @zoom_speed), 0.01].max
end
def get_battler_height(battler)
bammy = get_battler_bmp(battler)
return bammy.height
end
def get_battler_bmp(battler)
return RPG::Cache.battler(battler.battler_name, battler.battler_hue)
end
def move?
return (@x != @new_x or @y != @new_y or @zoom != @new_zoom)
end
end
#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
# バトル画面のスプライトをまとめたクラスです。このクラスは Scene_Battle クラ
# スの内部で使用されます。
#==============================================================================
class Spriteset_Battle
attr_accessor :battle_camera
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias spriteset_battle_battle_camera_initialize initialize
def initialize
@battle_camera = Battle_Camera.new
spriteset_battle_battle_camera_initialize
@battleback_sprite.ox = @viewport1.rect.width / 2
@battleback_sprite.oy = @viewport1.rect.height / 2
camera_battleback_scroll
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias spriteset_battle_battle_camera_update update
def update
spriteset_battle_battle_camera_update
camera_update
end
# 更新するバトラーの指定
def camera_update_battlers
if MoMo_Camera::CAMERA_UPDATE_ACTOR
return @enemy_sprites + @actor_sprites
else
return @enemy_sprites
end
end
# カメラ更新
def camera_update
@battle_camera.update
camera_battleback_scroll
camera_battleback_zoom
camera_battler_update
end
# カメラ更新:バトルバックスクロール
def camera_battleback_scroll
# バトルバックの計算色々
view_width = @viewport1.rect.width / 2
view_height = @viewport1.rect.height / 2
@battleback_sprite.x = view_width + (view_width - @battle_camera.x) * @battle_camera.zoom
@battleback_sprite.y = view_height + (view_height - @battle_camera.y) * @battle_camera.zoom
end
# カメラ更新:バトルバックズーム
def camera_battleback_zoom
@battleback_sprite.zoom_x = @battle_camera.zoom + MoMo_Camera::BATTLEBACK_ZOOM
@battleback_sprite.zoom_y = @battle_camera.zoom + MoMo_Camera::BATTLEBACK_ZOOM
end
# カメラ更新:バトラースプライト更新
def camera_battler_update
for sprite in camera_update_battlers
battler_sprite_zoom(sprite)
battler_sprite_scroll(sprite)
end
end
# カメラ更新:バトラースプライト更新:バトラースプライトスクロール
def battler_sprite_scroll(sprite)
if !sprite.nil? and !sprite.battler.nil?
sprite.x = @battle_camera.battler_x(sprite.battler)
sprite.y = @battle_camera.battler_y(sprite.battler)
end
end
# カメラ更新:バトラースプライト更新:バトラースプライトズーム
def battler_sprite_zoom(sprite)
unless sprite.nil?
sprite.zoom_x = @battle_camera.zoom
sprite.zoom_y = @battle_camera.zoom
end
end
end
class Arrow_Actor < Arrow_Base
attr_accessor :camera
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias arrow_actor_battle_camera_update update
def update
arrow_actor_battle_camera_update
# スプライトの座標を再設定
if self.actor != nil and @camera != nil
self.x = @camera.battler_x(self.actor)
self.y = @camera.battler_y(self.actor)
end
end
end
class Arrow_Enemy < Arrow_Base
attr_accessor :camera
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias arrow_enemy_battle_camera_update update
def update
arrow_enemy_battle_camera_update
# スプライトの座標を再設定
if self.enemy != nil and @camera != nil
self.x = @camera.battler_x(self.enemy)
self.y = @camera.battler_y(self.enemy)
end
end
end
class Scene_Battle
def camera
return @spriteset.battle_camera
end
# 行動側アニメーション中のカメラワーク判定
def camera_action_judge_active
if @active_battler.is_a?(Game_Enemy)
case @active_battler.current_action.kind
when 0
camera_action_judge_active_basic_enemy
when 1
camera_action_judge_active_skill_enemy
when 2
camera_action_judge_active_item_enemy
end
else
case @active_battler.current_action.kind
when 0
camera_action_judge_active_basic_actor
when 1
camera_action_judge_active_skill_actor
when 2
camera_action_judge_active_item_actor
end
end
end
# 行動側アニメ中のカメラワーク(エネミー):基本
def camera_action_judge_active_basic_enemy
case @active_battler.current_action.basic
when 0
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_NOMAL_ATTACK
when 1
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_GUARD
when 2
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_ESCAPE
end
end
# 行動側アニメ中のカメラワーク(エネミー):スキル
def camera_action_judge_active_skill_enemy
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_SKILL
end
# 行動側アニメ中のカメラワーク(エネミー):アイテム(一応実装)
def camera_action_judge_active_item_enemy
camera.battler_look(@active_battler)
end
# 行動側アニメ中のカメラワーク(アクター):基本
def camera_action_judge_active_basic_actor
case @active_battler.current_action.basic
when 0
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_NOMAL_ATTACK
when 1
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_GUARD
when 2
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_ESCAPE
end
end
# 行動側アニメ中のカメラワーク(アクター):スキル
def camera_action_judge_active_skill_actor
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_SKILL
end
# 行動側アニメ中のカメラワーク(アクター):アイテム
def camera_action_judge_active_item_actor
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_ITEM
end
# 対象側アニメーション中のカメラワーク判定
def camera_action_judge_target
if @active_battler.is_a?(Game_Enemy)
case @active_battler.current_action.kind
when 0
camera_action_judge_target_basic_enemy
when 1
camera_action_judge_target_skill_enemy
when 2
camera_action_judge_target_item_enemy
end
else
case @active_battler.current_action.kind
when 0
camera_action_judge_target_basic_actor
when 1
camera_action_judge_target_skill_actor
when 2
camera_action_judge_target_item_actor
end
end
end
# 対象側アニメ中のカメラワーク(エネミー):基本
def camera_action_judge_target_basic_enemy
case @active_battler.current_action.basic
when 0
camera_action_judge_target_basic_enemy_attack
when 1
camera_action_judge_target_basic_enemy_guard
when 2
camera_action_judge_target_basic_enemy_escape
when 3
camera_action_judge_target_basic_enemy_none
end
end
# 対象側アニメ中のカメラワーク(エネミー):基本:攻撃
def camera_action_judge_target_basic_enemy_attack
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
else
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ACTOR
if @target_battlers[0].critical
if MoMo_Camera::CLITICAL_LOOK_ENEMY_TR_ACTOR
camera.battler_look(@target_battlers[0])
end
camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ENEMY
end
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ENEMY
if @target_battlers[0].critical
if MoMo_Camera::CLITICAL_LOOK_ENEMY_TR_ENEMY
camera.battler_look(@target_battlers[0])
end
camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ENEMY
end
else
camera.center
end
end
end
# 対象側アニメ中のカメラワーク(エネミー):基本:防御
def camera_action_judge_target_basic_enemy_guard
end
# 対象側アニメ中のカメラワーク(エネミー):基本:逃走
def camera_action_judge_target_basic_enemy_escape
end
# 対象側アニメ中のカメラワーク(エネミー):基本:なにもしない
def camera_action_judge_target_basic_enemy_none
end
# 対象側アニメ中のカメラワーク(エネミー):スキル
def camera_action_judge_target_skill_enemy
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
elsif @target_battlers.size == 1
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_SKILL_TR_ACTOR
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_SKILL_TR_ENEMY
end
else
camera.center
end
end
# 対象側アニメ中のカメラワーク(エネミー):アイテム(一応実装)
def camera_action_judge_target_item_enemy
end
# 対象側アニメ中のカメラワーク(アクター):基本
def camera_action_judge_target_basic_actor
case @active_battler.current_action.basic
when 0
camera_action_judge_target_basic_actor_attack
when 1
camera_action_judge_target_basic_actor_guard
when 2
camera_action_judge_target_basic_actor_escape
when 3
camera_action_judge_target_basic_actor_none
end
end
# 対象側アニメ中のカメラワーク(アクター):基本:攻撃
def camera_action_judge_target_basic_actor_attack
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
else
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ACTOR
if @target_battlers[0].critical
if MoMo_Camera::CLITICAL_LOOK_ACTOR_TR_ACTOR
camera.battler_look(@target_battlers[0])
end
camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ACTOR
end
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ENEMY
if @target_battlers[0].critical
if MoMo_Camera::CLITICAL_LOOK_ACTOR_TR_ENEMY
camera.battler_look(@target_battlers[0])
end
camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ACTOR
end
else
camera.center
end
end
end
# 対象側アニメ中のカメラワーク(エネミー):基本:防御
def camera_action_judge_target_basic_actor_guard
end
# 対象側アニメ中のカメラワーク(エネミー):基本:逃走
def camera_action_judge_target_basic_actor_escape
end
# 対象側アニメ中のカメラワーク(エネミー):基本:なにもしない
def camera_action_judge_target_basic_actor_none
end
# 対象側アニメ中のカメラワーク(アクター):スキル
def camera_action_judge_target_skill_actor
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
elsif @target_battlers.size == 1
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_SKILL_TR_ACTOR
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_SKILL_TR_ENEMY
end
else
camera.center
end
end
# 対象側アニメ中のカメラワーク(アクター):アイテム
def camera_action_judge_target_item_actor
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
elsif @target_battlers.size == 1
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_ITEM_TR_ACTOR
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_ITEM_TR_ENEMY
else
end
else
camera.center
end
end
#--------------------------------------------------------------------------
# ● パーティコマンドフェーズ開始
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_start_phase2 start_phase2
def start_phase2
camera.center
scene_battle_battle_camera_start_phase2
end
#--------------------------------------------------------------------------
# ● アフターバトルフェーズ開始
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_start_phase5 start_phase5
def start_phase5
camera.center
scene_battle_battle_camera_start_phase5
end
#--------------------------------------------------------------------------
# ● 次のアクターのコマンド入力へ
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_phase3_next_actor phase3_next_actor
def phase3_next_actor
scene_battle_battle_camera_phase3_next_actor
if @active_battler != nil and MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.battler_look(@active_battler)
end
end
#--------------------------------------------------------------------------
# ● 前のアクターのコマンド入力へ
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_phase3_prior_actor phase3_prior_actor
def phase3_prior_actor
scene_battle_battle_camera_phase3_prior_actor
if @active_battler != nil and MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.battler_look(@active_battler)
end
end
#--------------------------------------------------------------------------
# ● アクター選択開始
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_start_actor_select start_actor_select
def start_actor_select
scene_battle_battle_camera_start_actor_select
if MoMo_Camera::ACTIVE_LOOK_ACTOR_SELECT
@last_arrow_index = nil
@actor_arrow.camera = camera
elsif MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.center
end
end
#--------------------------------------------------------------------------
# ● アクター選択終了
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_end_actor_select end_actor_select
def end_actor_select
scene_battle_battle_camera_end_actor_select
if MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.battler_look(@active_battler)
else
camera.center
end
end
#--------------------------------------------------------------------------
# ● エネミー選択開始
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_start_enemy_select start_enemy_select
def start_enemy_select
scene_battle_battle_camera_start_enemy_select
if MoMo_Camera::ACTIVE_LOOK_ENEMY_SELECT
@last_arrow_index = nil
@enemy_arrow.camera = camera
elsif MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.center
end
end
#--------------------------------------------------------------------------
# ● エネミー選択終了
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_end_enemy_select end_enemy_select
def end_enemy_select
scene_battle_battle_camera_end_enemy_select
if MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.battler_look(@active_battler)
else
camera.center
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (アクターコマンドフェーズ : アクター選択)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase3_actor_select update_phase3_actor_select
def update_phase3_actor_select
scene_battle_battle_camera_update_phase3_actor_select
if MoMo_Camera::ACTIVE_LOOK_ACTOR_SELECT
if @actor_arrow != nil and (@last_arrow_index != @actor_arrow.index)
@last_arrow_index = @actor_arrow.index
camera.battler_look(@actor_arrow.actor)
end
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase3_enemy_select update_phase3_enemy_select
def update_phase3_enemy_select
scene_battle_battle_camera_update_phase3_enemy_select
if MoMo_Camera::ACTIVE_LOOK_ENEMY_SELECT
if @enemy_arrow != nil and (@last_arrow_index != @enemy_arrow.index)
@last_arrow_index = @enemy_arrow.index
camera.battler_look(@enemy_arrow.enemy)
end
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase4_step1 update_phase4_step1
def update_phase4_step1
unless @camera_move
if $game_temp.forcing_battler == nil and @action_battlers.size != 0 and
@action_battlers[0].slip_damage?
camera_action_judge_phase4_step1
end
@camera_move = true
end
return if camera.move?
@camera_move = false
scene_battle_battle_camera_update_phase4_step1
end
def camera_action_judge_phase4_step1
if @action_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@action_battlers[0]) if MoMo_Camera::LOOK_ENEMY_SLIP_DAMAGE
elsif @action_battlers[0].is_a?(Game_Actor)
camera.battler_look(@action_battlers[0]) if MoMo_Camera::LOOK_ACTOR_SLIP_DAMAGE
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase4_step3 update_phase4_step3
def update_phase4_step3
unless @camera_move
camera_action_judge_active
@camera_move = true
end
return if camera.move?
@camera_move = false
scene_battle_battle_camera_update_phase4_step3
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase4_step4 update_phase4_step4
def update_phase4_step4
unless @camera_move
camera_action_judge_target
@camera_move = true
end
return if camera.move?
@camera_move = false
scene_battle_battle_camera_update_phase4_step4
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase4_step6 update_phase4_step6
def update_phase4_step6
scene_battle_battle_camera_update_phase4_step6
camera.center if MoMo_Camera::EACH_ACTION_CENTERING
end
end
|
|
#75
|
||||
|
||||
|
Cita:
aki hay otroscript que quizas le sirva a alguno de ustedes, se trata de un menu de seleccion de niveles al clasico estilo de Megaman. Es muy personalizable asi que podrian usarlo en un juego que no sea de megaman, usenlo como quieran, es mi aporte a esta comunidad. FICHA TECNICA Crado por mi amigo SOULDARK DESCRIPCION: Script que permite implementar un menu de seleccion de niveles, muy personalizable.
Spoiler
SCRIPT RGSS
MODS: Código:
#===============================================================================
# MENU SELECCION DE NIVEL - ESTILO MEGAMAN
# DESARROLLADO POR --SOULDARK--
#-------------------------------------------------------------------------------
# MODS
#===============================================================================
class Window_Selectable < Window_Base
def setColumn_max(cm)
@column_max = cm
end
def set_Index(i)
self.index = i
end
end
class Window_Base < Window
def draw_text_outline(x, y, wid, hei, text, align = 0, line = outline_color,fore = normal_color)
self.contents.font.color = line
self.contents.draw_text(x + 1,y + 1,wid,hei,text, align)
self.contents.draw_text(x + 1,y - 1,wid,hei,text, align)
self.contents.draw_text(x - 1,y - 1,wid,hei,text, align)
self.contents.draw_text(x - 1,y + 1,wid,hei,text, align)
self.contents.draw_text(x - 1,y,wid,hei,text, align)
self.contents.draw_text(x + 1,y,wid,hei,text, align)
self.contents.draw_text(x ,y-1,wid,hei,text, align)
self.contents.draw_text(x,y+1,wid,hei,text, align)
self.contents.font.color = fore
self.contents.draw_text(x,y,wid,hei,text, align)
end
def outline_color
return Color.new(0, 0, 0, 255)
end
end
class Window_Info < Window_Base
def initialize(s, d, j)
super(100, 190, 300, 200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
self.opacity = 0
refresh(s, d, j)
end
def refresh(s, d, j)
self.contents.clear
escribir(s, d, j)
end
def escribir(s, d, j)
draw_text_outline(5, 5, 250, 20, "Stage: #{s}")
draw_text_outline(5, 30, 250, 20, "Dificultad: #{d}")
draw_text_outline(5, 55, 250, 20, "Jefe: #{j}")
end
def update(s, d, j)
refresh(s, d, j)
end
def clear
self.contents.clear
end
end
class Window_Desicion < Window_Selectable
def initialize
an = 250
al = 100
x = 320 - (an / 2)
y = 240 - (al / 2)
super(x, y, an, al)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
self.contents.font.color = normal_color
@item_max = 2
@column_max = 2
@opc = ["Si", "No"]
pos_cur(1)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(4, 0, 165, 32, "¿Deseas Entrar?", 2)
draw_item(0)
draw_item(1)
end
def draw_item(index)
x = 4 + index % @column_max * ((self.width - 64)/@column_max + 25)
self.contents.draw_text(x, 40, 53, 32, @opc[index], 2)
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
x = -4 + index % @column_max * ((self.width - 64)/@column_max + 22)
self.cursor_rect.set(x, 40, 110, 32)
end
end
def pos_cur(p)
self.index = p
end
def pos_cur2
return self.index
end
end
Código:
#===============================================================================
# MENU SELECCION DE NIVEL - ESTILO MEGAMAN
# DESARROLLADO POR --SOULDARK--
#-------------------------------------------------------------------------------
# Script que permite implementar un menu de seleccion de niveles,
# muy personalizable.
#===============================================================================
class Scene_MenuMegaman
$m = []
$m = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
def initialize(p = 0)
@p = p
end
def main
# ------------------- MODIFICABLES --------------------
@nroMounstros = 10 # Numero de Mounstros
@nroFilas = 2 # Numero de Filas
@stages = ["Bosque", "Laboratorio", "Base", "Laboratorio Parte 2", "Volcan", "Polo Norte", "Desierto", "???", "Cielo", "Termales Contaminados"]
@dificultad = [1, 5, "Ninguna", 6, 8, 4, 7, "???", 3, 2]
@jefes = ["Comander Yamark", "Gate", "Ninguno", "Colonel", "Matrrex", "FrostMan", "Anubis the Necromancer", "???", "TenguMan", "FlameMan"]
@ma = [1, 1, 1, 1, 1, 1, 1, 0, 1, 1] #Mounstros Activos
$mapa = [2, 2, 2, 1, 2, 2, 2, 2, 2, 2] #ID de Mapa en el que aparece el Mounstro
$corx = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] #Coordenada X del Mapa en el que aparece el Mounstro
$cory = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] #Coordenada Y del Mapa en el que aparece el Mounstro
@posMf = 7 #Posicion mounstro final
# -----------------------------------------------------------
@fondo = Sprite.new
@fondo.bitmap = RPG::Cache.picture("mapa")
@wc = []
for i in 0..@nroMounstros - 1
@wc[i] = ""
end
@command_window = Window_Command.new(192, @wc)
pos_cur(@p)
@command_window.opacity = 0
@command_window.setColumn_max(@nroMounstros / @nroFilas)
@command_window.visible = false
# -----------------------------------------------------------
@caras = []
dibujarCaras(true)
# -----------------------------------------------------------
@window = Window_Info.new(@stages[@p], @dificultad[@p], @jefes[@p])
# -----------------------------------------------------------
@marco = Sprite.new
@marco.bitmap = RPG::Cache.picture("marcos")
@cursor = Sprite.new
@cursor.bitmap = RPG::Cache.picture("cursor")
dibujarCursor(@p)
@flag = true
# -----------------------------------------------------------
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
if @flag
@fondo.dispose
@marco.dispose
for i in 0..@nroMounstros - 1
@caras[i + 1].dispose
end
@cursor.dispose
end
@window.dispose
end
# -------------------------------------------------------------
# METODO: UPDATE
# -------------------------------------------------------------
def update
@command_window.update
# -----------------------------------------------------------
if compruebaMounstro
@caras[@posMf + 1].bitmap = RPG::Cache.picture("m#{@posMf + 1}_v_a")
@ma[@posMf] = 1
end
# -----------------------------------------------------------
if Input.repeat?(Input::DOWN) or Input.repeat?(Input::UP) or Input.repeat?(Input::LEFT) or Input.repeat?(Input::RIGHT)
for i in 0..@nroMounstros - 1
if @command_window.index == i
dibujarCursor(i)
if @ma[i] == 1
@window.update(@stages[i], @dificultad[i], @jefes[i])
else
@window.clear
end
end
end
end
if Input.trigger?(Input::C)
for i in 0..@nroMounstros - 1
if @command_window.index == i
if @ma[i] == 1
@flag = false
$scene = Scene_Seleccion.new(@command_window.index)
end
end
end
end
end
def pos_cur(p)
@command_window.set_Index(p)
end
def dibujarCaras(f)
flag = f
for i in 0..@nroMounstros - 1
if flag
@caras[i + 1] = Sprite.new
end
if $m[i] == 1
@caras[i + 1].bitmap = RPG::Cache.picture("m#{i + 1}_v_d")
else
if $m[i] == 0
@caras[i + 1].bitmap = RPG::Cache.picture("m#{i + 1}_m_d")
end
end
if i < @nroMounstros / @nroFilas
@caras[i + 1].x = 63 + (i * 105)
@caras[i + 1].y = 23
else
@caras[i + 1].x = 63 + ((i - (@nroMounstros / 2)) * 105)
@caras[i + 1].y = 356
end
end
end
def compruebaMounstro
sum = 0
res = false
for i in 0..9
sum += $m[i]
end
if sum == 0
res = true
end
return res
end
def dibujarCursor(i)
if @command_window.index < @nroMounstros / @nroFilas
@cursor.x = 75 + (i * 105)
@cursor.y = 31
else
@cursor.x = 75 + ((i - (@nroMounstros / @nroFilas)) * 105)
@cursor.y = 362
end
end
end
Código:
#===============================================================================
# MENU SELECCION DE NIVEL - ESTILO MEGAMAN
# DESARROLLADO POR --SOULDARK--
#-------------------------------------------------------------------------------
# VENTANA DESICION
#===============================================================================
class Scene_Seleccion
def initialize(p)
@p = p
end
def main
@wd = Window_Desicion.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@wd.dispose
end
# -------------------------------------------------------------
# METODO: UPDATE
# -------------------------------------------------------------
def update
@wd.update
if Input.trigger?(Input::C)
if @wd.pos_cur2 == 1
$scene = Scene_MenuMegaman.new(@p)
else @wd.pos_cur2 == 0
if
teletransporte($mapa[@p], $corx[@p], $cory[@p])
end
end
end
end
def teletransporte(mapa, cx, cy)
$scene = Scene_Map.new
$game_map.setup(mapa)
$game_player.moveto(cx, cy)
end
IMPORTANTE
Spoiler
Para poder usar este scripts necesitaras 4 tipos de imagenes:
NOTA: Las imagenes de los rostros tendran un estandar para los nombres: "mX_E_d", donde X es el numero del jefe y E el estado. Ejemplo: m2_v_d Para el Jefe final el nombre de la imagen sera: "mX_v_a", donde X es el numero del jefe Si desean que corriga algo, o tienen alguna duda simplemente posteen, estoy aqui para ayudar y espero que este script le sirva a alguien. SUERTE! Última edición por The_Virus_X fecha: 27-abr-2008 a las 23:11. Razón: Otro script |
|
#77
|
||||
|
||||
|
Cita:
Código:
#==============================================================================
# ■ Main
#------------------------------------------------------------------------------
# Despues de la definicion de cada clase...El proceso real empieza aqui
#==============================================================================
begin
# Fuente que usará el juego
$fontface = "Lucida Console"
# Tamaño de la fuente
$fontsize = 25
# Preparar transicion
Graphics.freeze
# Crear objeto de escena (Pantalla de Titulo)
$scene = Scene_Title.new
# Limitacion efectiva de $scene. Llamar metodo principal
while $scene != nil
$scene.main
end
# Fundido
Graphics.transition(20)
rescue Errno::ENOENT
# Complementar la exepcion con Errno::ENOENT
# Cuando no se puede abrir un archivo, mostrar un mensaje y cerrar.
filename = $!.message.sub("No se encontó el archivo o directorio - ", "")
print("Error RGSS: #{filename}")
end
|
|
#78
|
||||
|
||||
|
The Virus: Me refiero al script de plataforma ¿Entiendes?
Bueno, 3 más del famoso MOGHUNTER: 1- Esena de salve extremadamente animado jeje: http://www.atelier-rgss.com/RGSS/Dem...Scene_File.zip 2- Esena de equipo totalmente animado: http://www.atelier-rgss.com/RGSS/Dem...cene_Equip.zip 3- Esena de objetos totalmente animado: http://www.atelier-rgss.com/RGSS/Dem...Scene_Item.zip Bueno, la explicación está en la demo, solo descárguenlo.... |
|
#79
|
||||
|
||||
|
Juego estilo zelda :
Script XMS:
Spoiler
################################################## ##############################
################################### XMS ######################################## ################################################## ############################## =begin MODULO XRXS Scripts necessários para rodar alguns scripts do site XMS. By Xiderowg (XMS) http://xms.rdy.jp/ L4 - built 122410 - Window Selectable L5 - built 091221 - Elemment % L6 - built 092308 - Elemment Set L7 - built ?????? - Window Command L10 - built ?????? - Window Selectable L13 - built ?????? - Map Name L14 - built 122012 - Sprite and Picture (05/01/06) =end ################################################## ############################## module XRXS_Cursor2 def initialize(x, y, w, h) super(x, y, w, h) @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height) @xrxsc2_window.opacity = 0 @xrxsc2_window.active = false @xrxsc2_window.index = -1 end def index2 return @xrxsc2_window.index end def index2=(index) @xrxsc2_window.index = index if index == -1 @xrxsc2_window.cursor_rect.empty else @xrxsc2_window.x = self.x @xrxsc2_window.y = self.y @xrxsc2_window.cursor_rect = self.cursor_rect end end def top_row=(row) super pre_oy = @xrxsc2_window.oy @xrxsc2_window.oy = self.oy @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy end def dispose @xrxsc2_window.dispose super end def x=(n) super @xrxsc2_window.x = self.x unless @xrxsc2_window.nil? end def y=(n) super @xrxsc2_window.y = self.y unless @xrxsc2_window.nil? end def visible=(b) @xrxsc2_window.visible = b super end end ###### # L5 # ###### module XRXS def XRXS.element_check(set, element_name) returnar = [false, 0, 0, []] return returnar if !set.is_a?(Array) or set.size == 0 or element_name == "" for i in set if $data_system.elements[i] =~ /^#{element_name}([+-]?[0-9]+)?(%)?/ returnar[0] = true if $2 == nil returnar[1] += $1.to_i returnar[3].push($1.to_i) else returnar[2] += $1.to_i end end end return returnar end def XRXS.element_include?(set, element_name) return element_check(set, element_name)[0] end def XRXS.element_amount(set, element_name) return element_check(set, element_name)[1] end def XRXS.element_percent(set, element_name) return element_check(set, element_name)[2] end def XRXS.element_numbers(set, element_name) return element_check(set, element_name)[3] end end ###### # L6 # ###### class Game_Battler def skill_element_set(skill) return skill.nil? ? [] : skill.element_set end def equip_element_set return self.element_set + self.guard_element_set end def guard_element_set return [] end end class Game_Actor < Game_Battler def guard_element_set set = [] for id in self.armor_ids next if id.nil? armor = $data_armors[id] set += (armor != nil ? armor.guard_element_set : []) end return set end def weapon_ids unless self.is_a?(Game_Actor) return [] end ids = @weapon_ids != nil ? @weapon_ids : [] ids[0] = @weapon_id return ids end def armor_ids unless self.is_a?(Game_Actor) return [] end ids = @armor_ids != nil ? @armor_ids : [] ids[0] = @armor1_id ids[1] = @armor2_id ids[2] = @armor3_id ids[3] = @armor4_id return ids end def equipments equipments = [] self.weapon_ids.each {|id| equipments.push($data_weapons[id])} self.armor_ids.each {|id| equipments.push($data_armors[id])} return equipments end def equiping?(item) case item when RPG::Weapon return self.weapon_ids.include?(item.id) when RPG::Armor return self.armor_ids.include?(item.id) else return false end end end ###### # L7 # ###### module XRXS_Window_Command def add_command(command) @disabled = [] if @disabled.nil? if @commands.size != @disabled.size for i in 0...@commands.size @disabled[i] = false end end @commands.push(command) @disabled.push(false) @item_max = @commands.size self.y -= 32 self.height += 32 self.contents.dispose self.contents = nil self.contents = Bitmap.new(self.width - 32, @item_max * 32) refresh for i in 0...@commands.size if @disabled[i] disable_item(i) end end end def disable_item(index) @disabled = [] if @disabled.nil? @disabled[index] = true draw_item(index, disabled_color) end def enable_item(index) @disabled = [] if @disabled.nil? @disabled[index] = false draw_item(index, normal_color) end end class Window_Command < Window_Selectable include XRXS_Window_Command def disable_item(index) super end end ####### # L1s0 # ####### module Module_SelectableEX def line_height return 32 end attr_accessor :align def initialize(x, y, width, height) super(x, y, width, height) @item_max = 1 @column_max = 1 @index = -1 @align = 0 end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(4, self.line_height * index, self.contents.width - 8, self.line_height) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index], self.align) end def top_row return self.oy / self.line_height end def top_row=(row) super self.oy = self.oy/32 * self.line_height end def page_row_max return (self.height - 32) / self.line_height end def update_cursor_rect super unless @index < 0 y = (self.cursor_rect.y + self.oy) * self.line_height/32 - self.oy self.cursor_rect.set(0, y, self.cursor_rect.width, self.line_height) end end end class Window_Command < Window_Selectable include Module_SelectableEX def line_height return 32 end def initialize(width, commands) super(0, 0, width, commands.size * self.line_height + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * self.line_height) refresh self.index = 0 end def draw_item(index, color) super end end ####### # L13 # ####### class Game_Map def name $data_mapinfos = load_data("Data/MapInfos.rxdata") if $data_mapinfos.nil? $data_mapinfos[@map_id].name end end ####### # L14 # ####### class Bitmap def draw_hemming_text(x, y, w, h, text, align = 0) original_color = self.font.color.dup self.font.color = Color.new(0,0,0,255) self.draw_text(x , y , w, h, text, align) self.draw_text(x , y+2, w, h, text, align) self.draw_text(x+2, y+2, w, h, text, align) self.draw_text(x+2, y , w, h, text, align) self.font.color = original_color self.draw_text(x+1, y+1, w, h, text, align) end end module RPG_FileTest def RPG_FileTest.character_exist?(filename) return RPG::Cache.character(filename, 0) rescue return false end def RPG_FileTest.picture_exist?(filename) return RPG::Cache.picture(filename) rescue return false end def RPG_FileTest.battler_exist?(filename) return RPG::Cache.battler(filename, 0) rescue return false end end class Sprite_Number < Sprite attr_reader :w def initialize(font = Font.new) super() self.bitmap = Bitmap.new(1,1) self.bitmap.font = font max = s = 0 for i in 0..9 s = self.bitmap.text_size(i.to_s).width max = s if max < s end @w = max + 2 @h = font.size + 2 self.bitmap.dispose self.bitmap = Bitmap.new(@w, @h * 10) self.bitmap.font = font (0..9).each {|n| self.bitmap.draw_hemming_text(0, @h * n, @w, @h, n.to_s) } self.src_rect.height /= 10 end def number=(n) self.src_rect.y = n * @h end def n=(n) self.number = n end end class Spriteset_Numbers attr_reader :x attr_reader :y attr_reader :z attr_reader :visible def initialize(font = Font.new) @font = font @numbers = [] @x = 0 @y = 0 @z = 0 @visible = true end def number=(n) @numbers.each{|number| number.n = 10 } d = (n == 0 ? 0 : Math.log10(n).to_i) for i in 0..d @numbers[i] = Sprite_Number.new(@font) if @numbers[i] == nil @numbers[i].n = n % 10 @numbers[i].visible = true n /= 10 end self.x = self.x self.y = self.y self.z = self.z end def n=(n) self.number=(n) end def x=(n) @x = n for i in 0...@numbers.size @numbers[i].x = n n -= @numbers[i].w end end def y=(n) @y = n @numbers.each{|sprite| sprite.y = @y } end def z=(n) @z = n @numbers.each{|sprite| sprite.z = @z } end def visible=(b) @visible = b @numbers.each{|sprite| sprite.visible = b } end def dispose @numbers.each{|sprite| sprite.dispose } end end #================================================= ============================== # ---> XIDEROWG ACTION SYSTEM) <--- # (XRXS64 Self Action System) #================================================= ============================== # By Xiderowg (XMS) # http://xms.rdy.jp/ #================================================= ============================== # Unofficial Hero Features by Moghunter #================================================= ============================== # XAS - System Config #================================================= ============================== module XAS_BA # Definição do Som quando o herói receber dano HERO_HIT_SE = RPG::AudioFile.new("Mana - Duran_Hit", 100, 100) #------------------------------------------------------------------------------- # Definição especifica da animação de dano da ferramenta. # ATTACK_ANI_HIT = {A=>B,A=>B...} # A = Ferramenta ID. # B = Animation ID. ATTACK_ANI_HIT = { 1=>14 } #------------------------------------------------------------------------------- # Definição padrão animação de dano, quando não especificado. DEFAULT_ATTACK_ANI_HIT = 4 #------------------------------------------------------------------------------- # Definição das skills que farão tremer a tela no momento do HIT. # (Coloque o ID da Ferramenta) ATTACK_SKILL_SHAKE = [] #------------------------------------------------------------------------------- # Definição do tremor. SH_POWER = 5 #Poder (Força) SH_SPEED = 10 #Velocidade SH_DUR = 20 #Duração(20 = 1 segundo) #------------------------------------------------------------------------------- # Ativar JUMP HIT, player dá um pulo quando recebe o dano. JUMP_HIT_HERO = true #------------------------------------------------------------------------------- # Definição dos inimigos que não terão a animação Jump # ao receberem dano. JUMP_HIT_ENEMY_DISABLE = [] #------------------------------------------------------------------------------- # Definição da ID da variável que definirá a área de # ativação da ação. SENSOR_VAR = 10 #------------------------------------------------------------------------------- # Definição de qual ferramenta será # ativada quando equipar a arma. # # WEP_ID_TOOL = { A=>B, A=>B, ...} # # A = ID da Arma. # B = ID da Ferramenta. WEP_ID_TOOL = { 1=>1 } #------------------------------------------------------------------------------- # Definição do equipamento secundário # que no caso é a função ESCUDO(SHIELD) # # SECOND_HAND_ID_TOOL = { A=>B, A=>B, ...} # A=>B # # A = ID da armadura(Função escudo). # B = ID da ferramenta. SECOND_HAND_ID_TOOL = { 1=>34 } #------------------------------------------------------------------------------- # Ativar Gameover automático ao ser derrotado. AUTOGAMEOVER = true #------------------------------------------------------------------------------- # ID da switch que será ativada quando o herói morrer. # (Somente quando a opção AUTOGAMEOVER estiver em False) GAMEOVER_SWITCH_ID = 4 #------------------------------------------------------------------------------- # Fazer o Battler Piscar após receber dano. # (O tempo de piscar é igual ao tempo de invencibilidade.) BLINK_ON = false #------------------------------------------------------------------------------- # Tempo de invencibilidade após receber o dano. INVICIBLE_DURATION_HERO = 35 #------------------------------------------------------------------------------- # Tempo em que o herói ficará paralisado após receber o dano. KNOCK_BACK_DURATION_HERO = 30 #------------------------------------------------------------------------------- # Tempo padrão de invencibilidade e paralisia do inimigo # após receber o dano. DEFAULT_INVICIBLE_DURATION_ENEMY = 60 #------------------------------------------------------------------------------- # Tempo especifico em que o inimigo ficará parado e invencível # após receber o dano. # # A=>B # # A = ID do inimigo (Tropas inimigos). # B = Tempo de invencibilidade. INVICIBLE_DURATION_ENEMY = { 1=>45 } #------------------------------------------------------------------------------- # Velocidade do recuo do battler após receber o dano. # (Herói e Inimigo) KNOCK_BACK_SPEED = 5 #------------------------------------------------------------------------------- # Definição da ME quando fizer Level UP. LEVEL_UP_ME = RPG::AudioFile.new("007-Fanfare01") #------------------------------------------------------------------------------- # Definição da SE ao pegar o item do inimigo no chão. ITEMDROP_SE = RPG::AudioFile.new("056-Right02", 70, 140) #------------------------------------------------------------------------------- # Definição da SE quando for ativada a função Shield. SHIELD_SE = RPG::AudioFile.new("097-Attack09", 80, 150) #------------------------------------------------------------------------------- # Definição do Texto quando for ativada a função Shield. SHIELD_TEXT = "Guard" #------------------------------------------------------------------------------- # Definição da animação ID quando for ativada a função Shield. SHIELD_ANI = 64 #------------------------------------------------------------------------------- end #================================================= ============================== # XAS - Item Config #================================================= ============================== module XAS # Definição das ferramentas que correspondem os itens # no banco de dados. # # A=>B # # A = ID da ferramenta. # B = ID do item no banco de dados. ITEM_COST = {} end #================================================= ============================== # XAS - Enemy Config #================================================= ============================== module XAS_BA_ENEMY # Ativar Animação do inimigo ao morrer. # A duração da animação é proporcional ao tempo # do colapso, por default é 40Frames(2s). # DEF_ANI = {A=>B, A=>B, A=>B...} # A = ID do inimigo. # B = ID da animação. DEF_ANI = {1=>119} #------------------------------------------------------------------------------- # Definição do inimigo que terá um dos lados invulnerável. # # A=>[b] # # A = ID do Inimigo # B = Direção que o inimigo ficará invulnerável. # #(2 = Defesa Frontal.) #(4 = Defesa Esquerda.) #(6 = Defesa Direita.) #(8 = Defesa nas costas.) SHILED_DIRECTIONS = {} #------------------------------------------------------------------------------- # Definição de quais tipos de ferramentas(Habilidades) o # inimigo será invulnerável. # # A=>[B,B,B,B,B,B...] # # A = ID do inimigo. # B = ID da ferramenta que não terá efeito no inimigo. SHILED_ACTIONS = {} #------------------------------------------------------------------------------- # Definição dos inimigos que terão o recuo desativado. KNOCK_BACK_DISABLES = [] #------------------------------------------------------------------------------- # Definição do tamanho extra(Área) do inimigo, ou seja, define a # área de impacto do inimigo. # # BODY_SQUARE = {A=>B, A=>B, A=>B...} # # A = ID do inimigo. # B = Valor do tamanho extra do inimigo. BODY_SQUARE = {} #------------------------------------------------------------------------------- # Ativação automática de Switchs quando o inimigo morre. # # A=>B # # A = ID do inimigo. # B = ID da switch que será ativada quando o inimigo morrer. DEFEAT_SWITCH_IDS = {} end #================================================= ============================== # XAS - (Y) Botão de Habilidade e Item. #================================================= ============================== module XRXS64 # Definição do botão que ativará a ferramenta. ACTION_BUTTON = Input::Y # Definição da variável que ficará registrado a # ID da ferramenta do botão Y. ACTION_VARIABLE_ID = 2 end #================================================= ============================== # XAS - (C) Botão de Ataque. #================================================= ============================== module XAS_CS # Definição do botão que ativará a ferramenta arma. SLASH_BUTTON = Input::C # Definição da variável que ficará registrado a # ID da ferramenta do botão C. SLASH_VARIABLE_ID = 1 end #================================================= ============================== # XAS - (Z) Button Action #================================================= ============================== module XAS_Z # Definição do botão que trocará as ferramentas ativas. ACTION_CHANGE_BUTTON = Input::Z #Função Desativada(SORA ED) # Definição da variável que ficará registrado a # ID da ferramenta SKILL. ACTION_VARIABLE_ID = 2 # Definição dos ícones que representam as ferramentas. ACTION_ICON = {} # Swtich que desativa a janela de ferramentas. SWITCH_ID = 5 # Posição da janela de ferramentas na horizontal. X = 246 # Posição da janela de ferramentas na vertical. Y = 390 end #================================================= ============================== # XAS - Customização de Mapa de Ferramenta. #================================================= ============================== module XAS # ID da variável de impacto de Ferramentas. HIT_ID = 3 # ID do mapa onde fica ficarão os eventos de ferramentas. ACTION_TEMPLATE_MAP_ID = 1 end #================================================= ============================== # XAS - Customizações gerais de evento. #================================================= ============================== module XAS_BA # Variável que define a ID do inimigo. ENEMY_ID_VARIABLE_ID = 4 # Sensor que Define a página de ação do inimigo. SENSOR_SELF_SWITCH = "D" # Definição da variável que registrará a # quantidade de inimigos derrotados. DEFEAT_NUMBER_ID = 999 end #================================================= ============================== # XAS EX - SYSTEM (XRXS64 Self Action System) #================================================= ============================== $xrxs = {} if $xrxs == nil $xrxs["xas"] = true $mogscript = {} if $mogscript == nil ################ # RPG_FileTest # ################ module RPG_FileTest def RPG_FileTest.character_exist?(filename) return RPG::Cache.character(filename, 0) rescue return false end def RPG_FileTest.picture_exist?(filename) return RPG::Cache.picture(filename) rescue return false end def RPG_FileTest.battler_exist?(filename) return RPG::Cache.battler(filename, 0) rescue return false end end ################# # Sprite_Number # ################# class Sprite_Number < Sprite attr_reader :w def initialize(font = Font.new) super() self.bitmap = Bitmap.new(1,1) self.bitmap.font = font max = s = 0 for i in 0..9 s = self.bitmap.text_size(i.to_s).width max = s if max < s end @w = max + 2 @h = font.size + 2 self.bitmap.dispose self.bitmap = Bitmap.new(@w, @h * 10) self.bitmap.font = font (0..9).each {|n| self.bitmap.draw_hemming_text(0, @h * n, @w, @h, n.to_s) } self.src_rect.height /= 10 end def number=(n) self.src_rect.y = n * @h end def n=(n) self.number = n end end class Spriteset_Numbers attr_reader :x attr_reader :y attr_reader :z attr_reader :visible def initialize(font = Font.new) @font = font @numbers = [] @x = 0 @y = 0 @z = 0 @visible = true end def number=(n) @numbers.each{|number| number.n = 10 } d = (n == 0 ? 0 : Math.log10(n).to_i) for i in 0..d @numbers[i] = Sprite_Number.new(@font) if @numbers[i] == nil @numbers[i].n = n % 10 @numbers[i].visible = true n /= 10 end self.x = self.x self.y = self.y self.z = self.z end def n=(n) self.number=(n) end def x=(n) @x = n for i in 0...@numbers.size @numbers[i].x = n n -= @numbers[i].w end end def y=(n) @y = n @numbers.each{|sprite| sprite.y = @y } end def z=(n) @z = n @numbers.each{|sprite| sprite.z = @z } end def visible=(b) @visible = b @numbers.each{|sprite| sprite.visible = b } end def dispose @numbers.each{|sprite| sprite.dispose } end end ######### # Lib15 # ######### class Game_Map attr_accessor :need_refresh_token def need_add_tokens @need_add_tokens = [] if @need_add_tokens == nil return @need_add_tokens end def need_remove_tokens @need_remove_tokens = [] if @need_remove_tokens == nil return @need_remove_tokens end def add_token(token_event) @events[token_event.id] = token_event self.need_add_tokens.push(token_event) self.need_refresh_token = true end def remove_token(token_event) @events.delete(token_event.id) self.need_remove_tokens.push(token_event) self.need_refresh_token = true end def clear_tokens for event in @events.values.dup remove_token(event) if event.is_a?(Token_Event) end channels = ["A", "B", "C", "D"] for id in 1001..(token_id_shift - 1) for a in channels key = [self.map_id, id, a] $game_self_switches.delete(key) end end clear_token_id end end class Game_SelfSwitches def delete(key) @data.delete(key) end end class Game_Map def token_id_shift @token_id = 1000 if @token_id == nil @token_id += 1 return @token_id end def clear_token_id @token_id = nil end end module XRXS_CTS_RefreshToken def refresh_token for event in $game_map.need_add_tokens @character_sprites.push(Sprite_Character.new(@view port1, event)) end $game_map.need_add_tokens.clear for sprite in @character_sprites.dup if $game_map.need_remove_tokens.empty? break end if $game_map.need_remove_tokens.delete(sprite.charact er) @character_sprites.delete(sprite) sprite.dispose end end $game_map.need_refresh_token = false end end class Spriteset_Map include XRXS_CTS_RefreshToken alias xrxs_lib15_update update def update xrxs_lib15_update refresh_token if $game_map.need_refresh_token end end class Scene_Map alias xrxs_lib15_transfer_player transfer_player def transfer_player $game_map.clear_tokens xrxs_lib15_transfer_player end end class Token_Event < Game_Event def initialize(map_id, event) event.id = $game_map.token_id_shift # @multi = 0 # super end def erase super $game_map.remove_token(self) end end ############## # Token Mech # ############## module XRXS_ActionTemplate map_id = XAS::ACTION_TEMPLATE_MAP_ID map = load_data(sprintf("Data/Map%03d.rxdata", map_id)) @@events = map.events end class Token_Event < Game_Event include XRXS_ActionTemplate end class Game_Temp attr_accessor :active_token end module XAS_ACTION attr_reader :action attr_reader :erased def shoot(action_id) return if action_id == 0 item_id = XAS::ITEM_COST[action_id] if item_id != nil and $game_party.item_number(item_id) == 0 $game_system.se_play($data_system.buzzer_se) return end self.action_attachment(action_id) n = 1 @action.prelag = n skill_id = action_id skill = skill_id == nil ? nil : $data_skills[skill_id] sp_cost = skill.sp_cost if self.battler.sp < sp_cost m = 1 else m = Database_Bullet::SUFLAGS[action_id].to_i end @action.duration = m end def action_attachment(action_id) @action = Game_Action.new(self, action_id) @action.attachment(action_id) plan = Database_Bullet::SELF_ANIMATION_PLANS[action_id] @self_animation_plan = plan.nil? ? nil : plan.dup end def action_update return unless @action.is_a?(Game_Action) if @self_motion != nil self.character_name_suffix = @self_motion @pattern = 0 @pattern_count = 0 @self_motion = nil if self.is_a?(Game_Player) @step_anime = true end end if @self_animation_plan != nil animation_id = @self_animation_plan[@action.now_count] self.animation_id = animation_id unless animation_id.nil? end if @action.prelag > 0 @action.prelag -= 1 self.shoot_bullet(@action.id) if @action.prelag == 0 return end @action.update end def check_event_trigger_attack() if $game_system.map_interpreter.running? return end if @action.nil? or @action.attack_id == 0 return end hit_check = false range = @action.attack_range hit = [] targets = [$game_player] + (@action.player_damage ? [] : $game_map.events.values) for event in targets next if event == self or @action.hit_events.include?(event) or event.jumping? or event.erased body_size = event.body_size event_center_x = event.x event_center_y = event.y - body_size dx = event_center_x - self.x dy = event_center_y - self.y dx = (dx >= 0 ? [dx - body_size, 0].max : [dx + body_size, 0].min) dy = (dy >= 0 ? [dy - body_size, 0].max : [dy + body_size, 0].min) case @action.attack_range_type when Map::RHOMBUS hit_check = (dx.abs + dy.abs <= range) when Map::SQUARE hit_check = (dx.abs <= range and dy.abs <= range) when Map::LINE case self.direction when 2 hit_check = (dx == 0 and dy >= 0 and dy <= range) when 8 hit_check = (dx == 0 and dy <= 0 and dy >= -range) when 6 hit_check = (dy == 0 and dx >= 0 and dx <= range) when 4 hit_check = (dy == 0 and dx <= 0 and dx >= -range) end end hit.push(event) if hit_check hit_check = false end for event in hit if event.action_effect(self, self.action.attack_id) hit_check = true end @action.hit_events.push(event) end if hit_check $game_temp.active_token = self end end def action_effect(attacker, attack_id) return false unless self.is_a?(Game_Event) for page in @event.pages if page.condition.variable_valid and page.condition.variable_id == XAS::HIT_ID and page.condition.variable_value == attack_id self.reaction_valid_attack_id = attack_id self.refresh @trigger = 0 self.start return true end end return false end def shoot_bullet(action_id) return false if action_id == 0 item_id = XAS::ITEM_COST[action_id] if item_id != nil $game_party.lose_item(item_id, 1) if $mogscript["mpequip"] == true $eref = true end end bullet_token = Token_Bullet.new(self, action_id) $game_map.add_token(bullet_token) @self_motion = Database_Bullet::SELF_MOTIONS[action_id] return bullet_token end def body_size return 0 end def action_clear @action = nil self.character_name_suffix = nil end end class Game_Character include XAS_ACTION end module XAS_Dispose def update action_update super if @action.is_a?(Game_Action) and @action.done? self.action_clear if self.is_a?(Game_Player) @step_anime = false end end end end class Game_Player < Game_Character include XAS_Dispose end class Game_Event < Game_Character include XAS_Dispose end module XAS_CharacterName_Suffix def character_name character_name = super file_name = character_name + self.character_name_suffix.to_s character_name = file_name if RPG_FileTest.character_exist?(file_name) return character_name end attr_accessor :character_name_suffix end class Game_Player < Game_Character include XAS_CharacterName_Suffix end class Game_Event < Game_Character include XAS_CharacterName_Suffix end module XAS_StopToAction def acting? return self.action != nil end def moving? return (super or self.acting?) end end class Game_Player < Game_Character include XAS_StopToAction end class Interpreter alias xrxs64_command_end command_end def command_end @list = nil event = $game_map.events[@event_id] return if event == nil if event.reaction_valid_attack_id event.reaction_valid_attack_id = nil event.refresh end xrxs64_command_end end end class Game_Event < Game_Character attr_accessor :reaction_valid_attack_id def refresh new_page = nil unless @erased for page in @event.pages.reverse c = page.condition if c.switch1_valid if $game_switches[c.switch1_id] == false next end end if c.switch2_valid if $game_switches[c.switch2_id] == false next end end if c.variable_valid if c.variable_id == XAS::HIT_ID and c.variable_value == self.reaction_valid_attack_id elsif $game_variables[c.variable_id] < c.variable_value next end end if c.self_switch_valid key = [@map_id, @event.id, c.self_switch_ch] if $game_self_switches[key] != true next end end new_page = page break end end if new_page == @page return end @page = new_page clear_starting if @page == nil @tile_id = 0 @character_name = "" @character_hue = 0 @move_type = 0 @through = true @trigger = nil @list = nil @interpreter = nil return end @tile_id = @page.graphic.tile_id @character_name = @page.graphic.character_name @character_hue = @page.graphic.character_hue if @original_direction != @page.graphic.direction @direction = @page.graphic.direction @original_direction = @direction @prelock_direction = 0 end if @original_pattern != @page.graphic.pattern @pattern = @page.graphic.pattern @original_pattern = @pattern end @opacity = @page.graphic.opacity @blend_type = @page.graphic.blend_type @move_type = @page.move_type @move_speed = @page.move_speed @move_frequency = @page.move_frequency @move_route = @page.move_route @move_route_index = 0 @move_route_forcing = false @walk_anime = @page.walk_anime @step_anime = @page.step_anime @direction_fix = @page.direction_fix @through = @page.through @always_on_top = @page.always_on_top @trigger = @page.trigger @list = @page.list @interpreter = nil if @trigger == 4 @interpreter = Interpreter.new end check_event_trigger_auto end end class Game_Action attr_reader :id attr_accessor relag attr_accessor :attack_id attr_reader :attack_range attr_reader :attack_range_type attr_accessor :user attr_reader :hit_events attr_accessor :now_count attr_reader :final_mark attr_accessor :duration attr_reader :blow_power attr_reader iercing attr_reader layer_damage attr_reader :ignore_invincible def initialize(user, action_id) @user = user @id = action_id @prelag = 0 @now_count = 0 @duration = nil @attack_id = 0 @attack_range= 0 @hit_events = [] @blow_power = 0 end def attachment(action_id) @duration = Database_Bullet: URATIONS[action_id]power = Database_Bullet::BLOW_POWERS[action_id] @blow_power = power == nil ? 1 : power @attack_id_plan = Database_Bullet::ATTACK_ID_PLANS[action_id] @attack_range_type = Database_Bullet::ATTACK_RANGE_TYPES[action_id] plan = Database_Bullet::ATTACK_RANGE_PLANS[action_id] @attack_range_plan = plan.nil? ? nil : plan.dup @self_damage = Database_Bullet::SELF_DAMAGES[self.id] @player_damage = Database_Bullet::PLAYER_DAMAGES[action_id] @ignore_invincible = Database_Bullet::IGNORE_INVINCIBLES[action_id] end def update if @attack_id_plan != nil id = @attack_id_plan[@now_count] unless id.nil? @attack_id = id @hit_events.clear @hit_events.push(self.user) unless @self_damage end end if @attack_range_plan != nil range = @attack_range_plan[@now_count] @attack_range = range unless range.nil? end @now_count += 1 end def done? return (self.duration.to_i > 0 and self.now_count >= self.duration) end end class Token_Bullet < Token_Event def initialize(user, action_id) original_event = @@events[action_id] return if original_event == nil event = original_event.dup event.x = user.x event.y = user.y event.pages[0].graphic.direction = user.direction @character_name = event.pages[0].graphic super($game_map.map_id, event) self.action_attachment(action_id) @action.user = user @remain_for_an_act = @action.duration.is_a?(Numeric) end def update super erase if @action == nil and @remain_for_an_act check_event_trigger_attack end end module Map RHOMBUS = 1 SQUARE = 2 LINE = 3 end module Database_Bullet include Map EVENTS = [] EVENT_IDS = [] DURATIONS = [] PRELAGS = [] SUFLAGS = [] FINALIZE_MARKS = [] ATTACK_ID_PLANS = [] ATTACK_RANGE_TYPES = [] ATTACK_RANGE_PLANS = [] BLOW_POWERS = [] SELF_MOTIONS = [] SELF_ANIMATION_PLANS = [] PIERCINGS = [] SELF_DAMAGES = [] PLAYER_DAMAGES = [] IGNORE_INVINCIBLES = [] end #================================================= ============================== # XAS - Character damage pop mechanism #================================================= ============================== module XRXS_DAMAGE_OFFSET def update super @damage_sprites = [] if @damage_sprites.nil? for damage_sprite in @damage_sprites damage_sprite.x = self.x damage_sprite.y = self.y end end end class Sprite_Character < RPG::Sprite include XRXS_DAMAGE_OFFSET end class Game_Character attr_accessor :collapse_duration attr_accessor :battler_visible attr_writer pacityattr_accessor :collapse_done end module XRXS_CharacterDamagePop def update super if @battler == nil return end if @character.collapse_duration != nil if @character.collapse_duration > 0 collapse end @_collapse_duration = @character.collapse_duration end @battler_visible = @character.battler_visible @battler_visible = true if @battler_visible == nil if @battler.damage_pop damage(@battler.damage, @battler.critical) @battler.damage = nil @battler.critical = false @battler.damage_pop = false end unless @battler_visible if not @battler.hidden and not @battler.dead? and (@battler.damage == nil or @battler.damage_pop) appear @battler_visible = true end end if @battler_visible if @battler.damage == nil and @battler.dead? if @battler.is_a?(Game_Enemy) $game_system.se_play($data_system.enemy_collapse_s e) else $game_system.se_play($data_system.actor_collapse_s e) end collapse @battler_visible = false end else if @_collapse_duration > 0 @_collapse_duration -= 1 @character.opacity = 256 - (48 - @_collapse_duration) * 6 if @_collapse_duration == 0 @character.collapse_done = true end end end @character.collapse_duration = @_collapse_duration @character.battler_visible = @battler_visible end end class Sprite_Character < RPG::Sprite include XRXS_CharacterDamagePop end ######################## # Action Battle System # ######################## class Game_Event < Game_Character def enemy_defeat_process(enemy) last_level = $game_player.battler.level $game_party.gain_exp(enemy.exp) $game_party.gain_gold(enemy.gold) if last_level < $game_player.battler.level $game_system.me_play(XAS_BA::LEVEL_UP_ME) $game_player.battler.damage = "Level up!" $game_player.battler.damage_pop = true $game_player.need_refresh = true end id = XAS_BA: EFEAT_NUMBER_ID$game_variables[id] += 1 if id != 0 switch_id = XAS_BA_ENEMY: EFEAT_SWITCH_IDS[self.enemy_id]if switch_id != nil $game_switches[switch_id] = true $game_map.refresh end end end class Game_Party def gain_exp(exp) for i in 0...$game_party.actors.size actor = $game_party.actors[i] if actor.cant_get_exp? == false actor.exp += exp end end end end class Game_Player < Game_Character attr_accessor :need_refresh end module XAS_BA_BULLET_SP_COST def shoot_bullet(action_id) skill_id = action_id skill = skill_id == nil ? nil : $data_skills[skill_id] if skill != nil sp_cost = skill.sp_cost if self.battler.sp < sp_cost $game_system.se_play($data_system.buzzer_se) return false end self.battler.sp -= sp_cost if $mogscript["mpstelen"] == true $game_player.wref = true end self.need_refresh = true end return super end end class Game_Player < Game_Character include XAS_BA_BULLET_SP_COST end module XRXS_EnemySensor def update_sensor distance = ($game_player.x - self.x).abs + ($game_player.y - self.y).abs enable = (distance <= $game_variables[XAS_BA::SENSOR_VAR]) key = [$game_map.map_id, self.id, XAS_BA::SENSOR_SELF_SWITCH] last_enable = $game_self_switches[key] last_enable = false if last_enable == nil if enable != last_enable $game_self_switches[key] = enable $game_map.need_refresh = true end end end class Game_Event < Game_Character include XRXS_EnemySensor end class Game_Character attr_writer pacityend module XRXS_BattlerAttachment def attack_effect(attacker) return super if self.battler.nil? or attacker.nil? result = (not self.battler.dead? and self.battler.hiblink_duration.to_i <= 0) if result $game_temp.in_battle = true self.battler.attack_effect(attacker.battler) self.battler.damage_pop = true $game_temp.in_battle = false if self.battler.damage.to_i > 0 self.blow(attacker.direction, 1) end self.battler.hiblink_duration = self.damage_hiblink_duration if self.is_a?(Game_Player) self.need_refresh = true end end @xrxs64c_defeat_done = false if @xrxs64c_defeat_done == nil if not @xrxs64c_defeat_done and self.battler.dead? defeat_process @xrxs64c_defeat_done = true end end def action_effect(bullet, action_id) return super if self.battler.nil? if self.battler.hiblink_duration.to_i > 0 and not bullet.action.ignore_invincible return false end skill_id = action_id return if skill_id == nil user = bullet.action.user attacker = (user == nil ? nil : user.battler) result = (user != nil and not self.battler.dead?) skill_id = action_id dirset = [2,6,8,4] dir_index = (dirset.index(bullet.direction) + 2) % 4 shield = self.shield_actions.include?(action_id) for direction in self.shield_directions dir_index2 = (dirset.index(self.direction) + dirset.index(direction)) % 4 shield |= dirset[dir_index2] == dirset[dir_index] end if shield if user.is_a?(Game_Player) self.battler.damage = XAS_BA::SHIELD_TEXT self.battler.damage_pop = true $game_system.se_play(XAS_BA::SHIELD_SE) user.blow(dirset[dir_index]) self.animation_id = XAS_BA::SHIELD_ANI end super return true end if result skill = $data_skills[skill_id] if skill_id == 2 and $game_switches[120] skill = skill.dup skill.power = 8 end $game_temp.in_battle = true self.battler.skill_effect(attacker, skill) self.battler.damage_pop = true $game_temp.in_battle = false if self.battler.damage.to_i > 0 if XAS_BA::ATTACK_SKILL_SHAKE.include?(skill_id) $game_screen.start_shake(XAS_BA::SH_POWER,XAS_BA:: SH_SPEED,XAS_BA::SH_DUR) end hit_skill_anime = XAS_BA::ATTACK_ANI_HIT[skill_id] if hit_skill_anime != nil self.animation_id = hit_skill_anime else self.animation_id = XAS_BA: EFAULT_ATTACK_ANI_HITend d = bullet.direction p = bullet.action.blow_power.to_i self.blow(d, p) self.battler.hiblink_duration = self.damage_hiblink_duration end if self.is_a?(Game_Player) self.need_refresh = true end end if not @xrxs64c_defeat_done and self.battler.dead? defeat_process @xrxs64c_defeat_done = true end return (super or result) end def shield_directions return [] end def shield_actions return [] end def knock_back_disable return false end def damage_hiblink_duration actor = $game_party.actors[0] if self.is_a?(Game_Player) and self.battler.damage.to_i > 0 if XAS_BA::JUMP_HIT_HERO == true jump(0,0) $game_system.se_play(XAS_BA::HERO_HIT_SE) end else if self.battler.damage.to_i > 0 unless XAS_BA::JUMP_HIT_ENEMY_DISABLE.include?(self.enemy _id) jump(0,0) end end end if self.is_a?(Game_Player) return XAS_BA::INVICIBLE_DURATION_HERO else enemy_invicible_duration = XAS_BA::INVICIBLE_DURATION_ENEMY[enemy_id] if enemy_invicible_duration != nil return enemy_invicible_duration else return XAS_BA: EFAULT_INVICIBLE_DURATION_ENEMY end end end def dead? return self.battler == nil ? false : self.battler.dead? end def defeat_process end end class Game_Player < Game_Character include XRXS_BattlerAttachment def battler return $game_party.actors[0] end def defeat_process super if XAS_BA::AUTOGAMEOVER == true $scene = Scene_Gameover.new rescue nil else $game_switches[XAS_BA::GAMEOVER_SWITCH_ID] = true $game_map.refresh end end alias xrxs64c_update update def update xrxs64c_update self.battler.remove_states_auto if self.battler != nil if self.collapse_done self.collapse_done = false @xrxs64c_defeat_done = false end end end class Game_Event < Game_Character include XRXS_BattlerAttachment def battler return @battler end alias xrxs64c_refresh refresh def refresh xrxs64c_refresh self.battler_recheck end def battler_recheck return if @battler != nil if @page == nil return end @enemy_id = 0 for page in @event.pages.reverse condition = page.condition if condition.variable_valid and condition.variable_id == XAS_BA::ENEMY_ID_VARIABLE_ID and (!condition.switch1_valid or $game_switches[condition.switch1_id]) and (!condition.switch2_valid or $game_switches[condition.switch2_id]) @enemy_id = condition.variable_value break end end if @enemy_id == 0 return end troop_id = -1 member_index = -1 for troop in $data_troops next if troop == nil for enemy in troop.members if enemy.enemy_id == @enemy_id troop_id = $data_troops.index(troop) member_index = troop.members.index(enemy) break end end end if troop_id != -1 and member_index != -1 @battler = Game_Enemy.new(troop_id, member_index) end end def enemy_id self.battler return @enemy_id end alias xrxs64c_update update def update if @collapse_wait_count.to_i > 0 @collapse_wait_count -= 1 if @collapse_wait_count == 0 @collapse_wait_count = nil $game_map.remove_token(self) end return end update_sensor xrxs64c_update if self.battler != nil self.battler.remove_states_auto end if self.collapse_duration.to_i > 0 @through = true end if self.collapse_done @opacity = 0 @collapse_wait_count = 32 return end end def shield_enable! @shield_disable = nil end def shield_disable! @shield_disable = true end def shield_directions set = @shield_disable ? [] : XAS_BA_ENEMY::SHILED_DIRECTIONS[self.enemy_id] set = [] if set == nil return set end def shield_actions set = @shield_disable ? [] : XAS_BA_ENEMY::SHILED_ACTIONS[self.enemy_id] set = [] if set == nil return set end def knock_back_disable return XAS_BA_ENEMY::KNOCK_BACK_DISABLES.include?(self.en emy_id) end def body_size return XAS_BA_ENEMY::BODY_SQUARE[self.enemy_id].to_i end def defeat_process super enemy_defeat_process(self.battler) enemy_defeat_animation = XAS_BA_ENEMY: EF_ANI[enemy_id]if XAS_BA_ENEMY: EF_ANI[enemy_id] != nilself.animation_id = enemy_defeat_animation end end end class Game_Event < Game_Character attr_reader :collision_attack def img_act_exist? begin RPG::Cache.character(@page.graphic.character_name + "_Act" , @page.graphic.character_hue) rescue return false end return true end def attack_on @collision_attack = true if img_act_exist? @character_name = @page.graphic.character_name + "_Act" end end def attack_off @collision_attack = false @character_name = @page.graphic.character_name end end class Game_Player < Game_Character alias xrxs64c_check_event_trigger_touch check_event_trigger_touch def check_event_trigger_touch(x, y) xrxs64c_check_event_trigger_touch(x, y) if $game_system.map_interpreter.running? return end for event in $game_map.events.values next unless event.collision_attack unless [1,2].include?(event.trigger) if event.battler != nil and event.x == x and event.y == y $game_player.attack_effect(event) $game_player.animation_id = XAS_BA: EFAULT_ATTACK_ANI_HIT end end end end end class Game_Event < Game_Character alias xrxs64c_check_event_trigger_touch check_event_trigger_touch def check_event_trigger_touch(x, y) xrxs64c_check_event_trigger_touch(x, y) if $game_system.map_interpreter.running? return end return unless self.collision_attack if self.battler != nil and x == $game_player.x and y == $game_player.y $game_player.attack_effect(self) end end end module XAS_BA_BATTLEEVENT_NONPREEMPT def update return if self.battler != nil and $game_system.map_interpreter.running? super end end class Game_Event < Game_Character include XAS_BA_BATTLEEVENT_NONPREEMPT end class Game_Battler attr_accessor :hiblink_duration end class Sprite_Character < RPG::Sprite alias xrxs64c_update update def update if @battler == nil @battler = @character.battler end xrxs64c_update if @battler == nil return end if @_collapse_duration > 0 return end if @character.collapse_done return end if @battler.hiblink_duration.is_a?(Numeric) if XAS_BA::BLINK_ON == true @character.opacity = (@character.opacity + 70) % 190 + 40 end @battler.hiblink_duration -= 1 if @battler.hiblink_duration <= 0 @battler.hiblink_duration = nil @character.opacity = 255 end end end end module XAS_BA_ItemDrop def defeat_process super if self.battler.is_a?(Game_Enemy) and self.battler.dead? treasure = nil enemy = self.battler if rand(100) < enemy.treasure_prob if enemy.item_id > 0 treasure = $data_items[enemy.item_id] end if enemy.weapon_id > 0 treasure = $data_weapons[enemy.weapon_id] end if enemy.armor_id > 0 treasure = $data_armors[enemy.armor_id] end end if treasure != nil item_se = XAS_BA::ITEMDROP_SE opecode = treasure.is_a?(RPG::Item) ? 126 : treasure.is_a?(RPG::Weapon) ? 127 : treasure.is_a?(RPG::Armor) ? 128 : nil list = [] if opecode != nil list[0] = RPG::EventCommand.new(opecode, 0, [treasure.id,0,0,1]) list[1] = RPG::EventCommand.new(250, 0, [item_se]) list[2] = RPG::EventCommand.new(116, 0, []) end list.push(RPG::EventCommand.new) command = RPG::MoveCommand.new command.code = 14 command.parameters = [0,0] route = RPG::MoveRoute.new route.repeat = false route.list = [command, RPG::MoveCommand.new] page = RPG::Event::Page.new page.move_type = 3 page.move_route = route page.move_frequency = 6 page.always_on_top = true page.trigger = 1 page.list = list event = RPG::Event.new(self.x, self.y) event.pages = [page] token = Token_Event.new($game_map.id, event) token.icon_name = treasure.icon_name $game_map.add_token(token) end end end end class Game_Event < Game_Character include XAS_BA_ItemDrop end class Game_Character attr_accessor :icon_name end class Sprite_Character < RPG::Sprite alias xrxs_charactericon_update update def update xrxs_charactericon_update if @character.icon_name != nil #and @icon_name != @character.icon_name @icon_name = @character.icon_name self.bitmap = RPG::Cache.icon(@icon_name) self.src_rect.set(0, 0, 24, 24) self.ox = 12 self.oy = 24 end end end class Game_Character def blow(d, power = 1) return if self.knock_back_disable @knock_back_prespeed = @move_speed if @knock_back_prespeed == nil power.times do if passable?(self.x, self.y, d) @x += ([3,6,9].include?(d) ? 1 : [1,4,7].include?(d) ? -1 : 0) @y += ([1,2,3].include?(d) ? 1 : [7,8,9].include?(d) ? -1 : 0) end end if self.battler.is_a?(Game_Enemy) enemy_knock_duration = XAS_BA::INVICIBLE_DURATION_ENEMY[enemy_id] if enemy_knock_duration != nil @knock_back_duration = enemy_knock_duration else @knock_back_duration = XAS_BA: EFAULT_INVICIBLE_DURATION_ENEMY end else @knock_back_duration = XAS_BA::KNOCK_BACK_DURATION_HERO end @move_speed = XAS_BA::KNOCK_BACK_SPEED end alias xrxs64c_nb_update update def update @stop_count = -1 if self.knockbacking? or self.dead? xrxs64c_nb_update def img_hit_enemy_exist? begin RPG::Cache.character(@page.graphic.character_name + "_Hit" , @page.graphic.character_hue) rescue return false end return true end def img_hit_actor_exist? begin actor = $game_party.actors[0] RPG::Cache.character(actor.character_name + "_Hit" , actor.character_hue) rescue return false end return true end if self.knockbacking? if self.battler.is_a?(Game_Enemy) if img_hit_enemy_exist? @character_name = @page.graphic.character_name + "_Hit" @collision_attack = false end else if img_hit_actor_exist? actor = $game_party.actors[0] @character_name = actor.character_name + "_Hit" end end @pattern = 0 @knock_back_duration -= 1 if @knock_back_duration <= 0 if self.battler.is_a?(Game_Enemy) @character_name = @page.graphic.character_name else actor = $game_party.actors[0] @character_name = actor.character_name end @knock_back_duration = nil @move_speed = @knock_back_prespeed @knock_back_prespeed = nil end return end end def knockbacking? return @knock_back_duration != nil end def collapsing? return self.collapse_duration.to_i > 0 end end module XAS_DamageStop def acting? return (super or self.knockbacking? or self.collapsing?) end end class Game_Player < Game_Character include XAS_DamageStop end class Game_Event < Game_Character include XAS_DamageStop end module RPG class Sprite < ::Sprite def dispose_animation if @_animation_sprites != nil sprite = @_animation_sprites[0] if sprite != nil @@_reference_count[sprite.bitmap] -= 1 end for sprite in @_animation_sprites sprite.dispose end @_animation_sprites = nil @_animation = nil end end end end #================================================= ============================== # XAS - (Y) Button Action #================================================= ============================== class Game_Player < Game_Character alias xrxs64_ya_update update def update xrxs64_ya_update if Input.trigger?(XRXS64::ACTION_BUTTON) unless $game_system.map_interpreter.running? or $game_temp.message_window_showing or self.action != nil action_id = $game_variables[XRXS64::ACTION_VARIABLE_ID] self.shoot(action_id) end end end end #================================================= ============================== # XAS - (Z) Button Change #================================================= ============================== class Game_Party def goods @goods = [] if @goods == nil return @goods end def gain_goods(action_id) @goods = [] if @goods == nil @goods.push(action_id) unless @goods.include?(action_id) end end module XAS_ACTION alias xas_z_shoot_bullet shoot_bullet def shoot_bullet(action_id) bullet_token = xas_z_shoot_bullet(action_id) $scene.refresh_goods if bullet_token return bullet_token end end class Game_Map attr_accessor :goodref end class Interpreter alias mogfix11_command_126 command_126 def command_126 mogfix11_command_126 $game_map.goodref = true end end class Scene_Map alias xrxs64_zc_main main def main @action_change = Spriteset_ActionChange.new if $game_switches[XAS_Z::SWITCH_ID] == false @action_change.show(nil, $game_variables[XAS_Z::ACTION_VARIABLE_ID], nil) end xrxs64_zc_main @action_change.dispose if @action_change != nil end alias xrxs64_zc_update update def update xrxs64_zc_update unless $game_switches[XAS_Z::SWITCH_ID] == false return @action_change.visible = false end @action_change.update if $game_map.goodref == true refresh_goods $game_map.goodref = false end if $xrxs["xas_good_ax"] == true if Input.trigger?(XAS_Z::ACTION_CHANGE_BUTTON) and XAS_WINDOW_SKILL::ZBUTTON_ACTIVE == true unless $game_system.map_interpreter.running? or $game_temp.message_window_showing action_id2 = $game_variables[XAS_Z::ACTION_VARIABLE_ID] goods = $game_party.goods return if goods.size == 0 index = (goods.index(action_id2).to_i + 1) % goods.size action_id3 = goods[index] $game_variables[XAS_Z::ACTION_VARIABLE_ID] = action_id3 @action_change.show(nil, action_id2, action_id3) @action_change.left_slide end end else if Input.trigger?(XAS_Z::ACTION_CHANGE_BUTTON) unless $game_system.map_interpreter.running? or $game_temp.message_window_showing action_id2 = $game_variables[XAS_Z::ACTION_VARIABLE_ID] goods = $game_party.goods return if goods.size == 0 index = (goods.index(action_id2).to_i + 1) % goods.size action_id3 = goods[index] $game_variables[XAS_Z::ACTION_VARIABLE_ID] = action_id3 @action_change.show(nil, action_id2, action_id3) @action_change.left_slide end end end end alias xrxs64_zc_transfer_player transfer_player def transfer_player xrxs64_zc_transfer_player if $game_switches[XAS_Z::SWITCH_ID] == false @action_change.show(nil, $game_variables[XAS_Z::ACTION_VARIABLE_ID], nil) end end def refresh_goods @action_change.refresh if @action_change != nil end end class Spriteset_ActionChange def initialize @x = XAS_Z::X @y = XAS_Z::Y @icons = [] @action_ids = [nil, nil, nil] @font = Font.new @font.name = "Comic Sans MS" @font.size = 22 @font.bold = true self.clear @leftslide_duration = 0 @show_duration = 0 @fadeout_duration = 0 end def dispose @icons.each {|sprite| sprite.dispose} @window.dispose if @window != nil @numbers.dispose if @numbers != nil end def clear self.dispose @window = Window_Base.new(@x, @y, 26, 26) @window.visible = false @window.back_opacity = 160 @window.z = 500 for i in 0..2 @icons[i] = Sprite.new @icons[i].z = 501 end @numbers = Spriteset_Numbers.new(@font) @numbers.visible = false @numbers.x = @x + 12 @numbers.y = @y + 12 @numbers.z = 502 end def show(action_id1, action_id2, action_id3) self.clear @window.visible = true @action_ids = [action_id1, action_id2, action_id3] for i in 0..2 icon_name = XAS_Z::ACTION_ICON[@action_ids[i]] if icon_name != nil @icons[i].bitmap = RPG::Cache.icon(icon_name) @icons[i].x = @x + (i - 1) * 48 @icons[i].y = @y + 16 - (i % 2) * 16 @icons[i].opacity = 96 + (i % 2) * 160 @icons[i].visible = true else @icons[i].bitmap = nil end end @show_duration = (action_id3 == nil ? 0 : 60) @leftslide_duration = 0 @fadeout_duration = (action_id3 == nil ? 12 : 0) @numbers.visible = self.need_number? @numbers.n = $game_party.item_number(self.item_id) if @numbers.visible end def refresh self.show(*@action_ids) end def left_slide @leftslide_duration = 8 end def visible=(b) @window.visible = b @icons.each{|sprite| sprite.visible = b } @numbers.visible = (b and need_number?) end def need_number? return (self.item_id != nil) end def item_id return XAS::ITEM_COST[@action_ids[1]] end def update if @leftslide_duration > 0 @leftslide_duration -= 1 @icons[0].opacity = @leftslide_duration * 20 @icons[1].x = @x - 48 + @leftslide_duration * 6 @icons[1].y = @y + 16 - @leftslide_duration * 2 @icons[1].opacity = @leftslide_duration * 20 + 96 @icons[2].x = @x + 48 - (8 - @leftslide_duration) * 6 @icons[2].y = @y + 16 - (8 - @leftslide_duration) * 2 @icons[2].opacity = (8 - @leftslide_duration) * 20 + 96 if @leftslide_duration == 0 show(@action_ids[1], @action_ids[2], nil) end return end if @icons[0].visible @icons[0].x += 2 @icons[0].opacity -= 22 @icons[0].visible = false if @icons[0].opacity == 0 return end end end #================================================= ============================== # XAS - (C) Button Slash #================================================= ============================== class Game_Player < Game_Character alias xrxs64_cs_update update def update xrxs64_cs_update if Input.trigger?(XAS_CS::SLASH_BUTTON) unless self.action != nil or $game_system.map_interpreter.running? or $game_temp.message_window_showing or $game_map.starting? or self.knockbacking? if Input.press?(Input::UP) turn_up elsif Input.press?(Input: OWN)turn_down elsif Input.press?(Input::RIGHT) turn_right elsif Input.press?(Input::LEFT) turn_left end action_id = $game_variables[XAS_CS::SLASH_VARIABLE_ID] self.shoot(action_id) end end end end #================================================= ============================== # Game_Map #================================================= ============================== class Game_Map def starting? if $game_system.map_interpreter.running? return true end for event in $game_map.events.values return true if event.starting end return false end end #================================================= ============================== # Scene_Map #================================================= ============================== class Game_Player alias mog_xaswep_update update def update mog_xaswep_update actor = $game_party.actors[0] weapon_id = actor.weapon_id weapon_tool_id = XAS_BA::WEP_ID_TOOL[weapon_id] $game_variables[XAS_CS::SLASH_VARIABLE_ID] = weapon_tool_id end end #================================================= ============================== # XAS - SCENE_SKILL_AX (OPCIONAL) #================================================= ============================== # - Suporte para equipar as ferramentas através da janela de #Skill. # - Permite ganhar as ferramentas através do level como se #fossem skills normais. #================================================= ============================== module XAS_WINDOW_SKILL #Texto de Skill Equipada. EQUIPPED = "Equipado" #Texto de ajuda inicial. PRESS = "Pressione C para Equipar" #Botão para equipar a skill. BUTTON = Input::C #Ativar ou desativar o botão de Change para mudar as skills. ZBUTTON_ACTIVE = false # Ativar ganho de Ferramentas através do ganho de skill por level #e através da adição e remoção de Skill usando o comando de #eventos. (Somente com o botão change Ativado.) LVGAINGOOD = false end $xrxs["xas_good_ax"] = true #================================================= ============================== # Scene_Skill #================================================= ============================== class Scene_Skill alias mog_xasmain main def main @xastextime = 0 @xastextime2 = 450 @skill_text = Sprite.new @skill_text.bitmap = Bitmap.new(160,100) @skill_text.x = 700 @skill_text.y = 0 @skill_text.z = 9999 @skill_text.bitmap.font.name = "Georgia" @skill_text.bitmap.font.size = 24 @skill_text.bitmap.font.bold = true @skill_text.visible = false @skill_text.bitmap.draw_text(0, 0, 140, 64, XAS_WINDOW_SKILL::EQUIPPED,1) @skill_text2 = Sprite.new @skill_text2.bitmap = Bitmap.new(640,64) @skill_text2.x = 0 @skill_text2.y = 450 @skill_text2.z = 9999 @skill_text2.bitmap.font.name = "Georgia" @skill_text2.bitmap.font.size = 24 @skill_text2.bitmap.font.bold = true @skill_text2.visible = true @skill_text2.bitmap.draw_text(0, 20, 640, 64,XAS_WINDOW_SKILL::PRESS ,1) @skill_text2.opacity = @xastextime2 mog_xasmain @skill_text.dispose @skill_text2.dispose end alias mog_xasupdate update def update mog_xasupdate @xastextime -= 3 @xastextime2 -= 3 @skill_text.opacity = @xastextime @skill_text2.opacity = @xastextime2 if @xastextime <= 0 @xastextime = 0 @skill_text.visible = false end if @xastextime2 <= 0 @xastextime2 = 0 @skill_text2.visible = false end if @skill_text2.y > 400 @skill_text2.y -= 3 elsif @skill_text2.y <= 400 @skill_text2.y = 400 end if @skill_text.x > 480 @skill_text.x -= 10 elsif @skill_text.x <= 480 @skill_text.x = 480 end end alias mog_xasupdate_skill update_skill def update_skill mog_xasupdate_skill if Input.trigger?(XAS_WINDOW_SKILL::BUTTON) @skill = @skill_window.skill unless @actor.skill_can_use?(@skill.id) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.equip_se) $game_variables[XAS_Z::ACTION_VARIABLE_ID] = @skill.id @skill_text.visible = true @skill_text.x = 700 @skill_text.opacity = @xastextime @xastextime = 355 end end end #================================================= ============================== # Game_Actor #================================================= ============================== class Game_Actor < Game_Battler alias mog_xasgood_setup setup def setup(actor_id) mog_xasgood_setup(actor_id) for i in 1..@level for j in $data_classes[@class_id].learnings if j.level == i $game_party.gain_goods(j.skill_id) if XAS_WINDOW_SKILL::LVGAINGOOD == true end end end end end #================================================= ============================== # Game_Actor #================================================= ============================== class Interpreter alias mog_xasgood_command_318 command_318 def command_318 mog_xasgood_command_318 actor = $game_actors[@parameters[0]] if actor != nil if @parameters[1] == 0 $game_party.gain_goods(@parameters[2]) if XAS_WINDOW_SKILL::LVGAINGOOD == true else $game_party.goods.delete(@parameters[2]) if XAS_WINDOW_SKILL::LVGAINGOOD == true end end return true end end #================================================= ============================== # XAS - SCENE_ITEM_AX (OPCIONAL) #================================================= ============================== # - Suporte para equipar as ferramentas através da janela de # itens. #================================================= ============================== module XAS_WINDOW_ITEM #Definição da ID que ativará a Ferramenta ID. # XASITEM_ID = {A=>B, A=>B,...} # A = ID do Item # B = ID da Ferramenta XASITEM_ID = { # A B Nome do item 1=>8, # Potion 2=>9, # HI-Potion 3=>10, # Ether 4=>11, # HI-Ether 5=>12, # Remedy 6=>13, # Elixir 7=>14 # Bomb } #Texto de item Equipado. EQUIPPED = "Equipado" #Texto de ajuda inicial. PRESS = "Pressione C para Equipar" #Botão para equipar o item. BUTTON = Input::C end ############## # Scene_Item # ############## class Scene_Item alias mog_xasmain main def main @xastextime = 0 @xastextime2 = 450 @item_text = Sprite.new @item_text.bitmap = Bitmap.new(160,100) @item_text.x = 700 @item_text.y = 0 @item_text.z = 9999 @item_text.bitmap.font.name = "Georgia" @item_text.bitmap.font.size = 24 @item_text.bitmap.font.bold = true @item_text.visible = false @item_text.bitmap.draw_text(0, 0, 140, 64, XAS_WINDOW_ITEM::EQUIPPED,1) @item_text2 = Sprite.new @item_text2.bitmap = Bitmap.new(640,64) @item_text2.x = 0 @item_text2.y = 450 @item_text2.z = 9999 @item_text2.bitmap.font.name = "Georgia" @item_text2.bitmap.font.size = 24 @item_text2.bitmap.font.bold = true @item_text2.visible = true @item_text2.bitmap.draw_text(0, 20, 640, 64,XAS_WINDOW_ITEM::PRESS ,1) @item_text2.opacity = @xastextime2 mog_xasmain @item_text.dispose @item_text2.dispose end alias mog_xasupdate update def update mog_xasupdate @xastextime -= 3 @xastextime2 -= 3 @item_text.opacity = @xastextime @item_text2.opacity = @xastextime2 if @xastextime <= 0 @xastextime = 0 @item_text.visible = false end if @xastextime2 <= 0 @xastextime2 = 0 @item_text2.visible = false end if @item_text2.y > 400 @item_text2.y -= 3 elsif @item_text2.y <= 400 @item_text2.y = 400 end if @item_text.x > 480 @item_text.x -= 10 elsif @item_text.x <= 480 @item_text.x = 480 end end alias mog_xas_update_item update_item def update_item mog_xas_update_item if Input.trigger?(XAS_WINDOW_ITEM::BUTTON) @item = @item_window.item unless @item.is_a?(RPG::Item) $game_system.se_play($data_system.buzzer_se) return end unless $game_party.item_can_use?(@item.id) $game_system.se_play($data_system.buzzer_se) return end item_id = @item.id item_tool_id = XAS_WINDOW_ITEM::XASITEM_ID[@item.id] if item_tool_id != nil $game_system.se_play($data_system.equip_se) @item_text.visible = true @item_text.x = 700 @item_text.opacity = @xastextime @xastextime = 355 $game_variables[XAS_Z::ACTION_VARIABLE_ID] = item_tool_id end end end end module Database_Bullet action_id = 1 SUFLAGS[action_id] = 22 DURATIONS[action_id] = 22 SELF_MOTIONS[action_id] = "_SWD_01" plan = [] plan[5] = action_id ATTACK_ID_PLANS[action_id] = plan ATTACK_RANGE_TYPES[action_id] = SQUARE ATTACK_RANGE_PLANS[action_id] = [1] BLOW_POWERS[action_id] = 1 SELF_ANIMATION_PLANS[action_id] = [] SELF_DAMAGES[action_id] = false PLAYER_DAMAGES[action_id] = false IGNORE_INVINCIBLES[action_id] = true end module Database_Bullet action_id = 2 SUFLAGS[action_id] = 20 DURATIONS[action_id] = 20 SELF_MOTIONS[action_id] = "_SHD_01" ATTACK_ID_PLANS[action_id] = [action_id] ATTACK_RANGE_TYPES[action_id] = LINE ATTACK_RANGE_PLANS[action_id] = [1] BLOW_POWERS[action_id] = 5 SELF_ANIMATION_PLANS[action_id] = [] SELF_DAMAGES[action_id] = false PLAYER_DAMAGES[action_id] = false IGNORE_INVINCIBLES[action_id] = false end Hud:
Spoiler
#_________________________________________________ ______________________________
# MOG_MPW ICON V1.0 #_________________________________________________ ______________________________ # By Moghunter # http://www.atelier-rgss.com #_________________________________________________ ______________________________ # HUD que apresenta o HP e SP em forma de ícones. # # É preciso ter as imagens: # HP_Icon # HP_Icon_Back # SP_Icon # SP_Icon_Back # Nome_do_Heroi_Face (Opcional) # Dentro da pasta Graphics/Pictures. # # NOTA - O script vai calcular cada ícone pela porcentagem de # HP ou SP, ou seja, não é porque você toma um ponto de dano # que você vai perder um ícone de HP (a não ser que seu HP final # seja igual a quantidade final de ícones. # #------------------------------------------------------------------------------- module MOG #Posição do HUD. STMAPX = 0 # X Pos STMAPY = 0 # Y Pos #Switch que desativa o HUD. STMAPVIS = 5 #Quantidade maxima final de ícones para o HP. MAX_ICON_HP = 20 #Quantidade maxima final de ícones para o SP. MAX_ICON_SP = 20 #Espaço entre os ícones de HP na horizontal. HP_ICON_SPACE_X = 20 #Espaço entre os ícones de SP na horizontal. SP_ICON_SPACE_X = 10 #Espaço entre a primeira linha de ícones com a segunda linha. #(Somente se a DIV_HP_LINE estiver como true) HP_ICON_SPACE_Y = 48 #Espaço entre a primeira linha de ícones com a segunda linha. #(Somente se a DIV_SP_LINE estiver como true) SP_ICON_SPACE_Y = 64 #Deixar os ìcones de HP em 2 linhas quando o HP #passar da metade do valor maximo final. DIV_HP_LINE = true #Deixar os ìcones de SP em 2 linhas quando o SP #passar da metade do valor maximo final. DIV_SP_LINE = false #Mostrar a condição do personagem. SHOW_STATES = true end $mogscript = {} if $mogscript == nil $mogscript["mpstelen"] = true ############## # Game_Actor # ############## class Game_Actor < Game_Battler attr_reader :final_maxhp attr_reader :final_maxsp def final_maxhp return $data_actors[@actor_id].parameters[0,$data_actors[@actor_id].final_level] end def final_maxsp return $data_actors[@actor_id].parameters[1,$data_actors[@actor_id].final_level] end end ############### # Window_Base # ############### class Window_Base < Window def draw_maphp2(actor, x, y) one_icon_hp_max = actor.final_maxhp * MOG::MAX_ICON_HP / actor.final_maxhp valor = 100 * actor.final_maxhp / 100 valor2 = 100 * actor.hp / 100 valor3 = one_icon_hp_max * valor2 / valor valor4 = 100 * actor.maxhp / 100 valor5 = one_icon_hp_max * valor4 / valor valor6 = one_icon_hp_max * valor / valor now_hp = RPG::Cache.icon("HP_Icon") now_cw = now_hp.width now_ch = now_hp.height now_hp_src_rect = Rect.new(0, 0, now_cw, now_ch) max_hp = RPG::Cache.icon("HP_Icon_Back") max_cw = max_hp.width max_ch = max_hp.height max_hp_src_rect = Rect.new(0, 0, max_cw, max_ch) if valor5 < 1 valor5 = 1 end if valor3 < 1 and actor.hp > 0 valor3 = 1 elsif valor3 <= 0 valor3 = 0 end if MOG: IV_HP_LINE == truediv = valor6 / 2 if valor5 < div for r in 0...valor5 x = r * MOG::HP_ICON_SPACE_X self.contents.blt(x + 80, y - max_ch + 30, max_hp, max_hp_src_rect) end else for r in 0...div x = r * MOG::HP_ICON_SPACE_X self.contents.blt(x + 80, y - max_ch + 30, max_hp, max_hp_src_rect) end for r in div...valor5 x = r * MOG::HP_ICON_SPACE_X self.contents.blt(x + 80 - MOG::HP_ICON_SPACE_X * div, y - max_ch + MOG::HP_ICON_SPACE_Y, max_hp, max_hp_src_rect) end end else for r in 0...valor5 x = r * MOG::HP_ICON_SPACE_X self.contents.blt(x + 80, y - max_ch + 30, max_hp, max_hp_src_rect) end end if MOG: IV_HP_LINE == truediv2 = valor6 / 2 if valor3 < div2 for i in 0...valor3 x = i * MOG::HP_ICON_SPACE_X self.contents.blt(x + 80, y - now_ch + 30, now_hp, now_hp_src_rect) end else for i in 0...div2 x = i * MOG::HP_ICON_SPACE_X self.contents.blt(x + 80, y - now_ch + 30, now_hp, now_hp_src_rect) end for i in div2...valor3 x = i * MOG::HP_ICON_SPACE_X self.contents.blt(x + 80 - MOG::HP_ICON_SPACE_X * div2, y - now_ch + MOG::HP_ICON_SPACE_Y, now_hp, now_hp_src_rect) end end else for i in 0...valor3 x = i * MOG::HP_ICON_SPACE self.contents.blt(x + 80, y - now_ch + 30, now_hp, now_hp_src_rect) end end end def draw_mapsp2(actor, x, y) one_icon_sp_max = actor.final_maxsp * MOG::MAX_ICON_SP / actor.final_maxsp valor = 100 * actor.final_maxsp / 100 valor2 = 100 * actor.sp / 100 valor3 = one_icon_sp_max * valor2 / valor valor4 = 100 * actor.maxsp / 100 valor5 = one_icon_sp_max * valor4 / valor valor6 = one_icon_sp_max * valor / valor now_sp = RPG::Cache.icon("SP_Icon") now_cw = now_sp.width now_ch = now_sp.height now_sp_src_rect = Rect.new(0, 0, now_cw, now_ch) max_sp = RPG::Cache.icon("SP_Icon_Back") max_cw = max_sp.width max_ch = max_sp.height max_sp_src_rect = Rect.new(0, 0, max_cw, max_ch) if valor5 < 1 valor5 = 1 end if valor3 < 1 and actor.sp > 0 valor3 = 1 elsif valor3 <= 0 valor3 = 0 end if MOG: IV_SP_LINE == truediv = valor6 / 2 if valor5 < div for r in 0...valor5 x = r * MOG::SP_ICON_SPACE_X self.contents.blt(x + 80, y - max_ch + 30, max_sp, max_sp_src_rect) end else for r in 0...div x = r * MOG::SP_ICON_SPACE_X self.contents.blt(x + 80, y - max_ch + 30, max_sp, max_sp_src_rect) end for r in div...valor5 x = r * MOG::SP_ICON_SPACE_X self.contents.blt(x + 80 - MOG::SP_ICON_SPACE_X * div, y - max_ch + MOG::SP_ICON_SPACE_Y, max_sp, max_sp_src_rect) end end else for r in 0...valor5 x = r * MOG::SP_ICON_SPACE_X self.contents.blt(x + 80, y - max_ch + 30, max_sp, max_sp_src_rect) end end if MOG: IV_SP_LINE == truediv = valor6 / 2 if valor5 < div for r in 0...valor3 x = r * MOG::SP_ICON_SPACE_X self.contents.blt(x + 80, y - now_ch + 30, now_sp, now_sp_src_rect) end else for r in 0...div x = r * MOG::SP_ICON_SPACE_X self.contents.blt(x + 80, y - now_ch + 30, now_sp, now_sp_src_rect) end for r in div...valor3 x = r * MOG::SP_ICON_SPACE_X self.contents.blt(x + 80 - MOG::SP_ICON_SPACE_X * div, y - now_ch + MOG::SP_ICON_SPACE_Y, now_sp, now_sp_src_rect) end end else for i in 0...valor3 x = i * MOG::SP_ICON_SPACE_X self.contents.blt(x + 80, y - now_ch + 30, now_sp, now_sp_src_rect) end end end def nada face = RPG::Cache.picture("") end def draw_heroface(actor,x,y) face = RPG::Cache.picture(actor.name + "_face") rescue nada cw = face.width ch = face.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, face, src_rect) end def draw_actor_statemap(actor, x, y) self.contents.font.size = 16 self.contents.font.name = "Georgia" text = make_battler_state_text(actor, width, true) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 1, y + 1, 120, 32, text,1) self.contents.font.color = Color.new(250,255,255,255) self.contents.draw_text(x, y, 120, 32, text,1) end end ##################### # Window_Status_Map # ##################### class Window_Sthero < Window_Base def initialize super(0, 0, 640, 160) self.contents = Bitmap.new(width - 32, height - 32) self.windowskin = RPG::Cache.windowskin("") self.contents.font.bold = true self.contents.font.size = 20 self.contents.font.name = "Georgia" self.opacity = 0 refresh end def refresh self.contents.clear actor = $game_party.actors[0] draw_maphp2(actor,0, 0) draw_mapsp2(actor, - 50, 50) draw_heroface(actor, 0, 80) draw_actor_statemap(actor, 0, 75) if MOG::SHOW_STATES == true end end ############### # Game_Player # ############### class Game_Player < Game_Character attr_accessor :wref end ############# # Scene_Map # ############# class Scene_Map alias mog11_main main def main @sthero = Window_Sthero.new @sthero.x = MOG::STMAPX @sthero.y = MOG::STMAPY if $game_switches[MOG::STMAPVIS] == false @sthero.visible = true else @sthero.visible = false end mog11_main @sthero.dispose end alias mog11_update update def update if $game_switches[MOG::STMAPVIS] == false @sthero.visible = true else @sthero.visible = false end if $game_player.wref == true @sthero.refresh $game_player.wref = false end mog11_update end end ############## # Game_Party # ############### class Game_Party alias mog11_check_map_slip_damage check_map_slip_damage def check_map_slip_damage for actor in @actors if actor.hp > 0 and actor.slip_damage? $game_player.wref = true end end mog11_check_map_slip_damage end end ############### # Interpreter # ############### class Interpreter alias mog11_command_311 command_311 def command_311 mog11_command_311 $game_player.wref = true end alias mog11_command_312 command_312 def command_312 mog11_command_312 $game_player.wref = true end alias mog11_command_313 command_313 def command_313 mog11_command_313 $game_player.wref = true end alias mog11_command_314 command_314 def command_314 mog11_command_314 $game_player.wref = true end alias mog11_command_315 command_315 def command_315 mog11_command_315 $game_player.wref = true end end ################ # Game_Battler # ################ class Game_Battler alias mog11_attack_effect attack_effect def attack_effect(attacker) mog11_attack_effect(attacker) $game_player.wref = true end alias mog11_skill_effect skill_effect def skill_effect(user, skill) mog11_skill_effect(user, skill) $game_player.wref = true end alias mog11_item_effect item_effect def item_effect(item) mog11_item_effect(item) $game_player.wref = true end alias mog11_add_state add_state def add_state(state_id, force = false) mog11_add_state(state_id, force = false) $game_player.wref = true end end Instrucciones: Pegas los dos scripts sobre main y listo PD: necesitas recursos del chara atacando y debilitado |
|
#80
|
|||
|
|||
|
Cita:
|
![]() |
| Herramientas | |
| Desplegado | |
|
|
Temas Similares para: Aportes de Scripts RPG-Maker
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Informacion sobre el rpg maker | polo4 | Cafetería | 3 | 20-nov-2009 05:17 |
| ¡Recopilemos Scripts! | Lord Fernando | RPG Maker | 4 | 06-dic-2008 00:54 |
| Rpg Maker Xp -TEMA OFICIAL- | neo_crimsom | RPG Maker | 1025 | 25-nov-2007 07:29 |
| Club general de Naruto | ~Xex | Zona Otaku | 2449 | 17-oct-2007 18:51 |
| Tutoriales en Video del RPG Maker xp por: savioWEB | savioWED | Añade tus manuales | 46 | 10-oct-2007 21:03 |













Mode Lineal
