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

Project1

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

CP制战斗中事件不执行的问题

 关闭 [复制链接]

Lv3.寻梦者

股东

梦石
0
星屑
2050
在线时间
1634 小时
注册时间
2006-8-21
帖子
489

第2届TG大赛季军

跳转到指定楼层
1
发表于 2008-7-8 04:43:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
用了桜雅在土的CP制御战斗(β?)以后,战斗事件里设置的依回合数触发的事件就都不执行了。请问能不能解决。
此外,题外话,如果是CP制,是不是战斗回合应该分开每个参战对象计算才行?
版务信息:本贴由楼主自主结贴~
程序正义,程序正义 - -|||

Lv3.寻梦者

永久的旅行者

梦石
1
星屑
110
在线时间
404 小时
注册时间
2006-12-13
帖子
3091

开拓者贵宾第3届短篇游戏大赛主流游戏组季军第5届短篇游戏比赛季军

2
发表于 2008-7-8 08:58:16 | 只看该作者
应该是没有问题的,只是事件执行的时机不太明确...
(大约是全部角色行动过一次后算是一回合)
你可以看看我签名上的那个游戏,有用到CP,事件也解决得到...
回复 支持 反对

使用道具 举报

Lv3.寻梦者

股东

梦石
0
星屑
2050
在线时间
1634 小时
注册时间
2006-8-21
帖子
489

第2届TG大赛季军

3
 楼主| 发表于 2008-7-8 09:17:41 | 只看该作者
以下引用darkten于2008-7-8 0:58:16的发言:
大约是全部角色行动过一次后算是一回合


不是的。我设置一个队员一个敌人,条件:1+1x;距离:回合
不过还是只有第一回合可以触发,然后就没反应了。
我用的是整合成一个CP槽的那个:
http://rpg.blue/web/htm/news474.htm
程序正义,程序正义 - -|||
回复 支持 反对

使用道具 举报

Lv3.寻梦者

永久的旅行者

梦石
1
星屑
110
在线时间
404 小时
注册时间
2006-12-13
帖子
3091

开拓者贵宾第3届短篇游戏大赛主流游戏组季军第5届短篇游戏比赛季军

4
发表于 2008-7-8 09:32:37 | 只看该作者
以下引用狒狒王于2008-7-8 1:17:41的发言:


以下引用darkten于2008-7-8 0:58:16的发言:
大约是全部角色行动过一次后算是一回合



不是的。我设置一个队员一个敌人,条件:1+1x;距离:回合
不过还是只有第一回合可以触发,然后就没反应了。
我用的是整合成一个CP槽的那个:
http://rpg.blue/web/htm/news474.htm

那个战斗事件的“距离”设定为“回合”就行了。

所谓的一回合是指全部角色行动一次后(包括敌人),无论一个角色行动了多少次,只要还有角色没有行动到,就不算一回合...



另外,这个脚本有点问题,需要在“AX追加”那个脚本里面修改一点东西...
具体请看这个...
http://rpg.blue/viewthread.php?tid=86864
回复 支持 反对

使用道具 举报

Lv3.寻梦者

股东

梦石
0
星屑
2050
在线时间
1634 小时
注册时间
2006-8-21
帖子
489

第2届TG大赛季军

5
 楼主| 发表于 2008-7-8 10:02:36 | 只看该作者
以下引用darkten于2008-7-8 1:32:37的发言:
不是的。我设置一个队员一个敌人,条件:1+1x;距离:回合
不过还是只有第一回合可以触发,然后就没反应了。

那个战斗事件的“距离”设定为“回合”就行了。

所谓的一回合是指全部角色行动一次后(包括敌人),无论一个角色行动了多少次,只要还有角色没有行动到,就不算一回合...


我设的距离是回合,并且也是全部行动过以后仍旧没有反应,呵呵,可能是我自己改脚本改出的问题。不过印象里只是改了CP槽的滑动啊,囧
复活的问题确实没发现,多谢提醒
程序正义,程序正义 - -|||
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
6
发表于 2008-7-8 17:33:42 | 只看该作者
LZ是改动了脚本,正常的不会出现你所说的问题,CP制肯定会执行,只是执行的时间和默认的
不同,LZ还是把你的CP制御贴出来

