| 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 for collide.c |
| 23 |
* |
| 24 |
*/ |
| 25 |
|
| 26 |
#pragma once |
| 27 |
|
| 28 |
#include "maths.h" |
| 29 |
|
| 30 |
#include <cstdint> |
| 31 |
#include "fwd-object.h" |
| 32 |
#include "fwd-segment.h" |
| 33 |
#include "fwd-vclip.h" |
| 34 |
#include "fwd-vecmat.h" |
| 35 |
#include "fwd-window.h" |
| 36 |
#include "robot.h" |
| 37 |
|
| 38 |
#ifdef DXX_BUILD_DESCENT |
| 39 |
namespace dcx { |
| 40 |
|
| 41 |
enum class apply_damage_player : bool |
| 42 |
{ |
| 43 |
always, |
| 44 |
check_for_friendly, |
| 45 |
}; |
| 46 |
|
| 47 |
} |
| 48 |
|
| 49 |
namespace dsx { |
| 50 |
void collide_two_objects(const d_robot_info_array &Robot_info, vmobjptridx_t A, vmobjptridx_t B, vms_vector &collision_point); |
| 51 |
window_event_result collide_object_with_wall( |
| 52 |
#if DXX_BUILD_DESCENT == 2 |
| 53 |
const d_level_shared_destructible_light_state &LevelSharedDestructibleLightState, |
| 54 |
#endif |
| 55 |
const d_robot_info_array &Robot_info, vmobjptridx_t A, fix hitspeed, vmsegptridx_t hitseg, sidenum_t hitwall, const vms_vector &hitpt); |
| 56 |
void apply_damage_to_player(object &player, icobjptridx_t killer, fix damage, apply_damage_player possibly_friendly); |
| 57 |
// Returns 1 if robot died, else 0. |
| 58 |
int apply_damage_to_robot(const d_robot_info_array &Robot_info, vmobjptridx_t robot, fix damage, objnum_t killer_objnum); |
| 59 |
|
| 60 |
#define PERSISTENT_DEBRIS (PlayerCfg.PersistentDebris && !(Game_mode & GM_MULTI)) // no persistent debris in multi |
| 61 |
|
| 62 |
void collide_player_and_materialization_center(vmobjptridx_t objp); |
| 63 |
void collide_robot_and_materialization_center(const d_robot_info_array &Robot_info, vmobjptridx_t objp); |
| 64 |
bool scrape_player_on_wall(vmobjptridx_t obj, vmsegptridx_t hitseg, sidenum_t hitwall, const vms_vector &hitpt); |
| 65 |
void collide_player_and_nasty_robot(const d_robot_info_array &Robot_info, vmobjptridx_t player, vmobjptridx_t robot, const vms_vector &collision_point); |
| 66 |
} |
| 67 |
|
| 68 |
namespace dcx { |
| 69 |
void bump_one_object(object_base &obj0, const vms_vector &hit_dir, fix damage); |
| 70 |
} |
| 71 |
#if DXX_BUILD_DESCENT == 1 |
| 72 |
#define check_effect_blowup(DestructibleLightsState,Vclip,seg,side,pnt,blower,force_blowup_flag,remote) check_effect_blowup(Vclip,seg,side,pnt) |
| 73 |
#endif |
| 74 |
namespace dsx { |
| 75 |
void collide_live_local_player_and_powerup(vmobjptridx_t powerup); |
| 76 |
void net_destroy_controlcen_object(const d_robot_info_array &Robot_info, imobjptridx_t controlcen); |
| 77 |
int check_effect_blowup(const d_level_shared_destructible_light_state &LevelSharedDestructibleLightState, const d_vclip_array &Vclip, vmsegptridx_t seg, sidenum_t side, const vms_vector &pnt, const laser_parent &blower, int force_blowup_flag, int remote); |
| 78 |
void apply_damage_to_controlcen(const d_robot_info_array &Robot_info, vmobjptridx_t controlcen, fix damage, const object &who); |
| 79 |
void drop_player_eggs(vmobjptridx_t playerobj); |
| 80 |
enum class volatile_wall_result : int8_t |
| 81 |
{ |
| 82 |
none = -1, |
| 83 |
lava, |
| 84 |
#if DXX_BUILD_DESCENT == 2 |
| 85 |
water, |
| 86 |
#endif |
| 87 |
}; |
| 88 |
#if DXX_BUILD_DESCENT == 2 |
| 89 |
window_event_result do_final_boss_frame(void); |
| 90 |
void do_final_boss_hacks(void); |
| 91 |
volatile_wall_result check_volatile_wall(vmobjptridx_t obj, const unique_side &seg); |
| 92 |
#endif |
| 93 |
} |
| 94 |
#endif |