Hengband  2.2.1
マクロ定義 | 変数
creature.h ファイル
被依存関係図:

[ソースコード]

マクロ定義

#define ENERGY_NEED()   (randnor(100, 25))
 消費する行動エネルギー値を正規乱数で返す(中央100/分散25) / Random energy [詳解]
 
#define SPEED_TO_ENERGY(SPEED)   (((SPEED) > 199) ? 49 : extract_energy[(SPEED)])
 加速値に応じた基本行動エネルギー消費量を返す / Extract energy from speed (Assumes that SPEED is unsigned) [詳解]
 

変数

const byte extract_energy [200]
 加速値による実質速度修正倍率テーブル / This table allows quick conversion from "speed" to "energy" [詳解]
 

マクロ定義詳解

◆ ENERGY_NEED

#define ENERGY_NEED ( )    (randnor(100, 25))

消費する行動エネルギー値を正規乱数で返す(中央100/分散25) / Random energy

◆ SPEED_TO_ENERGY

#define SPEED_TO_ENERGY (   SPEED)    (((SPEED) > 199) ? 49 : extract_energy[(SPEED)])

加速値に応じた基本行動エネルギー消費量を返す / Extract energy from speed (Assumes that SPEED is unsigned)

変数詳解

◆ extract_energy

const byte extract_energy[200]

加速値による実質速度修正倍率テーブル / This table allows quick conversion from "speed" to "energy"

The basic function WAS ((S>=110) ? (S-110) : (100 / (120-S)))
Note that table access is *much* quicker than computation.
Note that the table has been changed at high speeds.  From
"Slow (-40)" to "Fast (+30)" is pretty much unchanged, but
at speeds above "Fast (+30)", one approaches an asymptotic
effective limit of 50 energy per turn.  This means that it
is relatively easy to reach "Fast (+30)" and get about 40
energy per turn, but then speed becomes very "expensive",
and you must get all the way to "Fast (+50)" to reach the
point of getting 45 energy per turn.  After that point,
furthur increases in speed are more or less pointless,
except to balance out heavy p_ptr->inventory_list.
Note that currently the fastest monster is "Fast (+30)".
It should be possible to lower the energy threshhold from
100 units to 50 units, though this may interact badly with
the (compiled out) small random energy boost code.  It may
also tend to cause more "clumping" at high speeds.