关于你所说的回合,看一下这两段
def start_phase4
    $game_temp.battle_turn -= 1
    # フラグを退避
    save_flags = $game_temp.battle_event_flags.dup
    # 呼び戻す
    xrxs65_start_phase4
    # フラグを復旧
    $game_temp.battle_event_flags = save_flags
  end

def cp_turn_count
    $game_temp.battle_turn += 1
    # バトルイベントの全ページを検索
    for index in 0...$data_troops[@troop_id].pages.size
      # このページのスパンが [ターン] の場合
      if $data_troops[@troop_id].pages[index].span == 1
        # 実行済みフラグをクリア
        $game_temp.battle_event_flags[index] = false
      end
    end
  end

当所有人行动完之后算一回合
来6r就是等某位仁兄的巨坑

褴褛着身行无端,囊中羞涩空心酸。
平生几无得意事,倒塔泡面宅寝室。
惟羡隔壁高帅富,雨露春风月夜声。
青丝无处觅其踪,只有硬盘苍井空。
莫云男儿空悲愁,鸿鹄岂不天际游。
坐断天下执鹿首,千百金帛万兜鍪。
夜深忽梦某年月,再见女神欲语迟。
吊丝终有逆袭日,木耳再无回粉时。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

股东

梦石
0
星屑
2050
在线时间
1634 小时
注册时间
2006-8-21
帖子
489

第2届TG大赛季军

7
 楼主| 发表于 2008-7-8 19:42:21 | 只看该作者
以下引用dbshy于2008-7-8 9:33:42的发言:
LZ是改动了脚本,正常的不会出现你所说的问题,CP制肯定会执行,只是执行的时间和默认的
不同,LZ还是把你的CP制御贴出来

两部分都一样。还是贴出来吧,不过当时改的部分已经不记得了,应该是只改了CP槽滑动的速度,和不同行动消耗的CP而已:

