qualcuno,mi potrebbe convertire questo script da vx ace a vx?
Spoiler
=begin
#==============================================================================
** Reverse Time
Author: Hime
Date: Sep 30, 2012
------------------------------------------------------------------------------
** Change log
Sep 30
- initial release
------------------------------------------------------------------------------
** Terms of Use
* Free to use in non-commercial projects
* Contact me for commercial use
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Preserve this header
-------------------------------------------------------------------------------
** Required
-Action History (http://www.rpgmakerv...4-reverse-time/)
-------------------------------------------------------------------------------
This script allows you to reverse the flow of time in a battle and
undo the results of actions that have been performed. Actions and result
histories are cleared at the end of the battle.
It does not actually undo actions, so items that have been consumed are not
returned. However, it literally turns back time by decreasing the number
of turns elapsed.
To reverse time, simply make a script call
$game_temp.reverse_time(n, reverse_turns?)
For some number of turns n.
You can also pass in "false" as the second argument if you don't want
the turn count to decrease.
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Tsuki_ReverseTime"] = true
#==============================================================================
# ** Configuration
#==============================================================================
module Tsuki
module Reverse_Time
end
end
#==============================================================================
# ** Rest of the script
#==============================================================================
class Game_Temp
# undo's the past n actions
def reverse_time(n, reverse_turns=true)
@reverse_turns = reverse_turns
$game_party.reverse_time(n)
$game_troop.reverse_time(n)
end
def reverse_turns?
@reverse_turns
end
end
class Game_Battler
# Turn 0 is the start of the battle. This is pre-battle processing.
# Turn 1 is when you begin inputting your first actions, and I don't want
# to return before turn 1. Maybe later something will be worked out.
def reverse_time(turns)
target_turn = [$game_troop.turn_count - turns, 1].max
while last_result.turn_count >= target_turn
act = pop_action # not too sure about this...
res = pop_result
reverse_damage(res)
reverse_states(res)
end
end
def reverse_damage(result)
@hp += result.total_hp_damage
@mp += result.total_mp_damage
@tp += result.total_tp_damage
end
def reverse_states(result)
reverse_added_states(result)
reverse_removed_states(result)
reverse_added_buffs(result)
reverse_removed_buffs(result)
# don't know how debuffs work
end
def reverse_added_states(result)
result.total_added_states.each {|state_id| remove_state(state_id) }
end
def reverse_removed_states(result)
result.total_removed_states.each {|state_id| add_state(state_id) }
end
def reverse_added_buffs(result)
result.total_added_buffs.each {|param_id| remove_buff(param_id) }
end
def reverse_removed_buffs(result)
result.total_removed_buffs.each {|param_id| add_buff(param_id) }
end
end
class Game_Unit
def reverse_time(turns)
members.each {|member|
member.reverse_time(turns)
}
end
end
class Game_Troop
def reverse_time(turns)
super
@turn_count = [@turn_count - turns, 1].max if $game_temp.reverse_turns?
end
end
Modificato da mew47, 10 January 2015 - 05:18 AM.