TP System+Blizz abs[Paying]

Started by chaucer, March 27, 2011, 01:00:31 am

Previous topic - Next topic

chaucer

March 27, 2011, 01:00:31 am Last Edit: April 16, 2011, 10:42:56 am by chaucer
is there anyway someone could edit mogs TP system to fit blizz abs? or point me in the right direction i think this is something i could do i just need to find a way to add the tp cost to blizz abs anyone kno a way? heres the script PM me the cost and time estimated to edit the script to fit blizz abs thanks.
Spoiler: ShowHide
#_______________________________________________________________________________
# MOG TP System V2.1        
#_______________________________________________________________________________
# By Moghunter            
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Troca o custo de SP por TP, ou seja, é possível definir
#que certas habilidades tenham o custo de TP no lugar do SP,
# O sistema é útil quando quisermos, por exemplo, que habilidades
#físicas não gastem SP mas outro parâmetro.
#_______________________________________________________________________________
module MOG
#Definição do nome do TP (Talent Points).  
TP_NAME = "SP "
#NOTA - Para mudar o nome do SP basta entrar no banco
#de dados na parte de System e mudar o nome de SP para outro
#nome, por exemplo, MP.
#-------------------------------------------------------------------------------
#Definição de quais habilidades terão o custo de TP.
#
#TP_COST = {A=>B, A=>B, ...}
#
#A = ID of SKILL.
#B = Cost of TP.
TP_COST = {
57=>1000,    #Cross Cut
58=>12,   #Feint Attack
59=>26,   #Hurricane
60=>40,   #Spiral Blade
61=>7,    #Leag Sweep
62=>15,   #Beast Slayer
63=>32,   #Thunder Pierce
64=>50,   #Screw Thrust
65=>6,    #Power Break
66=>13,   #Mind Break
67=>28,   #Aqua Buster
68=>32,   #Rolling Axe
73=>10,   #Bird Killer
74=>15    #Mute Arrow
         }  
#-------------------------------------------------------------------------------          
#Definição da quantidade inicial de TP.
#(Caso não especificado TP inicial igual a 1)
#
#A=>B
#
#A = ID of actor
#B = Initial TP.
INITP = {
1=>1000,
2=>70,
7=>15,
8=>20
        }
#-------------------------------------------------------------------------------
#Definição da quantidade de TP ganho ao fazer LV-UP.
#(Caso não especificado TP ganho igual a 1)
#
#A=>B
#
#A = ID of actor    
#B = Amount of TP per lvl.
TP_EXP = {
1=>0,
2=>0,
7=>0,
8=>0
        }
#-------------------------------------------------------------------------------
#Items that recover tp
#A=>B
#
#A = ID do Item
#B = Amount of tp
ITEM_TP_RECOVER = {
1=>10,
2=>999
}  
#-------------------------------------------------------------------------------
end

#===============================================================================
# Game_Actor
#===============================================================================
class Game_Actor < Game_Battler  
 attr_accessor   :tp
 attr_accessor   :maxtp
#--------------------------------------------------------------------------
# Setup
#--------------------------------------------------------------------------
 alias mog45_setup setup
 def setup(actor_id)
   mog45_setup(actor_id)  
   @maxtp = 0
   @maxtp_plus = 0
   @tp_exp = MOG::TP_EXP[actor_id]
   ini_tp = MOG::INITP[actor_id]
   if ini_tp != nil
     @base_tp = ini_tp
   else
     @base_tp = 0
   end
   if @tp_exp != nil
     tpx = (@tp_exp * @level) - @tp_exp
   else
     tpx = 1
   end
   @tp = @base_tp + tpx
 end
#--------------------------------------------------------------------------
# maxtp_plus
#--------------------------------------------------------------------------  
 def maxtp_plus
   if @tp_exp != nil and @level > 1  
     cal =  @tp_exp * @level
     return @maxtp_plus + cal - @tp_exp
   else
     return @maxtp_plus
   end
 end