CP制御

  1. # ▼▲▼ XRXS65. CP制御ターンシステム ver.β ▼▲▼ built 201120
  2. # by 桜雅 在土

  3. #==============================================================================
  4. # □ カスタマイズポイント
  5. #==============================================================================
  6. module XRXS65
  7.   #
  8.   # 「バトルスピード」(数値が高いほど早い)
  9.   #
  10.   SPEED = 1.0
  11.   #
  12.   # 戦闘開始時 CP。 固定値と占有率
  13.   #
  14.   CP_PRESET_FIXNUM = 40000
  15.   CP_PRESET_RATIO  = 0.2
  16.   #
  17.   # ターンコントローラ (nil  : カウント/ターンを有効。
  18.   #                     数値 : そのインデックスをもつエネミーが支配)
  19.   #
  20.   TC = 10
  21.   #
  22.   # カウント/ターン (TCが有効な場合は無視)
  23.   #
  24.   CPT = 10
  25.   #
  26.   # CP スキン
  27.   #
  28.   SKIN        = "123"  # スキンファイル名(Graphics/Windowskinsフォルダ)
  29.   LINE_HEIGHT =  6        # スキンの"一行"の縦幅[単位:ピクセル]
  30.   #
  31.   # 表示位置セッティング
  32.   #
  33.   #X_OFFSET = 144    # 横位置
  34.   #Y_OFFSET = 464    # 縦位置
  35.   ALIGN    =   2    #「位置揃え」(CPメーターの位置。0:左寄せ 1:中央 2:右寄せ)
  36.   MAX      =   4    # 確保するサイズ[単位:~人分]
  37.   #
  38.   # アクターコマンドがポップしたときの効果音
  39.   #
  40.   COMMAND_UP_SE = "Audio/SE/System_确定.mp3"
  41. end
  42. #==============================================================================
  43. # --- CP メーターの描画情報の取得 --- (Game_Battlerにインクルードされます)
  44. #==============================================================================
  45. module XRXS_CP
  46.   #--------------------------------------------------------------------------
  47.   # ○ スキンライン (スキンの何行目を使うか)
  48.   #--------------------------------------------------------------------------
  49.   def cp_linetype
  50.     # CP フルの場合はスキンの 2 行目を使う
  51.     return 2 if self.cp_full?
  52.     # 通常はスキンの 1 行目を使う
  53.     return 1
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ○ メーター量[単位:%]
  57.   #--------------------------------------------------------------------------
  58.   def cp_lineamount
  59.     # 戦闘不能の場合は 0 %として表示させる
  60.     return 0 if self.dead?
  61.     # CP値を%値に変換して返却する
  62.     return 100 * self.cp / self.max_cp
  63.   end
  64. end
  65. #
  66. # カスタマイズポイントここまで。
  67. #------------------------------------------------------------------------------



  68. #==============================================================================
  69. # --- XRXS. CP機構 ---
  70. #==============================================================================
  71. module XRXS_CP_SYSTEM
  72.   #----------------------------------------------------------------------------
  73.   # ○ 合計 AGI の取得
  74.   #----------------------------------------------------------------------------
  75.   def self.total_agi
  76.     total = 0
  77.     for battler in $game_party.actors + $game_troop.enemies
  78.       total += battler.agi
  79.     end
  80.     return total
  81.   end
  82. end
  83. #==============================================================================
  84. # --- バトラーにCP機能を追加 モジュール ---
  85. #==============================================================================
  86. module XRXS_CP
  87.   #--------------------------------------------------------------------------
  88.   # ○ 最大 CP の取得
  89.   #--------------------------------------------------------------------------
  90.   def max_cp
  91.     return 65535
  92.   end
  93.   
  94.   def new_agi
  95.     if self.hid_property[0] < 0
  96.       new_agi = self.agi**0.5
  97.       new_agi *= 10
  98.       new_agi = new_agi.round
  99.     else
  100.       new_agi = (self.agi / 2).round
  101.       new_agi = new_agi**0.5
  102.       new_agi *= 10
  103.       new_agi = new_agi.round
  104.     end
  105.     return new_agi
  106.   end
  107.   
  108.   #--------------------------------------------------------------------------
  109.   # ○ CP の取得と設定
  110.   #--------------------------------------------------------------------------
  111.   def cp
  112.     return @cp == nil ? @cp = 0 : @cp
  113.   end
  114.   def cp=(n)
  115.     @cp = [[n.to_i, 0].max, self.max_cp].min
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ○ CP 初期設定
  119.   #--------------------------------------------------------------------------
  120.   def cp_preset
  121.     percent = self.max_cp * XRXS65::CP_PRESET_RATIO * (rand(16) + 16) * self.new_agi / XRXS_CP_SYSTEM.total_agi / 24
  122.     self.cp = XRXS65::CP_PRESET_FIXNUM + percent
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ○ CP カウントアップ
  126.   #--------------------------------------------------------------------------
  127.   def cp_update
  128.     self.cp += XRXS65::SPEED * 4096 * self.new_agi / XRXS_CP_SYSTEM.total_agi
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ○ CP 満タン?
  132.   #--------------------------------------------------------------------------
  133.   def cp_full?
  134.     return @cp == self.max_cp
  135.   end
  136. end
  137. class Game_Battler
  138.   include XRXS_CP
  139. end
  140. #==============================================================================
  141. # --- ガード機能 ---
  142. #==============================================================================
  143. class Game_Battler
  144.   #--------------------------------------------------------------------------
  145.   # ○ ガードフラグ
  146.   #--------------------------------------------------------------------------
  147.   def guarding=(n)
  148.     @guarding = n
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # ● 防御中判定 [再定義]
  152.   #--------------------------------------------------------------------------
  153.   def guarding?
  154.     return @guarding
  155.   end
  156. end
  157. #==============================================================================
  158. # --- アクター「コマンド入力可能判定」:CPがないとコマンドしない ---
  159. #==============================================================================
  160. module XRXS_CP_INPUTABLE
  161.   def inputable?
  162.     return (self.cp_full? and super)
  163.   end
  164. end
  165. class Game_Actor < Game_Battler
  166.   include XRXS_CP_INPUTABLE
  167. end
  168. #==============================================================================
  169. # --- エネミー「行動可能判定」:CPがないとコマンドしない ---
  170. #==============================================================================
  171. module XRXS_CP_MOVABLE
  172.   def movable?
  173.     return (self.cp_full? and super)
  174.   end
  175. end
  176. class Game_Enemy < Game_Battler
  177.   include XRXS_CP_MOVABLE
  178. end
  179. #==============================================================================
  180. # --- 戦闘時 CPカウント ---
  181. #==============================================================================
  182. module XRXS_CP_Battle
  183.   #--------------------------------------------------------------------------
  184.   # ○ パーティ全員の CP を初期設定
  185.   #--------------------------------------------------------------------------
  186.   def cp_preset_party
  187.     for actor in $game_party.actors
  188.       actor.cp_preset
  189.     end
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ○ トループ全員の CP を初期設定
  193.   #--------------------------------------------------------------------------
  194.   def cp_preset_troop
  195.     for enemy in $game_troop.enemies
  196.       enemy.cp_preset
  197.     end
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ○ バトラー全員の CP をカウントアップ
  201.   #--------------------------------------------------------------------------
  202.   def cp_update
  203.     for battler in $game_party.actors + $game_troop.enemies
  204.       battler.cp_update
  205.     end
  206.   end
  207. end
  208. class Scene_Battle
  209.   include XRXS_CP_Battle
  210. end
  211. #==============================================================================
  212. # ■ Scene_Battle
  213. #==============================================================================
  214. class Scene_Battle
  215.   #--------------------------------------------------------------------------
  216.   # ● メイン処理
  217.   #--------------------------------------------------------------------------
  218.   alias xrxs65_main main
  219.   def main
  220.     # エクストラスプライトの初期化
  221.     @extra_sprites = [] if @extra_sprites == nil
  222.     # CP の初期化
  223.     cp_preset_party
  224.     # CP メーターの作成
  225.     @cp_meters = CP_Meters.new
  226.     # CP メーターをエクストラスプライトへ登録
  227.     @extra_sprites.push(@cp_meters)
  228.     # 呼び戻す
  229.     xrxs65_main
  230.     # メーターの解放
  231.     @cp_meters.dispose
  232.   end
  233.   
  234.   def cp_meter_refresh
  235.     @cp_meters.refresh
  236.   end
  237.   
  238.   #--------------------------------------------------------------------------
  239.   # ● プレバトルフェーズ開始
  240.   #--------------------------------------------------------------------------
  241.   alias xrxs65_start_phase1 start_phase1
  242.   def start_phase1
  243.     # 呼び戻す
  244.     xrxs65_start_phase1
  245.     # CP の初期化
  246.     cp_preset_troop
  247.     # CP メーターの更新
  248.     @cp_meters.refresh
  249.     # インデックスを計算
  250.     @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  251.     # アクターコマンドウィンドウに追加
  252.     @actor_command_window.add_command("撤退")
  253.     if !$game_temp.battle_can_escape
  254.       @actor_command_window.disable_item(@cp_escape_actor_command_index)
  255.     end
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ● パーティコマンドフェーズ開始
  259.   #--------------------------------------------------------------------------
  260.   alias xrxs65_start_phase2 start_phase2
  261.   def start_phase2
  262.     # 呼び戻す
  263.     xrxs65_start_phase2
  264.     # パーティコマンドウィンドウを無効化
  265.     @party_command_window.active  = false
  266.     @party_command_window.visible = false
  267.     # 強制的にフェイズ 2 を保持
  268.     @phase = 2
  269.     # ただし、既に行動可能者が存在する場合は 3 へ
  270.     start_phase3 if anybody_movable?
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # ○ CP制での ターンのカウント
  274.   #--------------------------------------------------------------------------
  275.   def cp_turn_count
  276.     $game_temp.battle_turn += 1
  277.     # バトルイベントの全ページを検索
  278.     for index in 0...$data_troops[@troop_id].pages.size
  279.       # このページのスパンが [ターン] の場合
  280.       if $data_troops[@troop_id].pages[index].span == 1
  281.         # 実行済みフラグをクリア
  282.         $game_temp.battle_event_flags[index] = false
  283.       end
  284.     end
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ● フレーム更新 (パーティコマンドフェーズ)
  288.   #--------------------------------------------------------------------------
  289.   alias xrxs65_update_phase2 update_phase2
  290.   def update_phase2
  291.     # パーティコマンドウィンドウのインデックスを無効化
  292.     @party_command_window.index = -1
  293.     # 呼び戻す
  294.     xrxs65_update_phase2
  295.     # 例外補正
  296.     @turn_count_time = 1 if @turn_count_time == nil
  297.     # ターンのカウント
  298.     if @turn_count_time > 0
  299.       @turn_count_time -= 1
  300.       if @turn_count_time == 0
  301.         cp_turn_count
  302.         @turn_count_time = XRXS65::CPT if XRXS65::TC == nil
  303.       end
  304.     end
  305.     # CP のフレーム更新
  306.     cp_update
  307.     @cp_meters.refresh
  308.     # フル CP のバトラーが存在する場合、ターン開始
  309.     start_phase3 if anybody_movable?
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # ○ フル CP バトラーが存在するか?
  313.   #--------------------------------------------------------------------------
  314.   def anybody_movable?
  315.     for battler in $game_party.actors + $game_troop.enemies
  316.       return true if battler.cp_full?
  317.     end
  318.     return false
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # ● アクターコマンドウィンドウのセットアップ
  322.   #--------------------------------------------------------------------------
  323.   alias xrxs65_phase3_setup_command_window phase3_setup_command_window
  324.   def phase3_setup_command_window
  325.     # 効果音の再生
  326.     Audio.se_play(XRXS65::COMMAND_UP_SE) rescue nil
  327.     # 呼び戻す
  328.     xrxs65_phase3_setup_command_window
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  332.   #--------------------------------------------------------------------------
  333.   alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  334.   def update_phase3_basic_command
  335.     # C ボタンが押された場合
  336.     if Input.trigger?(Input::C)
  337.       # アクターコマンドウィンドウのカーソル位置で分岐
  338.       case @actor_command_window.index
  339.       when @cp_escape_actor_command_index # 逃げる
  340.         if $game_temp.battle_can_escape
  341.           # 決定 SE を演奏
  342.           $game_system.se_play($data_system.decision_se)
  343.           # アクションを設定
  344.           @active_battler.current_action.kind = 0
  345.           @active_battler.current_action.basic = 4
  346.           # 次のアクターのコマンド入力へ
  347.           phase3_next_actor
  348.         else
  349.           # ブザー SE を演奏
  350.           $game_system.se_play($data_system.buzzer_se)
  351.         end
  352.         return
  353.       end
  354.     end
  355.     # 呼び戻す
  356.     xrxs_bsp1_update_phase3_basic_command
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ● メインフェーズ開始
  360.   #--------------------------------------------------------------------------
  361.   alias xrxs65_start_phase4 start_phase4
  362.   def start_phase4
  363.     # ターン数を引くことによって擬似的にカウントに変化を起こさせない
  364.     $game_temp.battle_turn -= 1
  365.     # フラグを退避
  366.     save_flags = $game_temp.battle_event_flags.dup
  367.     # 呼び戻す
  368.     xrxs65_start_phase4
  369.     # フラグを復旧
  370.     $game_temp.battle_event_flags = save_flags
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● 行動順序作成
  374.   #--------------------------------------------------------------------------
  375.   alias xrxs65_make_action_orders make_action_orders
  376.   def make_action_orders
  377.     # 呼び戻す
  378.     xrxs65_make_action_orders
  379.     # CPが不足している場合は @action_battlers から除外する
  380.     for battler in @action_battlers.dup
  381.       @action_battlers.delete(battler) unless battler.cp_full?
  382.     end
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  386.   #--------------------------------------------------------------------------
  387.   alias xrxs65_update_phase4_step2 update_phase4_step2
  388.   def update_phase4_step2
  389.     # ガードの解除
  390.     @active_battler.guarding = false
  391.     # CPの消費
  392.     case @active_battler.current_action.kind
  393.     when 0  # 基本
  394.       case @active_battler.current_action.basic
  395.       when 0 #攻击
  396.         @active_battler.cp = (@active_battler.max_cp*30/100).round
  397.       when 1#防御
  398.       @active_battler.cp = (@active_battler.max_cp*50/100).round
  399.       when 4#逃跑
  400.         @active_battler.cp = 0
  401.       else
  402.         @active_battler.cp = 0
  403.       end
  404.     when 1  # 特技
  405.       @active_battler.cp = (@active_battler.max_cp*$data_skills[@active_battler.current_action.skill_id].time_cost/100).round
  406.     when 2  # 物品
  407.       @active_battler.cp = (@active_battler.max_cp*35/100).round
  408.     else
  409.       @active_battler.cp = 0
  410.     end
  411.     # CP メーターの更新
  412.     @cp_meters.refresh
  413.     # 呼び戻す
  414.     xrxs65_update_phase4_step2
  415.     # 例外補正
  416.     return if @active_battler == nil
  417.     # ターンコントローラ
  418.     if @active_battler.is_a?(Game_Enemy) and @active_battler.index == XRXS65::TC
  419.       cp_turn_count
  420.     end
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # ● 基本アクション 結果作成
  424.   #--------------------------------------------------------------------------
  425.   alias xrxs65_make_basic_action_result make_basic_action_result
  426.   def make_basic_action_result
  427.     # 呼び戻す
  428.     xrxs65_make_basic_action_result
  429.     # 防御の場合
  430.     if @active_battler.current_action.basic == 1
  431.       @active_battler.guarding = true
  432.       return
  433.     end
  434.     # パーティの逃亡の場合
  435.     if @active_battler.current_action.basic == 4
  436.       # 逃走可能ではない場合
  437.       if $game_temp.battle_can_escape == false
  438.         # ブザー SE を演奏
  439.         $game_system.se_play($data_system.buzzer_se)
  440.         return
  441.       end
  442.       # パーティ全員の CP をクリア
  443.       for actor in $game_party.actors
  444.         actor.cp = 0
  445.       end
  446.       # CP メーターの更新
  447.       @cp_meters.refresh
  448.       # 逃走処理
  449.       update_phase2_escape
  450.       return
  451.     end
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  455.   #--------------------------------------------------------------------------
  456.   alias xrxs65_update_phase4_step5 update_phase4_step5
  457.   def update_phase4_step5
  458.     # 呼び戻す
  459.     xrxs65_update_phase4_step5
  460.     # CP メーターの更新
  461.     @cp_meters.refresh
  462.   end
  463. end

  464. #==============================================================================
  465. # --- XRXS. レクタンギュラーメーター表示・極 ---
  466. #==============================================================================
  467. class MeterSprite < Sprite
  468.   #--------------------------------------------------------------------------
  469.   # ○ オブジェクト初期化
  470.   #--------------------------------------------------------------------------
  471.   def initialize(skin, line_height)
  472.     @skin   = skin
  473.     @width  = @skin.width
  474.     @height = line_height
  475.     @line   = 1
  476.     @amount = 0
  477.     @base_sprite = Sprite.new
  478.     @base_sprite.bitmap = @skin
  479.     @base_sprite.src_rect.set(0, 0, @width, @height)
  480.     @base_sprite.z = 601
  481.     super()
  482.     self.z = @base_sprite.z + 1
  483.     self.bitmap = @skin
  484.     self.line = 1
  485.   end
  486.   #--------------------------------------------------------------------------
  487.   # ○ 値の設定
  488.   #--------------------------------------------------------------------------
  489.   def line=(n)
  490.     @line = n
  491.     refresh
  492.   end
  493.   def amount=(n)
  494.     @amount = n
  495.     refresh
  496.   end
  497.   def refresh
  498.     self.src_rect.set(0, @line * @height, @width * @amount / 100, @height)
  499.   end
  500.   #--------------------------------------------------------------------------
  501.   # ○ 座標の設定
  502.   #--------------------------------------------------------------------------
  503.   def x=(n)
  504.     super
  505.     @base_sprite.x = n
  506.   end
  507.   def y=(n)
  508.     super
  509.     @base_sprite.y = n
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # ○ 解放
  513.   #--------------------------------------------------------------------------
  514.   def dispose
  515.     @base_sprite.dispose
  516.     super
  517.   end
  518. end

