Defines | Functions

ball.c File Reference

#include "hack.h"
Include dependency graph for ball.c:

Defines

#define BCPOS_DIFFER   0
#define BCPOS_CHAIN   1
#define BCPOS_BALL   2
#define CHAIN_IN_MIDDLE(chx, chy)   (distmin(x, y, chx, chy) <= 1 && distmin(chx, chy, uball->ox, uball->oy) <= 1)
#define IS_CHAIN_ROCK(x, y)
#define SKIP_TO_DRAG

Functions

STATIC_DCL int NDECL (bc_order)
STATIC_DCL void NDECL (litter)
void ballfall ()
void placebc ()
void unplacebc ()
STATIC_OVL int bc_order ()
void set_bc (int already_blind)
void move_bc (int before, int control, xchar ballx, xchar bally, xchar chainx, xchar chainy)
boolean drag_ball (xchar x, xchar y, int *bc_control, xchar *ballx, xchar *bally, xchar *chainx, xchar *chainy, boolean *cause_delay, boolean allow_drag)
void drop_ball (xchar x, xchar y)
STATIC_OVL void litter ()
void drag_down ()

Define Documentation

#define BCPOS_BALL   2

Referenced by bc_order(), and move_bc().

#define BCPOS_CHAIN   1

Referenced by bc_order(), move_bc(), placebc(), and set_bc().

#define BCPOS_DIFFER   0

Referenced by bc_order(), move_bc(), placebc(), and set_bc().

#define CHAIN_IN_MIDDLE (   chx,
  chy 
)    (distmin(x, y, chx, chy) <= 1 && distmin(chx, chy, uball->ox, uball->oy) <= 1)

Referenced by drag_ball().

#define IS_CHAIN_ROCK (   x,
 
)
Value:
(IS_ROCK(levl[x][y].typ) || (IS_DOOR(levl[x][y].typ) && \
      (levl[x][y].doormask & (D_CLOSED|D_LOCKED))))

Referenced by drag_ball().

#define SKIP_TO_DRAG
Value:
{ *chainx = oldchainx; *chainy = oldchainy; \
    move_bc(0, *bc_control, *ballx, *bally, *chainx, *chainy); \
    goto drag; }

Referenced by drag_ball().


Function Documentation

void ballfall (  )

References body_part(), carried, FALSE, flags, freeinv(), HEAD, is_metallic, losehp(), NO_KILLER_PREFIX, obj::ox, obj::oy, pline(), rn1, rn2(), setuqwep(), setuswapwep(), setuwep(), u, uarmh, uball, uquiver, uswapwep, uwep, you::ux, you::uy, flag::verbose, and xname().

Referenced by dotrap(), and goto_level().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int bc_order (  )

References BCPOS_BALL, BCPOS_CHAIN, BCPOS_DIFFER, carried, level, dlevel_t::objects, obj::ox, obj::oy, u, uball, and uchain.

Referenced by drop_ball(), move_bc(), and set_bc().

Here is the caller graph for this function:

boolean drag_ball ( xchar  x,
xchar  y,
int *  bc_control,
xchar ballx,
xchar bally,
xchar chainx,
xchar chainy,
boolean cause_delay,
boolean  allow_drag 
)
void drag_down (  )

References A_STR, carried, exercise(), FALSE, KILLED_BY_AN, litter(), losehp(), NO_KILLER_PREFIX, rn2(), rnd(), uball, and uwep.

Referenced by goto_level().

Here is the call graph for this function:

Here is the caller graph for this function:

void drop_ball ( xchar  x,
xchar  y 
)
STATIC_OVL void litter (  )

References aobjnam(), canletgo(), dropx(), invent, obj::nobj, otmp, obj::owt, rnd(), uball, and weight_cap().

Referenced by drag_down(), and repair_damage().

Here is the call graph for this function:

Here is the caller graph for this function:

void move_bc ( int  before,
int  control,
xchar  ballx,
xchar  bally,
xchar  chainx,
xchar  chainy 
)

References BC_BALL, BC_CHAIN, you::bc_felt, bc_order(), you::bc_order, BCPOS_BALL, BCPOS_CHAIN, BCPOS_DIFFER, you::bglyph, Blind, carried, you::cglyph, levl, map_object(), movobj(), newsym(), obj::ox, obj::oy, place_object(), remove_object(), u, uball, and uchain.

Referenced by domove(), drag_ball(), litroom(), move_into_trap(), and teleds().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL void NDECL ( litter   )
STATIC_DCL int NDECL ( bc_order   )
void placebc (  )

References you::bc_order, BCPOS_CHAIN, BCPOS_DIFFER, carried, flooreffects(), place_object(), u, uball, uchain, you::ux, and you::uy.

Referenced by dotrap(), drown(), goto_level(), movebubbles(), punish(), repair_damage(), teleds(), and unstuck().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_bc ( int  already_blind )

References BC_BALL, BC_CHAIN, you::bc_felt, bc_order(), you::bc_order, BCPOS_CHAIN, BCPOS_DIFFER, you::bglyph, carried, you::cglyph, levl, newsym(), obj::ox, obj::oy, place_object(), remove_object(), u, uball, uchain, you::ux, and you::uy.

Referenced by Blindf_off(), Blindf_on(), make_blinded(), and punish().

Here is the call graph for this function:

Here is the caller graph for this function:

void unplacebc (  )

References BC_BALL, BC_CHAIN, you::bc_felt, you::bglyph, Blind, carried, you::cglyph, levl, newsym(), obj_extract_self(), obj::ox, obj::oy, u, uball, and uchain.

Referenced by dotrap(), drown(), goto_level(), gulpmu(), movebubbles(), repair_damage(), and teleds().

Here is the call graph for this function:

Here is the caller graph for this function: