dxx-rebirth/common/main/fireball.h

108 lines
3.6 KiB
C
Raw Normal View History

2006-03-20 17:12:09 +00:00
/*
2014-06-01 17:55:23 +00:00
* Portions of this file are copyright Rebirth contributors and licensed as
* described in COPYING.txt.
* Portions of this file are copyright Parallax Software and licensed
* according to the Parallax license below.
* See COPYING.txt for license details.
2006-03-20 17:12:09 +00:00
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
/*
*
* Header for fireball.c
*
*/
#pragma once
2006-03-20 17:12:09 +00:00
2013-10-26 03:40:50 +00:00
#include <physfs.h>
#include "maths.h"
2022-02-12 18:57:12 +00:00
#include "fwd-powerup.h"
#include "fwd-segment.h"
#include "fwd-vecmat.h"
#include "fwd-wall.h"
2015-07-25 23:10:45 +00:00
#include "pack.h"
namespace dcx {
extern unsigned Num_exploding_walls;
}
2006-03-20 17:12:09 +00:00
#ifdef dsx
namespace dsx {
#if defined(DXX_BUILD_DESCENT_II)
struct disk_expl_wall
{
int segnum, sidenum;
2006-03-20 17:12:09 +00:00
fix time;
};
static_assert(sizeof(disk_expl_wall) == 12, "sizeof(disk_expl_wall) wrong");
#endif
2006-03-20 17:12:09 +00:00
imobjptridx_t object_create_explosion(vmsegptridx_t segnum, const vms_vector &position, fix size, int vclip_type);
void object_create_muzzle_flash(vmsegptridx_t segnum, const vms_vector &position, fix size, int vclip_type);
2006-03-20 17:12:09 +00:00
imobjptridx_t object_create_badass_explosion(imobjptridx_t objp, vmsegptridx_t segnum, const vms_vector &position, fix size, int vclip_type,
fix maxdamage, fix maxdistance, fix maxforce, icobjptridx_t parent);
2006-03-20 17:12:09 +00:00
// blows up a badass weapon, creating the badass explosion
// return the explosion object
void explode_badass_weapon(vmobjptridx_t obj,const vms_vector &pos);
2006-03-20 17:12:09 +00:00
// blows up the player with a badass explosion
void explode_badass_player(vmobjptridx_t obj);
2006-03-20 17:12:09 +00:00
void explode_object(vmobjptridx_t obj,fix delay_time);
void do_explosion_sequence(object &obj);
void do_debris_frame(vmobjptridx_t obj); // deal with debris for this frame
2006-03-20 17:12:09 +00:00
2018-10-21 00:24:07 +00:00
void draw_fireball(const d_vclip_array &Vclip, grs_canvas &, vcobjptridx_t obj);
2006-03-20 17:12:09 +00:00
void explode_wall(fvcvertptr &, vcsegptridx_t, sidenum_t sidenum, wall &);
unsigned do_exploding_wall_frame(wall &);
void maybe_drop_net_powerup(powerup_type_t powerup_type, bool adjust_cap, bool random_player);
void maybe_replace_powerup_with_energy(object_base &del_obj);
}
2006-03-20 17:12:09 +00:00
namespace dcx {
void init_exploding_walls();
enum class explosion_vclip_stage : int
{
s0,
s1,
};
}
namespace dsx {
int get_explosion_vclip(const object_base &obj, explosion_vclip_stage stage);
imobjptridx_t drop_powerup(const d_vclip_array &Vclip, int id, const vms_vector &init_vel, const vms_vector &pos, vmsegptridx_t segnum, bool player);
bool 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);
2006-03-20 17:12:09 +00:00
#if defined(DXX_BUILD_DESCENT_II)
2006-03-20 17:12:09 +00:00
// creates afterburner blobs behind the specified object
void drop_afterburner_blobs(object &obj, int count, fix size_scale, fix lifetime);
2006-03-20 17:12:09 +00:00
/*
* reads n expl_wall structs from a PHYSFS_File and swaps if specified
*/
void expl_wall_read_n_swap(fvmwallptr &, PHYSFS_File *fp, int swap, unsigned);
void expl_wall_write(fvcwallptr &, PHYSFS_File *);
2012-11-11 00:14:30 +00:00
extern fix Flash_effect;
#endif
vmsegidx_t choose_thief_recreation_segment(fvcsegptr &vcsegptr, fvcwallptr &vcwallptr, const vcsegidx_t plrseg);
}
#endif