复制代码


AX追加

  1. # ▼▲▼ XRXS65A. CP制御ターンシステム「シンセ・ゲージ」 ▼▲▼ built201202
  2. # by 桜雅 在土

  3. #==============================================================================
  4. # □ カスタマイズポイント
  5. #==============================================================================
  6. class XRXS65A
  7.   #--------------------------------------------------------------------------
  8.   # 「アイコン設定」
  9.   #--------------------------------------------------------------------------
  10.   DEFAULT = "e_monster" # 默认头像
  11.   # 主角与ICON对应
  12.   ICONS = {
  13.     1=>"a_加尔福特"
  14.   }
  15.   # 敌人与ICON对应
  16.   ICONE = {
  17.     3=>"e_boss"
  18.   }
  19.   #--------------------------------------------------------------------------
  20.   # 「シンセ・ゲージ」
  21.   #--------------------------------------------------------------------------
  22.   SKIN = "CP条"  # スキン
  23.   X    =  16         # X 座標
  24.   Y    =  24         # Y 座標
  25.   Z    =  1
  26. end
  27. #==============================================================================
  28. # --- CP メーターをまとめて管理するクラス、表示関係はすべてココ --- [再定義]
  29. #==============================================================================
  30. class CP_Meters
  31.   #--------------------------------------------------------------------------
  32.   # ○ オブジェクト初期化
  33.   #--------------------------------------------------------------------------
  34.   def initialize
  35.     # シンセゲージの生成
  36.     @base = Sprite.new
  37.     @base.bitmap = RPG::Cache.windowskin(XRXS65A::SKIN).dup
  38.     @base.x = XRXS65A::X
  39.     @base.y = XRXS65A::Y
  40.     @base.z = XRXS65A::Z
  41.     @width  = @base.bitmap.width - 12
  42.     @height = @base.bitmap.height
  43.     @icon_set = []
  44.     @last_target = -1
  45.     @old_z = 1
  46.     refresh
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ○ リフレッシュ
  50.   #--------------------------------------------------------------------------
  51.   def refresh
  52.     # 生成すべきバトラーの取得
  53.     need_initializes = []
  54.     for battler in $game_party.actors + $game_troop.enemies
  55.       exist = false
  56.       for set in @icon_set
  57.         exist |= (set[1] == battler)
  58.       end
  59.       need_initializes.push(battler) unless exist
  60.     end
  61.     for battler in need_initializes
  62.       iconname = nil
  63.       if battler.is_a?(Game_Actor)
  64.         iconname = XRXS65A::ICONS[battler.id]
  65.       else
  66.         iconname = XRXS65A::ICONE[battler.id]
  67.       end
  68.       if iconname == nil
  69.         iconname = XRXS65A::DEFAULT
  70.       end
  71.       sprite = RPG::Sprite.new
  72.       sprite.bitmap = RPG::Cache.icon(iconname).dup
  73.       sprite.oy = 35 #XRXS65A::Y + @height / 2 - 12
  74.       sprite.y = 33
  75.       @icon_set.push([sprite, battler])
  76.     end
  77.    
  78.       
  79.     # 更新
  80.     for set in @icon_set
  81.       set[0].x = @width *0.987* set[1].cp / set[1].max_cp+10 #- 12#XRXS65A::X +
  82.       set[0].z = icon_index(set[0])
  83.       if set[1].dead? or !set[1].exist?
  84.         set[0].visible = false
  85.       else
  86.         set[0].visible = true
  87.       end
  88.     end
  89.   end
  90.   
  91.   def update
  92.     for i in @icon_set
  93.       i[0].update
  94.     end
  95.   end
  96.   
  97.   
  98.   def icon_index(icon)#以CP长度计算顺序
  99.     index = 0
  100.     icon_cp = []
  101.     for i in @icon_set
  102.       icon_cp.push i[0].x
  103.     end
  104.     for i in icon_cp
  105.       index += 1
  106.       if icon.x == icon_cp.max
  107.         return index
  108.       else
  109.         icon_cp.delete(icon_cp.max)
  110.       end
  111.     end
  112.     return index
  113.   end
  114.   
  115.   #--------------------------------------------------------------------------
  116.   # ○ 可視状態
  117.   #--------------------------------------------------------------------------
  118.   def icon_flash(target)
  119.     if target != @last_target
  120.       @last_target = target
  121.       for i in @icon_set
  122.         i[0].blink_off
  123.         i[0].z = @old_z
  124.         if i[1] == target
  125.           i[0].blink_on
  126.           @old_z = i[0].z
  127.           i[0].z = @icon_set.size+1
  128.         end
  129.       end
  130.     end
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ○ 可視状態
  134.   #--------------------------------------------------------------------------
  135.   def visible=(b)
  136.     @base.visible = b
  137.     @icon_set.each{|set| set[0].visible = b }
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ○ 解放
  141.   #--------------------------------------------------------------------------
  142.   def dispose
  143.     @base.dispose
  144.     @icon_set.each{|set| set[0].dispose }
  145.   end
  146. end

