| 赞 | 14 |
| VIP | |
| 好人卡 | |
| 积分 | 25 |
| 经验 | |
| 最后登录 | 2024-3-12 |
| 在线时间 | 912 小时 |
- 梦石
- 0
- 星屑
- 2457
- 在线时间
- 912 小时
- 注册时间
- 2014-10-14
- 回帖
- 1155

|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 j296196585 于 2016-11-12 11:04 编辑
[code]#===============================================================================
#===============================================================================
# 击败过程/宝物/伤害弹窗
#===============================================================================
#===============================================================================
#===============================================================================
# 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
#===============================================================================
# Sprite_Character
#===============================================================================
class Sprite_Character < RPG::Sprite
include XRXS_DAMAGE_OFFSET
end
#===============================================================================
# module RPG
#===============================================================================
module RPG
class Sprite < ::Sprite
#--------------------------------------------------------------------------
# 崩坏
#--------------------------------------------------------------------------
def collapse
self.opacity = 255
@_collapse_duration = 70
@_whiten_duration = 0
@_appear_duration = 0
@_escape_duration = 0
end
end
end
#===============================================================================
# XRXS_CharacterDamagePop
#===============================================================================
module XRXS_CharacterDamagePop
#--------------------------------------------------------------------------
# 崩坏效果刷新
#--------------------------------------------------------------------------
def collapse_effect_update
if @battler.is_a?(Game_Enemy) and
XAS_BA_ENEMY::ITEM_ENEMY.include?(@battler.id)
@character.opacity = 0
else
@character.opacity = 256 - (70 - @_collapse_duration) * 3
if @battler.is_a?(Game_Enemy) and
XAS_BA_ENEMY::COLLAPSE_ZOOM_A.include?(@battler.id)
self.zoom_x -= 0.02
self.zoom_y += 0.2
elsif @battler.is_a?(Game_Enemy) and
XAS_BA_ENEMY::COLLAPSE_ZOOM_B.include?(@battler.id)
self.zoom_x += 0.05
self.zoom_y -= 0.02
elsif @battler.is_a?(Game_Enemy) and
XAS_BA_ENEMY::COLLAPSE_ZOOM_C.include?(@battler.id)
self.zoom_x += 0.05
self.zoom_y += 0.05
elsif @battler.is_a?(Game_Enemy) and
XAS_BA_ENEMY::COLLAPSE_ZOOM_D.include?(@battler.id)
self.zoom_x -= 0.01
self.zoom_y -= 0.01
elsif @battler.is_a?(Game_Enemy) and
XAS_BA_ENEMY::COLLAPSE_ZOOM_E.include?(@battler.id)
if @_collapse_duration > 30
self.zoom_x += 0.04
self.zoom_y -= 0.02
else
self.zoom_x -= 0.1
self.zoom_y += 0.5
end
end
end
end
#--------------------------------------------------------------------------
# 声音刷新
#--------------------------------------------------------------------------
def voice_update
if @battler.is_a?(Game_Actor) and
$game_system.fly == false
#声音类型 -----------------------
#击空
if @battler.damage == "Miss"
voice = XAS_VOICE::HEROMISS
#击败
elsif @battler.damage.is_a?(Numeric) and
@battler.hp == 0
voice = XAS_VOICE::HERODEFEAT
#暴击
elsif @battler.critical == true and
voice = XAS_VOICE::HEROCRITICAL
#普通伤害
elsif @battler.damage.is_a?(Numeric) and
@battler.damage.to_i > 0
voice = XAS_VOICE::HERODAMAGE
#升级
elsif @battler.damage == XAS_BA::LEVEL_UP_TEXT
voice = XAS_VOICE::LEVEL_UP_VOICE
end
#声音活跃 --------------------
if voice != nil
Audio.se_play("Audio/SE/" + voice[rand(voice.size)],130,100) rescue nil
end
else
#声音类型
if @battler.critical == true and not
XAS_BA_ENEMY::ITEM_ENEMY.include?(@battler.id)
voice = XAS_VOICE::ENEMYCRITICAL
elsif @battler.damage.is_a?(Numeric) and
@battler.damage.to_i > 0 and
XAS_VOICE::ENEMY_DAMAGE.include?(@battler.id)
voice = XAS_VOICE::ENEMY_DAMAGE[@battler.id]
end
#声音活跃
if voice != nil
if voice != nil
Audio.se_play("Audio/SE/" + voice[rand(voice.size)],130,100) rescue nil
end
end
end
end
#--------------------------------------------------------------------------
# 刷新
#--------------------------------------------------------------------------
def update
super
if @battler == nil
return
end
@battler.hit_it -= 1 if @battler.hit_it > 0
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
if XAS_ABS_SETUP::DAMAGE_POP == true
unless XAS_BA_ENEMY::ITEM_ENEMY.include?(@battler.id) or
@battler.no_damage == true
if $xrxs_damage_pop != nil
damage(@battler.damage, @battler.critical,@battler.state,@battler.item)
else
damage(@battler.damage, @battler.critical)
end
end
end
voice_update
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
if $xrxs_damage_pop != nil
@battler.state = false
@battler.item = false
end
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_se) if not XAS_BA_ENEMY::ITEM_ENEMY.include?(@battler.id)
else
$game_system.se_play($data_system.actor_collapse_se)
end
collapse
@battler_visible = false
end
else
if @_collapse_duration > 0
@_collapse_duration -= 1
collapse_effect_update
if @_collapse_duration == 0
@character.collapse_done = true
end
end
end
@character.collapse_duration = @_collapse_duration
@character.battler_visible = @battler_visible
end
end
#===============================================================================
# Sprite_Character
#===============================================================================
class Sprite_Character < RPG::Sprite
include XRXS_CharacterDamagePop
end
#===============================================================================
# Game_Event
#===============================================================================
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 $mog_rgss_ap_parameter != nil
$game_party.gain_ap(enemy.ap)
end
if last_level < $game_player.battler.level
$game_system.se_play(XAS_BA::LEVEL_UP_SE)
$game_player.battler.damage = XAS_BA::LEVEL_UP_TEXT
$game_player.battler.damage_pop = true
$game_player.need_refresh = true
$game_player.animation_id = XAS_BA::LEVEL_ANIMATION_ID
$game_temp.ifw_text = "Level UP!!! - L " + $game_player.battler.level.to_s
$game_temp.ifw_active = true
$game_temp.slow_motion = 30 if XAS_BA::LEVEL_SLOW_MOTION == true
if XAS_BA::LEVELUP_RECOVER == true
actor = $game_party.actors[0]
actor.hp = actor.maxhp
actor.sp = actor.maxsp
end
end
id = XAS_BA::DEFEAT_NUMBER_ID
$game_variables[id] += 1 if id != 0
switch_id = XAS_BA_ENEMY::DEFEAT_SWITCH_IDS[self.enemy_id]
jumpa(0,0,20) if XAS_BA_ENEMY::COLLAPSE_JUMP == true
if switch_id != nil
$game_switches[switch_id] = true
$game_map.refresh
end
end
end
#===============================================================================
# Game_Party
#===============================================================================
class Game_Party
#--------------------------------------------------------------------------
# 获得经验
#--------------------------------------------------------------------------
def gain_exp(exp)
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor.cant_get_exp? == false
actor.exp += exp
end
end
end
end
#===============================================================================
#===============================================================================
# 宝物
#===============================================================================
#===============================================================================
#===============================================================================
# XAS_BA_ItemDrop
#===============================================================================
module XAS_BA_ItemDrop
#--------------------------------------------------------------------------
# 击败过程
#--------------------------------------------------------------------------
def defeat_process
super
if self.battler.is_a?(Game_Enemy) and self.battler.dead? and
$game_map.passable?(self.x, self.y,2) and
terrain_tag != XAS::FALL_TERRAIN
treasure = nil
enemy = self.battler
if rand(100) < enemy.treasure_prob and
self.battler.steal == false
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
else
# 多重掉落
tesouro = XAS_BA_ENEMY::ENEMY_MULTI_TREASURE[enemy.id]
if tesouro != nil
item_2treasure = tesouro[rand(tesouro.size)]
end
if item_2treasure != nil
treasure_type = item_2treasure[0]
treasure_id = item_2treasure[1]
treasure_prob = item_2treasure[2]
if rand(100) < treasure_prob
if treasure_type == 0
treasure = $data_items[treasure_id]
end
if treasure_type == 1
treasure = $data_weapons[treasure_id]
end
if treasure_type == 2
treasure = $data_armors[treasure_id]
end
end
end
end
if treasure != nil
item_se = XAS::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
item_number = XAS::ITEM_NUMBER[treasure.id]
if item_number != nil and treasure.is_a?(RPG::Item)
list[0] = RPG::EventCommand.new(opecode, 0, [treasure.id,0,0,item_number])
else
list[0] = RPG::EventCommand.new(opecode, 0, [treasure.id,0,0,1])
end
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
page.through = true
page.condition.variable_id = 10000
page.condition.variable_value = 100 + (40 * MOG::XAS_ICON_ERASE_TIME)
event = RPG::Event.new(self.x, self.y)
event.pages = |
|