Skip to content

Instantly share code, notes, and snippets.

@rutan
Created March 31, 2013 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rutan/5280517 to your computer and use it in GitHub Desktop.
Save rutan/5280517 to your computer and use it in GitHub Desktop.
【RGSS3】エネミーのトループターゲットランダム化さん for RGSS3
# coding: utf-8
#===============================================================================
# ■ エネミーのトループターゲットランダム化さん for RGSS3
#-------------------------------------------------------------------------------
# 2012/03/03 Ru/むっくRu
#-------------------------------------------------------------------------------
# 敵に「味方単体」対象の技(例:ヒール)を使わせると,
# 同じ敵にずっと使い続けてしまうので,
# 対象をランダムにするように変更するスクリプトです.
#-------------------------------------------------------------------------------
# 【更新履歴】
# 2012/03/03 味方単体(戦闘不能)がきちんと動かない不具合修正orz
# 2012/03/03 戦闘不能エネミーがいるとおかしくなるのを修正,味方単体(戦闘不能)に対応
# 2012/03/03 ぶっぱ
#-------------------------------------------------------------------------------
#===============================================================================
# ↓ 以下、スクリプト部 ↓
#===============================================================================
class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# ● ターゲットのスムーズな決定(エイリアス)
#--------------------------------------------------------------------------
alias hzm_vxa_troopTargetRandom_smooth_target smooth_target
def smooth_target(index)
return random_target unless index >= 0
hzm_vxa_troopTargetRandom_smooth_target(index)
end
#--------------------------------------------------------------------------
# ● ターゲットのスムーズな決定(戦闘不能)(エイリアス)
#--------------------------------------------------------------------------
alias hzm_vxa_troopTargetRandom_smooth_dead_target smooth_dead_target
def smooth_dead_target(index)
return random_dead_target unless index >= 0
hzm_vxa_troopTargetRandom_smooth_dead_target(index)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment