| 1 |
/* |
| 2 |
* Portions of this file are copyright Rebirth contributors and licensed as |
| 3 |
* described in COPYING.txt. |
| 4 |
* Portions of this file are copyright Parallax Software and licensed |
| 5 |
* according to the Parallax license below. |
| 6 |
* See COPYING.txt for license details. |
| 7 |
|
| 8 |
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX |
| 9 |
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO |
| 10 |
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A |
| 11 |
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS |
| 12 |
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS |
| 13 |
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE |
| 14 |
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE |
| 15 |
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS |
| 16 |
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. |
| 17 |
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. |
| 18 |
*/ |
| 19 |
|
| 20 |
/* |
| 21 |
* |
| 22 |
* Header file for multiplayer robot support. |
| 23 |
* |
| 24 |
*/ |
| 25 |
|
| 26 |
#pragma once |
| 27 |
|
| 28 |
#include <bitset> |
| 29 |
#include "pstypes.h" |
| 30 |
|
| 31 |
#include "fwd-player.h" // playernum_t |
| 32 |
#include "fwd-vclip.h" |
| 33 |
#include "fwd-vecmat.h" |
| 34 |
#include "robot.h" |
| 35 |
|
| 36 |
namespace dcx { |
| 37 |
|
| 38 |
enum class multi_send_robot_position_priority : uint8_t |
| 39 |
{ |
| 40 |
_0, |
| 41 |
_1, |
| 42 |
_2, |
| 43 |
}; |
| 44 |
|
| 45 |
constexpr std::integral_constant<std::size_t, 5> MAX_ROBOTS_CONTROLLED{}; |
| 46 |
constexpr std::integral_constant<std::size_t, MAX_ROBOTS_CONTROLLED> HANDS_OFF_PERIOD{}; // i.e. one slow above max |
| 47 |
|
| 48 |
extern std::array<objnum_t, MAX_ROBOTS_CONTROLLED> robot_controlled; |
| 49 |
extern std::array<int, MAX_ROBOTS_CONTROLLED> robot_agitation; |
| 50 |
extern std::bitset<MAX_ROBOTS_CONTROLLED> robot_fired; |
| 51 |
} |
| 52 |
|
| 53 |
#ifdef DXX_BUILD_DESCENT |
| 54 |
int multi_can_move_robot(vmobjptridx_t objnum, int agitation); |
| 55 |
void multi_send_robot_position(object &objnum, multi_send_robot_position_priority fired); |
| 56 |
void multi_send_robot_fire(vmobjptridx_t objnum, robot_gun_number gun_num, const vms_vector &fire); |
| 57 |
void multi_send_claim_robot(vmobjptridx_t objnum); |
| 58 |
void multi_send_robot_explode(imobjptridx_t objnum, objnum_t killer); |
| 59 |
void multi_send_create_robot(station_number robotcen, objnum_t objnum, robot_id type); |
| 60 |
namespace dsx { |
| 61 |
void multi_send_boss_teleport(vmobjptridx_t bossobjnum, vcsegidx_t where); |
| 62 |
} |
| 63 |
void multi_send_boss_cloak(objnum_t bossobjnum); |
| 64 |
void multi_send_boss_start_gate(objnum_t bossobjnum); |
| 65 |
void multi_send_boss_stop_gate(objnum_t bossobjnum); |
| 66 |
void multi_send_boss_create_robot(vmobjidx_t bossobjnum, vmobjptridx_t objnum); |
| 67 |
void multi_send_robot_frame(); |
| 68 |
namespace dsx { |
| 69 |
int multi_explode_robot_sub(const d_robot_info_array &Robot_info, vmobjptridx_t botnum); |
| 70 |
void multi_robot_request_change(vmobjptridx_t robot, int playernum); |
| 71 |
#if DXX_BUILD_DESCENT == 2 |
| 72 |
void multi_send_thief_frame(); |
| 73 |
#endif |
| 74 |
} |
| 75 |
#endif |
| 76 |
|
| 77 |
void multi_strip_robots(int playernum); |
| 78 |
void multi_check_robot_timeout(void); |