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

Project1

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

[RMVA发布] 可以对敌也可以对友的技能

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
49 小时
注册时间
2014-11-1
帖子
21
跳转到指定楼层
1
发表于 2015-10-5 15:52:32 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 中二病医生 于 2015-10-5 15:54 编辑

嗯……为增强游戏的灵活性弄了这么一种可以对敌也可以对友的技能……
不过代码比较散所以没有整合到一起……
应该不会有需求?
另外还做了技能冷却和装备加工……
但是看到站内已经有了而且做的比我完善我还是不发上来了……

QQ图片20151005155026.png (282.52 KB, 下载次数: 14)

QQ图片20151005155026.png

评分

参与人数 1星屑 +75 收起 理由
chd114 + 75 正好需要,先收藏顺便塞糖

查看全部评分

Lv2.观梦者

梦石
0
星屑
254
在线时间
316 小时
注册时间
2015-7-2
帖子
1747

开拓者

2
发表于 2015-10-5 16:43:23 | 只看该作者
实际上使用默认数据库的【混乱】也能起到相似的效果,只是是乱序的。
那么求发……我这边可能会用到
顺带问一句为什么一个叫做李的家伙会这么多符卡啊……
灵梦的梦想天生啊……这货会这么多不会是EX面BOSS吧
反白而已
测试你的东方project认知程度?那就来玩[url=https://store.steampowered.com/app/930840/TouHouAsked/]《东方百问》[/url]吧!
东方风自作曲认知企划绝赞咕咕咕中
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
49 小时
注册时间
2014-11-1
帖子
21
3
 楼主| 发表于 2015-10-5 17:01:58 | 只看该作者
本帖最后由 中二病医生 于 2015-10-5 17:07 编辑
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Window_BattleEnemy
  4. #------------------------------------------------------------------------------
  5. #  战斗画面中,选择目标的窗口。
  6. #==============================================================================

  7. class Window_BattleAim < Window_Selectable
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化对象
  10.   #     info_viewport : 信息显示用显示端口
  11.   #--------------------------------------------------------------------------
  12.   def initialize(info_viewport)
  13.     super(0, info_viewport.rect.y, window_width, fitting_height(4))
  14.     refresh
  15.     self.visible = false
  16.     @info_viewport = info_viewport
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● 获取窗口的宽度
  20.   #--------------------------------------------------------------------------
  21.   def window_width
  22.     Graphics.width - 128
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 获取列数
  26.   #--------------------------------------------------------------------------
  27.   def col_max
  28.     return 2
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # ● 获取项目数
  32.   #--------------------------------------------------------------------------
  33.   def item_max
  34.     $game_troop.alive_members.size + $game_party.battle_alive_members.size
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   # ● 获取所有项目
  38.   #--------------------------------------------------------------------------
  39.   def all_item
  40.     $game_troop.alive_members + $game_party.battle_alive_members
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ● 获取目标实例
  44.   #--------------------------------------------------------------------------
  45.   def aim
  46.     all_item[@index]
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● 绘制项目
  50.   #--------------------------------------------------------------------------
  51.   def draw_item(index)
  52.     change_color(normal_color)
  53.     name = all_item[index].name
  54.     draw_text(item_rect_for_text(index), name)
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ● 显示窗口
  58.   #--------------------------------------------------------------------------
  59.   def show
  60.     if @info_viewport
  61.       width_remain = Graphics.width - width
  62.       self.x = width_remain
  63.       @info_viewport.rect.width = width_remain
  64.       select(0)
  65.     end
  66.     super
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ● 隐藏窗口
  70.   #--------------------------------------------------------------------------
  71.   def hide
  72.     @info_viewport.rect.width = Graphics.width if @info_viewport
  73.     super
  74.   end
  75. end
  76. #encoding:utf-8
  77. #==============================================================================
  78. # ■ Scene_Battle
  79. #------------------------------------------------------------------------------
  80. #  战斗画面
  81. #==============================================================================

  82. class Scene_Battle < Scene_Base
  83.   #--------------------------------------------------------------------------
  84.   # ● 生成所有窗口
  85.   #--------------------------------------------------------------------------
  86.   def create_all_windows
  87.     create_message_window
  88.     create_scroll_text_window
  89.     create_log_window
  90.     create_status_window
  91.     create_info_viewport
  92.     create_party_command_window
  93.     create_actor_command_window
  94.     create_help_window
  95.     create_skill_window
  96.     create_item_window
  97.     create_actor_window
  98.     create_enemy_window
  99.     create_aim_window
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● 生成目标窗口
  103.   #--------------------------------------------------------------------------
  104.   def create_aim_window
  105.     @aim_window = Window_BattleAim.new(@info_viewport)
  106.     @aim_window.set_handler(:ok,     method(:on_aim_ok))
  107.     @aim_window.set_handler(:cancel, method(:on_aim_cancel))
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ● 开始选择目标
  111.   #--------------------------------------------------------------------------
  112.   def select_aim_selection
  113.     @aim_window.refresh
  114.     @aim_window.show.activate
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ● 目标“确定”
  118.   #--------------------------------------------------------------------------
  119.   def on_aim_ok
  120.     BattleManager.actor.input.target_index = @aim_window.index
  121.     @aim_window.hide
  122.     @skill_window.hide
  123.     @item_window.hide
  124.     next_command
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● 目标“取消”
  128.   #--------------------------------------------------------------------------
  129.   def on_aim_cancel
  130.     @aim_window.hide
  131.     case @actor_command_window.current_symbol
  132.     when :skill
  133.       @skill_window.activate
  134.     when :item
  135.       @item_window.activate
  136.     end
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 技能“确定”
  140.   #--------------------------------------------------------------------------
  141.   def on_skill_ok
  142.     @skill = @skill_window.item
  143.     BattleManager.actor.input.set_skill(@skill.id)
  144.     BattleManager.actor.last_skill.object = @skill
  145.     if @skill.note.include?('目标不定')
  146.       select_aim_selection
  147.     elsif [email protected]_selection?
  148.       @skill_window.hide
  149.       next_command
  150.     elsif @skill.for_opponent?
  151.       select_enemy_selection
  152.     else
  153.       select_actor_selection
  154.     end
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # ● 物品“确定”
  158.   #--------------------------------------------------------------------------
  159.   def on_item_ok
  160.     @item = @item_window.item
  161.     BattleManager.actor.input.set_item(@item.id)
  162.     if @item.note.include?('目标不定')
  163.       select_aim_selection
  164.     elsif [email protected]_selection?
  165.       @item_window.hide
  166.       next_command
  167.     elsif @item.for_opponent?
  168.       select_enemy_selection
  169.     else
  170.       select_actor_selection
  171.     end
  172.     $game_party.last_item.object = @item
  173.   end
  174. end
  175. #encoding:utf-8
  176. #==============================================================================
  177. # ■ Game_Action
  178. #------------------------------------------------------------------------------
  179. #  处理战斗中的行动的类。本类在 Game_Battler 类的内部使用。
  180. #==============================================================================
  181. class Game_Action
  182.   #--------------------------------------------------------------------------
  183.   # ● 生成目标数组
  184.   #--------------------------------------------------------------------------
  185.   def make_targets
  186.     if item.note.include?('目标不定')
  187.       target_for_one
  188.     elsif !forcing && subject.confusion?
  189.       [confusion_target]
  190.     elsif item.for_opponent?
  191.       targets_for_opponents
  192.     elsif item.for_friend?
  193.       targets_for_friends
  194.     else
  195.       []
  196.     end
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● 获取技能/使用物品的候选目标
  200.   #--------------------------------------------------------------------------
  201.   def item_target_candidates
  202.     if item.note.include?('目标不定')
  203.       opponents_unit.alive_members + friends_unit.alive_members
  204.     elsif item.for_opponent?
  205.       opponents_unit.alive_members
  206.     elsif item.for_user?
  207.       [subject]
  208.     elsif item.for_dead_friend?
  209.       friends_unit.dead_members
  210.     else
  211.       friends_unit.alive_members
  212.     end
  213.   end
  214. end
复制代码
……回去整合了下,应该是这样
不过难免有遗漏,毕竟用Ruby也就一个星期。
有Bug请报告我hhh
另外这里的验证码区分大小写??
落了一段hhhh
是Action里的
  1.   #--------------------------------------------------------------------------
  2.   # ● 目标为一位不定势力
  3.   #--------------------------------------------------------------------------
  4.   def target_for_one
  5.     num = 1 + (attack? ? subject.atk_times_add.to_i : 0)
  6.     newunit = Game_Unit.new($game_troop.alive_members +
  7.     $game_party.battle_alive_members, true)
  8.     if @target_index < 0
  9.       [newunit.random_target] * num
  10.     else
  11.       [newunit.smooth_target(@target_index)] * num
  12.     end
  13.   end
  14. #encoding:utf-8
  15. #==============================================================================
  16. # ■ Game_Unit
  17. #------------------------------------------------------------------------------
  18. #  管理游戏单位的类。是 Game_Party 和 Game_Troop 类的父类。
  19. #==============================================================================

  20. class Game_Unit
  21.   #--------------------------------------------------------------------------
  22.   # ● 定义实例变量
  23.   #--------------------------------------------------------------------------
  24.   attr_reader   :in_battle                # 战斗中的标志
  25.   attr_accessor :mymembers                # 成员
  26.   #--------------------------------------------------------------------------
  27.   # ● 初始化对象
  28.   #--------------------------------------------------------------------------
  29.   def initialize(m = nil, ib = true)
  30.     @mymembers = m if m != nil
  31.     @in_battle = ib
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # ● 获取成员
  35.   #--------------------------------------------------------------------------
  36.   def members
  37.     return @mymembers
  38.   end
  39. end
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
61
在线时间
696 小时
注册时间
2011-1-4
帖子
208
4
发表于 2016-2-26 23:51:50 | 只看该作者
楼主你好,之前用你这脚本发现个问题,
https://rpg.blue/forum.php?mod=v ... p;page=1#pid2667088

有人回复说是脚本里有个地方错了,麻烦你看一下,要是错了的话就顺便更新下吧,省得别的小白跟我一样纠结半天

点评

唔……抱歉很久不上这里了现在有点问题才想起来要上2333 额回头我仔细看看吧确实可能有问题233  发表于 2016-5-22 09:53
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9275
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

5
发表于 2016-2-27 20:39:03 | 只看该作者
这个帖子沉的够久。。。到现在看到
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 18:17

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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