ペットAI掲示板

おすすめ マナ&スタミナ節約格闘系アタッカー
アゼルハム 09/08/25 01:22
ペットキャラクターAIソースコード ソースコードをコピーする

初投稿です。
桃やんさん、痛いネカマさんのロジックなどを参考に
自分流にカスタマイズしてみました。
コードは長いのか入らないので↓

・自分でターゲット
・魔法は使わない
・カウンターは特定のシーンでのみ行う
・初撃はスマッシュ
・スマッシュ迎撃はアタック

の基本戦闘型です。

アルメディアさんが指摘しているように防具をつけられる
訳ではないのでカウンターが正なのでしょうが、相互カウ
ンターお見合い、とスタミナ消耗が気になって作ってみました。

プレイヤーのように釣り行為をしないので有効シーンが
限られますが比較的テンポ良くザコを掃討していきます。
作成したばかりの柴犬で高原イノシシやダイヤウルフにて
検証し、ほぼ全勝を確認しました。
(ちなみにDでゴブリンとかはタゲ撹乱してしまってダメでした)
-----
<rules>
<rule name="先制攻撃判断">
<conditions>
<condition name="skill_preparable" pet_skill="smash"/>
</conditions>
<pattern>
<param_decl/>
<sequence>
<cmd name="cancel_skill"/>
<cmd name="prepare_skill" pet_skill="smash" try_cnt="0" timeout="0"/>
<cmd name="melee_attack" timeout="0"/>
</sequence>
</pattern>
<event name="seek_target"/>
</rule>
<rule name="敵が硬直→攻撃">
<conditions>
<condition name="target_state" state="hit"/>
</conditions>
<pattern>
<param_decl/>
<sequence>
<cmd name="prepare_skill" pet_skill="smash" try_cnt="0" timeout="0"/>
<cmd name="melee_attack" timeout="0"/>
</sequence>
</pattern>
<event name="now_targeting"/>
</rule>
<rule name="近接攻撃後暴発防止">
<conditions/>
<pattern>
<param_decl/>
<sequence/>
</pattern>
<event name="attack" pet_attackable_skill="basic" down="true"/>
</rule>
<rule name="敵のノックバック→ディフェンス">
<conditions>
<condition name="target_state" state="shoved"/>
</conditions>
<pattern>
<param_decl/>
<sequence>
<cmd name="prepare_skill" pet_skill="defence" try_cnt="1" timeout="0"/>
<cmd name="move_against" distance="1000" run="false" timeout="1000"/>
</sequence>
</pattern>
<event name="now_targeting"/>
</rule>
<rule name="敵がダウン→ディフェンス">
<conditions>
<condition name="target_state" state="blowaway"/>
</conditions>
<pattern>
<param_decl/>
<sequence>
<cmd name="prepare_skill" pet_skill="defence" try_cnt="1" timeout="0"/>
<cmd name="move_against" distance="1000" run="false" timeout="1000"/>
</sequence>
</pattern>
<event name="now_targeting"/>
</rule>
<rule name="攻撃された→ディフェンス">
<conditions/>
<pattern>
<param_decl/>
<sequence>
<cmd name="prepare_skill" pet_skill="defence" try_cnt="3" timeout="0"/>
<cmd name="move_against" distance="100" run="false" timeout="1000"/>
</sequence>
</pattern>
<event name="attacked" master_skill="all" down="false"/>
</rule>
<rule name="ディフェンス反撃">
<conditions/>
<pattern>
<param_decl/>
<sequence>
<cmd name="cancel_skill"/>
<cmd name="melee_attack" timeout="0"/>
</sequence>
</pattern>
<event name="defence" defence_enable_skill="all"/>
</rule>
<rule name="歩いた→スマッシュ">
<conditions>
<condition name="target_state" state="walk"/>
</conditions>
<pattern>
<param_decl/>
<sequence>
<cmd name="cancel_skill"/>
<cmd name="prepare_skill" pet_skill="smash" try_cnt="1" timeout="0"/>
<cmd name="melee_attack" timeout="0"/>
</sequence>
</pattern>
<event name="target_skill_prepare"/>
</rule>
<rule name="走ってきた→攻撃">
<conditions>
<condition name="target_state" state="run"/>
</conditions>
<pattern>
<param_decl/>
<sequence>
<cmd name="cancel_skill"/>
<cmd name="melee_attack" timeout="0"/>
</sequence>
</pattern>
<event name="target_skill_prepare"/>
</rule>
<rule name="動かない→ディフェンス">
<conditions>
<condition name="target_state" state="stop"/>
</conditions>
<pattern>
<param_decl/>
<sequence>
<cmd name="prepare_skill" pet_skill="defence" try_cnt="0" timeout="0"/>
</sequence>
</pattern>
<event name="now_targeting"/>
</rule>
<rule name="飛ばされた→カウンター">
<conditions/>
<pattern>
<param_decl/>
<sequence>
<cmd name="prepare_skill" pet_skill="counter" try_cnt="1" timeout="5000"/>
</sequence>
</pattern>
<event name="attacked" master_skill="all" down="true"/>
</rule>
<rule name="レンジ対策">
<conditions/>
<pattern>
<param_decl/>
<sequence>
<cmd name="cancel_skill"/>
<cmd name="melee_attack" timeout="0"/>
</sequence>
</pattern>
<event name="aimed"/>
</rule>
<rule name="魔法対策">
<conditions/>
<pattern>
<param_decl/>
<sequence>
<cmd name="cancel_skill"/>
<cmd name="melee_attack" timeout="0"/>
</sequence>
</pattern>
<event name="target_magic_prepare"/>
</rule>
<rule name="撃破判断">
<conditions/>
<pattern>
<param_decl/>
<sequence/>
</pattern>
<event name="now_targeting"/>
</rule>
</rules>
-----

痛いネカマ ダミーコード意味ないwwwとか、
何で硬直してる隙にスマッシュなんて無謀なwwとか
いろいろ突っ込みたいけど!意外と上手く動いてて突っ込めない><; 09/08/25 21:43
アゼルハム 硬直にスマッシュは私が2打でワンパンスマッシュとかワンパンミルとか
やってるのでついw
敵やペットの相性考えるとスマッシュじゃない方が汎用性はありそうですね。 09/08/26 02:30
痛いネカマ なるほど!でも殴った後にスマッシュ準備しないよ><; 09/08/26 10:09
件名 名前 日付 閲覧数 投票数

マナ&スタミナ節約格闘系アタッカー

+3
アゼルハム 2009/08/25 11385 0