复制代码
程序正义,程序正义 - -|||
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
8
发表于 2008-7-8 21:27:21 | 只看该作者
alias xrxs65_update_phase4_step2 update_phase4_step2
def update_phase4_step2
   # ガードの解除
   @active_battler.guarding = false
   # CPの消費
   case @active_battler.current_action.kind
   when 0  # 基本
     case @active_battler.current_action.basic
     when 0 #攻击
       @active_battler.cp = (@active_battler.max_cp*30/100).round
     when 1#防御
     @active_battler.cp = (@active_battler.max_cp*50/100).round
     when 4#逃跑
       @active_battler.cp = 0
     else
       @active_battler.cp = 0
     end
   when 1  # 特技
     @active_battler.cp = (@active_battler.max_cp*$data_skills[@active_battler.current_action.skill_id].time_cost/100).round
   when 2  # 物品
     @active_battler.cp = (@active_battler.max_cp*35/100).round
   else
     @active_battler.cp = 0
   end
   # CP メーターの更新
   @cp_meters.refresh
   # 呼び戻す
   xrxs65_update_phase4_step2
   # 例外補正
   return if @active_battler == nil
   # ターンコントローラ
   if @active_battler.is_a?(Game_Enemy) and @active_battler.index == XRXS65::TC
     cp_turn_count
   end

end

module XRXS65
# TC = 10
end


将TC改为0,不改为0会一直停留在第一回合 = =!



系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
来6r就是等某位仁兄的巨坑

褴褛着身行无端,囊中羞涩空心酸。
平生几无得意事,倒塔泡面宅寝室。
惟羡隔壁高帅富,雨露春风月夜声。
青丝无处觅其踪,只有硬盘苍井空。
莫云男儿空悲愁,鸿鹄岂不天际游。
坐断天下执鹿首,千百金帛万兜鍪。
夜深忽梦某年月,再见女神欲语迟。
吊丝终有逆袭日,木耳再无回粉时。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

股东

梦石
0
星屑
2050
在线时间
1634 小时
注册时间
2006-8-21
帖子
489

第2届TG大赛季军

9
 楼主| 发表于 2008-7-8 22:39:04 | 只看该作者
以下引用dbshy于2008-7-8 13:27:21的发言:
将TC改为0,不改为0会一直停留在第一回合 = =!

了解了,多谢。
程序正义,程序正义 - -|||
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-8-8 13:53

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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