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

Project1

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

[已经解决] 如何做一个类似于补给水晶之类的物品

[复制链接]

Lv2.观梦者

梦石
0
星屑
327
在线时间
1291 小时
注册时间
2013-1-12
帖子
3590

贵宾

1
发表于 2013-9-27 06:48:00 | 显示全部楼层
本帖最后由 76213585 于 2013-9-26 17:52 编辑

插入main以上
設定設好之後就行了
RUBY 代码复制
  1. module Panda
  2. U_VAR = 1 #使用變量
  3. ACT = 1#几號隊員回血?
  4. end
  5. class Scene_Map < Scene_Base
  6.   def update
  7.     super
  8.     $game_map.update(true)
  9.     $game_player.update
  10.     $game_timer.update
  11.     @spriteset.update
  12.      if $game_variables[Panda::U_VAR]> 0
  13.       $game_actors[Panda::ACT].hp += 1
  14.       $game_variables[Panda::U_VAR] -= 1
  15.      end
  16.      update_scene if scene_change_ok?
  17.    end
  18. end


然後物品的設置就是通到公共事件然後加你使用的變量任何數字(血包含量)即可
應該可行  有bug跟我說

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
327
在线时间
1291 小时
注册时间
2013-1-12
帖子
3590

贵宾

2
发表于 2013-9-27 08:20:25 | 显示全部楼层
本帖最后由 76213585 于 2013-9-26 17:52 编辑

請原諒連帖.........
這個可以讓血量是一瞬間恢復的......  不是一點一點加上去  血量很多的遊戲也不用擔心了
RUBY 代码复制
  1. module Panda
  2. U_VAR = 1 #使用變量
  3. ACT = 1#几號隊員回血?
  4. end
  5. class Scene_Map < Scene_Base
  6.   def update
  7.     super
  8.     $game_map.update(true)
  9.     $game_player.update
  10.     $game_timer.update
  11.     @spriteset.update
  12.      update_scene if scene_change_ok?   
  13.      @k = $game_actors[Panda::ACT].mhp - $game_actors[Panda::ACT].hp
  14.      if $game_variables[Panda::U_VAR]> 0
  15.       if $game_variables[Panda::U_VAR]>= @k
  16.         $game_variables[Panda::U_VAR] -= @k
  17.         $game_actors[Panda::ACT].hp += @k
  18.       end
  19.       else if $game_variables[Panda::U_VAR]< @k
  20.         $game_actors[Panda::ACT].hp += $game_variables[Panda::U_VAR]
  21.         $game_variables[Panda::U_VAR] = 0
  22.       end
  23.       end
  24.    end
  25. end

评分

参与人数 1梦石 +1 收起 理由
Sion + 1 感谢帮忙

查看全部评分


回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-6 16:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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