|
static bool | int_outof (monster_race *r_ptr, int prob) |
| モンスターがプレイヤーの弱点をついた選択を取るかどうかの判定 / Internal probability routine [詳細]
|
|
static void | remove_bad_spells (int m_idx, u32b *f4p, u32b *f5p, u32b *f6p) |
| モンスターの魔法一覧から戦術的に適さない魔法を除外する / Remove the "bad" spells from a spell list [詳細]
|
|
bool | summon_possible (int y1, int 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 | clean_shot (int y1, int x1, int y2, int x2, bool is_friend) |
| モンスターにとってボルト型魔法が有効な状態かを返す / Determine if a bolt spell will hit the player. [詳細]
|
|
void | bolt (int m_idx, int y, int x, int 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 | beam (int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type) |
| モンスターのビーム型魔法処理 / [詳細]
|
|
void | breath (int y, int x, int m_idx, int typ, int dam_hp, int 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 [詳細]
|
|
u32b | get_curse (int power, object_type *o_ptr) |
| モンスターのボール型&ブレス型魔法処理 / [詳細]
|
|
void | curse_equipment (int chance, int heavy_chance) |
| 装備への呪い付加判定と付加処理 / [詳細]
|
|
static bool | spell_attack (byte spell) |
| ID値が正しいモンスター魔法IDかどうかを返す / Return TRUE if a spell is good for hurting the player (directly). [詳細]
|
|
static bool | spell_escape (byte spell) |
| ID値が退避目的に適したモンスター魔法IDかどうかを返す / Return TRUE if a spell is good for escaping. [詳細]
|
|
static bool | spell_annoy (byte spell) |
| ID値が妨害目的に適したモンスター魔法IDかどうかを返す / Return TRUE if a spell is good for annoying the player. [詳細]
|
|
static bool | spell_summon (byte spell) |
| ID値が召喚型のモンスター魔法IDかどうかを返す / Return TRUE if a spell is good for annoying the player. [詳細]
|
|
static bool | spell_raise (byte spell) |
| ID値が死者復活処理かどうかを返す / Return TRUE if a spell is good for annoying the player. [詳細]
|
|
static bool | spell_tactic (byte spell) |
| ID値が戦術的なモンスター魔法IDかどうかを返す / Return TRUE if a spell is good in a tactical situation. [詳細]
|
|
static bool | spell_invulner (byte spell) |
| ID値が無敵化するモンスター魔法IDかどうかを返す / Return TRUE if a spell makes invulnerable. [詳細]
|
|
static bool | spell_haste (byte spell) |
| ID値が加速するモンスター魔法IDかどうかを返す / Return TRUE if a spell hastes. [詳細]
|
|
static bool | spell_world (byte spell) |
| ID値が時間停止を行うモンスター魔法IDかどうかを返す / Return TRUE if a spell world. [詳細]
|
|
static bool | spell_special (byte spell) |
| ID値が特別効果のモンスター魔法IDかどうかを返す / Return TRUE if a spell special. [詳細]
|
|
static bool | spell_psy_spe (byte spell) |
| ID値が光の剣のモンスター魔法IDかどうかを返す / Return TRUE if a spell psycho-spear. [詳細]
|
|
static bool | spell_heal (byte spell) |
| ID値が治癒魔法かどうかを返す / Return TRUE if a spell is good for healing. [詳細]
|
|
static bool | spell_dispel (byte spell) |
| ID値が魔力消去かどうかを返す / Return TRUE if a spell is good for dispel. [詳細]
|
|
bool | dispel_check (int m_idx) |
| モンスターがプレイヤーに魔力消去を与えるべきかを判定するルーチン Check should monster cast dispel spell. [詳細]
|
|
static int | choose_attack_spell (int m_idx, byte spells[], byte num) |
| モンスターの魔法選択ルーチン Have a monster choose a spell from a list of "useful" spells. [詳細]
|
|
bool | spell_is_inate (u16b spell) |
| ID値が非魔術的な特殊技能かどうかを返す / Return TRUE if a spell is inate spell. [詳細]
|
|
static bool | adjacent_grid_check (monster_type *m_ptr, int *yp, int *xp, int f_flag, bool(*path_check)(int, int, int, int)) |
| モンスターがプレイヤーにダメージを与えるための最適な座標を算出する / [詳細]
|
|
bool | make_attack_spell (int m_idx) |
| モンスターの特殊技能メインルーチン / Creatures can cast spells, shoot missiles, and breathe. [詳細]
|
|
モンスター魔法の実装 / Monster spells (attack player)
- 日付
- 2014/01/17
- 作者
- Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
This software may be copied and distributed for educational, research,
and not for profit purposes provided that this copyright and statement
are included in all such copies. Other copyrights may also apply.
2014 Deskull rearranged comment for Doxygen.
And now for Intelligent monster attacks (including spells).
Original idea and code by "DRS" (David Reeves Sward).
Major modifications by "BEN" (Ben Harrison).
Give monsters more intelligent attack/spell selection based on
observations of previous attacks on the player, and/or by allowing
the monster to "cheat" and know the player status.
Maintain an idea of the player status, and use that information
to occasionally eliminate "ineffective" spell attacks. We could
also eliminate ineffective normal attacks, but there is no reason
for the monster to do this, since he gains no benefit.
Note that MINDLESS monsters are not allowed to use this code.
And non-INTELLIGENT monsters only use it partially effectively.
Actually learn what the player resists, and use that information
to remove attacks or spells before using them. This will require
much less space, if I am not mistaken. Thus, each monster gets a
set of 32 bit flags, "smart", build from the various "SM_*" flags.
This has the added advantage that attacks and spells are related.
The "smart_learn" option means that the monster "learns" the flags
that should be set, and "smart_cheat" means that he "knows" them.
So "smart_cheat" means that the "smart" field is always up to date,
while "smart_learn" means that the "smart" field is slowly learned.
Both of them have the same effect on the "choose spell" routine.
bool make_attack_spell |
( |
int |
m_idx | ) |
|
モンスターの特殊技能メインルーチン / Creatures can cast spells, shoot missiles, and breathe.
- 引数
-
- 戻り値
- 実際に特殊技能を利用したらTRUEを返す
Returns "TRUE" if a spell (or whatever) was (successfully) cast.
XXX XXX XXX 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.
XXX XXX XXX 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.
- 覚え書き
- that certain spell attacks do not use the "project()" function
but "simulate" it via the "direct" variable, which is always at least
as restrictive as the "project()" function. This is necessary to
prevent "blindness" attacks and such from bending around walls, etc,
and to allow the use of the "track_target" option in the future.
Note that this function attempts to optimize the use of spells for the
cases in which the monster has no spells, or has spells but cannot use
them, or has spells but they will have no "useful" effect. Note that
this function has been an efficiency bottleneck in the past.
Note the special "MFLAG_NICE" flag, which prevents a monster from using
any spell attacks until the player has had a single chance to move.