赞 | 0 |
VIP | 0 |
好人卡 | 1 |
积分 | 0 |
经验 | 1145 |
最后登录 | 2013-2-25 |
在线时间 | 26 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 49
- 在线时间
- 26 小时
- 注册时间
- 2012-11-18
- 帖子
- 40
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 丝诺·冯·温特 于 2012-11-24 10:54 编辑
- #======================================
- # ■ 战斗处理
- #======================================
- # By: pudding
- #==============================================================================
- # 伤害值
- #==============================================================================
- # $game_player.damage = 数值
- # $game_player.critical = true/false
- # $game_player.damage_pop = true
- # $game_map.events[事件编号].damage = 数值
- # $game_map.events[事件编号].critical = true/false
- # $game_map.events[事件编号].damage_pop = true
- #==============================================================================
- class Sprite_Character < RPG::Sprite
- alias hzhj_sc_update update
- def update
- hzhj_sc_update
- if @character.damage_pop
- damage(@character.damage, @character.critical)
- @character.damage = nil
- @character.critical = false
- @character.damage_pop = false
- end
- #------------------------------------------------------------------------------
- # 当敌人生命值小于0时。
- #------------------------------------------------------------------------------
- if @hp <= 0 and @character.id != 0 and [email protected]_erased2 and @character.list[0].code == 108 and @character.list[0].parameters[0] == "全部"
- @character.erase2
- end
- #------------------------------------------------------------------------------
- # 角色死亡设置
- #------------------------------------------------------------------------------
- if $game_party.actors[0].hp <= 1
- $scene = Scene_Gameover.new
- Mess_Text.clear
- end
- #------------------------------------------------------------------------------
- # 敌人死亡设置
- #------------------------------------------------------------------------------
- if @character.id != 0 and @character.return_erased2 == true and [url=home.php?mod=space&uid=7207]@asd[/url] == nil
- [url=home.php?mod=space&uid=7207]@asd[/url] = 1
- Mess_Text.write ("#{@name}被消灭了。")
- Mess_Text.write ("获得#{@exp_x.to_i}点经验值。")
- $game_party.actors[0].exp += @exp_x
- @hpspsprite.bitmap.dispose
- #@character.name = "delete"
- @character.erase
- end
- end
- end
- class Game_Character
- attr_accessor :through
- attr_accessor :character_name
- attr_accessor :white_flash
- attr_accessor :damage_pop
- attr_accessor :damage
- attr_accessor :critical
- alias carol3_66RPG_damage_pop_initialize initialize
- def initialize
- @damage_pop = false
- @damage = 0
- @critical = false
- @white_flash=false
- carol3_66RPG_damage_pop_initialize
- end
- end
- #===================================================================
- #此脚本存在的话,就不能存档了。
- #等动画结束后角色才能移动
- =begin
- class Game_Player
- attr_accessor :sprite
- alias hzhj_update update
- def update
- return if [url=home.php?mod=space&uid=114926]@sprite[/url] != nil and @sprite.effect?
- hzhj_update
- end
- end
- module RPG
- class Sprite < ::Sprite
- def effect?
- @_whiten_duration > 0 or
- @_appear_duration > 0 or
- @_escape_duration > 0 or
- @_collapse_duration > 0 or
- @_animation_duration > 0
- end
- end
- end
- class Sprite_Character < RPG::Sprite
- alias hzhj_initialize initialize
- def initialize(viewport, character = nil)
- hzhj_initialize(viewport, character)
- if @character.class == Game_Player
- @character.sprite = self
- end
- end
- end
- =end
- #==============================================================================
- class Game_Event
- def return_erased2
- return @erased2
- end
- def erase2
- @erased2 = true
- end
- end
- class ARPG
- def skill
- return @skill
- end
- end
- #==============================================================================
- $wait_H = 0
- $wait_H2 = 0
- $普通攻击动画ID = 0
- #==============================================================================
- class Scene_Map
- alias update_olc update
- def update
- update_olc
- [url=home.php?mod=space&uid=28395]@ppp[/url] = $game_party.actors[0]
- #--------------------------------------------------------------------------
- # ● 敌人攻击
- #--------------------------------------------------------------------------
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- #敌人的攻击力:
- @enemy_attack = enemy.list[6].parameters[0].to_i
- @enemy_animation = enemy.list[9].parameters[0].to_i
- #敌人面向下,攻击角色
- $wait_H += 0.1
- if $game_player.x == enemy.x and $game_player.y - enemy.y == 1 and enemy.direction == 2
- if $wait_H >= 200
- case rand(40)
- when 2
- enemy.animation_id = @enemy_animation
- if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御
- $game_switches[31] = true #显示MISS
- $game_player.damage_pop = true
- Mess_Text.write ("#{@ppp.name}没有受到伤害。")
- $wait_H += 0
- else
- $game_player.damage = @enemy_attack - @ppp.pdef
- $game_player.damage_pop = true
- @ppp.hp -= $game_player.damage
- Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。")
- $wait_H += 0
- end #if
- end #if
- end #case
- end #if
- #敌人面向左,攻击角色
- if $game_player.x - enemy.x == -1 and $game_player.y == enemy.y and enemy.direction == 4
- if $wait_H >= 200
- case rand(40)
- when 2
- enemy.animation_id = @enemy_animation + 1
- if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御
- $game_switches[31] = true #显示MISS
- $game_player.damage_pop = true
- Mess_Text.write ("#{@ppp.name}没有受到伤害。")
- $wait_H += 0
- else
- $game_player.damage = @enemy_attack - @ppp.pdef
- $game_player.damage_pop = true
- @ppp.hp -= $game_player.damage
- Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。")
- $wait_H += 0
- end #if
- end #if
- end #case
- end #if
- #敌人面向右,攻击角色
- if $game_player.x - enemy.x == 1 and $game_player.y == enemy.y and enemy.direction == 6
- if $wait_H >= 200
- case rand(40)
- when 2
- enemy.animation_id = @enemy_animation + 2
- if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御
- $game_switches[31] = true #显示MISS
- $game_player.damage_pop = true
- Mess_Text.write ("#{@ppp.name}没有受到伤害。")
- $wait_H += 0
- else
- $game_player.damage = @enemy_attack - @ppp.pdef
- $game_player.damage_pop = true
- @ppp.hp -= $game_player.damage
- Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。")
- $wait_H += 0
- end #if
- end #if
- end #case
- end #if
- #敌人面向上,攻击角色
- if $game_player.x == enemy.x and $game_player.y - enemy.y == -1 and enemy.direction == 8
- if $wait_H >= 200
- case rand(40)
- when 2
- enemy.animation_id = @enemy_animation + 3
- if @ppp.pdef >= @enemy_attack #当敌人攻击少于角色防御
- $game_switches[31] = true #显示MISS
- $game_player.damage_pop = true
- Mess_Text.write ("#{@ppp.name}没有受到伤害。")
- $wait_H += 0
- else
- $game_player.damage = @enemy_attack - @ppp.pdef
- $game_player.damage_pop = true
- @ppp.hp -= $game_player.damage
- Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。")
- $wait_H += 0
- end #if
- end #if
- end #case
- end #if
- #★★★★
- end#for★
- $普通攻击动画ID = 108
- #--------------------------------------------------------------------------
- # ● 角色普通攻击
- #--------------------------------------------------------------------------
- if Input.trigger?(Input::C)
- player_attack
- end#if
- end#update
- #--------------------------------------------------------------------------
- # ● 定义旋舞斩
- #--------------------------------------------------------------------------
- def skill_旋舞斩
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- px = $game_player.x
- py = $game_player.y
- if (px - enemy.x).abs <= 2 and (py - enemy.y).abs <= 1
- case rand(10)
- when 0..8
- enemy.damage = $data_skills[@skill.id].power
- enemy.damage_pop = true
- case $game_player.direction
- when 2
- enemy.jump(0, 1)
- when 4
- enemy.jump(-1, 0)
- when 6
- enemy.jump(1, 0)
- when 8
- enemy.jump(0, -1)
- end
- when 9
- enemy.damage = $data_skills[@skill.id].power*2
- enemy.damage_pop = true
- enemy.critical = true
- case $game_player.direction
- when 2
- enemy.jump(0, 1)
- when 4
- enemy.jump(-1, 0)
- when 6
- enemy.jump(1, 0)
- when 8
- enemy.jump(0, -1)
- end
- end
- Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
- end #伤害范围
- end #定义event
- end #旋舞斩技能
- #--------------------------------------------------------------------------
- # ● 定义圣光
- #--------------------------------------------------------------------------
- def skill_圣光
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- px = $game_player.x
- py = $game_player.y
- if (px - enemy.x).abs <= 4 and (py - enemy.y).abs <= 2
- case rand(10)
- when 0..8
- enemy.damage = $data_skills[@skill.id].power
- enemy.damage_pop = true
- case $game_player.direction
- when 2
- enemy.jump(0, 1)
- when 4
- enemy.jump(-1, 0)
- when 6
- enemy.jump(1, 0)
- when 8
- enemy.jump(0, -1)
- end
- when 9
- enemy.damage = $data_skills[@skill.id].power*2
- enemy.damage_pop = true
- enemy.critical = true
- case $game_player.direction
- when 2
- enemy.jump(0, 1)
- when 4
- enemy.jump(-1, 0)
- when 6
- enemy.jump(1, 0)
- when 8
- enemy.jump(0, -1)
- end
- end
- Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
- end #伤害范围
- end #定义event
- end #圣光技能
- #--------------------------------------------------------------------------
- # ● 角色普通攻击的处理
- #--------------------------------------------------------------------------
- def player_attack
- ppp = $game_party.actors[0]
- case $game_player.direction
- #| 下 |
- when 2
- $game_player.animation_id = $普通攻击动画ID
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- if $game_player.x == enemy.x and enemy.y - $game_player.y == 1
- case rand(10)
- when 0..6
- enemy .animation_id = 7
- enemy.damage = (ppp.atk + ppp.str) / 3
- enemy.damage_pop = true
- enemy.jump(0, 1)
- when 7..9
- enemy .animation_id = 7
- enemy.damage = (ppp.atk + ppp.str) / 3 + (ppp.dex / 5 )
- enemy.damage_pop = true
- enemy.critical = true
- enemy.jump(0, 1)
- end #case
- Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
- end #if
- end #for
- #| 右 |
- when 4
- $game_player.animation_id = $普通攻击动画ID + 1
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- if enemy.x - $game_player.x == -1 and enemy.y == $game_player.y
- case rand(10)
- when 0..6
- enemy.animation_id = 7
- enemy.damage = (ppp.atk + ppp.str) / 3
- enemy.damage_pop = true
- enemy.jump(0, 1)
- when 7..9
- enemy.animation_id = 7
- enemy.damage = (ppp.atk + ppp.str) / 3 + (ppp.dex / 5 )
- enemy.damage_pop = true
- enemy.critical = true
- enemy.jump(0, 1)
- end #case
- Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
- end #if
- end #for
- #| 左 |
- when 6
- $game_player.animation_id = $普通攻击动画ID + 2
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- if enemy.x - $game_player.x == 1 and $game_player.y == enemy.y
- case rand(10)
- when 0..6
- enemy.animation_id = 7
- enemy.damage = (ppp.atk + ppp.str) / 3
- enemy.damage_pop = true
- enemy.jump(0, 1)
- when 7..9
- enemy.animation_id = 7
- enemy.damage = (ppp.atk + ppp.str) / 3 + (ppp.dex / 5 )
- enemy.damage_pop = true
- enemy.critical = true
- enemy.jump(0, 1)
- end #case
- Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
- end #if
- end #for
- #| 上 |
- when 8
- $game_player.animation_id = $普通攻击动画ID + 3
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- if $game_player.x == enemy.x and enemy.y - $game_player.y == -1
- case rand(10)
- when 0..6
- enemy.animation_id = 7
- enemy.damage = (ppp.atk + ppp.str) / 3
- enemy.damage_pop = true
- enemy.jump(0, 1)
- when 7..9
- enemy.animation_id = 7
- enemy.damage = (ppp.atk + ppp.str) / 3 + (ppp.dex / 5 )
- enemy.damage_pop = true
- enemy.critical = true
- enemy.jump(0, 1)
- end #case
- Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
- end #if $game_player.x
- end #for
- end #case $game_player.direction
- end #角色普通攻击
- #--------------------------------------------------------------------------
- # ● 物品炸弹
- #--------------------------------------------------------------------------
- def item_bomb
- for bomb in $game_map.events.values
- next if bomb.list == nil
- next if bomb.list[0].code != 108
- next if bomb.list[0].parameters[0] != "bomb"
- bomb.animation_id = 99
- for enemy in $game_map.events.values
- next if enemy.return_erased2
- next if enemy.list == nil
- next if enemy.list[0].code != 108
- next if enemy.list[1].parameters[0] != "敌人"
- if (bomb.x - enemy.x).abs <= 1 and (bomb.y - enemy.y).abs <= 2
- enemy.damage = (@ppp.atk/[email protected]/2)*2 + 500
- enemy.damage_pop = true
- case $game_player.direction
- when 2
- enemy.jump(0, 1)
- when 4
- enemy.jump(-1, 0)
- when 6
- enemy.jump(1, 0)
- when 8
- enemy.jump(0, -1)
- end #case
- Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
- end #if (bomb.x
- end #for enemy
- end #for bomb
- end #def item_bomb
- end#class
复制代码 谁可以帮咱让敌人死亡后打开敌人的独立开关A啊?
咱看晕了@。@ |
|