#--------------------------------------------------------------------------
# maxtp
#--------------------------------------------------------------------------
 def maxtp
   n = [[@base_tp + maxtp_plus, 1].max, 9999].min
   return n
 end  
#--------------------------------------------------------------------------
# TP
#--------------------------------------------------------------------------
 def tp=(tp)
   @tp = [[tp, maxtp].min, 0].max
 end
end

#===============================================================================
# Game_Battler
#===============================================================================
class Game_Battler
 alias mog45_skill_can_use? skill_can_use?  
 def skill_can_use?(skill_id)
   tp_cost = MOG::TP_COST[skill_id]
   if tp_cost != nil and self.is_a?(Game_Actor)
     if tp_cost > self.tp
       return false
     end
   else
     if $data_skills[skill_id].sp_cost > self.sp
       return false
     end
   end
   if dead?
     return false
   end
   if $data_skills[skill_id].atk_f == 0 and self.restriction == 1
     return false
   end
   occasion = $data_skills[skill_id].occasion
   if $game_temp.in_battle
     return (occasion == 0 or occasion == 1)
   else
     return (occasion == 0 or occasion == 2)
   end
   return
   mog45_skill_can_use?(skill_id)    
 end
end

#===============================================================================
# Scene_Battle
#===============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# update_phase4_step5
#--------------------------------------------------------------------------  
 alias mog45_update_phase4_step5 update_phase4_step5
 def update_phase4_step5
   mog45_update_phase4_step5
   item_tp_recover_id = MOG::ITEM_TP_RECOVER[@item.id]
   if @active_battler.is_a?(Game_Actor) and @active_battler.current_action.kind == 2 and @item =! nil
     for target_tp in @target_battlers    
   if target_tp.is_a?(Game_Actor) and item_tp_recover_id != nil  
     target_tp.tp += item_tp_recover_id
     target_tp.damage = MOG::TP_NAME.to_s + item_tp_recover_id.to_s
     target_tp.damage_pop = true
   end  
   end
   end  
 end
#--------------------------------------------------------------------------
# make_skill_action_result
#--------------------------------------------------------------------------
 alias mog45_make_skill_action_result make_skill_action_result
 def make_skill_action_result
   @skill = $data_skills[@active_battler.current_action.skill_id]
   unless @active_battler.current_action.forcing
     unless @active_battler.skill_can_use?(@skill.id)
       $game_temp.forcing_battler = nil
       @phase4_step = 1
       return
     end
   end
   tp_cost = MOG::TP_COST[@skill.id]
   if tp_cost != nil and @active_battler.is_a?(Game_Actor)
     @active_battler.tp -= tp_cost
   else
     @active_battler.sp -= @skill.sp_cost
   end
   @status_window.refresh
   @help_window.set_text(@skill.name, 1)
   @animation1_id = @skill.animation1_id
   @animation2_id = @skill.animation2_id
   @common_event_id = @skill.common_event_id
   set_target_battlers(@skill.scope)
   for target in @target_battlers
     target.skill_effect(@active_battler, @skill)
   end
   return
   mog45_make_skill_action_result
 end
end  

#===============================================================================
# Game_Battler
#===============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# item_effect
#--------------------------------------------------------------------------  
 alias mog45_item_effect item_effect
 def item_effect(item)
   if $game_temp.in_battle == false  
   item_tp_recover = MOG::ITEM_TP_RECOVER[item.id]
   if item_tp_recover != nil
     if self.tp < self.maxtp
       self.tp += item_tp_recover
       return true
     else  
       return false
     end
       return false
     end
   end
   mog45_item_effect(item)
 end
end

#===============================================================================
# Interpreter
#===============================================================================
class Interpreter
#--------------------------------------------------------------------------
# command_314
#--------------------------------------------------------------------------    
 alias mog45_command_314 command_314
 def command_314
   mog45_command_314
   for i in 0...$game_party.actors.size
     actor = $game_party.actors[i]
     actor.tp = actor.maxtp
   end
   return true
 end
end

