Hengband
2.2.1
|
データ構造 | |
struct | monster_power |
型定義 | |
typedef struct monster_power | monster_power |
関数 | |
bool | clean_shot (POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend) |
モンスターにとってボルト型魔法が有効な状態かを返す / Determine if a bolt spell will hit the player. [詳解] | |
bool | summon_possible (POSITION y1, POSITION x1) |
モンスターにとって所定の地点が召還に相応しい地点かどうかを返す。 / Determine if there is a space near the player in which a summoned creature can appear [詳解] | |
bool | raise_possible (monster_type *m_ptr) |
モンスターにとって死者復活を行うべき状態かどうかを返す / Determine if there is a space near the player in which a summoned creature can appear [詳解] | |
bool | dispel_check (MONSTER_IDX m_idx) |
モンスターがプレイヤーに魔力消去を与えるべきかを判定するルーチン Check should monster cast dispel spell. [詳解] | |
bool | spell_is_inate (SPELL_IDX spell) |
ID値が非魔術的な特殊技能かどうかを返す / Return TRUE if a spell is inate spell. [詳解] | |
bool | make_attack_spell (MONSTER_IDX m_idx) |
モンスターの特殊技能メインルーチン / Creatures can cast spells, shoot missiles, and breathe. [詳解] | |
void | beam (MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type) |
モンスターのビーム型魔法処理 / [詳解] | |
void | bolt (MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type) |
モンスターのボルト型魔法処理 / Cast a bolt at the player Stop if we hit a monster Affect monsters and the player [詳解] | |
void | breath (POSITION y, POSITION x, MONSTER_IDX m_idx, EFFECT_ID typ, int dam_hp, POSITION rad, bool breath, int monspell, int target_type) |
モンスターのボール型&ブレス型魔法処理 / Cast a breath (or ball) attack at the player Pass over any monsters that may be in the way Affect grids, objects, monsters, and the player [詳解] | |
void | get_project_point (POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg) |
モンスターが特殊能力の目標地点を決める処理 / Get the actual center point of ball spells (rad > 1) (originally from TOband) [詳解] | |
bool | monst_spell_monst (MONSTER_IDX m_idx) |
モンスターが敵モンスターに特殊能力を使う処理のメインルーチン / Monster tries to 'cast a spell' (or breath, etc) at another monster. [詳解] | |
bool | do_cmd_cast_learned (void) |
青魔法コマンドのメインルーチン / do_cmd_cast calls this function if the player's class is 'Blue-Mage'. [詳解] | |
void | learn_spell (int monspell) |
青魔法のラーニング判定と成功した場合のラーニング処理 [詳解] | |
void | set_rf_masks (BIT_FLAGS *f4, BIT_FLAGS *f5, BIT_FLAGS *f6, BIT_FLAGS mode) |
モンスター特殊能力のフラグ配列から特定条件の魔法だけを抜き出す処理 Extract monster spells mask for the given mode [詳解] | |
bool | spell_learnable (MONSTER_IDX m_idx) |
モンスターの唱えた呪文を青魔法で学習できるか判定する / [詳解] | |
HIT_POINT | monspell_to_player (int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx) |
モンスターからプレイヤーへの呪文の振り分け関数。 / [詳解] | |
HIT_POINT | monspell_to_monster (int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx) |
モンスターからモンスターへの呪文の振り分け関数。 / [詳解] | |
HIT_POINT | monspell_damage (int SPELL_NUM, MONSTER_IDX m_idx, int TYPE) |
モンスターの使う呪文の威力を返す / [詳解] | |
HIT_POINT | monspell_race_damage (int SPELL_NUM, MONRACE_IDX r_idx, int TYPE) |
モンスターの使う呪文の威力を返す / [詳解] | |
HIT_POINT | monspell_bluemage_damage (int SPELL_NUM, PLAYER_LEVEL plev, int TYPE) |
青魔導師の使う呪文の威力を返す / [詳解] | |
変数 | |
const monster_power | monster_powers [MAX_MONSPELLS] |
青魔法テーブル [詳解] | |
const concptr | monster_powers_short [MAX_MONSPELLS] |
モンスター魔法名テーブル [詳解] | |
#define BASE_DAM 8 |
#define DAM_MAX 2 |
#define DAM_MIN 3 |
#define DAM_ROLL 1 |
#define DICE_DIV 7 |
#define DICE_MULT 6 |
#define DICE_NUM 4 |
#define DICE_SIDE 5 |
#define MAX_MONSPELLS 96 |
#define MONSPELL_TYPE_BALL 2 |
#define MONSPELL_TYPE_BOLT 1 |
#define MONSPELL_TYPE_BREATH 3 |
#define MONSPELL_TYPE_OTHER 5 |
#define MONSPELL_TYPE_SUMMON 4 |
#define MONSTER_TO_MONSTER 0x02 |
#define MONSTER_TO_PLAYER 0x01 |
#define MS_BALL_ACID 32 |
#define MS_BALL_CHAOS 30 |
#define MS_BALL_COLD 35 |
#define MS_BALL_DARK 40 |
#define MS_BALL_ELEC 33 |
#define MS_BALL_FIRE 34 |
#define MS_BALL_MANA 39 |
#define MS_BALL_NETHER 37 |
#define MS_BALL_NUKE 28 |
#define MS_BALL_POIS 36 |
#define MS_BALL_WATER 38 |
#define MS_BLIND 60 |
#define MS_BLINK 68 |
#define MS_BOLT_ACID 48 |
#define MS_BOLT_COLD 51 |
#define MS_BOLT_ELEC 49 |
#define MS_BOLT_FIRE 50 |
#define MS_BOLT_ICE 57 |
#define MS_BOLT_MANA 55 |
#define MS_BOLT_NETHER 53 |
#define MS_BOLT_PLASMA 56 |
#define MS_BOLT_WATER 54 |
#define MS_BR_ACID 8 |
#define MS_BR_CHAOS 18 |
#define MS_BR_COLD 11 |
#define MS_BR_CONF 16 |
#define MS_BR_DARK 15 |
#define MS_BR_DISEN 19 |
#define MS_BR_DISI 31 |
#define MS_BR_ELEC 9 |
#define MS_BR_FIRE 10 |
#define MS_BR_FORCE 26 |
#define MS_BR_GRAVITY 23 |
#define MS_BR_INERTIA 22 |
#define MS_BR_LITE 14 |
#define MS_BR_MANA 27 |
#define MS_BR_NETHER 13 |
#define MS_BR_NEXUS 20 |
#define MS_BR_NUKE 29 |
#define MS_BR_PLASMA 25 |
#define MS_BR_POIS 12 |
#define MS_BR_SHARDS 24 |
#define MS_BR_SOUND 17 |
#define MS_BR_TIME 21 |
#define MS_BRAIN_SMASH 43 |
#define MS_CAUSE_1 44 |
#define MS_CAUSE_2 45 |
#define MS_CAUSE_3 46 |
#define MS_CAUSE_4 47 |
#define MS_CONF 61 |
#define MS_DARKNESS 76 |
#define MS_DISPEL 2 |
#define MS_DRAIN_MANA 41 |
#define MS_FORGET 78 |
#define MS_HAND_DOOM 65 |
#define MS_HEAL 66 |
#define MS_INVULNER 67 |
#define MS_MAGIC_MISSILE 58 |
#define MS_MAKE_TRAP 77 |
#define MS_MIND_BLAST 42 |
#define MS_PSY_SPEAR 75 |
#define MS_RAISE_DEAD 79 |
#define MS_ROCKET 3 |
#define MS_S_AMBERITE 94 |
#define MS_S_ANGEL 88 |
#define MS_S_ANT 84 |
#define MS_S_CYBER 81 |
#define MS_S_DEMON 89 |
#define MS_S_DRAGON 91 |
#define MS_S_HI_DRAGON 93 |
#define MS_S_HI_UNDEAD 92 |
#define MS_S_HOUND 86 |
#define MS_S_HYDRA 87 |
#define MS_S_KIN 80 |
#define MS_S_MONSTER 82 |
#define MS_S_MONSTERS 83 |
#define MS_S_SPIDER 85 |
#define MS_S_UNDEAD 90 |
#define MS_S_UNIQUE 95 |
#define MS_SCARE 59 |
#define MS_SHOOT 4 |
#define MS_SHRIEK 0 |
#define MS_SLEEP 63 |
#define MS_SLOW 62 |
#define MS_SPECIAL 71 |
#define MS_SPEED 64 |
#define MS_STARBURST 52 |
#define MS_TELE_AWAY 73 |
#define MS_TELE_LEVEL 74 |
#define MS_TELE_TO 72 |
#define MS_TELEPORT 69 |
#define MS_WORLD 70 |
#define MS_XXX1 1 |
#define MS_XXX2 5 |
#define MS_XXX3 6 |
#define MS_XXX4 7 |
#define RF4_ATTACK_MASK (RF4_BOLT_MASK | RF4_BEAM_MASK | RF4_BALL_MASK | RF4_DISPEL) |
#define RF4_BALL_MASK |
#define RF4_BEAM_MASK 0UL |
#define RF4_BIG_BALL_MASK (RF4_BA_CHAO) |
#define RF4_BOLT_MASK (RF4_ROCKET | RF4_SHOOT) |
#define RF4_BREATH_MASK |
#define RF4_INDIRECT_MASK (RF4_SUMMON_MASK | RF4_SHRIEK) |
#define RF4_INT_MASK (RF4_SUMMON_MASK | RF4_DISPEL) |
#define RF4_NOMAGIC_MASK (RF4_BREATH_MASK | RF4_SHRIEK | RF4_ROCKET | RF4_SHOOT) |
#define RF4_RIDING_MASK (RF4_SHRIEK) |
#define RF4_SPELL_SIZE 32 |
#define RF4_SPELL_START 32 * 3 |
#define RF4_SUMMON_MASK 0UL |
#define RF5_ATTACK_MASK |
#define RF5_BALL_MASK |
#define RF5_BEAM_MASK 0UL |
#define RF5_BIG_BALL_MASK (RF5_BA_LITE | RF5_BA_DARK | RF5_BA_WATE | RF5_BA_MANA) |
#define RF5_BOLT_MASK |
#define RF5_BREATH_MASK 0UL |
#define RF5_INDIRECT_MASK (RF5_SUMMON_MASK) |
#define RF5_INT_MASK |
#define RF5_NOMAGIC_MASK (RF5_BREATH_MASK) |
#define RF5_RIDING_MASK 0UL |
#define RF5_SPELL_SIZE 32 |
#define RF5_SPELL_START 32 * 4 |
#define RF5_SUMMON_MASK 0UL |
#define RF6_ATTACK_MASK |
#define RF6_BALL_MASK (RF6_BIG_BALL_MASK | RF6_BREATH_MASK) |
#define RF6_BEAM_MASK (RF6_PSY_SPEAR) |
#define RF6_BIG_BALL_MASK 0UL |
#define RF6_BOLT_MASK 0UL |
#define RF6_BREATH_MASK 0UL |
#define RF6_INDIRECT_MASK |
#define RF6_INT_MASK |
#define RF6_NOMAGIC_MASK (RF6_BREATH_MASK | RF6_SPECIAL) |
#define RF6_RIDING_MASK (RF6_BLINK | RF6_TPORT | RF6_TRAPS | RF6_DARKNESS | RF6_SPECIAL) |
#define RF6_SPELL_SIZE 32 |
#define RF6_SPELL_START 32 * 5 |
#define RF6_SUMMON_MASK |
#define S_NUM_4 (easy_band ? 1 : 4) |
#define S_NUM_6 (easy_band ? 2 : 6) |
typedef struct monster_power monster_power |
void beam | ( | MONSTER_IDX | m_idx, |
POSITION | y, | ||
POSITION | x, | ||
EFFECT_ID | typ, | ||
int | dam_hp, | ||
int | monspell, | ||
int | target_type | ||
) |
モンスターのビーム型魔法処理 /
m_idx | モンスターのID |
y | 目標のY座標 |
x | 目標のX座標 |
typ | 効果属性ID |
dam_hp | 威力 |
monspell | モンスター魔法のID |
target_type | モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER |
void bolt | ( | MONSTER_IDX | m_idx, |
POSITION | y, | ||
POSITION | x, | ||
EFFECT_ID | typ, | ||
int | dam_hp, | ||
int | monspell, | ||
int | target_type | ||
) |
モンスターのボルト型魔法処理 / Cast a bolt at the player Stop if we hit a monster Affect monsters and the player
m_idx | モンスターのID |
y | 目標のY座標 |
x | 目標のX座標 |
typ | 効果属性ID |
dam_hp | 威力 |
monspell | モンスター魔法のID |
target_type | モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER |
void breath | ( | POSITION | y, |
POSITION | x, | ||
MONSTER_IDX | m_idx, | ||
EFFECT_ID | typ, | ||
int | dam_hp, | ||
POSITION | rad, | ||
bool | breath, | ||
int | monspell, | ||
int | target_type | ||
) |
モンスターのボール型&ブレス型魔法処理 / Cast a breath (or ball) attack at the player Pass over any monsters that may be in the way Affect grids, objects, monsters, and the player
y | 目標地点のY座標 |
x | 目標地点のX座標 |
m_idx | モンスターのID |
typ | 効果属性ID |
dam_hp | 威力 |
rad | 半径 |
breath | |
monspell | モンスター魔法のID |
target_type | モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER |
モンスターにとってボルト型魔法が有効な状態かを返す / Determine if a bolt spell will hit the player.
y1 | ボルト魔法発射地点のY座標 |
x1 | ボルト魔法発射地点のX座標 |
y2 | ボルト魔法目標地点のY座標 |
x2 | ボルト魔法目標地点のX座標 |
is_friend | モンスターがプレイヤーに害意を持たない(ペットか友好的)ならばTRUEをつける |
Originally, it was possible for a friendly to shoot another friendly.
Change it so a "clean shot" means no equally friendly monster is
between the attacker and target.
This is exactly like "projectable", but it will
return FALSE if a monster is in the way.
no equally friendly monster is
between the attacker and target.
bool dispel_check | ( | MONSTER_IDX | m_idx | ) |
モンスターがプレイヤーに魔力消去を与えるべきかを判定するルーチン Check should monster cast dispel spell.
m_idx | モンスターの構造体配列ID |
bool do_cmd_cast_learned | ( | void | ) |
青魔法コマンドのメインルーチン / do_cmd_cast calls this function if the player's class is 'Blue-Mage'.
モンスターが特殊能力の目標地点を決める処理 / Get the actual center point of ball spells (rad > 1) (originally from TOband)
sy | 始点のY座標 |
sx | 始点のX座標 |
ty | 目標Y座標を返す参照ポインタ |
tx | 目標X座標を返す参照ポインタ |
flg | 判定のフラグ配列 |
void learn_spell | ( | int | monspell | ) |
青魔法のラーニング判定と成功した場合のラーニング処理
monspell | ラーニングを試みるモンスター攻撃のID |
bool make_attack_spell | ( | MONSTER_IDX | m_idx | ) |
モンスターの特殊技能メインルーチン / Creatures can cast spells, shoot missiles, and breathe.
m_idx | モンスター構造体配列のID |
Returns "TRUE" if a spell (or whatever) was (successfully) cast.
This function could use some work, but remember to
keep it as optimized as possible, while retaining generic code.
Verify the various "blind-ness" checks in the code.
Note that several effects should really not be "seen"
if the player is blind. See also "effects.c" for other "mistakes".
Perhaps monsters should breathe at locations near the player,
since this would allow them to inflict "partial" damage.
Perhaps smart monsters should decline to use "bolt" spells if
there is a monster in the way, unless they wish to kill it.
Note that, to allow the use of the "track_target" option at some
later time, certain non-optimal things are done in the code below,
including explicit checks against the "direct" variable, which is
currently always true by the time it is checked, but which should
really be set according to an explicit "projectable()" test, and
the use of generic "x,y" locations instead of the player location,
with those values being initialized with the player location.
It will not be possible to "correctly" handle the case in which a
monster attempts to attack a location which is thought to contain
the player, but which in fact is nowhere near the player, since this
might induce all sorts of messages about the attack itself, and about
the effects of the attack, which the player might or might not be in
a position to observe. Thus, for simplicity, it is probably best to
only allow "faulty" attacks by a monster if one of the important grids
(probably the initial or final grid) is in fact in view of the player.
It may be necessary to actually prevent spell attacks except when the
monster actually has line of sight to the player. Note that a monster
could be left in a bizarre situation after the player ducked behind a
pillar and then teleported away, for example.
HIT_POINT monspell_bluemage_damage | ( | int | SPELL_NUM, |
PLAYER_LEVEL | plev, | ||
int | TYPE | ||
) |
青魔導師の使う呪文の威力を返す /
SPELL_NUM | 呪文番号 |
plev | 使用するレベル。2倍して扱う。 |
TYPE | DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。 |
HIT_POINT monspell_damage | ( | int | SPELL_NUM, |
MONSTER_IDX | m_idx, | ||
int | TYPE | ||
) |
モンスターの使う呪文の威力を返す /
SPELL_NUM | 呪文番号 |
m_idx | 呪文を唱えるモンスターID |
TYPE | DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。 |
HIT_POINT monspell_race_damage | ( | int | SPELL_NUM, |
MONRACE_IDX | r_idx, | ||
int | TYPE | ||
) |
モンスターの使う呪文の威力を返す /
SPELL_NUM | 呪文番号 |
r_idx | 呪文を唱えるモンスターの種族ID |
TYPE | DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。 |
HIT_POINT monspell_to_monster | ( | int | SPELL_NUM, |
POSITION | y, | ||
POSITION | x, | ||
MONSTER_IDX | m_idx, | ||
MONSTER_IDX | t_idx | ||
) |
モンスターからモンスターへの呪文の振り分け関数。 /
SPELL_NUM | モンスター魔法ID |
y | 対象の地点のy座標 |
x | 対象の地点のx座標 |
m_idx | 呪文を唱えるモンスターID |
t_idx | 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。 |
HIT_POINT monspell_to_player | ( | int | SPELL_NUM, |
POSITION | y, | ||
POSITION | x, | ||
MONSTER_IDX | m_idx | ||
) |
モンスターからプレイヤーへの呪文の振り分け関数。 /
SPELL_NUM | モンスター魔法ID |
y | 対象の地点のy座標 |
x | 対象の地点のx座標 |
m_idx | 呪文を唱えるモンスターID |
bool monst_spell_monst | ( | MONSTER_IDX | m_idx | ) |
モンスターが敵モンスターに特殊能力を使う処理のメインルーチン / Monster tries to 'cast a spell' (or breath, etc) at another monster.
m_idx | 術者のモンスターID |
The player is only disturbed if able to be affected by the spell.
bool raise_possible | ( | monster_type * | m_ptr | ) |
モンスターにとって死者復活を行うべき状態かどうかを返す / Determine if there is a space near the player in which a summoned creature can appear
m_ptr | 判定を行いたいモンスターの構造体参照ポインタ |
モンスター特殊能力のフラグ配列から特定条件の魔法だけを抜き出す処理 Extract monster spells mask for the given mode
f4 | モンスター特殊能力の4番目のフラグ配列 |
f5 | モンスター特殊能力の5番目のフラグ配列 |
f6 | モンスター特殊能力の6番目のフラグ配列 |
mode | 抜き出したい条件 |
ID値が非魔術的な特殊技能かどうかを返す / Return TRUE if a spell is inate spell.
spell | 判定対象のID |
bool spell_learnable | ( | MONSTER_IDX | m_idx | ) |
モンスターの唱えた呪文を青魔法で学習できるか判定する /
m_idx | モンスターID |
モンスターにとって所定の地点が召還に相応しい地点かどうかを返す。 / Determine if there is a space near the player in which a summoned creature can appear
y1 | 判定を行いたいマスのY座標 |
x1 | 判定を行いたいマスのX座標 |
const monster_power monster_powers[MAX_MONSPELLS] |
青魔法テーブル
level, smana, fail, manedam, manefail, use_stat, name
const concptr monster_powers_short[MAX_MONSPELLS] |
モンスター魔法名テーブル