Subversion Repositories Games.Descent

Rev

Blame | Last modification | View Log | Download | RSS feed

  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 fireball.c
  23.  *
  24.  */
  25.  
  26. #pragma once
  27.  
  28. #include <physfs.h>
  29.  
  30. #ifdef __cplusplus
  31. #include "maths.h"
  32. #include "fwd-object.h"
  33. #include "fwd-segment.h"
  34. #include "fwd-vecmat.h"
  35. #include "fwd-wall.h"
  36. #include "pack.h"
  37.  
  38. enum powerup_type_t : uint8_t;
  39.  
  40. namespace dcx {
  41. extern unsigned Num_exploding_walls;
  42. }
  43.  
  44. #ifdef dsx
  45. namespace dsx {
  46.  
  47. #if defined(DXX_BUILD_DESCENT_II)
  48. struct disk_expl_wall
  49. {
  50.         int segnum, sidenum;
  51.         fix time;
  52. };
  53. static_assert(sizeof(disk_expl_wall) == 12, "sizeof(disk_expl_wall) wrong");
  54. #endif
  55.  
  56. imobjptridx_t object_create_explosion(vmsegptridx_t segnum, const vms_vector &position, fix size, int vclip_type);
  57. void object_create_muzzle_flash(vmsegptridx_t segnum, const vms_vector &position, fix size, int vclip_type);
  58.  
  59. imobjptridx_t object_create_badass_explosion(imobjptridx_t objp, vmsegptridx_t segnum, const vms_vector &position, fix size, int vclip_type,
  60.                 fix maxdamage, fix maxdistance, fix maxforce, icobjptridx_t parent);
  61.  
  62. // blows up a badass weapon, creating the badass explosion
  63. // return the explosion object
  64. void explode_badass_weapon(vmobjptridx_t obj,const vms_vector &pos);
  65.  
  66. // blows up the player with a badass explosion
  67. void explode_badass_player(vmobjptridx_t obj);
  68.  
  69. void explode_object(vmobjptridx_t obj,fix delay_time);
  70. void do_explosion_sequence(object &obj);
  71. void do_debris_frame(vmobjptridx_t obj);      // deal with debris for this frame
  72.  
  73. void draw_fireball(const d_vclip_array &Vclip, grs_canvas &, vcobjptridx_t obj);
  74.  
  75. void explode_wall(fvcvertptr &, vcsegptridx_t, unsigned sidenum, wall &);
  76. unsigned do_exploding_wall_frame(wall &);
  77. void maybe_drop_net_powerup(powerup_type_t powerup_type, bool adjust_cap, bool random_player);
  78. void maybe_replace_powerup_with_energy(object_base &del_obj);
  79. }
  80.  
  81. namespace dcx {
  82. void init_exploding_walls();
  83. enum class explosion_vclip_stage : int
  84. {
  85.         s0,
  86.         s1,
  87. };
  88. }
  89.  
  90. namespace dsx {
  91. int get_explosion_vclip(const object_base &obj, explosion_vclip_stage stage);
  92.  
  93. #if defined(DXX_BUILD_DESCENT_II)
  94. imobjptridx_t drop_powerup(const d_vclip_array &Vclip, int id, unsigned num, const vms_vector &init_vel, const vms_vector &pos, vmsegptridx_t segnum, bool player);
  95.  
  96. // creates afterburner blobs behind the specified object
  97. void drop_afterburner_blobs(object &obj, int count, fix size_scale, fix lifetime);
  98.  
  99. /*
  100.  * reads n expl_wall structs from a PHYSFS_File and swaps if specified
  101.  */
  102. void expl_wall_read_n_swap(fvmwallptr &, PHYSFS_File *fp, int swap, unsigned);
  103. void expl_wall_write(fvcwallptr &, PHYSFS_File *);
  104. extern fix      Flash_effect;
  105. #endif
  106.  
  107. imsegidx_t pick_connected_segment(vcsegidx_t objp, int max_depth);
  108. }
  109. #endif
  110.  
  111. #endif
  112.