赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 690 |
最后登录 | 2013-12-4 |
在线时间 | 2 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 2 小时
- 注册时间
- 2013-12-3
- 帖子
- 5
|
3楼
楼主 |
发表于 2013-12-3 22:27:07
|
只看该作者
wwwcctvty 发表于 2013-12-3 20:28
对象找不到对应的方法.楼主最好放上整个脚本
有点长
class ARPG_BATTLE
HP_BAR_DISP_TIME = 50 # 敌人血条消失时间
ENEMY_HP = 1 # 敌人回血的技能ID #-___-无视这个`要敌人会加血的话直接在敌人的技能数组里加上恢复HP的技能就好了``
YC = false # 敌人被攻击是否增加延迟
KEYS = {
"A"=>$R_Key_A,
"S"=>$R_Key_S,
"D"=>$R_Key_D,
"F"=>$R_Key_F,
"G"=>$R_Key_G,
"Q"=>$R_Key_Q,
"W"=>$R_Key_W,
"E"=>$R_Key_E,
"R"=>$R_Key_R,
"T"=>$R_Key_T,
}#Kboard.trigger?
LVUP_ME = "Audio/ME/OS_13.wav" # 升级音效
$refresh = {} # 全局化一个刷新列表
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
@actor = $game_party.actors[0]
@x = $game_player.x
@y = $game_player.y
@d = $game_player.direction
# 血条消失的时间
@hp_disp_time = 0
# 攻击延迟
@actor_atktime = 0
@bullets = []
# 敌人攻击延迟
# 事件ID->延迟时间
@event_atk = {}
for event in $game_map.events.values
next if !event.is_enemy?
@event_atk[event.id] = 0
end
#--------------------------------------------------------------------------
# ● 以下左岸添加,获取地图上的队友,事件名称用ISDY开头
#--------------------------------------------------------------------------
@party_id=[]
@pretect=[]
for event in $game_map.events.values
if event.name.size>4
@Is_party=event.name[0,4]
#Mess_Text.write("#{@Is_party}")
if @Is_party=="ISDY"
@party_id.push(event.name[4,3].to_i)
s = event.name.split(/,/)[1].nil? ? 0 : event.name.split(/,/)[1]
#Mess_Text.write("#{s}")
@pretect.push(s)
# Mess_Text.write("获取到isdy,#{event.name[4,3]}")
else
# Mess_Text.write("未获取到isdy,,#{event.id}")
end
end
end
end
#--------------------------------------------------------------------------
# ● 以上左岸添加,获取地图上的队友
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
@sprite.dispose if [email protected]?
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def update
if @hp_disp_time >= 0
@hp_disp_time -= 1
if @hp_disp_time <= 0
@attev = nil
end
end
if @actor_atktime > 0
@actor_atktime -= 1
end
update_actor
update_event
end
#--------------------------------------------------------------------------
# ● 刷新事件
#--------------------------------------------------------------------------
def update_event
for event in $game_map.events.values
next if !event.is_enemy?
if @event_atk[event.id]> 0
@event_atk[event.id] -= 1
end
new_x = event.x + (event.direction == 6 ? 1 : event.direction == 4 ? -1 : 0)
new_y = event.y + (event.direction == 2 ? 1 : event.direction == 8 ? -1 : 0)
if event.hp <= event.maxhp*0.4 and rand(101)>100-event.escape_rand and event.escape? and event.sp >= $game_skills[ENEMY_HP].sp_cost
if (event.x - $game_player.x).abs < 64 and
(event.y - $game_player.y).abs < 64
for i in 0..randg(2,3)
break if rand(100) < 10
event.move_away_from_player
end
end
damage_skill_enemy(event, $game_skills[ENEMY_HP])
break
end
if new_x == @x and new_y == @y and @event_atk[event.id] <= 0
if event.skill.size > 0 and rand(101)>100-event.skill_rand
skill = event.skill[rand(event.skill.size)]
damage_skill_enemy(event, $game_skills[skill])
break
end
dagame_acon_actor(@actor,event_damage(event,@actor),event.animation2_id,event)
break
end
end
end
#--------------------------------------------------------------------------
# ● 判断可否移动
#--------------------------------------------------------------------------
def move?
if @actor.states.size == 0
return true
end
for i in @actor.states
if $data_states.restriction == 4
return false
end
end
return true
end
#--------------------------------------------------------------------------
# ● 是否可以用技能
#--------------------------------------------------------------------------
def skill?
if @actor.states.size == 0
return true
end
for i in @actor.states
if $data_states.restriction == 1
return false
end
end
return true
end
#--------------------------------------------------------------------------
# ● 刷新角色
#--------------------------------------------------------------------------
def update_actor
refresh(0) if @x != $game_player.x
refresh(1) if @y != $game_player.y
refresh(2) if @d != $game_player.direction
update_actor_attk if move?
update_actor_skill if move? and skill?
update_actor_item
update_bullet if @bullets.size > 0
end
#--------------------------------------------------------------------------
# ● 刷按下物品键时
#--------------------------------------------------------------------------
def update_actor_item
if Kboard.trigger?($R_Key_Z)
item = $data_items[@actor.item_key["Z"]]
return if item.nil?
item_effect(item)
if item.common_event_id > 0
$game_temp.common_event_id = item.common_event_id
end
end
if Kboard.trigger?($R_Key_X)
item = $data_items[@actor.item_key["X"]]
return if item.nil?
item_effect(item)
if item.common_event_id > 0
$game_temp.common_event_id = item.common_event_id
end
end
if Kboard.trigger?($R_Key_C)
item = $data_items[@actor.item_key["C"]]
return if item.nil?
item_effect(item)
if item.common_event_id > 0
$game_temp.common_event_id = item.common_event_id
end
end
if Kboard.trigger?($R_Key_V)
item = $data_items[@actor.item_key["V"]]
return if item.nil?
item_effect(item)
if item.common_event_id > 0
$game_temp.common_event_id = item.common_event_id
end
end
if Kboard.trigger?($R_Key_B)
item = $data_items[@actor.item_key["B"]]
return if item.nil?
item_effect(item)
if item.common_event_id > 0
$game_temp.common_event_id = item.common_event_id
end
end
def item_effect(item)
damage = @actor.item_effect(item)
$game_player.animation_id = item.animation2_id
$game_system.se_play(item.menu_se)
if item.consumable
$game_party.lose_item(item.id,1)
end
$refresh["item"] = true
end
end
#--------------------------------------------------------------------------
# ● 刷新按下技能键时
#--------------------------------------------------------------------------
def update_actor_skill
if @actor_atktime <= 0
if Kboard.trigger?(KEYS["A"])
skill = $game_skills[@actor.key["A"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs, skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
$game_temp.common_event_id = skill.common_event_id
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
if Kboard.trigger?(KEYS["S"])
skill = $game_skills[@actor.key["S"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs,skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
$game_temp.common_event_id = skill.common_event_id
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
if Kboard.trigger?(KEYS["D"])
skill = $game_skills[@actor.key["D"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs,skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
$game_temp.common_event_id = skill.common_event_id
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
if Kboard.trigger?(KEYS["F"])
skill = $game_skills[@actor.key["F"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs,skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
$game_temp.common_event_id = skill.common_event_id
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
if Kboard.trigger?(KEYS["G"])
skill = $game_skills[@actor.key["G"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs,skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
$game_temp.common_event_id = skill.common_event_id
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
if Kboard.trigger?(KEYS["Q"])
skill = $game_skills[@actor.key["Q"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs, skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
$game_temp.common_event_id = skill.common_event_id
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
if Kboard.trigger?(KEYS["W"])
skill = $game_skills[@actor.key["W"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs, skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
$game_temp.common_event_id = skill.common_event_id
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
if Kboard.trigger?(KEYS["E"])
skill = $game_skills[@actor.key["E"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs, skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
$game_temp.common_event_id = skill.common_event_id
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
if Kboard.trigger?(KEYS["R"])
skill = $game_skills[@actor.key["R"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs, skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
$game_temp.common_event_id = skill.common_event_id
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
if Kboard.trigger?(KEYS["T"])
skill = $game_skills[@actor.key["T"]]
return if skill.nil?
if skill.scope == 2
rangs = ARPG_Rangs.new($game_player, skill.rang).rangs
damage_skill(@actor, skill, rangs, skill.dop?)
elsif skill.scope == 1 or skill.scope == 3
damage_skill(@actor, skill)
end
#设置公共事件序号(是第几个公共事件?)
common_event_id = 385
#开始应用
common_event = $data_common_events[common_event_id]
#完全应用效果
$game_system.map_interpreter.setup(common_event.list, 0)
end
end
end
#--------------------------------------------------------------------------
# ● 刷新角色普通攻击行为
#--------------------------------------------------------------------------
def update_actor_attk
# C按下时
if ((Kboard.trigger?($R_Key_HOME) or Kboard.trigger?($R_Key_HOME)) or S[1])and @actor_atktime <= 0
if @actor.weapon_id.between?(50, 65) # and $data_weapons[@actor.weapon_id].rang >= 1
new_x = @x + (@d == 6 ? 1 : @d == 4 ? -1 : 0)
new_y = @y + (@d == 2 ? 1 : @d == 8 ? -1 : 0)
event = $game_map.events[$game_map.check_event(new_x,new_y)]
return if !event.nil? and !event.is_enemy?
rang_atk#(@actor.animation1_id)
return
end
new_x = @x + (@d == 6 ? 1 : @d == 4 ? -1 : 0)
new_y = @y + (@d == 2 ? 1 : @d == 8 ? -1 : 0)
event = $game_map.events[$game_map.check_event(new_x,new_y)]
show_ain(@actor.animation1_id,true)
if $data_weapons[@actor.weapon_id].element_set.include?(17)
tag = []
rang = ARPG_Rangs.new($game_player, 2).rangs
for xy in rang
event = $game_map.events[$game_map.check_event(xy[0],xy[1])]
event.move_type=2
if !event.nil? and event.maxhp > 0
tag.push(event)
end
end
tag.each{|t|dagame_acon(t,event_damage(@actor, t),@actor.animation2_id)}
end
if $data_weapons[@actor.weapon_id].element_set.include?(18)
tag = []
rang = ARPG_Rangs.new($game_player, 4).rangs
for xy in rang
event = $game_map.events[$game_map.check_event(xy[0],xy[1])]
event.move_type=2
if !event.nil? and event.maxhp > 0
tag.push(event)
end
end
tag.each{|t|dagame_acon(t,event_damage(@actor, t),@actor.animation2_id)}
end
if !event.nil? and event.maxhp > 0 and @actor_atktime <= 0
@attev = event
event.move_type=2
dagame_acon(event,event_damage(@actor, event),@actor.animation2_id)
end
end
end
#--------------------------------------------------------------------------
# ● 刷新精灵的移动以及接触判断
#--------------------------------------------------------------------------
def update_bullet
for bullet in @bullets
bullet.update
case bullet.hit_event
when String
if bullet.opacity <= 10
$scene.spriteset.delete_bullet(bullet)
@bullets.delete(bullet)
end
when Game_Event
event = bullet.hit_event
next if !event.is_enemy?
@attev = event
dagame_acon(event,event_damage(@actor, event),@actor.animation2_id)
$scene.spriteset.delete_bullet(bullet)
@bullets.delete(bullet)
end
end
end
#--------------------------------------------------------------------------
# ● 生成远程攻击的精灵
#--------------------------------------------------------------------------
def rang_atk
bullet = ARPG_Bullet.new("Arrow", @x, @y, @d)
$scene.spriteset.add_bullet(bullet)
@bullets.push(bullet)
@actor_atktime = $data_weapons[@actor.weapon_id].time
end
#--------------------------------------------------------------------------
# ● 获取被攻击中的事件
#--------------------------------------------------------------------------
def target
return @attev
end
#--------------------------------------------------------------------------
# ● 敌人死亡处理
#--------------------------------------------------------------------------
def chae_deal(event)
if event.hp <= 0
$game_system.enemy_cun += 1
$game_variables[95] += 5
if $game_variables[990] < 1
$game_variables[990] = 1
end
if $game_variables[990] == 1
$game_variables[1227] = 10
end
if $game_switches[536] == true
$game_variables[990] = 5
end
if $game_party.item_number(677).> 0
$game_variables[992] = 30
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(677,1)
end
elsif $game_party.item_number(676).> 0
$game_variables[992] = 29
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(676,1)
end
elsif $game_party.item_number(675).> 0
$game_variables[992] = 28
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(675,1)
end
elsif $game_party.item_number(674).> 0
$game_variables[992] = 27
$game_variables[993] += 1
if $game_variables[993] > 9
$game_party.lose_item(674,1)
end
elsif $game_party.item_number(673).> 0
$game_variables[992] = 26
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(673,1)
end
elsif $game_party.item_number(672).> 0
$game_variables[992] = 25
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(672,1)
end
elsif $game_party.item_number(671).> 0
$game_variables[992] = 24
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(671,1)
end
elsif $game_party.item_number(670).> 0
$game_variables[992] = 23
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(670,1)
end
elsif $game_party.item_number(669).> 0
$game_variables[992] = 22
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(669,1)
end
elsif $game_party.item_number(668).> 0
$game_variables[992] = 21
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(668,1)
end
elsif $game_party.item_number(667).> 0
$game_variables[992] = 20
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(667,1)
end
elsif $game_party.item_number(666).> 0
$game_variables[992] = 19
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(666,1)
end
elsif $game_party.item_number(665).> 0
$game_variables[992] = 18
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(665,1)
end
elsif $game_party.item_number(664).> 0
$game_variables[992] = 17
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(664,1)
end
elsif $game_party.item_number(663).> 0
$game_variables[992] = 16
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(663,1)
end
elsif $game_party.item_number(662).> 0
$game_variables[992] = 15
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(662,1)
end
elsif $game_party.item_number(661).> 0
$game_variables[992] = 14
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(661,1)
end
elsif $game_party.item_number(660).> 0
$game_variables[992] = 13
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(660,1)
end
elsif $game_party.item_number(659).> 0
$game_variables[992] = 12
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(659,1)
end
elsif $game_party.item_number(658).> 0
$game_variables[992] = 11
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(658,1)
end
elsif $game_party.item_number(657).> 0
$game_variables[992] = 10
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(657,1)
end
elsif $game_party.item_number(656).> 0
$game_variables[992] = 9
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(656,1)
end
elsif $game_party.item_number(655).> 0
$game_variables[992] = 8
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(655,1)
end
elsif $game_party.item_number(654).> 0
$game_variables[992] = 7
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(654,1)
end
elsif $game_party.item_number(653).> 0
$game_variables[992] = 6
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(653,1)
end
elsif $game_party.item_number(652).> 0
$game_variables[992] = 5
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(652,1)
end
elsif $game_party.item_number(650).> 0
$game_variables[992] = 4
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(650,1)
end
elsif $game_party.item_number(649).> 0
$game_variables[992] = 3
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(649,1)
end
elsif $game_party.item_number(648).> 0
$game_variables[992] = 2
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(648,1)
end
elsif $game_party.item_number(647).> 0
$game_variables[992] = 1
$game_variables[993] += 1
if $game_variables[993] > 9
$game_variables[992] = 0
$game_variables[993] = 0
$game_party.lose_item(647,1)
end
end
if $game_variables[1226] > 100
$game_variables[1226] = 100
end
list_level = @actor.level
list_maxhp = @actor.maxhp
list_maxsp = @actor.maxsp
list_skill = @actor.skills.dup
list_hp = @actor.hp
list_sp = @actor.sp
list_str = @actor.str
list_dex = @actor.dex
list_agi = @actor.agi
list_int = @actor.int
#@actor.exp += event.exp
team = Teammate.new
team.now.exp = team.now.exp + event.exp * $game_variables[1187]
team_exp_add = (event.exp * 0.3).to_i
if team.islead?
team.wf.exp = team.wf.exp + team_exp_add if team.havewf?
team.tm.exp = team.tm.exp + team_exp_add if team.havetm?
elsif team.iswf?
team.lead.exp = team.lead.exp + team_exp_add
if team.havetm?
team.tm.exp = team.tm.exp + team_exp_add
end
elsif team.istm?
team.lead.exp = team.lead.exp + team_exp_add
if team.havewf?
team.wf.exp = team.wf.exp + team_exp_add
end
end
Mess_Text.write("#{@actor.name}击败了#{event.name}获得#{event.exp * $game_variables[1187]}点经验")
n1 = rand(100)
if n1 < 50
if $game_map.map_id == 77 or $game_map.map_id == 78 or $game_map.map_id == 79 or $game_map.map_id == 134 or $game_map.map_id == 135 or $game_map.map_id == 202 or $game_map.map_id == 203 or $game_map.map_id == 204 or $game_map.map_id == 205 or $game_map.map_id == 218 or $game_map.map_id == 219 or $game_map.map_id == 220 or $game_map.map_id == 221 or $game_map.map_id == 222
$game_variables[986] = rand(600) + 100
$game_party.gain_gold($game_variables[986])
Mess_Text.write("#{@actor.name}击败了#{event.name}从身上搜出#{$game_variables[986]}銀兩")
end
end
if event.item.size > 0 #物品1
for item in event.item
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item2.size > 0 #物品2
for item in event.item2
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0],rand(3)+1 )
end
end
end
if event.item3.size > 0 #物品3
for item in event.item3
if rand(101) > 100-item[1]- $game_variables[992]- $game_variables[994] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0],rand(5)+3)
end
end
end
if event.item4.size > 0 #物品4 世界BOSS掉落 药品
for item in event.item4
if rand(101) > 100-item[1] - $game_variables[992] - $game_variables[994] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], rand(50)+1)
end
end
end
if event.item5.size > 0 #物品5
for item in event.item5
if rand(101) > 100-item[1]- $game_variables[992] - $game_variables[994] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item6.size > 0 #物品6
for item in event.item6
if rand(101) > 100-item[1]- $game_variables[992] - $game_variables[994] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item7.size > 0 #物品7
for item in event.item7
if rand(101) > 100-item[1] - $game_variables[992] - $game_variables[994] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item8.size > 0 #物品8
for item in event.item8
if rand(101) > 100-item[1]- $game_variables[992]- $game_variables[994] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item9.size > 0 #物品9
for item in event.item9
if rand(101) > 100-item[1]- $game_variables[992] - $game_variables[994] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item10.size > 0 #物品10
for item in event.item10
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item11.size > 0 #物品11
for item in event.item11
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item12.size > 0 #物品12
for item in event.item12
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item13.size > 0 #物品13
for item in event.item13
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item14.size > 0 #物品14
for item in event.item14
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item15.size > 0 #物品15
for item in event.item15
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item16.size > 0 #物品16
for item in event.item16
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item17.size > 0 #物品17
for item in event.item17
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item18.size > 0 #物品17
for item in event.item18
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item19.size > 0 #物品19
for item in event.item19
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item20.size > 0 #物品20
for item in event.item20
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item21.size > 0 #物品21
for item in event.item21
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item22.size > 0 #物品22
for item in event.item22
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item23.size > 0 #物品23
for item in event.item23
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item24.size > 0 #物品24
for item in event.item24
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item25.size > 0 #物品25
for item in event.item25
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.item26.size > 0 #物品26
for item in event.item26
if rand(101) > 100-item[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{event.name}掉落了#{$data_items[item[0]].name}")
$game_party.gain_item(item[0], 1)
end
end
end
if event.weapon.size > 0 #武器
for weapon in event.weapon
if rand(101) > 100 -weapon[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{@actor.name}击败了#{event.name}捡起武器#{$data_weapons[weapon[0]].name}")
$game_party.gain_weapon(weapon[0], 1 )
end
end
end
if event.weapon1.size > 0 #武器
for weapon in event.weapon1
if rand(101) > 100 -weapon[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{@actor.name}击败了#{event.name}捡起武器#{$data_weapons[weapon[0]].name}")
$game_party.gain_weapon(weapon[0], 1 )
end
end
end
if event.weapon2.size > 0 #武器
for weapon in event.weapon2
if rand(101) > 100 -weapon[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{@actor.name}击败了#{event.name}捡起武器#{$data_weapons[weapon[0]].name}")
$game_party.gain_weapon(weapon[0], 1 )
end
end
end
if event.weapon3.size > 0 #武器
for weapon in event.weapon3
if rand(101) > 100 -weapon[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{@actor.name}击败了#{event.name}捡起武器#{$data_weapons[weapon[0]].name}")
$game_party.gain_weapon(weapon[0], 1 )
end
end
end
if event.weapon4.size > 0 #武器
for weapon in event.weapon4
if rand(101) > 100 -weapon[1] - $game_variables[994]- $game_variables[992] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{@actor.name}击败了#{event.name}捡起武器#{$data_weapons[weapon[0]].name}")
$game_party.gain_weapon(weapon[0], 1 )
end
end
end
if event.armor.size > 0 #防具
for armor in event.armor
if rand(101) > 100-armor[1] - $game_variables[992] - $game_variables[994] - $game_variables[1226] + $game_variables[1227]
Mess_Text.write("#{@actor.name}击败了#{event.name}获得装备#{$data_armors[armor[0]].name}")
$game_party.gain_armor(armor[0],1 )
end
end
end
if $game_variables[1226] < 100
if $game_party.item_number(687).> 99
$game_variables[1226] += 100
$game_party.lose_item(687,100)
elsif $game_party.item_number(687).> 49
$game_variables[1226] += 50
$game_party.lose_item(687,50)
elsif $game_party.item_number(687).> 29
$game_variables[1226] += 30
$game_party.lose_item(687,30)
elsif $game_party.item_number(687).> 19
$game_variables[1226] += 20
$game_party.lose_item(687,20)
elsif $game_party.item_number(687).> 9
$game_variables[1226] += 10
$game_party.lose_item(687,10)
elsif $game_party.item_number(687).> 4
$game_variables[1226] += 5
$game_party.lose_item(687,5)
elsif $game_party.item_number(687).> 1
$game_variables[1226] += 2
$game_party.lose_item(687,2)
elsif $game_party.item_number(687).> 0
$game_variables[1226] += 1
$game_party.lose_item(687,1)
end
end
if $game_variables[1226] > 100
$game_variables[1226] = 100
end
if @actor.level > list_level
@actor.hp = list_hp
@actor.sp = list_sp
Audio.me_play(LVUP_ME)
Mess_Text.write("#{@actor.name}等级提升:")
Mess_Text.write("#{@actor.name}气血最大值 上升 #{@actor.maxhp - list_maxhp}")
Mess_Text.write("#{@actor.name}內力最大值 上升 #{@actor.maxsp - list_maxsp}")
$game_party.actors[0].hp = $game_party.actors[0].maxhp
$game_party.actors[0].sp = $game_party.actors[0].maxsp
b1 = rand(100)
if b1 > 96
$game_party.actors[0].maxhp += 100
$game_party.actors[0].maxsp += 100
$game_party.actors[0].str += 1
$game_party.actors[0].dex += 1
$game_party.actors[0].agi += 1
$game_party.actors[0].int += 1
Mess_Text.write("#{@actor.name}人品超然,四维各提升1点,气血内力各提升100点")
end
end
ls = []
if list_skill != @actor.skills
for s in @actor.skills
if !list_skill.include?(s)
ls.push s
end
end
end
ls.each{|skill|
Mess_Text.write("#{@actor.name}领悟:#{$game_skills[skill].name}")
}
$refresh["item"] = true
delete_event(event)
@attev = nil
end
end
#--------------------------------------------------------------------------
# ● 删除事件
#--------------------------------------------------------------------------
def delete_event(event)
# 生成独立开关键
key = [$game_map.map_id, event.id, 'A']
# 更改独立开关
$game_self_switches[key] = true
$game_map.need_refresh = true
#$game_map.events.delete(event.id)
#$scene.spriteset.dispose
#$scene.spriteset = Spriteset_Map.new
end
#--------------------------------------------------------------------------
# ● 敌人被攻击伤害处理(也就是角色的攻击)
#--------------------------------------------------------------------------
def dagame_acon(event,damage,ani_id)
#======================左岸加,调节游戏难度=======
if $game_variables[987]==0
$game_variables[987]=10
end
#====================================================
event.hp -= damage.to_i/ $game_variables[987]*10
event.animation_id = ani_id
@hp_disp_time = HP_BAR_DISP_TIME
@actor_atktime = $data_weapons[@actor.weapon_id].time
if YC
@event_atk[event.id] = [[@event_atk[event.id]+randg(5,8), event.atk_time*3].min, 0].max
end
event.damage = damage/ $game_variables[987]*10
event.damage_pop = true
if rand(2)==1
#event.turn_toward_player
if randg(1,4) == 2
@event_atk[event.id] += randg(5,8)
end
end
if event.move_type == 1
event.move_type = 2
event.move_speed = 3
event.move_frequency = 6
end
if event.damage == "Miss"
Mess_Text.write("#{event.name}没有受到伤害")
else
Mess_Text.write("#{event.name}受到了#{event.damage}点伤害")
end
chae_deal(event)
if $game_party.all_dead?
#=========================================左岸加==
if @actor.skills.include?(882)#紫霞回生效果
n4=rand(100)
if n4>30
#event.reduce=damage
Mess_Text.write("紫霞回生被激发!")
if @actor.skills.include?(890)
rhp=rand(@actor.maxhp)
@actor.hp+=rhp
Mess_Text.write("紫霞不灭回复了您#{rhp}点气血!")
end
return
end
end
if $game_variables[1038]==1#调节游戏难度=======
$game_variables[987]=$game_variables[1039]
$game_variables[1038]=0
end
#=====================================================
$scene = Scene_Gameover.new
end
end
#--------------------------------------------------------------------------
# ● 角色被攻击伤害处理(也就是敌人的攻击)
#--------------------------------------------------------------------------
def dagame_acon_actor(actor,damage,ani_id,event)
#=========================================
#左岸增加
if $game_variables[987]==0#调节游戏难度=======
$game_variables[987]=10
end
for i in @party_id
j=0
n=rand(100)
getrand=@pretect[j].to_i
if n<getrand.to_i and $game_actors.hp>0
n2=rand(3)
if n2.to_i==0
Mess_Text.write("手疾眼快,队友化解了您的伤害")
damage=0
end
if n2==1
partyname= $game_actors.name
$game_actors.hp-=damage.to_i
Mess_Text.write("舍己为人,#{partyname} 代替了您的伤害")
damage=0
end
if n2==3
$game_actors.hp-=damage.to_i/2
damage=damage.to_i/2
Mess_Text.write("同甘共苦,#{$game_actors.name} 承担了您的一半伤害")
end
end
j=j+1
end
if @actor.skills.include?(881)#斗转星移效果
n3=rand(100)
if n3>70
#event.reduce=damage
Mess_Text.write("斗转星移被激发,您没有受到伤害!")
return
end
end
if $game_party.item_number(680).> 0
if $game_party.actors[0].level > 750
$game_variables[993] -= 100
$game_party.lose_item(680,1)
if $game_party.item_number(679).> 0
if $game_party.actors[0].level > 350
$game_variables[993] -= 50
$game_party.lose_item(679,1)
if $game_party.item_number(678).> 0
if $game_party.actors[0].level > 100
$game_variables[993] -= 10
$game_party.lose_item(678,1)
end
end
end
end
end
end
if $game_variables[990] < 2
$game_variables[990] == 2
elsif $game_variables[990] == 1
$game_variables[990] == 100
elsif $game_variables[990] == 0
$game_variables[990] == 99999999
end
if $game_variables[1226] > 100
$game_variables[1226] = 100
end
if @actor.skills.include?(894)#斗转星移效果
n3=rand(100)
if n3>60
#event.reduce=damage
Mess_Text.write("斗转星移被激发,您没有受到伤害!")
return
end
end
if actor.skill_learn?(924)
sg = rand(100)
huixue = @actor.maxhp
huilan = @actor.maxsp
huilan / 1000
huixue / 1000
if sg < 25
@actor.hp += huixue
Mess_Text.write("道法自然特殊效果触发#{@actor.name}气血恢复#{huixue}点")
elsif sg < 25
@actor.sp += huilan
Mess_Text.write("道法自然特殊效果触发#{@actor.name}内力恢复#{huilan}点")
end
end
if @actor.skills.include?(920)#斗转星移效果
n3=rand(100)
if n3>40
#event.reduce=damage
Mess_Text.write("斗转星移被激发,您没有受到伤害!")
return
end
end
#=========================================
#左岸增加 不滅不絕效果
if @actor.skills.include?(615)
if @actor.hp<@actor.maxhp*0.2
n3=rand(100)
if n3>70
@[email protected]
Mess_Text.write("不滅不絕效果,恢复了您的全部气血")
end
end
end
#=========================================
#=========================================
event.white_flash = true
if damage==0
damage==1
end
actor.hp -= damage.to_i*$game_variables[987]/10
if YC
@actor_atktime = [[@actor_atktime+randg(5,8), $data_weapons[@actor.weapon_id].time*3].min, 0].max
end
if event.attk_states[0] > 0 and rand(100) > 100-event.attk_states[1]
unless @actor.state_guard?(event.attk_states[0])
@actor.add_state(event.attk_states[0])
end
end
$game_player.animation_id = ani_id
@event_atk[event.id] = event.atk_time
ndam=$game_variables[987]/10
$game_player.damage = damage*ndam
$game_player.damage_pop = true
if damage != "Miss"
Mess_Text.write("#{@actor.name}受到了#{$game_player.damage}点伤害")
else
Mess_Text.write("#{actor.name}没有受到伤害")
end
if $game_party.all_dead?
#=========================================左岸加==
if @actor.skills.include?(882)#紫霞回生效果
n4=rand(100)
if n4>30
#event.reduce=damage
Mess_Text.write("紫霞回生效果,另你起死回生!")
if @actor.skills.include?(890)
rhp=[rand(@actor.maxhp),@actor.maxhp/2].max
@actor.hp+=rhp
Mess_Text.write("紫霞不灭回复了您#{rhp}点气血!")
end
return
end
end
if $game_variables[1038]==1#调节游戏难度=======
$game_variables[987]=$game_variables[1039]
$game_variables[1038]=0
end
#=====================================================
$scene = Scene_Gameover.new
end
end
#--------------------------------------------------------------------------
# ● 敌人使用技能处理
#--------------------------------------------------------------------------
def damage_skill_enemy(user, skill, skill_rang=[])
return if user.sp < skill.sp_cost
#=========================================
#左岸增加,鬥轉星移效果
#Mess_Text.write("wwwwwwwwwwwwwwwwww")
if @actor.skills.include?(881)
n3=rand(100)
if n3>70
if skill.scope == 1 or skill.scope == 2
user.animation_id = skill.animation1_id
Mess_Text.write("#{user.name}使用了#{skill.name}")
damage = event_damage_skill(user,user,skill)
dagame_acon(user,damage,skill.animation2_id)
Mess_Text.write("斗转星移被激发,反弹了敌人的技能伤害!")
user.sp -= skill.sp_cost
end
if skill.scope == 3
user.animation_id = skill.animation1_id
user.animation_id = skill.animation2_id
damage = event_damage_skill(user,user,skill)
@actor.hp -= damage.to_i
user.sp -= skill.sp_cost
@event_atk[user.id] = user.atk_time
Mess_Text.write("斗转星移效果,#{user.name}使用了#{skill.name}")
Mess_Text.write("斗转星移效果,恢复了您的#{damage.abs}气血")
end
return
end
end
#=========================================
#=========================================
#左岸增加 鬥轉星移效果
#Mess_Text.write("wwwwwwwwwwwwwwwwww")
if @actor.skills.include?(894)
n3=rand(100)
if n3>60
if skill.scope == 1 or skill.scope == 2
user.animation_id = skill.animation1_id
Mess_Text.write("#{user.name}使用了#{skill.name}")
damage = event_damage_skill(user,user,skill)
dagame_acon(user,damage,skill.animation2_id)
Mess_Text.write("斗转星移被激发,反弹了敌人的技能伤害!")
user.sp -= skill.sp_cost
end
if skill.scope == 3
user.animation_id = skill.animation1_id
user.animation_id = skill.animation2_id
damage = event_damage_skill(user,user,skill)
@actor.hp -= damage.to_i
user.sp -= skill.sp_cost
@event_atk[user.id] = user.atk_time
Mess_Text.write("斗转星移效果,#{user.name}使用了#{skill.name}")
Mess_Text.write("斗转星移效果,恢复了您的#{damage.abs}气血")
end
return
end
end
#=========================================
#=========================================
#左岸增加,鬥轉星移效果
#Mess_Text.write("wwwwwwwwwwwwwwwwww")
if @actor.skills.include?(920)
n3=rand(100)
if n3>40
if skill.scope == 1 or skill.scope == 2
user.animation_id = skill.animation1_id
Mess_Text.write("#{user.name}使用了#{skill.name}")
damage = event_damage_skill(user,user,skill)
dagame_acon(user,damage,skill.animation2_id)
Mess_Text.write("斗转星移被激发,反弹了敌人的技能伤害!")
user.sp -= skill.sp_cost
end
if skill.scope == 3
user.animation_id = skill.animation1_id
user.animation_id = skill.animation2_id
damage = event_damage_skill(user,user,skill)
@actor.hp -= damage.to_i
user.sp -= skill.sp_cost
@event_atk[user.id] = user.atk_time
Mess_Text.write("斗转星移效果,#{user.name}使用了#{skill.name}")
Mess_Text.write("斗转星移效果,恢复了您的#{damage.abs}气血")
end
return
end
end
#=========================================
#=========================================
#=========================================
#左岸增加 不滅不絕效果
if @actor.skills.include?(615)
if @actor.hp<@actor.maxhp*0.2
n3=rand(100)
if n3>70
@[email protected]
Mess_Text.write("不滅不絕效果,恢复了您的全部气血")
end
end
end
#=========================================
if skill.scope == 1 or skill.scope == 2
user.animation_id = skill.animation1_id
Mess_Text.write("#{user.name}使用了#{skill.name}")
damage = event_damage_skill(user,@actor,skill)
dagame_acon_actor(@actor,damage,skill.animation2_id,user)
user.sp -= skill.sp_cost
#=========================================
#左岸增加
for i in @party_id
damage = event_damage_skill(user,$game_actors[i.to_i],skill)
dagame_acon_actor_party($game_actors[i.to_i],damage,skill.animation2_id,user,i)
end
#=========================================
elsif skill.scope == 3
user.animation_id = skill.animation1_id
user.animation_id = skill.animation2_id
#damage = event_damage(user,user)
damage = event_damage_skill(user,user,skill)
user.hp -= damage.to_i
user.sp -= skill.sp_cost
@event_atk[user.id] = user.atk_time
Mess_Text.write("#{user.name}使用了#{skill.name}恢复了#{damage.abs}气血")
end
end
#--------------------------------------------------------------------------
# ● 角色使用技能处理# if $game_party.actors[0].weapon_id >= 155
#--------------------------------------------------------------------------
def damage_skill(user, skill, skill_rang=[],d = false)
if user.sp < skill.sp_cost
Mess_Text.write("你的內力不足")
Mess_Text.write("#{$actor_id}使用了#{skill.name}")
return
end
#=======================冷月窥人==============
bolzh=0
if $game_variables[1034].to_i==10
skill_rang = ARPG_Rangs.new($game_player, 3).rangs
if skill.scope == 1
skill.scope =2
bolzh=1
#Mess_Text.write("置换成2了。当前#{skill.scope }")
end
end
# ========================以下为莫轩增加=============================================
if $data_weapons[$game_party.actors[0].weapon_id].name.include?("[运]")
$game_variables[994] = 12
else
$game_variables[994] = 0
end
if $data_weapons[$game_party.actors[0].weapon_id].name.include?("[卸]")
$game_switches[2776] = true
$game_variables[1976] = rand(100) + 10
elsif $data_weapons[$game_party.actors[0].weapon_id].name.include?("[碎]")
$game_switches[2777] = true
$game_variables[1976] = rand(1000) + 100
else
$game_variables[1976] = 0
$game_switches[2777] = false
$game_switches[2776] = false
end
if $game_variables[990] == 1
$game_variables[1227] = 10
end
if $game_switches[536] == true
$game_variables[990] = 5
end
#==========================================
if skill.id==885#古一阳指定敌效果
for xy in skill_rang
event = $game_map.events[$game_map.check_event(xy[0],xy[1])]
if !event.nil? and event.maxhp > 0
event.move_type=0
end
end
end
#==========================================================
sk=0
if @actor.skills.include?(886)#左右互博
skills=user.skills
if skills.size>0
s= rand(skills.size)
sk= $game_skills[skills]
end
end
#==========================================================
if skill.scope == 1
new_x = @x + (@d == 6 ? 1 : @d == 4 ? -1 : 0)
new_y = @y + (@d == 2 ? 1 : @d == 8 ? -1 : 0)
event = $game_map.events[$game_map.check_event(new_x,new_y)]
if !event.nil? and event.maxhp > 0 and @actor_atktime <= 0
Mess_Text.write("#{user.name}使用了#{skill.name}")
if skill.id!=885 and event.name!="練功型木樁" and event.name!="木樁"
event.move_type=2
end
@attev = event
$game_player.animation_id = skill.animation1_id
damage = event_damage_skill(user, event, skill)
dagame_acon(event,damage,skill.animation2_id)
user.sp -= skill.sp_cost
if @actor.skills.include?(902)#喇嘛嗜血术效果
addhp=damage*0.05
addhp=[Integer(addhp),300].min
user.hp+=addhp
Mess_Text.write("嗜血术吸收了#{addhp}点血")
end
if skill.id==893#北冥六脉神剑效果
addhp=damage*0.05
addhp=[Integer(addhp),1000].min
user.sp+=addhp
Mess_Text.write("【融】北冥六脉神剑吸收了#{addhp}点内力")
end
if @actor.skills.include?(901)#无剑效果
rd=rand(100)
if rd>95
event.hp=[Integer(event.hp*0.9),1].max
Mess_Text.write("无剑伤害了敌人当前十分之一的血")
elsif rd>70
event.hp-=Integer(damage*0.2)
Mess_Text.write("无剑使您的伤害增加20%")
elsif rd>50
rd2=rand(1000)
event.hp-=rd2
Mess_Text.write("无剑伤害敌人#{rd2}点血")
end
end
if $game_variables[1034].to_i==10
@actor_atktime = skill.time/2
elsif
@actor_atktime = skill.time
end
$game_skills[skill.id].exp += (damage/5).abs+(randg(damage*0.8,damage*1.2)/10)
end
elsif skill.scope == 2
tag = []
for xy in skill_rang
event = $game_map.events[$game_map.check_event(xy[0],xy[1])]
if !event.nil? and event.maxhp > 0
tag.push(event)
end
end
if tag.size == 0
show_ain(skill.animation1_id ,d)
user.sp -= skill.sp_cost
@actor_atktime = skill.time#$data_weapons[@actor.weapon_id].time
return
end
Mess_Text.write("#{user.name}使用了#{skill.name}")
for e in tag
@attev = e
damage = event_damage_skill(user, e, skill)
#萬佛效果
if skill.id==867
if $game_variables[94]>0
damage=0
elsif
damage=damage*[$game_variables[252].to_i/1000,5].min
end
end
dagame_acon(e,damage,skill.animation2_id)
#喇嘛嗜血术效果
if @actor.skills.include?(902)
addhp=damage*0.05
addhp=[Integer(addhp),300].min
user.hp+=addhp
Mess_Text.write("嗜血术吸收了#{addhp}点血")
end
#北冥六脉神剑效果
if skill.id==893
addhp=damage*0.05
addhp=[Integer(addhp),1000].min
user.sp+=addhp
Mess_Text.write("【融】北冥六脉神剑吸收了#{addhp}点内力")
end
#寒冰劲
rhbj=rand(100)
if rhbj>70
if @actor.skills.include?(888)
e.add_state(100)
Mess_Text.write("寒冰劲附加状态")
end
end
#无剑效果
if @actor.skills.include?(901)
rd=rand(100)
if rd>95
e.hp=[Integer(e.hp*0.9),1].max
Mess_Text.write("无剑伤害了敌人十分之一的血")
elsif rd>80
e.hp-=Integer(damage*0.1)
Mess_Text.write("无剑使您的伤害增加10%")
elsif rd>50
rd2=rand(1000)
e.hp-=rd2
Mess_Text.write("无剑伤害敌人#{rd2}点血")
end
end
#==========================左右==================
rzy=rand(100)
if rzy>50
if sk !=0 and sk.scope == 2
Mess_Text.write("【古】左右互博发出了#{$game_skills[skills].name}")
damage = event_damage_skill(user, e, skill)
dagame_acon(e,damage,skill.animation2_id)
end
end
#=================================================
if skill.id!=885 and e.name!="練功型木樁" and e.name!="木樁" #定身解除
e.move_type=2
end
@hp_disp_time = 0 if tag.size > 1
end
show_ain(skill.animation1_id,d)
if $game_variables[1034].to_i==10
@actor_atktime = skill.time/2
elsif
@actor_atktime = skill.time
end
if tag != []
user.sp -= skill.sp_cost
if skill.id == 29
bmxl1 = user.str + user.dex + user.agi + user.int
bmxl2 = user.sp/4
user.sp += bmxl1* 3 + bmxl2
end
$game_skills[skill.id].exp += (damage/5).abs+(randg(damage*0.8,damage*1.2)/10)
end
if bolzh==1
skill.scope =1
bolzh=0
#Mess_Text.write("置换成1了。当前#{skill.scope }")
end
elsif skill.scope == 3
$game_player.animation_id = skill.animation1_id
$game_player.animation_id = skill.animation2_id
damage = @actor.skill_effect(@actor,skill)#event_damage_skill(user, @actor, skill)
#user.hp -= damage
#user.sp += skill.sp_cost
$game_player.damage = damage.to_i
$game_player.damage_pop = true
#Mess_Text.write("#{user.name}使用了#{skill.name}恢复了#{damage.abs}HP")
#$data_weapons[@actor.weapon_id].time
if $game_variables[1034].to_i==10
@actor_atktime = skill.time/2
elsif
@actor_atktime = skill.time
end
end
end
#--------------------------------------------------------------------------
# ● 获取普通攻击伤害
#--------------------------------------------------------------------------
def event_damage(attk,event)
hit_result = (rand(100) < attk.hit)
if hit_result
atk = [attk.atk - event.pdef / 2, 0].max
damage = atk * (20 + attk.str) / 20
amp = [damage.abs * 15 / 100, 1].max
damage += rand(amp+1) + rand(amp+1) - amp
damage = damage.abs
if attk.plus_state_set.size > 0
if rand(100) > randg(85,100)
event.add_state(attk.plus_state_set[0])
end
end
else
damage = "Miss"
end
return damage
end
#--------------------------------------------------------------------------
# ● 获取技能攻击伤害
#--------------------------------------------------------------------------
def event_damage_skill(user,event,skill)
# 计算威力
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= event.pdef * skill.pdef_f / 200
power -= event.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# 计算倍率
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# 计算基本伤害
damage = power * rate / 20
if @actor.skills.include?(26)#愤怒一击
rd=rand(100)
if rd > 97
damage *= 2
Mess_Text.write("触发愤怒一击效果伤害翻倍")
end
end
#分散
if skill.variance > 0 and damage.abs > 0
amp = [damage.abs * skill.variance / 100, 1].max
damage += rand(amp+1) + rand(amp+1) - amp
end
if skill.plus_state_set.size > 0
if rand(100) > 100-rand(skill.hit)
#==============左岸修改,不知道为什么原先程序只取技能第一状态==
for state in skill.plus_state_set
#event.add_state(skill.plus_state_set[0])
event.add_state(state)
end
#=====================注释掉的内容是原先的代码========================
end
end
return damage
end
#--------------------------------------------------------------------------
# ● 左岸加无Gameover,同伴被攻击。角色被攻击伤害处理(也就是敌人的攻击)
#--------------------------------------------------------------------------
def dagame_acon_actor_party(actor,damage,ani_id,event,i)
event.white_flash = true
actor.hp -= damage.to_i
if event.attk_states[0] > 0 and rand(100) > 100-event.attk_states[1]
unless @actor.state_guard?(event.attk_states[0])
@actor.add_state(event.attk_states[0])
end
end
$game_actors[i.to_i].animation_id = ani_id
@event_atk[event.id] = event.atk_time
$game_actors[i.to_i].damage = damage.to_i
$game_actors[i.to_i].damage_pop = true
n=$game_actors[i.to_i].name
if damage != "Miss"
Mess_Text.write("#{n}受到了#{damage}點傷害")
end
end
#--------------------------------------------------------------------------
# ● 更新一下坐标
#--------------------------------------------------------------------------
def refresh(type)
case type
when 0 then @x = $game_player.x
when 1 then @y = $game_player.y
when 2 then @d = $game_player.direction
end
end
#--------------------------------------------------------------------------
# ● 角色显示动画#skill.animation1_id
#--------------------------------------------------------------------------
def show_ain(ain_id,d)
if d
case @d
when 2 then $game_player.animation_id = ain_id
when 4 then $game_player.animation_id = ain_id + 1
when 6 then $game_player.animation_id = ain_id + 2
when 8 then $game_player.animation_id = ain_id + 3
end
else
$game_player.animation_id = ain_id
end
end
end |
|