设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1246|回复: 1
打印 上一主题 下一主题

[已经过期] 求修改一下这个脚本 =。=

[复制链接]

Lv1.梦旅人

梦石
0
星屑
49
在线时间
26 小时
注册时间
2012-11-18
帖子
40
跳转到指定楼层
1
发表于 2012-11-24 08:15:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 丝诺·冯·温特 于 2012-11-24 10:54 编辑
  1. #======================================
  2. # ■ 战斗处理
  3. #======================================
  4. #  By: pudding
  5. #==============================================================================
  6. #                              伤害值
  7. #==============================================================================
  8. # $game_player.damage = 数值
  9. # $game_player.critical = true/false
  10. # $game_player.damage_pop = true
  11. # $game_map.events[事件编号].damage = 数值
  12. # $game_map.events[事件编号].critical = true/false
  13. # $game_map.events[事件编号].damage_pop = true
  14. #==============================================================================
  15. class Sprite_Character < RPG::Sprite
  16. alias hzhj_sc_update update
  17. def update
  18. hzhj_sc_update
  19. if @character.damage_pop
  20.       damage(@character.damage, @character.critical)
  21.       @character.damage = nil
  22.       @character.critical = false
  23.       @character.damage_pop = false
  24.     end
  25. #------------------------------------------------------------------------------
  26. #  当敌人生命值小于0时。
  27. #------------------------------------------------------------------------------
  28. if @hp <= 0 and @character.id != 0 and [email protected]_erased2 and @character.list[0].code == 108 and @character.list[0].parameters[0] == "全部"
  29.   @character.erase2
  30. end
  31. #------------------------------------------------------------------------------
  32. # 角色死亡设置
  33. #------------------------------------------------------------------------------
  34. if $game_party.actors[0].hp <= 1
  35. $scene = Scene_Gameover.new
  36. Mess_Text.clear
  37. end
  38. #------------------------------------------------------------------------------
  39. # 敌人死亡设置
  40. #------------------------------------------------------------------------------
  41. if @character.id != 0 and @character.return_erased2 == true and [url=home.php?mod=space&uid=7207]@asd[/url] == nil
  42.   [url=home.php?mod=space&uid=7207]@asd[/url] = 1
  43. Mess_Text.write ("#{@name}被消灭了。")
  44. Mess_Text.write ("获得#{@exp_x.to_i}点经验值。")
  45. $game_party.actors[0].exp += @exp_x
  46. @hpspsprite.bitmap.dispose
  47. #@character.name = "delete"
  48. @character.erase
  49. end
  50. end
  51. end

  52. class Game_Character
  53.   attr_accessor :through
  54.   attr_accessor :character_name
  55.   attr_accessor :white_flash
  56.   attr_accessor :damage_pop
  57.   attr_accessor :damage
  58.   attr_accessor :critical
  59.   alias carol3_66RPG_damage_pop_initialize initialize
  60.   def initialize
  61.     @damage_pop = false
  62.     @damage = 0
  63.     @critical = false
  64.     @white_flash=false
  65.     carol3_66RPG_damage_pop_initialize
  66.   end
  67. end
  68. #===================================================================
  69. #此脚本存在的话,就不能存档了。
  70. #等动画结束后角色才能移动
  71. =begin
  72. class Game_Player
  73. attr_accessor :sprite
  74. alias hzhj_update update
  75. def update
  76. return if [url=home.php?mod=space&uid=114926]@sprite[/url] != nil and @sprite.effect?
  77. hzhj_update
  78. end
  79. end
  80. module RPG
  81. class Sprite < ::Sprite
  82. def effect?
  83. @_whiten_duration > 0 or
  84. @_appear_duration > 0 or
  85. @_escape_duration > 0 or
  86. @_collapse_duration > 0 or
  87. @_animation_duration > 0
  88. end
  89. end
  90. end
  91. class Sprite_Character < RPG::Sprite
  92. alias hzhj_initialize initialize
  93. def initialize(viewport, character = nil)
  94. hzhj_initialize(viewport, character)
  95. if @character.class == Game_Player
  96. @character.sprite = self
  97. end
  98. end
  99. end
  100. =end
  101. #==============================================================================
  102. class Game_Event
  103.   def return_erased2
  104.     return @erased2
  105.   end
  106.   def erase2
  107.     @erased2 = true
  108.   end
  109. end
  110. class ARPG
  111.   def skill
  112.     return @skill
  113.   end
  114. end
  115. #==============================================================================
  116. $wait_H = 0
  117. $wait_H2 = 0
  118. $普通攻击动画ID = 0
  119. #==============================================================================
  120. class Scene_Map
  121. alias update_olc update
  122. def update
  123. update_olc
  124. [url=home.php?mod=space&uid=28395]@ppp[/url] = $game_party.actors[0]
  125. #--------------------------------------------------------------------------
  126. # ● 敌人攻击
  127. #--------------------------------------------------------------------------
  128.   for enemy in $game_map.events.values
  129.     next if enemy.return_erased2
  130.     next if enemy.list == nil
  131.     next if enemy.list[0].code != 108
  132.     next if enemy.list[1].parameters[0] != "敌人"
  133. #敌人的攻击力:
  134. @enemy_attack = enemy.list[6].parameters[0].to_i
  135. @enemy_animation = enemy.list[9].parameters[0].to_i
  136. #敌人面向下,攻击角色
  137. $wait_H += 0.1
  138. if $game_player.x == enemy.x and $game_player.y - enemy.y == 1 and enemy.direction == 2
  139. if $wait_H >= 200
  140.   case rand(40)
  141.   when 2
  142.   enemy.animation_id = @enemy_animation
  143. if @ppp.pdef >= @enemy_attack     #当敌人攻击少于角色防御
  144.    $game_switches[31] = true      #显示MISS
  145.    $game_player.damage_pop = true
  146.    Mess_Text.write ("#{@ppp.name}没有受到伤害。")
  147.    $wait_H += 0
  148.    else
  149.     $game_player.damage = @enemy_attack - @ppp.pdef
  150.     $game_player.damage_pop = true
  151.     @ppp.hp -= $game_player.damage
  152.     Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。")
  153.    $wait_H += 0
  154. end #if
  155. end #if
  156. end #case
  157. end #if
  158. #敌人面向左,攻击角色
  159. if $game_player.x - enemy.x == -1 and $game_player.y == enemy.y and enemy.direction == 4
  160. if $wait_H >= 200
  161.   case rand(40)
  162.   when 2
  163.   enemy.animation_id = @enemy_animation + 1
  164. if @ppp.pdef >= @enemy_attack     #当敌人攻击少于角色防御
  165.    $game_switches[31] = true      #显示MISS
  166.    $game_player.damage_pop = true
  167.    Mess_Text.write ("#{@ppp.name}没有受到伤害。")
  168.    $wait_H += 0
  169.    else
  170.     $game_player.damage = @enemy_attack - @ppp.pdef
  171.     $game_player.damage_pop = true
  172.     @ppp.hp -= $game_player.damage
  173.     Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。")
  174.     $wait_H += 0
  175. end #if
  176. end #if
  177. end #case
  178. end #if
  179. #敌人面向右,攻击角色
  180. if $game_player.x - enemy.x == 1 and $game_player.y == enemy.y and enemy.direction == 6
  181. if $wait_H >= 200
  182.   case rand(40)
  183.   when 2
  184.   enemy.animation_id = @enemy_animation + 2
  185. if @ppp.pdef >= @enemy_attack     #当敌人攻击少于角色防御
  186.    $game_switches[31] = true      #显示MISS
  187.    $game_player.damage_pop = true
  188.    Mess_Text.write ("#{@ppp.name}没有受到伤害。")
  189.    $wait_H += 0
  190.    else
  191.     $game_player.damage = @enemy_attack - @ppp.pdef
  192.     $game_player.damage_pop = true
  193.     @ppp.hp -= $game_player.damage
  194.     Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。")
  195.     $wait_H += 0
  196. end #if
  197. end #if
  198. end #case
  199. end #if
  200. #敌人面向上,攻击角色
  201. if $game_player.x == enemy.x and $game_player.y - enemy.y == -1 and enemy.direction == 8
  202. if $wait_H >= 200
  203.   case rand(40)
  204.   when 2
  205.   enemy.animation_id = @enemy_animation + 3
  206. if @ppp.pdef >= @enemy_attack     #当敌人攻击少于角色防御
  207.    $game_switches[31] = true      #显示MISS
  208.    $game_player.damage_pop = true
  209.    Mess_Text.write ("#{@ppp.name}没有受到伤害。")
  210.    $wait_H += 0
  211.    else
  212.     $game_player.damage = @enemy_attack - @ppp.pdef
  213.     $game_player.damage_pop = true
  214.     @ppp.hp -= $game_player.damage
  215.     Mess_Text.write ("#{@ppp.name}受到#{$game_player.damage.to_i}点伤害。")
  216.     $wait_H += 0
  217. end #if
  218. end #if
  219. end #case
  220. end #if
  221. #★★★★
  222. end#for★
  223. $普通攻击动画ID = 108
  224. #--------------------------------------------------------------------------
  225. # ● 角色普通攻击
  226. #--------------------------------------------------------------------------
  227. if Input.trigger?(Input::C)
  228. player_attack
  229. end#if
  230. end#update
  231. #--------------------------------------------------------------------------
  232. # ● 定义旋舞斩
  233. #--------------------------------------------------------------------------
  234. def skill_旋舞斩
  235.   for enemy in $game_map.events.values
  236.     next if enemy.return_erased2
  237.     next if enemy.list == nil
  238.     next if enemy.list[0].code != 108
  239.     next if enemy.list[1].parameters[0] != "敌人"
  240. px = $game_player.x
  241. py = $game_player.y
  242. if (px - enemy.x).abs <= 2 and (py - enemy.y).abs <= 1
  243. case rand(10)  
  244. when 0..8
  245.       enemy.damage = $data_skills[@skill.id].power
  246.       enemy.damage_pop = true
  247. case $game_player.direction
  248.     when 2
  249.     enemy.jump(0, 1)
  250.     when 4
  251.     enemy.jump(-1, 0)
  252.     when 6
  253.     enemy.jump(1, 0)
  254.     when 8
  255.     enemy.jump(0, -1)
  256.     end
  257. when 9
  258.       enemy.damage = $data_skills[@skill.id].power*2
  259.       enemy.damage_pop = true
  260.       enemy.critical = true
  261. case $game_player.direction
  262.     when 2
  263.     enemy.jump(0, 1)
  264.     when 4
  265.     enemy.jump(-1, 0)
  266.     when 6
  267.     enemy.jump(1, 0)
  268.     when 8
  269.     enemy.jump(0, -1)
  270.     end
  271.     end
  272. Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
  273.       end #伤害范围
  274.     end #定义event
  275. end #旋舞斩技能
  276. #--------------------------------------------------------------------------
  277. # ● 定义圣光
  278. #--------------------------------------------------------------------------
  279. def skill_圣光
  280.   for enemy in $game_map.events.values
  281.     next if enemy.return_erased2
  282.     next if enemy.list == nil
  283.     next if enemy.list[0].code != 108
  284.     next if enemy.list[1].parameters[0] != "敌人"
  285. px = $game_player.x
  286. py = $game_player.y
  287. if (px - enemy.x).abs <= 4 and (py - enemy.y).abs <= 2
  288.   case rand(10)  
  289.     when 0..8
  290.     enemy.damage = $data_skills[@skill.id].power
  291.     enemy.damage_pop = true
  292.     case $game_player.direction
  293.     when 2
  294.     enemy.jump(0, 1)
  295.     when 4
  296.     enemy.jump(-1, 0)
  297.     when 6
  298.     enemy.jump(1, 0)
  299.     when 8
  300.     enemy.jump(0, -1)
  301.     end
  302.     when 9
  303.     enemy.damage = $data_skills[@skill.id].power*2
  304.     enemy.damage_pop = true
  305.     enemy.critical = true
  306.     case $game_player.direction
  307.     when 2
  308.     enemy.jump(0, 1)
  309.     when 4
  310.     enemy.jump(-1, 0)
  311.     when 6
  312.     enemy.jump(1, 0)
  313.     when 8
  314.     enemy.jump(0, -1)
  315.     end
  316.   end
  317. Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
  318.       end #伤害范围
  319.     end #定义event
  320.   end #圣光技能
  321. #--------------------------------------------------------------------------
  322. # ● 角色普通攻击的处理
  323. #--------------------------------------------------------------------------
  324. def player_attack
  325. ppp = $game_party.actors[0]
  326. case $game_player.direction
  327. #| 下 |
  328. when 2
  329. $game_player.animation_id = $普通攻击动画ID
  330. for enemy in $game_map.events.values
  331. next if enemy.return_erased2
  332. next if enemy.list == nil
  333. next if enemy.list[0].code != 108
  334. next if enemy.list[1].parameters[0] != "敌人"
  335. if $game_player.x == enemy.x and enemy.y - $game_player.y == 1
  336.   case rand(10)  
  337.     when 0..6
  338.     enemy .animation_id = 7
  339.     enemy.damage = (ppp.atk + ppp.str) / 3
  340.     enemy.damage_pop = true
  341.     enemy.jump(0, 1)
  342.     when 7..9
  343.     enemy .animation_id = 7
  344.     enemy.damage =  (ppp.atk + ppp.str) / 3 + (ppp.dex / 5 )
  345.     enemy.damage_pop = true
  346.     enemy.critical = true
  347.     enemy.jump(0, 1)
  348.     end #case
  349. Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
  350. end #if
  351. end #for
  352. #| 右 |
  353. when 4
  354. $game_player.animation_id = $普通攻击动画ID + 1
  355. for enemy in $game_map.events.values
  356. next if enemy.return_erased2
  357. next if enemy.list == nil
  358. next if enemy.list[0].code != 108
  359. next if enemy.list[1].parameters[0] != "敌人"
  360. if enemy.x - $game_player.x == -1 and enemy.y == $game_player.y
  361.   case rand(10)  
  362.     when 0..6
  363.     enemy.animation_id = 7
  364.     enemy.damage = (ppp.atk + ppp.str) / 3
  365.     enemy.damage_pop = true
  366.     enemy.jump(0, 1)
  367.     when 7..9
  368.     enemy.animation_id = 7
  369.     enemy.damage =  (ppp.atk + ppp.str) / 3 + (ppp.dex / 5 )
  370.     enemy.damage_pop = true
  371.     enemy.critical = true
  372.     enemy.jump(0, 1)
  373.     end #case
  374. Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
  375. end #if
  376. end #for
  377. #| 左 |
  378. when 6
  379. $game_player.animation_id = $普通攻击动画ID + 2
  380. for enemy in $game_map.events.values
  381. next if enemy.return_erased2
  382. next if enemy.list == nil
  383. next if enemy.list[0].code != 108
  384. next if enemy.list[1].parameters[0] != "敌人"
  385. if enemy.x - $game_player.x == 1 and $game_player.y == enemy.y
  386.   case rand(10)  
  387.     when 0..6
  388.     enemy.animation_id = 7
  389.     enemy.damage = (ppp.atk + ppp.str) / 3
  390.     enemy.damage_pop = true
  391.     enemy.jump(0, 1)
  392.     when 7..9
  393.     enemy.animation_id = 7
  394.     enemy.damage =  (ppp.atk + ppp.str) / 3 + (ppp.dex / 5 )
  395.     enemy.damage_pop = true
  396.     enemy.critical = true
  397.     enemy.jump(0, 1)
  398.     end #case
  399. Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
  400. end #if
  401. end #for
  402. #| 上 |
  403. when 8
  404. $game_player.animation_id = $普通攻击动画ID + 3
  405. for enemy in $game_map.events.values
  406. next if enemy.return_erased2
  407. next if enemy.list == nil
  408. next if enemy.list[0].code != 108
  409. next if enemy.list[1].parameters[0] != "敌人"
  410. if $game_player.x == enemy.x and enemy.y - $game_player.y == -1
  411.   case rand(10)  
  412.     when 0..6
  413.     enemy.animation_id = 7
  414.     enemy.damage = (ppp.atk + ppp.str) / 3
  415.     enemy.damage_pop = true
  416.     enemy.jump(0, 1)
  417.     when 7..9
  418.     enemy.animation_id = 7
  419.     enemy.damage =  (ppp.atk + ppp.str) / 3 + (ppp.dex / 5 )
  420.     enemy.damage_pop = true
  421.     enemy.critical = true
  422.     enemy.jump(0, 1)
  423.     end #case
  424. Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
  425. end #if $game_player.x
  426. end #for
  427. end #case $game_player.direction
  428. end #角色普通攻击
  429. #--------------------------------------------------------------------------
  430. # ● 物品炸弹
  431. #--------------------------------------------------------------------------
  432. def item_bomb
  433. for bomb in $game_map.events.values
  434. next if bomb.list == nil
  435. next if bomb.list[0].code != 108
  436. next if bomb.list[0].parameters[0] != "bomb"
  437. bomb.animation_id = 99
  438. for enemy in $game_map.events.values
  439. next if enemy.return_erased2
  440. next if enemy.list == nil
  441. next if enemy.list[0].code != 108
  442. next if enemy.list[1].parameters[0] != "敌人"
  443. if (bomb.x - enemy.x).abs <= 1 and (bomb.y - enemy.y).abs <= 2
  444.       enemy.damage = (@ppp.atk/[email protected]/2)*2 + 500
  445.       enemy.damage_pop = true
  446. case $game_player.direction
  447. when 2
  448. enemy.jump(0, 1)
  449. when 4
  450. enemy.jump(-1, 0)
  451. when 6
  452. enemy.jump(1, 0)
  453. when 8
  454. enemy.jump(0, -1)
  455. end #case
  456. Mess_Text.write ("#{enemy.list[2].parameters[0]}受到#{enemy.damage.to_i}伤害。")
  457. end #if (bomb.x
  458. end #for enemy
  459. end #for bomb
  460. end #def item_bomb
  461. end#class
复制代码
谁可以帮咱让敌人死亡后打开敌人的独立开关A啊?
咱看晕了@。@  

Lv1.梦旅人

梦石
0
星屑
49
在线时间
26 小时
注册时间
2012-11-18
帖子
40
2
 楼主| 发表于 2012-11-24 09:57:16 | 只看该作者
@pudding 一直被无视,已经成习惯。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-23 10:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表