#===============================================================================
# Window_Base
#===============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# draw_actor_tp
#--------------------------------------------------------------------------      
 def draw_actor_tp(actor, x, y,type)
   self.contents.font.color = system_color  
   self.contents.draw_text(x, y, 32, 32, MOG::TP_NAME)
   self.contents.font.color = normal_color
   case type
   when 0
     self.contents.draw_text(x - 40, y, 198, 32, actor.tp.to_s + " / " + actor.maxtp.to_s, 2)
   when 1
     self.contents.draw_text(x - 70, y, 198, 32, actor.tp.to_s + " / " + actor.maxtp.to_s, 2)
   when 2
       self.contents.draw_text(x + 40, y, 80, 32, actor.tp.to_s,2)
   when 3
     self.contents.draw_text(x - 20, y, 150, 32, actor.tp.to_s + " / " + actor.maxtp.to_s, 2)
   when 4
     self.contents.font.name = "Georgia"
     self.contents.draw_text(x - 55, y, 130, 32, actor.tp.to_s, 2)
   end  
 end
#--------------------------------------------------------------------------
# draw_actor_tp2
#--------------------------------------------------------------------------
 def draw_actor_tp2(actor, x, y)
   self.contents.font.name = "Georgia"
   back = RPG::Cache.picture("STBAR_Back")    
   cw = back.width  
   ch = back.height
   src_rect = Rect.new(0, 0, cw, ch)    
   self.contents.blt(x + 86, y - ch + 40, back, src_rect)  
   meter = RPG::Cache.picture("STBAR.png")    
   cw2 = meter.width * actor.tp / actor.maxtp
   ch2 = meter.height
   src_rect2 = Rect.new(0, 0, cw2, ch2)    
   self.contents.blt(x + 86, y - ch + 40, meter, src_rect2)  
   self.contents.font.color = normal_color  
   self.contents.draw_text(x - 40, y, 198, 32, MOG::TP_NAME + actor.tp.to_s, 2)
 end
end

#===============================================================================
# Window_Help
#===============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# set_actor
#--------------------------------------------------------------------------        
 alias mog45_set_actor set_actor
 def set_actor(actor)
   if actor != @actor
     self.contents.clear
     draw_actor_name(actor, 4, 0)
     draw_actor_hp(actor, 110, 0)
     draw_actor_sp(actor, 460, 0)
     draw_actor_tp(actor, 284, 0,0)
     @actor = actor
     @text = nil
     self.visible = true
   end
   return
   mog45_set_actor(actor)
 end
end

#===============================================================================
# Window_SkillStatus
#===============================================================================
class Window_SkillStatus < Window_Base
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------        
 alias mog45_refresh refresh
 def refresh
   self.contents.clear
   draw_actor_name(@actor, 4, 0)
   draw_actor_hp(@actor, 110, 0)
   draw_actor_sp(@actor, 460, 0)
   draw_actor_tp(@actor, 284, 0,0)
   return
   mog45_refresh
 end
end  

#===============================================================================
#  Window_Status
#===============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------        
 alias mog45_refresh refresh
 def refresh
   mog45_refresh
   if $mog_rgss_Scene_Status != nil
     draw_actor_tp2(@actor, 435, 250)    
   else
     draw_actor_tp(@actor, 96, 170,0)  
   end  
 end  
end

#===============================================================================
#  Window_BattleStatus
#===============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------        
 alias mog45_refresh refresh
 def refresh
   self.contents.clear
   @item_max = $game_party.actors.size
   for i in 0...$game_party.actors.size
     actor = $game_party.actors[i]
     actor_x = i * 160 + 4
     draw_actor_name(actor, actor_x, 0)
     draw_actor_hp(actor, actor_x, 24, 120)
     draw_actor_sp(actor, actor_x, 48, 120)
     draw_actor_tp(actor, actor_x, 72,2)
     if @level_up_flags[i]
       self.contents.font.color = normal_color
       self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
     else
       draw_actor_state(actor, actor_x, 96)
     end
   end
 end  
end

