|
Galactic Bloodshed
|
Miscellaneous stuff included in the shell. More...
#include "gb/shlmisc.h"#include <cctype>#include <cmath>#include <cstdio>#include <cstdlib>#include <cstring>#include <ctime>#include <sstream>#include <string>#include "gb/GB_server.h"#include "gb/buffers.h"#include "gb/files.h"#include "gb/files_shl.h"#include "gb/max.h"#include "gb/races.h"#include "gb/ships.h"#include "gb/tweakables.h"#include "gb/vars.h"Go to the source code of this file.
Functions | |
| std::optional< shipnum_t > | string_to_shipnum (std::string_view s) |
| Convert input string to a shipnum_t. More... | |
| bool | authorized (const governor_t Governor, const Ship &ship) |
| shipnum_t | start_shiplist (GameObj &g, const std::string_view p) |
| Get start of ship lists from either a ship number or ScopeLevel. More... | |
| shipnum_t | do_shiplist (Ship **s, shipnum_t *nextshipno) |
| bool | in_list (const player_t playernum, const std::string_view list, const Ship &s, shipnum_t *nextshipno) |
| Check is the ship is in the given input string. More... | |
| void | DontOwnErr (int Playernum, int Governor, shipnum_t shipno) |
| int | enufAP (int Playernum, int Governor, unsigned short AP, int x) |
| std::tuple< player_t, governor_t > | getracenum (const std::string &racepass, const std::string &govpass) |
| Find the player/governor that matches passwords. More... | |
| player_t | get_player (const std::string &name) |
| void | allocateAPs (const command_t &argv, GameObj &g) |
| void | deductAPs (const player_t Playernum, const governor_t Governor, unsigned int n, starnum_t snum, int sdata) |
| double | morale_factor (double x) |
Miscellaneous stuff included in the shell.
Definition in file shlmisc.cc.
Definition at line 175 of file shlmisc.cc.
References getsdata(), getstar(), putsdata(), and putstar().
| bool authorized | ( | const governor_t | Governor, |
| const Ship & | ship | ||
| ) |
Definition at line 46 of file shlmisc.cc.
| void deductAPs | ( | const player_t | Playernum, |
| const governor_t | Governor, | ||
| unsigned int | n, | ||
| starnum_t | snum, | ||
| int | sdata | ||
| ) |
Definition at line 214 of file shlmisc.cc.
References getsdata(), getstar(), putsdata(), and putstar().
Referenced by bombard(), capital(), capture(), declare(), defend(), dump(), examine(), fire(), insurgency(), land(), launch(), mobilize(), move_popn(), name(), page(), scrap(), sell(), send_message(), tax(), technology(), toxicity(), transfer(), and walk().
Definition at line 94 of file shlmisc.cc.
Referenced by bombard(), capture(), detonate(), fire(), grant(), jettison(), land(), launch(), load(), mount(), order(), and scrap().
| void DontOwnErr | ( | int | Playernum, |
| int | Governor, | ||
| shipnum_t | shipno | ||
| ) |
Definition at line 126 of file shlmisc.cc.
Referenced by testship().
| int enufAP | ( | int | Playernum, |
| int | Governor, | ||
| unsigned short | AP, | ||
| int | x | ||
| ) |
Definition at line 131 of file shlmisc.cc.
Referenced by bombard(), capital(), capture(), declare(), defend(), dump(), fire(), insurgency(), jettison(), land(), launch(), load(), mobilize(), move_popn(), page(), scrap(), sell(), send_message(), tax(), technology(), toxicity(), transfer(), and walk().
| player_t get_player | ( | const std::string & | name | ) |
Definition at line 163 of file shlmisc.cc.
| std::tuple<player_t, governor_t> getracenum | ( | const std::string & | racepass, |
| const std::string & | govpass | ||
| ) |
Find the player/governor that matches passwords.
| racepass | Password for the race |
| govpass | Password for the governor |
Definition at line 147 of file shlmisc.cc.
| bool in_list | ( | const player_t | playernum, |
| const std::string_view | list, | ||
| const Ship & | s, | ||
| shipnum_t * | nextshipno | ||
| ) |
Check is the ship is in the given input string.
See start_shiplist's comment for more details.
Definition at line 109 of file shlmisc.cc.
| double morale_factor | ( | double | x | ) |
Definition at line 239 of file shlmisc.cc.
Referenced by capture(), ground_attack(), insurgency(), mech_attack_people(), and people_attack_mech().
Get start of ship lists from either a ship number or ScopeLevel.
start_shiplist and in_list work together so that a user can enter one of:
When a letter or asterisk is given, the shiplist is taken from the current scope.
| g | Game object for scope |
| p | String that might contain ship number |
Definition at line 68 of file shlmisc.cc.
References getplanet(), getsdata(), and getstar().
| std::optional<shipnum_t> string_to_shipnum | ( | std::string_view | s | ) |
Convert input string to a shipnum_t.
| s | User-provided input string |
Definition at line 34 of file shlmisc.cc.
1.8.13