赞 | 0 |
VIP | 4 |
好人卡 | 0 |
积分 | 2 |
经验 | 31715 |
最后登录 | 2021-9-11 |
在线时间 | 829 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 180
- 在线时间
- 829 小时
- 注册时间
- 2010-6-26
- 帖子
- 671
|
7楼
楼主 |
发表于 2010-12-20 23:00:42
|
只看该作者
回复 shua1125 的帖子
啊,我错了,因为角色一共有4个,估计你蓄力也要有4组变量记录吧?如果是只有一个主角用还好……要不你还是研究一下这个脚本好了……- # Tension
- # 「テンションシステム」
- module TENSION
- ELEMENT_ID = 10 # テンションが 0 でない場合に付加される攻撃属性(ID)
- MESSAGE_FORMAT = "%sのテンションが %s になった!"
- TENSON_DOWN = "%sのテンションがもとにもどった!"
- OVER_TENSION = "%sはスーパーハイテンションになった!"
- end
- #____________________________________________________________________________
- class RPG::UsableItem < RPG::BaseItem
- def tension_up?
- return self.note.include?("<tension_up>")
- end
- #--------------------------------------------------------------------------
- def tension_clear?
- return self.note.include?("<tension_clear>")
- end
- #--------------------------------------------------------------------------
- def tension_down?
- return true if self.note.include?("<tension_down>")
- return true if self.tension_clear?
- return false
- end
- end
- #____________________________________________________________________________
- class Game_Battler
- attr_accessor :tension
- attr_reader :super_high_tension
- alias tension_system_initialize initialize
- def initialize
- tension_system_initialize
- @tension = 0
- end
- #--------------------------------------------------------------------------
- alias tension_system_claer_action_results clear_action_results
- def claer_action_results
- tension_system_claer_action_results
- @super_high_tension = false
- end
- #--------------------------------------------------------------------------
- def tension_value
- case @tension
- when 0; return 0
- when 1; return 5
- when 2; return 20
- when 3; return 50
- when 4; return 100
- end
- end
- #--------------------------------------------------------------------------
- alias tension_system_make_attack_damage_value make_attack_damage_value
- def make_attack_damage_value(attacker)
- tension_system_make_attack_damage_value(attacker)
- make_tension_damage_effect(attacker)
- end
- #--------------------------------------------------------------------------
- alias tension_system_make_obj_damage_value make_obj_damage_value
- def make_obj_damage_value(user, obj)
- tension_system_make_obj_damage_value(user, obj)
- make_tension_damage_effect(user, obj)
- end
- #--------------------------------------------------------------------------
- def make_tension_damage_effect(user, obj = nil)
- return if obj != nil and (obj.tension_up? or obj.tension_down?)
- case user.tension
- when 1; damage_rate = 170
- when 2; damage_rate = 300
- when 3; damage_rate = 500
- when 4; damage_rate = 750
- else ; return
- end
- @hp_damage = @hp_damage * damage_rate / 100
- @mp_damage = @mp_damage * damage_rate / 100
- end
- #--------------------------------------------------------------------------
- alias tension_system_skill_effect skill_effect
- def skill_effect(user, skill)
- original_element_set = nil
- if user.tension > 0
- original_element_set = skill.element_set.clone
- skill.element_set += [TENSION::ELEMENT_ID]
- end
- tension_system_skill_effect(user, skill)
- skill.element_set = original_element_set if original_element_set != nil
- tension_up_effect(user, skill) if skill.tension_up?
- tension_down_effect(user, skill) if skill.tension_down?
- end
- #--------------------------------------------------------------------------
- alias tension_system_item_effect item_effect
- def item_effect(user, item)
- original_element_set = nil
- if user.tension > 0
- original_element_set = item.element_set.clone
- skill.element_set += [TENSION::ELEMENT_ID]
- end
- tension_system_item_effect(user, item)
- item.element_set = original_element_set if original_element_set != nil
- tension_up_effect(user, item) if item.tension_up?
- tension_down_effect(user, item) if item.tension_down?
- end
- #--------------------------------------------------------------------------
- def tension_up_effect(user, obj)
- unless @tension < 4
- @missed = true
- return
- end
- @tension += 1; @missed = false
- @super_high_tension = true if @tension == 4
- end
- #--------------------------------------------------------------------------
- def tension_down_effect(user, obj)
- if @tension == 0
- @missed = true
- return
- end
- obj.tension_clear? ? @tension = 0 : @tension -= 1
- @missed = false
- end
- end
- class Game_Actor < Game_Battler
- alias tension_system_element_set element_set
- def element_set
- return tension_system_element_set + [TENSION::ELEMENT_ID] if @tension != 0
- return tension_system_element_set
- end
- end
- class Game_Enemy < Game_Battler
- def element_set
- return super + [TENSION::ELEMENT_ID] if @tension != 0
- return super
- end
- end
- class Scene_Battle < Scene_Base
- alias tension_system_battle_end battle_end
- def battle_end(result)
- $game_party.members.each{|member| member.tension = 0 }
- tension_system_battle_end(result)
- end
- #--------------------------------------------------------------------------
- alias tension_system_execute_action_attack execute_action_attack
- def execute_action_attack
- last_tension = @active_battler.tension
- tension_system_execute_action_attack
- if last_tension != 0
- @active_battler.tension = 0
- @message_window.clear
- text = sprintf(TENSION::TENSON_DOWN, @active_battler.name)
- @message_window.add_instant_text(text); wait(30)
- end
- end
- #--------------------------------------------------------------------------
- alias tension_system_execute_action_skill execute_action_skill
- def execute_action_skill
- last_tension = @active_battler.tension
- tension_system_execute_action_skill
- if last_tension != 0
- return if @active_battler.action.skill.base_damage == 0
- @active_battler.tension = 0
- @message_window.clear
- text = sprintf(TENSION::TENSON_DOWN, @active_battler.name)
- @message_window.add_instant_text(text); wait(30)
- end
- end
- #--------------------------------------------------------------------------
- alias tension_system_execute_action_item execute_action_item
- def execute_action_item
- last_tension = @active_battler.tension
- tension_system_execute_action_item
- if last_tension != 0
- return if @active_battler.action.item.base_damage != 0
- @active_battler.tension = 0
- @message_window.clear
- text = sprintf(TENSION::TENSON_DOWN, @active_battler.name)
- @message_window.add_instant_text(text); wait(30)
- end
- end
- #--------------------------------------------------------------------------
- alias tension_system_display_action_effects display_action_effects
- def display_action_effects(target, obj = nil)
- tension_system_display_action_effects(target, obj)
- display_tension_changes(target, obj)
- end
- #--------------------------------------------------------------------------
- alias tension_system_display_hp_damage display_hp_damage
- def display_hp_damage(target, obj = nil)
- return if target.hp_damage == 0 and
- obj != nil and (obj.tension_up? or obj.tension_down?)
- tension_system_display_hp_damage(target, obj)
- end
- #--------------------------------------------------------------------------
- alias tension_system_display_failure display_failure
- def display_failure(target, obj)
- return if obj != nil and (obj.tension_up? or obj.tension_down?)
- tension_system_display_failure(target, obj)
- end
- #--------------------------------------------------------------------------
- def display_tension_changes(target, obj)
- return if obj == nil
- return unless (obj.tension_up? or obj.tension_down?)
- @message_window.clear
- if target.super_high_tension
- format = TENSION::OVER_TENSION
- text = sprintf(format, target.name)
- elsif target.tension == 0
- format = TENSION::TENSON_DOWN
- text = sprintf(format, target.name)
- else
- format = TENSION::MESSAGE_FORMAT
- text = sprintf(format, target.name, target.tension_value)
- end
- @message_window.add_instant_text(text); wait(30)
- end
- end
复制代码 |
|