#===============================================================================
#  Window_MenuStatus
#===============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------        
 alias mog45_refresh refresh
 def refresh
   self.contents.clear  
   mog45_refresh
   for i in 0...$game_party.actors.size
     x = 64
     y = i * 116
     actor = $game_party.actors[i]
     draw_actor_tp(actor, x + 236, y,1 )
   end
 end
end

#===============================================================================
# Window_Target
#===============================================================================
class Window_Target < Window_Selectable
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------        
 alias mog45_refresh refresh
 def refresh
   self.contents.clear
   for i in 0...$game_party.actors.size
     x = 4
     y = i * 116
     actor = $game_party.actors[i]
     draw_actor_name(actor, x, y)
     draw_actor_level(actor, x + 8, y + 32)
     draw_actor_state(actor, x + 8, y + 64)
     draw_actor_hp(actor, x + 152, y + 0)
     draw_actor_tp(actor, x + 152, y + 32,3)
     draw_actor_sp(actor, x + 152, y + 64)
   end
   return
   mog45_refresh  
 end
end

#===============================================================================
# Window_Skill
#===============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------        
 alias mog45_draw_item draw_item
 def draw_item(index)
   skill = @data[index]
   if @actor.skill_can_use?(skill.id)
     self.contents.font.color = normal_color
     else
     self.contents.font.color = disabled_color
     end
     x = 4 + index % 2 * (288 + 32)
     y = index / 2 * 32
     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
     bitmap = RPG::Cache.icon(skill.icon_name)
     opacity = self.contents.font.color == normal_color ? 255 : 128
     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
     self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
     tp_cost = MOG::TP_COST[skill.id]
     if tp_cost != nil
       self.contents.font.color = Color.new(50,250,150,255)
       self.contents.draw_text(x + 180, y, 48, 32,MOG::TP_NAME, 2)
       self.contents.font.color = Color.new(255,255,255,255)
       self.contents.draw_text(x + 232, y, 48, 32,tp_cost.to_s, 2)
     else
       self.contents.font.color = Color.new(250,150,50,255)  
       self.contents.draw_text(x + 180, y, 48, 32,$data_system.words.sp, 2)
       self.contents.font.color = Color.new(255,255,255,255)
       self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)  
   end
   return
   mog45_draw_item(index)
 end
end

#===============================================================================
# Scene_Skill
#===============================================================================
class Scene_Skill
#--------------------------------------------------------------------------
# update_target
#--------------------------------------------------------------------------        
 alias mog45_update_target update_target
 def update_target
   if Input.trigger?(Input::C)
   unless @actor.skill_can_use?(@skill.id)
     $game_system.se_play($data_system.buzzer_se)
     return
   end
   if @target_window.index == -1
     used = false
     for i in $game_party.actors
       used |= i.skill_effect(@actor, @skill)
     end
   end
   if @target_window.index <= -2
     target = $game_party.actors[@target_window.index + 10]
     used = target.skill_effect(@actor, @skill)
   end
   if @target_window.index >= 0
     target = $game_party.actors[@target_window.index]
     used = target.skill_effect(@actor, @skill)
   end
   if used
     $game_system.se_play(@skill.menu_se)
     tp_cost = MOG::TP_COST[@skill.id]
     if tp_cost != nil  
       @actor.tp -= tp_cost
     else
       @actor.sp -= @skill.sp_cost
     end        
     @status_window.refresh
     @skill_window.refresh
     @target_window.refresh
     if $game_party.all_dead?
       $scene = Scene_Gameover.new
       return
     end
     if @skill.common_event_id > 0
       $game_temp.common_event_id = @skill.common_event_id
       $scene = Scene_Map.new
       return
     end
     end
     unless used
       $game_system.se_play($data_system.buzzer_se)
     end
     return
   end
   mog45_update_target    
 end
end

$mog_rgss_TP_System = true
any help would be greatly apprieciated thank you :)

AliveDrive

Bump...

I took a look at it, and managed to fix the F12 restart freeze error xD

But not the original problem.
Quote from: Blizzard on September 09, 2011, 02:26:33 am
The permanent solution for your problem would be to stop hanging out with stupid people.