bool heal_monster(DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_OLD_HEAL, dir, dam, flg));
+ return (project_hook(p_ptr, GF_OLD_HEAL, dir, dam, flg));
}
/*!
bool speed_monster(DIRECTION dir, int power)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_OLD_SPEED, dir, power, flg));
+ return (project_hook(p_ptr, GF_OLD_SPEED, dir, power, flg));
}
/*!
bool slow_monster(DIRECTION dir, int power)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_OLD_SLOW, dir, power, flg));
+ return (project_hook(p_ptr, GF_OLD_SLOW, dir, power, flg));
}
/*!
bool sleep_monster(DIRECTION dir, int power)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_OLD_SLEEP, dir, power, flg));
+ return (project_hook(p_ptr, GF_OLD_SLEEP, dir, power, flg));
}
/*!
bool confuse_monster(DIRECTION dir, PLAYER_LEVEL plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_OLD_CONF, dir, plev, flg));
+ return (project_hook(p_ptr, GF_OLD_CONF, dir, plev, flg));
}
/*!
bool stun_monster(DIRECTION dir, PLAYER_LEVEL plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_STUN, dir, plev, flg));
+ return (project_hook(p_ptr, GF_STUN, dir, plev, flg));
}
/*!
bool poly_monster(DIRECTION dir, int power)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- bool tester = (project_hook(GF_OLD_POLY, dir, power, flg));
+ bool tester = (project_hook(p_ptr, GF_OLD_POLY, dir, power, flg));
if (tester)
chg_virtue(p_ptr, V_CHANCE, 1);
return(tester);
bool clone_monster(DIRECTION dir)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_OLD_CLONE, dir, 0, flg));
+ return (project_hook(p_ptr, GF_OLD_CLONE, dir, 0, flg));
}
/*!
bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_TURN_ALL, dir, plev, flg));
+ return (project_hook(p_ptr, GF_TURN_ALL, dir, plev, flg));
}
/*!
* @param flg フラグ
* @return 作用が実際にあった場合TRUEを返す
*/
-bool project_hook(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg)
+bool project_hook(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg)
{
POSITION tx, ty;
flg |= (PROJECT_THRU);
/* Use the given direction */
- tx = p_ptr->x + ddx[dir];
- ty = p_ptr->y + ddy[dir];
+ tx = caster_ptr->x + ddx[dir];
+ ty = caster_ptr->y + ddy[dir];
/* Hack -- Use an actual "target" */
if ((dir == 5) && target_okay())
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
- return (project_hook(typ, dir, dam, flg));
+ return (project_hook(caster_ptr, typ, dir, dam, flg));
}
bool fire_beam(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
- return (project_hook(typ, dir, dam, flg));
+ return (project_hook(p_ptr, typ, dir, dam, flg));
}
bool lite_line(DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
- return (project_hook(GF_LITE_WEAK, dir, dam, flg));
+ return (project_hook(p_ptr, GF_LITE_WEAK, dir, dam, flg));
}
/*!
bool hypodynamic_bolt(DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_HYPODYNAMIA, dir, dam, flg));
+ return (project_hook(p_ptr, GF_HYPODYNAMIA, dir, dam, flg));
}
/*!
bool wall_to_mud(DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
- return (project_hook(GF_KILL_WALL, dir, dam, flg));
+ return (project_hook(p_ptr, GF_KILL_WALL, dir, dam, flg));
}
/*!
bool wizard_lock(DIRECTION dir)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
- return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg));
+ return (project_hook(p_ptr, GF_JAM_DOOR, dir, 20 + randint1(30), flg));
}
/*!
bool destroy_door(DIRECTION dir)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
- return (project_hook(GF_KILL_DOOR, dir, 0, flg));
+ return (project_hook(p_ptr, GF_KILL_DOOR, dir, 0, flg));
}
/*!
bool disarm_trap(DIRECTION dir)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
- return (project_hook(GF_KILL_TRAP, dir, 0, flg));
+ return (project_hook(p_ptr, GF_KILL_TRAP, dir, 0, flg));
}
bool death_ray(DIRECTION dir, PLAYER_LEVEL plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
- return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg));
+ return (project_hook(p_ptr, GF_DEATH_RAY, dir, plev * 200, flg));
}
/*!
bool teleport_monster(DIRECTION dir, int distance)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL;
- return (project_hook(GF_AWAY_ALL, dir, distance, flg));
+ return (project_hook(p_ptr, GF_AWAY_ALL, dir, distance, flg));
}
/*!
bool charm_monster(DIRECTION dir, PLAYER_LEVEL plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
- return (project_hook(GF_CHARM, dir, plev, flg));
+ return (project_hook(p_ptr, GF_CHARM, dir, plev, flg));
}
/*!
bool control_one_undead(DIRECTION dir, PLAYER_LEVEL plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
- return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg));
+ return (project_hook(p_ptr, GF_CONTROL_UNDEAD, dir, plev, flg));
}
/*!
bool control_one_demon(DIRECTION dir, PLAYER_LEVEL plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
- return (project_hook(GF_CONTROL_DEMON, dir, plev, flg));
+ return (project_hook(p_ptr, GF_CONTROL_DEMON, dir, plev, flg));
}
/*!
bool charm_animal(DIRECTION dir, PLAYER_LEVEL plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
- return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg));
+ return (project_hook(p_ptr, GF_CONTROL_ANIMAL, dir, plev, flg));
}