Galactic Bloodshed
Functions | Variables
shootblast.cc File Reference
#include "gb/shootblast.h"
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "gb/GB_server.h"
#include "gb/buffers.h"
#include "gb/build.h"
#include "gb/defense.h"
#include "gb/files_shl.h"
#include "gb/fire.h"
#include "gb/getplace.h"
#include "gb/misc.h"
#include "gb/races.h"
#include "gb/ships.h"
#include "gb/shlmisc.h"
#include "gb/tweakables.h"
#include "gb/utils/rand.h"
#include "gb/vars.h"
Include dependency graph for shootblast.cc:

Go to the source code of this file.

Functions

static int do_radiation (Ship *, double, int, int, const char *, char *)
 
static int do_damage (int, Ship *, double, int, int, int, int, double, const char *, char *)
 
static void ship_disposition (Ship *, int *, int *, int *)
 
static int CEW_hit (double, int)
 
static int Num_hits (double, int, int, double, int, int, int, int, int, int, int, int)
 
static int cew_hit_odds (double, int)
 
static void do_critical_hits (int, Ship *, int *, int *, int, char *)
 
static double p_factor (double, double)
 
static void mutate_sector (Sector &)
 
int shoot_ship_to_ship (Ship *from, Ship *to, int strength, int cew, int ignore, char *long_msg, char *short_msg)
 
int shoot_planet_to_ship (racetype *Race, Ship *ship, int strength, char *long_msg, char *short_msg)
 
int shoot_ship_to_planet (Ship *ship, Planet *pl, int strength, int x, int y, SectorMap &smap, int ignore, int caliber, char *long_msg, char *short_msg)
 
int hit_odds (double range, int *factor, double tech, int fdam, int fev, int tev, int fspeed, int tspeed, int body, int caliber, int defense)
 
double gun_range (Race *r, Ship *s, int mode)
 
double tele_range (int type, double tech)
 
int current_caliber (Ship *ship)
 
void do_collateral (Ship *ship, int damage, int *casualties, int *casualties1, int *primgundamage, int *secgundamage)
 
int planet_guns (int points)
 

Variables

static int hit_probability
 
static double penetration_factor
 

Function Documentation

◆ CEW_hit()

static int CEW_hit ( double  dist,
int  cew_range 
)
static

Definition at line 457 of file shootblast.cc.

References cew_hit_odds().

Referenced by shoot_ship_to_ship().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cew_hit_odds()

static int cew_hit_odds ( double  range,
int  cew_range 
)
static

Definition at line 518 of file shootblast.cc.

Referenced by CEW_hit().

Here is the caller graph for this function:

◆ current_caliber()

int current_caliber ( Ship ship)

Definition at line 546 of file shootblast.cc.

Referenced by ship_report(), and shoot_ship_to_ship().

Here is the caller graph for this function:

◆ do_collateral()

void do_collateral ( Ship ship,
int  damage,
int *  casualties,
int *  casualties1,
int *  primgundamage,
int *  secgundamage 
)

Definition at line 603 of file shootblast.cc.

Referenced by do_damage(), and people_attack_mech().

Here is the caller graph for this function:

◆ do_critical_hits()

static void do_critical_hits ( int  penetrate,
Ship ship,
int *  crithits,
int *  critdam,
int  caliber,
char *  critmsg 
)
static

Definition at line 556 of file shootblast.cc.

Referenced by do_damage().

Here is the caller graph for this function:

◆ do_damage()

static int do_damage ( int  who,
Ship ship,
double  tech,
int  strength,
int  hits,
int  defense,
int  caliber,
double  range,
const char *  weapon,
char *  msg 
)
static

Definition at line 354 of file shootblast.cc.

References do_collateral(), do_critical_hits(), hit_probability, p_factor(), and penetration_factor.

Referenced by shoot_planet_to_ship(), and shoot_ship_to_ship().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_radiation()

static int do_radiation ( Ship ship,
double  tech,
int  strength,
int  hits,
const char *  weapon,
char *  msg 
)
static

Definition at line 310 of file shootblast.cc.

Referenced by shoot_ship_to_ship().

Here is the caller graph for this function:

◆ gun_range()

double gun_range ( Race r,
Ship s,
int  mode 
)

Definition at line 530 of file shootblast.cc.

Referenced by profile(), and shoot_ship_to_ship().

Here is the caller graph for this function:

◆ hit_odds()

int hit_odds ( double  range,
int *  factor,
double  tech,
int  fdam,
int  fev,
int  tev,
int  fspeed,
int  tspeed,
int  body,
int  caliber,
int  defense 
)

Definition at line 493 of file shootblast.cc.

Referenced by Num_hits(), and ship_report().

Here is the caller graph for this function:

◆ mutate_sector()

static void mutate_sector ( Sector s)
static

Definition at line 634 of file shootblast.cc.

Referenced by shoot_ship_to_planet().

Here is the caller graph for this function:

◆ Num_hits()

static int Num_hits ( double  dist,
int  focus,
int  guns,
double  tech,
int  fdam,
int  fev,
int  tev,
int  fspeed,
int  tspeed,
int  body,
int  caliber,
int  defense 
)
static

Definition at line 469 of file shootblast.cc.

References hit_odds(), and hit_probability.

Referenced by shoot_planet_to_ship(), and shoot_ship_to_ship().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ p_factor()

static double p_factor ( double  attacker,
double  defender 
)
static

Definition at line 624 of file shootblast.cc.

Referenced by do_damage().

Here is the caller graph for this function:

◆ planet_guns()

int planet_guns ( int  points)

Definition at line 629 of file shootblast.cc.

Referenced by doplanet(), and shoot_ship_to_planet().

Here is the caller graph for this function:

◆ ship_disposition()

static void ship_disposition ( Ship ship,
int *  evade,
int *  speed,
int *  body 
)
static

Definition at line 447 of file shootblast.cc.

Referenced by shoot_planet_to_ship(), and shoot_ship_to_ship().

Here is the caller graph for this function:

◆ shoot_planet_to_ship()

int shoot_planet_to_ship ( racetype Race,
Ship ship,
int  strength,
char *  long_msg,
char *  short_msg 
)

Definition at line 156 of file shootblast.cc.

References do_damage(), Num_hits(), and ship_disposition().

Here is the call graph for this function:

◆ shoot_ship_to_planet()

int shoot_ship_to_planet ( Ship ship,
Planet pl,
int  strength,
int  x,
int  y,
SectorMap smap,
int  ignore,
int  caliber,
char *  long_msg,
char *  short_msg 
)

Definition at line 188 of file shootblast.cc.

References mutate_sector(), and planet_guns().

Referenced by bombard(), defend(), domissile(), and land().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shoot_ship_to_ship()

int shoot_ship_to_ship ( Ship from,
Ship to,
int  strength,
int  cew,
int  ignore,
char *  long_msg,
char *  short_msg 
)

Definition at line 43 of file shootblast.cc.

References CEW_hit(), current_caliber(), do_damage(), do_radiation(), gun_range(), Num_hits(), and ship_disposition().

Referenced by bombard(), doabm(), domissile(), and fire().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tele_range()

double tele_range ( int  type,
double  tech 
)

Definition at line 539 of file shootblast.cc.

Referenced by initialize_new_ship(), mk_expl_aimed_at(), and profile().

Here is the caller graph for this function:

Variable Documentation

◆ hit_probability

int hit_probability
static

Definition at line 27 of file shootblast.cc.

Referenced by do_damage(), and Num_hits().

◆ penetration_factor

double penetration_factor
static

Definition at line 28 of file shootblast.cc.

Referenced by do_damage().