2019-09-19 22:42:45 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 Nuke.YKT
|
|
|
|
|
|
|
|
This file is part of NBlood.
|
|
|
|
|
|
|
|
NBlood is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2019-09-21 18:59:54 +00:00
|
|
|
//#include <iostream>
|
|
|
|
|
|
|
|
#include "ns.h" // Must come before everything else!
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
#include "build.h"
|
2020-09-06 10:44:58 +00:00
|
|
|
#include "automap.h"
|
2020-11-21 20:31:50 +00:00
|
|
|
#include "savegamehelp.h"
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
#include "blood.h"
|
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
BEGIN_BLD_NS
|
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
static DBloodActor* actDropObject(DBloodActor* actor, int nType);
|
|
|
|
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
VECTORDATA gVectorData[] = { // this is constant EXCEPT for [VECTOR_TYPE_20].maxDist. What were they thinking...
|
2020-12-02 19:05:53 +00:00
|
|
|
|
|
|
|
// Tine
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
17,
|
|
|
|
174762,
|
|
|
|
1152,
|
|
|
|
10240,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
20480,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_43, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_43, FX_6, FX_NONE, 502,
|
|
|
|
FX_43, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_7, 502,
|
|
|
|
FX_43, FX_6, FX_7, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 503,
|
|
|
|
FX_43, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// Shell
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
4,
|
|
|
|
65536,
|
|
|
|
0,
|
|
|
|
8192,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
12288,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_43, FX_5, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_43, FX_6, FX_NONE, -1,
|
|
|
|
FX_43, FX_0, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_43, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_43, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Bullet
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
7,
|
|
|
|
21845,
|
|
|
|
0,
|
|
|
|
32768,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
12288,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_43, FX_5, FX_7, 510,
|
|
|
|
FX_NONE, FX_5, FX_7, 511,
|
|
|
|
FX_43, FX_6, FX_NONE, 512,
|
|
|
|
FX_43, FX_0, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_7, 512,
|
|
|
|
FX_43, FX_6, FX_7, 512,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 513,
|
|
|
|
FX_43, FX_NONE, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Tommy AP
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
20,
|
|
|
|
65536,
|
|
|
|
0,
|
|
|
|
16384,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
20480,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_43, FX_5, FX_7, 510,
|
|
|
|
FX_NONE, FX_5, FX_7, 511,
|
|
|
|
FX_43, FX_6, FX_NONE, 512,
|
|
|
|
FX_43, FX_0, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_7, 512,
|
|
|
|
FX_43, FX_6, FX_7, 512,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 513,
|
|
|
|
FX_43, FX_NONE, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Shell AP
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
6,
|
|
|
|
87381,
|
|
|
|
0,
|
|
|
|
12288,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
6144,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_43, FX_5, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_43, FX_6, FX_NONE, -1,
|
|
|
|
FX_43, FX_0, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_43, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_43, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Tommy regular
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
12,
|
|
|
|
65536,
|
|
|
|
0,
|
|
|
|
16384,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
12288,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_43, FX_5, FX_7, 510,
|
|
|
|
FX_NONE, FX_5, FX_7, 511,
|
|
|
|
FX_43, FX_6, FX_NONE, 512,
|
|
|
|
FX_43, FX_0, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_7, 512,
|
|
|
|
FX_43, FX_6, FX_7, 512,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 513,
|
|
|
|
FX_43, FX_NONE, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 513,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Bat bite
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
4,
|
|
|
|
0,
|
|
|
|
921,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
4096,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Eel bite
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
12,
|
|
|
|
0,
|
|
|
|
1177,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Gill bite
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
9,
|
|
|
|
0,
|
|
|
|
1177,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Beast slash
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageExplode,
|
2020-12-02 19:05:53 +00:00
|
|
|
50,
|
|
|
|
43690,
|
|
|
|
1024,
|
|
|
|
8192,
|
|
|
|
0,
|
|
|
|
4,
|
|
|
|
32768,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Axe
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
18,
|
|
|
|
436906,
|
|
|
|
1024,
|
|
|
|
16384,
|
|
|
|
0,
|
|
|
|
2,
|
|
|
|
20480,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Cleaver
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
9,
|
|
|
|
218453,
|
|
|
|
1024,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
24576,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Phantasm slash
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
20,
|
|
|
|
436906,
|
|
|
|
1024,
|
|
|
|
16384,
|
|
|
|
0,
|
|
|
|
3,
|
|
|
|
24576,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// Gargoyle Slash
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
218453,
|
|
|
|
1024,
|
|
|
|
8192,
|
|
|
|
0,
|
|
|
|
4,
|
|
|
|
20480,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// Cerberus bite
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
19,
|
|
|
|
218453,
|
|
|
|
614,
|
|
|
|
8192,
|
|
|
|
0,
|
|
|
|
2,
|
|
|
|
24576,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// Hound bite
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
10,
|
|
|
|
218453,
|
|
|
|
614,
|
|
|
|
8192,
|
|
|
|
0,
|
|
|
|
2,
|
|
|
|
24576,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// Rat bite
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
4,
|
|
|
|
0,
|
|
|
|
921,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
24576,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// Spider bite
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
8,
|
|
|
|
0,
|
|
|
|
614,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
24576,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// Unk
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBullet,
|
2020-12-02 19:05:53 +00:00
|
|
|
9,
|
|
|
|
0,
|
|
|
|
512,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 500,
|
|
|
|
FX_NONE, FX_5, FX_NONE, 501,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_0, FX_NONE, 503,
|
|
|
|
FX_NONE, FX_4, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_6, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 502,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
(DAMAGE_TYPE)-1,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
2560,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_34, FX_35, -1,
|
|
|
|
FX_NONE, FX_34, FX_35, -1,
|
|
|
|
FX_NONE, FX_34, FX_35, -1,
|
|
|
|
FX_NONE, FX_34, FX_35, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_34, FX_35, -1,
|
|
|
|
FX_NONE, FX_34, FX_35, -1,
|
|
|
|
FX_NONE, FX_34, FX_35, -1,
|
|
|
|
FX_NONE, FX_34, FX_35, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// Tchernobog burn vector
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageBurn,
|
2020-12-02 19:05:53 +00:00
|
|
|
2,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
15,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// Vodoo 1.0 vector
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageSpirit,
|
2020-12-02 19:05:53 +00:00
|
|
|
25,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
},
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 19:05:53 +00:00
|
|
|
// 22 kVectorGenDudePunch
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageFall,
|
2020-12-02 19:05:53 +00:00
|
|
|
37,
|
|
|
|
874762,
|
|
|
|
620,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, -1,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
FX_NONE, FX_NONE, FX_NONE, 357,
|
|
|
|
},
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
const ITEMDATA gItemData[] = {
|
2020-12-02 19:05:53 +00:00
|
|
|
{
|
|
|
|
0,
|
|
|
|
2552,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2553,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2554,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2555,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2556,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2557,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
2021-04-17 10:05:37 +00:00
|
|
|
2558,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
2021-04-17 10:05:37 +00:00
|
|
|
32,
|
|
|
|
32,
|
2020-12-02 19:05:53 +00:00
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
519,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
822,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2169,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2433,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
517,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
783,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
896,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
825,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
827,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
4,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
828,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
829,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
830,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
80,
|
|
|
|
64,
|
|
|
|
1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
831,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
863,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
760,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
836,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
851,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2428,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
839,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
3,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
768,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
840,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
841,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
842,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
843,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
683,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
521,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
604,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
520,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
803,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
518,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
522,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
523,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
837,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
80,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2628,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2586,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2578,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2602,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2594,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
753,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
753,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
7,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
3558,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
3558,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
7,
|
|
|
|
64,
|
|
|
|
64,
|
|
|
|
-1,
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
const AMMOITEMDATA gAmmoItemData[] = {
|
2020-12-02 19:05:53 +00:00
|
|
|
{
|
|
|
|
0,
|
|
|
|
618,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
480,
|
|
|
|
6,
|
|
|
|
7
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
589,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
1,
|
|
|
|
5,
|
|
|
|
6
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
589,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
1,
|
|
|
|
5,
|
|
|
|
6
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
809,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
5,
|
|
|
|
5,
|
|
|
|
6
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
811,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
1,
|
|
|
|
10,
|
|
|
|
11
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
810,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
1,
|
|
|
|
11,
|
|
|
|
12
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
820,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
24,
|
|
|
|
24,
|
|
|
|
10,
|
|
|
|
8,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
619,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
4,
|
|
|
|
2,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
812,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
15,
|
|
|
|
2,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
813,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
15,
|
|
|
|
3,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
525,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
100,
|
|
|
|
9,
|
|
|
|
10
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
814,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
15,
|
|
|
|
255,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
817,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
100,
|
|
|
|
3,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
548,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
24,
|
|
|
|
24,
|
|
|
|
32,
|
|
|
|
7,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
0,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
6,
|
|
|
|
255,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
0,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
6,
|
|
|
|
255,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
816,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
8,
|
|
|
|
1,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
818,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
8,
|
|
|
|
255,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
819,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
8,
|
|
|
|
255,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
801,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
6,
|
|
|
|
4,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0
|
|
|
|
},
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
const WEAPONITEMDATA gWeaponItemData[] = {
|
2020-12-02 19:05:53 +00:00
|
|
|
{
|
|
|
|
0,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
-1,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
559,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
3,
|
|
|
|
2,
|
|
|
|
8
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
558,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
4,
|
|
|
|
3,
|
|
|
|
50
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
524,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
2,
|
|
|
|
1,
|
|
|
|
9
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
525,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
10,
|
|
|
|
9,
|
|
|
|
100
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
539,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
8,
|
|
|
|
7,
|
|
|
|
64
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
526,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
5,
|
|
|
|
4,
|
|
|
|
6
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
-1,
|
|
|
|
0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
618,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
7,
|
|
|
|
6,
|
|
|
|
480
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
589,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
6,
|
|
|
|
5,
|
|
|
|
1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
800,
|
2021-04-17 08:22:00 +00:00
|
|
|
-8,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
9,
|
|
|
|
8,
|
|
|
|
35
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
const MissileType missileInfo[] = {
|
2020-12-02 19:05:53 +00:00
|
|
|
// Cleaver
|
|
|
|
{
|
|
|
|
2138,
|
|
|
|
978670,
|
|
|
|
512,
|
|
|
|
40,
|
|
|
|
40,
|
2021-04-17 08:22:00 +00:00
|
|
|
-16,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// Regular flare
|
|
|
|
{
|
|
|
|
2424,
|
|
|
|
3145728,
|
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
32,
|
|
|
|
},
|
|
|
|
// Tesla alt
|
|
|
|
{
|
|
|
|
3056,
|
|
|
|
2796202,
|
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
32,
|
|
|
|
},
|
|
|
|
// Flare alt
|
|
|
|
{
|
|
|
|
2424,
|
|
|
|
2446677,
|
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
4,
|
|
|
|
},
|
|
|
|
// Spray flame
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
1118481,
|
|
|
|
0,
|
|
|
|
24,
|
|
|
|
24,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// Fireball
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
1118481,
|
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
32,
|
|
|
|
},
|
|
|
|
// Tesla regular
|
|
|
|
{
|
|
|
|
2130,
|
|
|
|
2796202,
|
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// EctoSkull
|
|
|
|
{
|
|
|
|
870,
|
|
|
|
699050,
|
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
2021-04-17 08:22:00 +00:00
|
|
|
-24,
|
2020-12-02 19:05:53 +00:00
|
|
|
32,
|
|
|
|
},
|
|
|
|
// Hellhound flame
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
1118481,
|
|
|
|
0,
|
|
|
|
24,
|
|
|
|
24,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// Puke
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
838860,
|
|
|
|
0,
|
|
|
|
16,
|
|
|
|
16,
|
2021-04-17 08:22:00 +00:00
|
|
|
-16,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// Reserved
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
838860,
|
|
|
|
0,
|
|
|
|
8,
|
|
|
|
8,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// Stone gargoyle projectile
|
|
|
|
{
|
|
|
|
3056,
|
|
|
|
2097152,
|
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// Napalm launcher
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2446677,
|
|
|
|
0,
|
|
|
|
30,
|
|
|
|
30,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
24,
|
|
|
|
},
|
|
|
|
// Cerberus fireball
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
2446677,
|
|
|
|
0,
|
|
|
|
30,
|
|
|
|
30,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
24,
|
|
|
|
},
|
|
|
|
// Tchernobog fireball
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
1398101,
|
|
|
|
0,
|
|
|
|
24,
|
|
|
|
24,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// Regular life leech
|
|
|
|
{
|
|
|
|
2446,
|
|
|
|
2796202,
|
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// Dropped life leech (enough ammo)
|
|
|
|
{
|
|
|
|
3056,
|
|
|
|
2446677,
|
|
|
|
0,
|
|
|
|
16,
|
|
|
|
16,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
},
|
|
|
|
// Dropped life leech (no ammo)
|
|
|
|
{
|
|
|
|
3056,
|
|
|
|
1747626,
|
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
16,
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2019-12-06 23:07:02 +00:00
|
|
|
const THINGINFO thingInfo[] = {
|
2020-12-02 19:05:53 +00:00
|
|
|
//TNT Barrel
|
|
|
|
{
|
|
|
|
25,
|
|
|
|
250,
|
|
|
|
32,
|
|
|
|
11,
|
|
|
|
4096,
|
|
|
|
80,
|
|
|
|
384,
|
|
|
|
907,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
256, 256, 128, 64, 0, 0, 128,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Armed Proxy Dynamite
|
|
|
|
{
|
|
|
|
5,
|
|
|
|
5,
|
|
|
|
16,
|
|
|
|
3,
|
|
|
|
24576,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
3444,
|
2021-04-17 08:22:00 +00:00
|
|
|
-16,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
256, 256, 256, 64, 0, 0, 512,
|
|
|
|
},
|
|
|
|
// Armed Remote Dynamite
|
|
|
|
{
|
|
|
|
5,
|
|
|
|
5,
|
|
|
|
16,
|
|
|
|
3,
|
|
|
|
24576,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
3457,
|
2021-04-17 08:22:00 +00:00
|
|
|
-16,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
256, 256, 256, 64, 0, 0, 512,
|
|
|
|
},
|
|
|
|
// Vase1
|
|
|
|
{
|
|
|
|
1,
|
|
|
|
20,
|
|
|
|
32,
|
|
|
|
3,
|
|
|
|
32768,
|
|
|
|
80,
|
|
|
|
0,
|
|
|
|
739,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
256, 0, 256, 128, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Vase2
|
|
|
|
{
|
|
|
|
1,
|
|
|
|
150,
|
|
|
|
32,
|
|
|
|
3,
|
|
|
|
32768,
|
|
|
|
80,
|
|
|
|
0,
|
|
|
|
642,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
256, 256, 256, 128, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Crate face
|
|
|
|
{
|
|
|
|
10,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
462,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0, 0, 0, 256, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Glass window
|
|
|
|
{
|
|
|
|
1,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
266,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
256, 0, 256, 256, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Flourescent Light
|
|
|
|
{
|
|
|
|
1,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
796,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
256, 0, 256, 256, 0, 0, 512,
|
|
|
|
},
|
|
|
|
// Wall Crack
|
|
|
|
{
|
|
|
|
50,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1127,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0, 0, 0, 256, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Wood Beam
|
|
|
|
{
|
|
|
|
8,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1142,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
256, 0, 256, 128, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Spider's Web
|
|
|
|
{
|
|
|
|
4,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1069,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
256, 256, 64, 256, 0, 0, 128,
|
|
|
|
},
|
|
|
|
// Metal Grate
|
|
|
|
{
|
|
|
|
40,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
483,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
64, 0, 128, 256, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Flammable Tree
|
|
|
|
{
|
|
|
|
1,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0, 256, 0, 256, 0, 0, 128,
|
|
|
|
},
|
|
|
|
// MachineGun Trap
|
|
|
|
{
|
|
|
|
1000,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
8,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0, 0, 128, 256, 0, 0, 512,
|
|
|
|
},
|
|
|
|
// Falling Rock
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
15,
|
|
|
|
8,
|
|
|
|
3,
|
|
|
|
32768,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Kickable Pail
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
8,
|
|
|
|
48,
|
|
|
|
3,
|
|
|
|
49152,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Gib Object
|
|
|
|
{
|
|
|
|
10,
|
|
|
|
2,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
32768,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
256, 0, 256, 256, 0, 0, 128,
|
|
|
|
},
|
|
|
|
// Explode Object
|
|
|
|
{
|
|
|
|
20,
|
|
|
|
2,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
32768,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0, 0, 0, 256, 0, 0, 128,
|
|
|
|
},
|
|
|
|
// Armed stick Of TNT
|
|
|
|
{
|
|
|
|
5,
|
|
|
|
14,
|
|
|
|
16,
|
|
|
|
3,
|
|
|
|
24576,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
3422,
|
2021-04-17 08:22:00 +00:00
|
|
|
-32,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
64, 256, 128, 64, 0, 0, 256,
|
|
|
|
},
|
|
|
|
// Armed bundle Of TNT
|
|
|
|
{
|
|
|
|
5,
|
|
|
|
14,
|
|
|
|
16,
|
|
|
|
3,
|
|
|
|
24576,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
3433,
|
2021-04-17 08:22:00 +00:00
|
|
|
-32,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
64, 256, 128, 64, 0, 0, 256,
|
|
|
|
},
|
|
|
|
// Armed aerosol
|
|
|
|
{
|
|
|
|
5,
|
|
|
|
14,
|
|
|
|
16,
|
|
|
|
3,
|
|
|
|
32768,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
3467,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
64, 256, 128, 64, 0, 0, 256,
|
|
|
|
},
|
|
|
|
// Bone (Flesh Garg.)
|
|
|
|
{
|
|
|
|
5,
|
|
|
|
6,
|
|
|
|
16,
|
|
|
|
3,
|
|
|
|
32768,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
1462,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
0, 0, 0, 0, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Some alpha stuff
|
|
|
|
{
|
|
|
|
8,
|
|
|
|
3,
|
|
|
|
16,
|
|
|
|
11,
|
|
|
|
32768,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
256, 0, 256, 256, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// WaterDrip
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1147,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
10,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// BloodDrip
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
1160,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
2,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Blood chucks1
|
|
|
|
{
|
|
|
|
15,
|
|
|
|
4,
|
|
|
|
4,
|
|
|
|
3,
|
|
|
|
24576,
|
|
|
|
0,
|
|
|
|
257,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
128, 64, 256, 256, 0, 0, 256,
|
|
|
|
},
|
|
|
|
// Blood chucks2
|
|
|
|
{
|
|
|
|
30,
|
|
|
|
30,
|
|
|
|
8,
|
|
|
|
3,
|
|
|
|
8192,
|
|
|
|
0,
|
|
|
|
257,
|
|
|
|
-1,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
128, 64, 256, 256, 0, 0, 64,
|
|
|
|
},
|
|
|
|
// Axe Zombie Head
|
|
|
|
{
|
|
|
|
60,
|
|
|
|
5,
|
|
|
|
32,
|
|
|
|
3,
|
|
|
|
40960,
|
|
|
|
1280,
|
|
|
|
257,
|
|
|
|
3405,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
40,
|
|
|
|
40,
|
|
|
|
128, 64, 256, 256, 0, 0, 64,
|
|
|
|
},
|
|
|
|
// Napalm's Alt Fire explosion
|
|
|
|
{
|
|
|
|
80,
|
|
|
|
30,
|
|
|
|
32,
|
|
|
|
3,
|
|
|
|
57344,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
3281,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
0, 0, 0, 0, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Fire Pod Explosion
|
|
|
|
{
|
|
|
|
80,
|
|
|
|
30,
|
|
|
|
32,
|
|
|
|
3,
|
|
|
|
57344,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
2020,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
256, 0, 256, 256, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Green Pod Explosion
|
|
|
|
{
|
|
|
|
80,
|
|
|
|
30,
|
|
|
|
32,
|
|
|
|
3,
|
|
|
|
57344,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
1860,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
256, 0, 256, 256, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// Life Leech
|
|
|
|
{
|
|
|
|
150,
|
|
|
|
30,
|
|
|
|
48,
|
|
|
|
3,
|
|
|
|
32768,
|
|
|
|
1600,
|
|
|
|
257,
|
|
|
|
800,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
48,
|
|
|
|
48,
|
|
|
|
64, 64, 112, 64, 0, 96, 96,
|
|
|
|
},
|
|
|
|
// Voodoo Head
|
|
|
|
{
|
|
|
|
1,
|
|
|
|
30,
|
|
|
|
48,
|
|
|
|
3,
|
|
|
|
32768,
|
|
|
|
1600,
|
|
|
|
0,
|
|
|
|
2443,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
16,
|
|
|
|
16,
|
|
|
|
0, 0, 0, 0, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// 433 - kModernThingTNTProx
|
|
|
|
{
|
|
|
|
5,
|
|
|
|
5,
|
|
|
|
16,
|
|
|
|
3,
|
|
|
|
24576,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
3444,
|
2021-04-17 08:22:00 +00:00
|
|
|
-16,
|
2020-12-02 19:05:53 +00:00
|
|
|
7,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
256, 256, 256, 64, 0, 0, 512,
|
|
|
|
},
|
|
|
|
// 434 - kModernThingThrowableRock
|
|
|
|
{
|
|
|
|
5,
|
|
|
|
6,
|
|
|
|
16,
|
|
|
|
3,
|
|
|
|
32768,
|
|
|
|
1600,
|
|
|
|
256,
|
|
|
|
1462,
|
2021-04-17 08:22:00 +00:00
|
|
|
0,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
32,
|
|
|
|
32,
|
|
|
|
0, 0, 0, 0, 0, 0, 0,
|
|
|
|
},
|
|
|
|
// 435 - kModernThingEnemyLifeLeech
|
|
|
|
{
|
|
|
|
150,
|
|
|
|
30,
|
|
|
|
48,
|
|
|
|
3,
|
|
|
|
32768,
|
|
|
|
1600,
|
|
|
|
257,
|
|
|
|
800,
|
2021-04-17 08:22:00 +00:00
|
|
|
-128,
|
2020-12-02 19:05:53 +00:00
|
|
|
0,
|
|
|
|
44,
|
|
|
|
44,
|
|
|
|
0, 1024, 512, 1024, 0, 64, 512,
|
|
|
|
},
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
const EXPLOSION explodeInfo[] = {
|
2020-12-02 19:05:53 +00:00
|
|
|
{
|
|
|
|
40,
|
|
|
|
10,
|
|
|
|
10,
|
|
|
|
75,
|
|
|
|
450,
|
|
|
|
0,
|
|
|
|
60,
|
|
|
|
80,
|
|
|
|
40
|
|
|
|
},
|
|
|
|
{
|
|
|
|
80,
|
|
|
|
20,
|
|
|
|
10,
|
|
|
|
150,
|
|
|
|
900,
|
|
|
|
0,
|
|
|
|
60,
|
|
|
|
160,
|
|
|
|
60
|
|
|
|
},
|
|
|
|
{
|
|
|
|
120,
|
|
|
|
40,
|
|
|
|
15,
|
|
|
|
225,
|
|
|
|
1350,
|
|
|
|
0,
|
|
|
|
60,
|
|
|
|
240,
|
|
|
|
80
|
|
|
|
},
|
|
|
|
{
|
|
|
|
80,
|
|
|
|
5,
|
|
|
|
10,
|
|
|
|
120,
|
|
|
|
20,
|
|
|
|
10,
|
|
|
|
60,
|
|
|
|
0,
|
|
|
|
40
|
|
|
|
},
|
|
|
|
{
|
|
|
|
120,
|
|
|
|
10,
|
|
|
|
10,
|
|
|
|
180,
|
|
|
|
40,
|
|
|
|
10,
|
|
|
|
60,
|
|
|
|
0,
|
|
|
|
80
|
|
|
|
},
|
|
|
|
{
|
|
|
|
160,
|
|
|
|
15,
|
|
|
|
10,
|
|
|
|
240,
|
|
|
|
60,
|
|
|
|
10,
|
|
|
|
60,
|
|
|
|
0,
|
|
|
|
120
|
|
|
|
},
|
|
|
|
{
|
|
|
|
40,
|
|
|
|
20,
|
|
|
|
10,
|
|
|
|
120,
|
|
|
|
0,
|
|
|
|
10,
|
|
|
|
30,
|
|
|
|
60,
|
|
|
|
40
|
|
|
|
},
|
|
|
|
{
|
|
|
|
80,
|
|
|
|
20,
|
|
|
|
10,
|
|
|
|
150,
|
|
|
|
800,
|
|
|
|
5,
|
|
|
|
60,
|
|
|
|
160,
|
|
|
|
60
|
|
|
|
},
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
static const short gPlayerGibThingComments[] = {
|
2020-12-02 19:05:53 +00:00
|
|
|
734, 735, 736, 737, 738, 739, 740, 741, 3038, 3049
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
const int DudeDifficulty[5] = {
|
|
|
|
512, 384, 256, 208, 160
|
|
|
|
};
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
int gPostCount = 0;
|
|
|
|
|
|
|
|
struct POSTPONE {
|
2020-12-02 19:05:53 +00:00
|
|
|
short sprite;
|
|
|
|
short status;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
POSTPONE gPost[kMaxSprites];
|
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
bool IsUnderwaterSector(int nSector)
|
|
|
|
{
|
2020-12-02 19:05:53 +00:00
|
|
|
int nXSector = sector[nSector].extra;
|
|
|
|
if (nXSector > 0 && xsector[nXSector].Underwater)
|
|
|
|
return 1;
|
|
|
|
return 0;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 19:55:08 +00:00
|
|
|
static void actInitTraps()
|
2020-12-02 16:10:00 +00:00
|
|
|
{
|
2020-12-02 19:22:13 +00:00
|
|
|
BloodStatIterator it(kStatTraps);
|
|
|
|
while (auto act = it.Next())
|
|
|
|
{
|
|
|
|
spritetype* pSprite = &act->s();
|
|
|
|
if (pSprite->type == kTrapExploder)
|
|
|
|
{
|
|
|
|
pSprite->cstat &= ~1;
|
|
|
|
pSprite->cstat |= CSTAT_SPRITE_INVISIBLE;
|
|
|
|
if (!act->hasX()) continue;
|
|
|
|
auto x = &act->x();
|
|
|
|
x->waitTime = ClipLow(x->waitTime, 1);
|
|
|
|
x->state = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-12 20:45:46 +00:00
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2019-10-12 20:45:46 +00:00
|
|
|
|
2020-12-02 19:55:08 +00:00
|
|
|
static void actInitThings()
|
2020-12-02 19:22:13 +00:00
|
|
|
{
|
|
|
|
BloodStatIterator it(kStatThing);
|
|
|
|
while (auto act = it.Next())
|
|
|
|
{
|
|
|
|
if (!act->hasX()) continue;
|
|
|
|
spritetype* pSprite = &act->s();
|
|
|
|
XSPRITE* pXSprite = &act->x();
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
int nType = pSprite->type - kThingBase;
|
|
|
|
pXSprite->health = thingInfo[nType].startHealth << 4;
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// allow level designer to set custom clipdist.
|
|
|
|
// this is especially useful for various Gib and Explode objects which have clipdist 1 for some reason predefined,
|
|
|
|
// but what if it have voxel model...?
|
|
|
|
if (!gModernMap)
|
|
|
|
#endif
|
|
|
|
pSprite->clipdist = thingInfo[nType].clipdist;
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
pSprite->flags = thingInfo[nType].flags;
|
|
|
|
if (pSprite->flags & kPhysGravity) pSprite->flags |= kPhysFalling;
|
|
|
|
act->xvel() = act->yvel() = act->zvel() = 0;
|
2020-12-02 16:10:00 +00:00
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kThingArmedProxBomb:
|
|
|
|
case kTrapMachinegun:
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
case kModernThingTNTProx:
|
|
|
|
#endif
|
|
|
|
pXSprite->state = 0;
|
|
|
|
break;
|
2020-12-03 19:30:30 +00:00
|
|
|
case kThingBloodChunks:
|
|
|
|
{
|
2020-12-02 19:22:13 +00:00
|
|
|
SEQINST* pInst = GetInstance(3, pSprite->extra);
|
|
|
|
if (pInst)
|
|
|
|
{
|
|
|
|
auto seq = getSequence(pInst->nSeqID);
|
|
|
|
if (!seq) break;
|
2020-12-03 19:30:30 +00:00
|
|
|
seqSpawn(pInst->nSeqID, act);
|
2020-12-02 19:22:13 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
pXSprite->state = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2020-12-02 16:10:00 +00:00
|
|
|
|
2020-12-02 19:55:08 +00:00
|
|
|
static void actInitDudes()
|
2020-12-02 19:22:13 +00:00
|
|
|
{
|
|
|
|
if (gGameOptions.nMonsterSettings == 0)
|
|
|
|
{
|
|
|
|
gKillMgr.SetCount(0);
|
|
|
|
BloodStatIterator it(kStatDude);
|
|
|
|
while (auto act = it.Next())
|
|
|
|
{
|
|
|
|
spritetype* pSprite = &act->s();
|
|
|
|
if (act->hasX() && act->x().key > 0) // Drop Key
|
2020-12-02 23:20:14 +00:00
|
|
|
actDropObject(act, kItemKeyBase + (act->x().key - 1));
|
2020-12-02 19:22:13 +00:00
|
|
|
DeleteSprite(act);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// by NoOne: WTF is this?
|
|
|
|
///////////////
|
|
|
|
char unk[kDudeMax - kDudeBase];
|
|
|
|
memset(unk, 0, sizeof(unk));
|
|
|
|
BloodStatIterator it(kStatDude);
|
|
|
|
while (auto act = it.Next())
|
|
|
|
{
|
|
|
|
spritetype* pSprite = &act->s();
|
|
|
|
if (pSprite->type < kDudeBase || pSprite->type >= kDudeMax)
|
|
|
|
I_Error("Non-enemy sprite (%d) in the enemy sprite list.\n", pSprite->index);
|
|
|
|
unk[pSprite->type - kDudeBase] = 1;
|
|
|
|
}
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
gKillMgr.CountTotalKills();
|
|
|
|
///////////////
|
|
|
|
|
|
|
|
for (int i = 0; i < kDudeMax - kDudeBase; i++)
|
|
|
|
for (int j = 0; j < 7; j++)
|
2020-12-02 23:30:19 +00:00
|
|
|
dudeInfo[i].damageVal[j] = MulScale(DudeDifficulty[gGameOptions.nDifficulty], dudeInfo[i].startDamage[j], 8);
|
2020-12-02 19:22:13 +00:00
|
|
|
|
|
|
|
it.Reset(kStatDude);
|
|
|
|
while (auto act = it.Next())
|
|
|
|
{
|
|
|
|
if (!act->hasX()) continue;
|
|
|
|
spritetype* pSprite = &act->s();
|
|
|
|
XSPRITE* pXSprite = &act->x();
|
|
|
|
|
|
|
|
int nType = pSprite->type - kDudeBase;
|
|
|
|
int seqStartId = dudeInfo[nType].seqStartID;
|
|
|
|
if (!act->IsPlayerActor())
|
|
|
|
{
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
|
|
|
case kDudeModernCustom:
|
|
|
|
case kDudeModernCustomBurning:
|
|
|
|
pSprite->cstat |= 4096 + CSTAT_SPRITE_BLOCK_HITSCAN + CSTAT_SPRITE_BLOCK;
|
|
|
|
seqStartId = genDudeSeqStartId(pXSprite); // Custom Dude stores its SEQ in data2
|
|
|
|
pXSprite->sysData1 = pXSprite->data3; // move sndStartId to sysData1, because data3 used by the game;
|
|
|
|
pXSprite->data3 = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudePodMother: // FakeDude type (no seq, custom flags, clipdist and cstat)
|
|
|
|
if (gModernMap) break;
|
|
|
|
[[fallthrough]];
|
|
|
|
default:
|
|
|
|
pSprite->clipdist = dudeInfo[nType].clipdist;
|
|
|
|
pSprite->cstat |= 4096 + CSTAT_SPRITE_BLOCK_HITSCAN + CSTAT_SPRITE_BLOCK;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
pSprite->clipdist = dudeInfo[nType].clipdist;
|
|
|
|
pSprite->cstat |= 4096 + CSTAT_SPRITE_BLOCK_HITSCAN + CSTAT_SPRITE_BLOCK;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
act->xvel() = act->yvel() = act->zvel() = 0;
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// add a way to set custom hp for every enemy - should work only if map just started and not loaded.
|
|
|
|
if (!gModernMap || pXSprite->sysData2 <= 0) pXSprite->health = dudeInfo[nType].startHealth << 4;
|
|
|
|
else pXSprite->health = ClipRange(pXSprite->sysData2 << 4, 1, 65535);
|
|
|
|
#else
|
|
|
|
pXSprite->health = dudeInfo[nType].startHealth << 4;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getSequence(seqStartId)) seqSpawn(seqStartId, 3, pSprite->extra);
|
|
|
|
}
|
|
|
|
aiInit();
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 19:22:13 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void actInit(bool bSaveLoad)
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
if (!gModernMap) nnExtResetGlobals();
|
|
|
|
else nnExtInitModernStuff(bSaveLoad);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
BloodStatIterator it(kStatItem);
|
|
|
|
while (auto act = it.Next())
|
|
|
|
{
|
|
|
|
if (act->s().type == kItemWeaponVoodooDoll)
|
|
|
|
{
|
|
|
|
act->s().type = kAmmoItemVoodooDoll;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
actInitTraps();
|
|
|
|
actInitThings();
|
|
|
|
actInitDudes();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-12-02 19:55:08 +00:00
|
|
|
static void ConcussSprite(DBloodActor* source, DBloodActor* actor, int x, int y, int z, int damage)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 19:55:08 +00:00
|
|
|
auto pSprite = &actor->s();
|
|
|
|
int dx = pSprite->x - x;
|
|
|
|
int dy = pSprite->y - y;
|
|
|
|
int dz = (pSprite->z - z) >> 4;
|
|
|
|
int dist2 = 0x40000 + dx * dx + dy * dy + dz * dz;
|
|
|
|
assert(dist2 > 0);
|
|
|
|
damage = scale(0x40000, damage, dist2);
|
|
|
|
|
|
|
|
if (pSprite->flags & kPhysMove)
|
|
|
|
{
|
|
|
|
int mass = 0;
|
|
|
|
if (actor->IsDudeActor())
|
|
|
|
{
|
|
|
|
mass = getDudeInfo(pSprite->type)->mass;
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
if (pSprite->type == kDudeModernCustom || pSprite->type == kDudeModernCustomBurning)
|
|
|
|
{
|
|
|
|
mass = getSpriteMassBySize(pSprite);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else if (pSprite->type >= kThingBase && pSprite->type < kThingMax)
|
|
|
|
{
|
|
|
|
mass = thingInfo[pSprite->type - kThingBase].mass;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Printf(PRINT_HIGH, "Unexpected type in ConcussSprite(): Sprite: %d Type: %d Stat: %d", (int)pSprite->index, (int)pSprite->type, (int)pSprite->statnum);
|
|
|
|
return;
|
|
|
|
}
|
2019-10-12 20:45:46 +00:00
|
|
|
|
2020-12-02 19:55:08 +00:00
|
|
|
if (mass > 0)
|
|
|
|
{
|
|
|
|
int size = (tileWidth(pSprite->picnum) * pSprite->xrepeat * tileHeight(pSprite->picnum) * pSprite->yrepeat) >> 1;
|
|
|
|
int t = scale(damage, size, mass);
|
|
|
|
int nSprite = pSprite->index;
|
|
|
|
actor->xvel() += MulScale(t, dx, 16);
|
|
|
|
actor->yvel() += MulScale(t, dy, 16);
|
|
|
|
actor->zvel() += MulScale(t, dz, 16);
|
|
|
|
}
|
|
|
|
}
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(source, actor, kDamageExplode, damage);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 19:55:08 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
int actWallBounceVector(int* x, int* y, int nWall, int a4)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 20:39:37 +00:00
|
|
|
int wx, wy;
|
|
|
|
GetWallNormal(nWall, &wx, &wy);
|
|
|
|
int t = DMulScale(*x, wx, *y, wy, 16);
|
2021-05-04 16:41:59 +00:00
|
|
|
int t2 = mulscale16r(t, a4 + 0x10000);
|
2020-12-02 20:39:37 +00:00
|
|
|
*x -= MulScale(wx, t2, 16);
|
|
|
|
*y -= MulScale(wy, t2, 16);
|
2021-05-04 16:41:59 +00:00
|
|
|
return mulscale16r(t, 0x10000 - a4);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 20:39:37 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
int actFloorBounceVector(int* x, int* y, int* z, int nSector, int a5)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
int t = 0x10000 - a5;
|
2020-12-02 20:39:37 +00:00
|
|
|
if (sector[nSector].floorheinum == 0)
|
|
|
|
{
|
|
|
|
int t2 = MulScale(*z, t, 16);
|
2021-05-04 16:41:59 +00:00
|
|
|
*z = -(*z - t2);
|
2020-12-02 20:39:37 +00:00
|
|
|
return t2;
|
|
|
|
}
|
2021-05-04 16:41:59 +00:00
|
|
|
walltype* pWall = &wall[sector[nSector].wallptr];
|
|
|
|
walltype* pWall2 = &wall[pWall->point2];
|
|
|
|
int angle = getangle(pWall2->x - pWall->x, pWall2->y - pWall->y) + 512;
|
|
|
|
int t2 = sector[nSector].floorheinum << 4;
|
2020-12-02 20:39:37 +00:00
|
|
|
int t3 = approxDist(-0x10000, t2);
|
|
|
|
int t4 = DivScale(-0x10000, t3, 16);
|
|
|
|
int t5 = DivScale(t2, t3, 16);
|
|
|
|
int t6 = MulScale(t5, Cos(angle), 30);
|
|
|
|
int t7 = MulScale(t5, Sin(angle), 30);
|
|
|
|
int t8 = TMulScale(*x, t6, *y, t7, *z, t4, 16);
|
2021-05-04 16:41:59 +00:00
|
|
|
int t9 = MulScale(t8, 0x10000 + a5, 16);
|
2020-12-02 20:39:37 +00:00
|
|
|
*x -= MulScale(t6, t9, 16);
|
|
|
|
*y -= MulScale(t7, t9, 16);
|
|
|
|
*z -= MulScale(t4, t9, 16);
|
|
|
|
return mulscale16r(t8, t);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 20:39:37 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void actRadiusDamage(DBloodActor* source, int x, int y, int z, int nSector, int nDist, int baseDmg, int distDmg, DAMAGE_TYPE dmgType, int flags, int burn)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 20:39:37 +00:00
|
|
|
uint8_t sectmap[(kMaxSectors + 7) >> 3];
|
|
|
|
auto pOwner = source->GetOwner();
|
|
|
|
GetClosestSpriteSectors(nSector, x, y, nDist, sectmap);
|
|
|
|
nDist <<= 4;
|
|
|
|
if (flags & 2)
|
|
|
|
{
|
|
|
|
BloodStatIterator it(kStatDude);
|
|
|
|
while (auto act2 = it.Next())
|
|
|
|
{
|
|
|
|
if (act2 != source || (flags & 1))
|
|
|
|
{
|
|
|
|
auto pSprite2 = &act2->s();
|
|
|
|
if (act2->hasX())
|
|
|
|
{
|
|
|
|
if (pSprite2->flags & 0x20) continue;
|
|
|
|
if (!TestBitString(sectmap, pSprite2->sectnum)) continue;
|
|
|
|
if (!CheckProximity(pSprite2, x, y, z, nSector, nDist)) continue;
|
|
|
|
|
|
|
|
int dx = abs(x - pSprite2->x);
|
|
|
|
int dy = abs(y - pSprite2->y);
|
|
|
|
int dz = abs(z - pSprite2->z) >> 4;
|
|
|
|
int dist = ksqrt(dx * dx + dy * dy + dz * dz);
|
|
|
|
if (dist > nDist) continue;
|
|
|
|
|
|
|
|
int totaldmg;
|
|
|
|
if (dist != 0) totaldmg = baseDmg + ((nDist - dist) * distDmg) / nDist;
|
|
|
|
else totaldmg = baseDmg + distDmg;
|
|
|
|
|
|
|
|
actDamageSprite(source, act2, dmgType, totaldmg << 4);
|
|
|
|
if (burn) actBurnSprite(pOwner, act2, burn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (flags & 4)
|
|
|
|
{
|
|
|
|
BloodStatIterator it(kStatDude);
|
|
|
|
while (auto act2 = it.Next())
|
|
|
|
{
|
|
|
|
auto pSprite2 = &act2->s();
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2020-12-02 20:39:37 +00:00
|
|
|
if (pSprite2->flags & 0x20) continue;
|
|
|
|
if (!TestBitString(sectmap, pSprite2->sectnum)) continue;
|
|
|
|
if (!CheckProximity(pSprite2, x, y, z, nSector, nDist)) continue;
|
|
|
|
|
|
|
|
XSPRITE* pXSprite2 = &act2->x();
|
|
|
|
if (pXSprite2->locked) continue;
|
|
|
|
|
|
|
|
int dx = abs(x - pSprite2->x);
|
|
|
|
int dy = abs(y - pSprite2->y);
|
|
|
|
int dist = ksqrt(dx * dx + dy * dy);
|
|
|
|
if (dist > nDist) continue;
|
|
|
|
|
|
|
|
int totaldmg;
|
|
|
|
if (dist != 0) totaldmg = baseDmg + ((nDist - dist) * distDmg) / nDist;
|
|
|
|
else totaldmg = baseDmg + distDmg;
|
|
|
|
|
|
|
|
actDamageSprite(source, act2, dmgType, totaldmg << 4);
|
|
|
|
if (burn) actBurnSprite(pOwner, act2, burn);
|
|
|
|
}
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 21:33:14 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void actNapalmMove(DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 21:33:14 +00:00
|
|
|
auto pXSprite = &actor->x();
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
auto pOwner = actor->GetOwner();
|
|
|
|
|
|
|
|
actPostSprite(actor, kStatDecoration);
|
|
|
|
seqSpawn(9, actor);
|
|
|
|
if (Chance(0x8000)) pSprite->cstat |= 4;
|
|
|
|
|
|
|
|
sfxPlay3DSound(pSprite, 303, 24 + (pSprite->flags & 3), 1);
|
2021-06-16 19:13:04 +00:00
|
|
|
actRadiusDamage(pOwner, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 128, 0, 60, kDamageExplode, 15, 120);
|
2020-12-02 21:33:14 +00:00
|
|
|
|
|
|
|
if (pXSprite->data4 > 1)
|
|
|
|
{
|
2020-12-03 17:00:07 +00:00
|
|
|
GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr);
|
2020-12-02 21:33:14 +00:00
|
|
|
int spawnparam[2];
|
|
|
|
spawnparam[0] = pXSprite->data4 >> 1;
|
|
|
|
spawnparam[1] = pXSprite->data4 - spawnparam[0];
|
|
|
|
int ang = pSprite->ang;
|
|
|
|
actor->xvel() = 0;
|
|
|
|
actor->yvel() = 0;
|
|
|
|
actor->zvel() = 0;
|
|
|
|
for (int i = 0; i < 2; i++)
|
|
|
|
{
|
|
|
|
int t1 = Random(0x33333) + 0x33333;
|
|
|
|
int rndang = Random2(0x71);
|
|
|
|
pSprite->ang = (rndang + ang + 2048) & 2047;
|
|
|
|
auto spawned = actFireThing(actor, 0, 0, -0x93d0, kThingNapalmBall, t1);
|
|
|
|
spawned->SetOwner(actor->GetOwner());
|
|
|
|
seqSpawn(61, spawned, nNapalmClient);
|
|
|
|
spawned->x().data4 = spawnparam[i];
|
|
|
|
}
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 21:33:14 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
static DBloodActor* actSpawnFloor(DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 22:39:38 +00:00
|
|
|
auto pSprite = &actor->s();
|
|
|
|
short sector = pSprite->sectnum;
|
|
|
|
int x = pSprite->x;
|
|
|
|
int y = pSprite->y;
|
|
|
|
updatesector(x, y, §or);
|
|
|
|
int zFloor = getflorzofslope(sector, x, y);
|
2021-05-04 16:41:59 +00:00
|
|
|
auto* spawned = actSpawnSprite(sector, x, y, zFloor, 3, 0);
|
2020-12-02 22:39:38 +00:00
|
|
|
if (spawned) spawned->s().cstat &= ~257;
|
|
|
|
return spawned;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
static DBloodActor* actDropAmmo(DBloodActor* actor, int nType)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 22:39:38 +00:00
|
|
|
if (!actor) return nullptr;
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
if (pSprite->statnum < kMaxStatus && nType >= kItemAmmoBase && nType < kItemAmmoMax)
|
|
|
|
{
|
|
|
|
auto act2 = actSpawnFloor(actor);
|
2021-05-04 16:41:59 +00:00
|
|
|
const AMMOITEMDATA* pAmmo = &gAmmoItemData[nType - kItemAmmoBase];
|
2020-12-02 22:39:38 +00:00
|
|
|
auto pSprite2 = &act2->s();
|
|
|
|
pSprite2->type = nType;
|
|
|
|
pSprite2->picnum = pAmmo->picnum;
|
|
|
|
pSprite2->shade = pAmmo->shade;
|
|
|
|
pSprite2->xrepeat = pAmmo->xrepeat;
|
|
|
|
pSprite2->yrepeat = pAmmo->yrepeat;
|
|
|
|
return act2;
|
|
|
|
}
|
|
|
|
return nullptr;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
static DBloodActor* actDropWeapon(DBloodActor* actor, int nType)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 22:39:38 +00:00
|
|
|
if (!actor) return nullptr;
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
if (pSprite->statnum < kMaxStatus && nType >= kItemWeaponBase && nType < kItemWeaponMax)
|
|
|
|
{
|
|
|
|
auto act2 = actSpawnFloor(actor);
|
2021-05-04 16:41:59 +00:00
|
|
|
const WEAPONITEMDATA* pWeapon = &gWeaponItemData[nType - kItemWeaponBase];
|
2020-12-02 22:39:38 +00:00
|
|
|
auto pSprite2 = &act2->s();
|
|
|
|
pSprite2->type = nType;
|
|
|
|
pSprite2->picnum = pWeapon->picnum;
|
|
|
|
pSprite2->shade = pWeapon->shade;
|
|
|
|
pSprite2->xrepeat = pWeapon->xrepeat;
|
|
|
|
pSprite2->yrepeat = pWeapon->yrepeat;
|
|
|
|
return act2;
|
|
|
|
}
|
|
|
|
return nullptr;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 22:39:38 +00:00
|
|
|
static DBloodActor* actDropItem(DBloodActor* actor, int nType)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 22:39:38 +00:00
|
|
|
if (!actor) return nullptr;
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
if (pSprite->statnum < kMaxStatus && nType >= kItemBase && nType < kItemMax)
|
|
|
|
{
|
|
|
|
auto act2 = actSpawnFloor(actor);
|
2021-05-04 16:41:59 +00:00
|
|
|
const ITEMDATA* pItem = &gItemData[nType - kItemBase];
|
2020-12-02 22:39:38 +00:00
|
|
|
auto pSprite2 = &act2->s();
|
|
|
|
pSprite2->type = nType;
|
|
|
|
pSprite2->picnum = pItem->picnum;
|
|
|
|
pSprite2->shade = pItem->shade;
|
|
|
|
pSprite2->xrepeat = pItem->xrepeat;
|
|
|
|
pSprite2->yrepeat = pItem->yrepeat;
|
|
|
|
return act2;
|
|
|
|
}
|
|
|
|
return nullptr;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 22:39:38 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
static DBloodActor* actDropKey(DBloodActor* actor, int nType)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 22:39:38 +00:00
|
|
|
if (!actor) return nullptr;
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
if (pSprite->statnum < kMaxStatus && nType >= kItemKeyBase && nType < kItemKeyMax)
|
|
|
|
{
|
|
|
|
auto act2 = actDropItem(actor, nType);
|
|
|
|
if (act2 && gGameOptions.nGameType == 1)
|
|
|
|
{
|
|
|
|
act2->addX();
|
|
|
|
auto pSprite2 = &act2->s();
|
|
|
|
act2->x().respawn = 3;
|
|
|
|
act2->hit().florhit = 0;
|
|
|
|
act2->hit().ceilhit = 0;
|
|
|
|
}
|
|
|
|
return act2;
|
|
|
|
}
|
|
|
|
return nullptr;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 22:39:38 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
static DBloodActor* actDropFlag(DBloodActor* actor, int nType)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 22:39:38 +00:00
|
|
|
if (!actor) return nullptr;
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
if (pSprite->statnum < kMaxStatus && (nType == 147 || nType == 148))
|
|
|
|
{
|
|
|
|
auto act2 = actDropItem(actor, nType);
|
|
|
|
if (act2 && gGameOptions.nGameType == 3)
|
|
|
|
{
|
2020-12-03 17:00:07 +00:00
|
|
|
evPost(act2, 1800, kCallbackReturnFlag);
|
2020-12-02 22:39:38 +00:00
|
|
|
}
|
|
|
|
return act2;
|
|
|
|
}
|
|
|
|
return nullptr;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 22:39:38 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
static DBloodActor* actDropObject(DBloodActor* actor, int nType)
|
2020-12-02 22:39:38 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
DBloodActor* act2 = nullptr;
|
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
if (nType >= kItemKeyBase && nType < kItemKeyMax) act2 = actDropKey(actor, nType);
|
|
|
|
else if (nType == kItemFlagA || nType == kItemFlagB) act2 = actDropFlag(actor, nType);
|
|
|
|
else if (nType >= kItemBase && nType < kItemMax) act2 = actDropItem(actor, nType);
|
|
|
|
else if (nType >= kItemAmmoBase && nType < kItemAmmoMax) act2 = actDropAmmo(actor, nType);
|
|
|
|
else if (nType >= kItemWeaponBase && nType < kItemWeaponMax) act2 = actDropWeapon(actor, nType);
|
2021-05-04 16:41:59 +00:00
|
|
|
|
|
|
|
if (act2)
|
2020-12-02 22:39:38 +00:00
|
|
|
{
|
|
|
|
int top, bottom;
|
|
|
|
GetActorExtents(act2, &top, &bottom);
|
|
|
|
if (bottom >= act2->s().z)
|
|
|
|
act2->s().z -= bottom - act2->s().z;
|
|
|
|
}
|
|
|
|
|
|
|
|
return act2;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 22:39:38 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
bool actHealDude(DBloodActor* actor, int add, int threshold)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 23:00:03 +00:00
|
|
|
if (!actor) return false;
|
|
|
|
auto pXDude = &actor->x();
|
|
|
|
add <<= 4;
|
|
|
|
threshold <<= 4;
|
2021-05-11 22:48:41 +00:00
|
|
|
if (pXDude->health < (unsigned)threshold)
|
2021-05-04 16:41:59 +00:00
|
|
|
{
|
|
|
|
spritetype* pSprite = &actor->s();
|
2020-12-02 23:00:03 +00:00
|
|
|
if (actor->IsPlayerActor()) sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 780, pSprite->sectnum);
|
2021-05-04 16:41:59 +00:00
|
|
|
pXDude->health = min<uint32_t>(pXDude->health + add, threshold);
|
2020-12-02 23:00:03 +00:00
|
|
|
return true;
|
2021-05-04 16:41:59 +00:00
|
|
|
}
|
2020-12-02 23:00:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2020-12-02 23:20:14 +00:00
|
|
|
|
2020-12-02 23:00:03 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
auto pXSprite = &actor->x();
|
2021-05-04 16:41:59 +00:00
|
|
|
GENDUDEEXTRA* pExtra = genDudeExtra(pSprite);
|
|
|
|
removeDudeStuff(pSprite);
|
2020-12-03 17:00:07 +00:00
|
|
|
if (pXSprite->txID <= 0 || getNextIncarnation(pXSprite) == nullptr)
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
if (pExtra->weaponType == kGenDudeWeaponKamikaze && Chance(0x4000) && damageType != kDamageSpirit && damageType != kDamageDrown)
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
doExplosion(pSprite, pXSprite->data1 - kTrapExploder);
|
2020-12-02 23:00:03 +00:00
|
|
|
if (Chance(0x9000)) damageType = (DAMAGE_TYPE)3;
|
2021-05-04 16:41:59 +00:00
|
|
|
}
|
2020-12-02 23:00:03 +00:00
|
|
|
|
2021-06-16 19:13:04 +00:00
|
|
|
if (damageType == kDamageBurn)
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
if (pExtra->availDeaths[kDamageBurn] && !spriteIsUnderwater(pSprite))
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
if (pExtra->canBurn)
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
pSprite->type = kDudeModernCustomBurning;
|
|
|
|
if (pXSprite->data2 == kGenDudeDefaultSeq) // don't inherit palette for burning if using default animation
|
|
|
|
pSprite->pal = 0;
|
|
|
|
|
|
|
|
aiGenDudeNewState(pSprite, &genDudeBurnGoto);
|
|
|
|
actHealDude(pXSprite, dudeInfo[55].startHealth, dudeInfo[55].startHealth);
|
|
|
|
if (pXSprite->burnTime <= 0) pXSprite->burnTime = 1200;
|
2020-12-02 23:30:19 +00:00
|
|
|
actor->dudeExtra().time = PlayClock + 360;
|
2020-12-02 23:00:03 +00:00
|
|
|
return true;
|
2021-05-04 16:41:59 +00:00
|
|
|
}
|
2020-12-02 23:00:03 +00:00
|
|
|
|
|
|
|
}
|
2021-05-04 16:41:59 +00:00
|
|
|
else
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
pXSprite->burnTime = 0;
|
|
|
|
pXSprite->burnSource = -1;
|
2021-06-16 19:13:04 +00:00
|
|
|
damageType = kDamageFall;
|
2020-12-02 23:00:03 +00:00
|
|
|
}
|
2021-05-04 16:41:59 +00:00
|
|
|
}
|
2020-12-02 23:00:03 +00:00
|
|
|
}
|
2021-05-04 16:41:59 +00:00
|
|
|
else
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
pXSprite->locked = 1; // lock while transforming
|
2020-12-02 23:00:03 +00:00
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
aiSetGenIdleState(pSprite, pXSprite); // set idle state
|
2020-12-02 23:00:03 +00:00
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
if (pXSprite->key > 0) // drop keys
|
|
|
|
actDropObject(pSprite, kItemKeyBase + pXSprite->key - 1);
|
2020-12-02 23:00:03 +00:00
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
if (pXSprite->dropMsg > 0) // drop items
|
|
|
|
actDropObject(pSprite, pXSprite->dropMsg);
|
2020-12-02 23:00:03 +00:00
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
pSprite->flags &= ~kPhysMove; xvel[pSprite->index] = yvel[pSprite->index] = 0;
|
2020-12-02 23:00:03 +00:00
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
playGenDudeSound(pSprite, kGenDudeSndTransforming);
|
|
|
|
int seqId = pXSprite->data2 + kGenDudeSeqTransform;
|
2020-12-02 23:00:03 +00:00
|
|
|
if (getSequence(seqId)) seqSpawn(seqId, actor, -1);
|
2021-05-04 16:41:59 +00:00
|
|
|
else
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
|
|
|
seqKill(actor);
|
|
|
|
DBloodActor* pEffectA = gFX.fxSpawnActor((FX_ID)52, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, pSprite->ang);
|
2021-05-04 16:41:59 +00:00
|
|
|
if (pEffectA != nullptr)
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
|
|
|
auto pEffect = &pEffectA->s();
|
2021-05-04 16:41:59 +00:00
|
|
|
pEffect->cstat = CSTAT_SPRITE_ALIGNMENT_FACING;
|
|
|
|
pEffect->pal = 6;
|
|
|
|
pEffect->xrepeat = pSprite->xrepeat;
|
|
|
|
pEffect->yrepeat = pSprite->yrepeat;
|
|
|
|
}
|
2020-12-02 23:00:03 +00:00
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
GIBTYPE nGibType;
|
|
|
|
for (int i = 0; i < 3; i++)
|
2020-12-02 23:00:03 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
if (Chance(0x3000)) nGibType = GIBTYPE_6;
|
|
|
|
else if (Chance(0x2000)) nGibType = GIBTYPE_5;
|
|
|
|
else nGibType = GIBTYPE_17;
|
2020-12-02 23:00:03 +00:00
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
int top, bottom;
|
2020-12-02 23:00:03 +00:00
|
|
|
GetActorExtents(actor, &top, &bottom);
|
2021-05-04 16:41:59 +00:00
|
|
|
CGibPosition gibPos(pSprite->x, pSprite->y, top);
|
2020-12-02 23:00:03 +00:00
|
|
|
CGibVelocity gibVel(actor->xvel() >> 1, actor->yvel() >> 1, -0xccccc);
|
2021-05-04 16:41:59 +00:00
|
|
|
GibSprite(pSprite, nGibType, &gibPos, &gibVel);
|
2020-12-02 23:00:03 +00:00
|
|
|
}
|
2021-05-04 16:41:59 +00:00
|
|
|
}
|
2020-12-02 23:00:03 +00:00
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
pXSprite->sysData1 = kGenDudeTransformStatus; // in transform
|
2020-12-02 23:00:03 +00:00
|
|
|
return true;
|
2021-05-04 16:41:59 +00:00
|
|
|
}
|
2020-12-02 23:00:03 +00:00
|
|
|
return false;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2020-12-02 23:00:03 +00:00
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
static bool actKillDudeStage1(DBloodActor* actor, DAMAGE_TYPE damageType)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 23:20:14 +00:00
|
|
|
auto pSprite = &actor->s();
|
|
|
|
auto pXSprite = &actor->x();
|
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
case kDudeModernCustom:
|
|
|
|
if (actKillModernDude(actor, damageType)) return true;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case kDudeCerberusTwoHead: // Cerberus
|
|
|
|
seqSpawn(dudeInfo[pSprite->type - kDudeBase].seqStartID + 1, actor, -1);
|
|
|
|
return true;
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
case kDudeCultistTommy:
|
|
|
|
case kDudeCultistShotgun:
|
|
|
|
case kDudeCultistTesla:
|
|
|
|
case kDudeCultistTNT:
|
2021-06-16 19:13:04 +00:00
|
|
|
if (damageType == kDamageBurn && pXSprite->medium == kMediumNormal)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
pSprite->type = kDudeBurningCultist;
|
|
|
|
aiNewState(actor, &cultistBurnGoto);
|
|
|
|
actHealDude(actor, dudeInfo[40].startHealth, dudeInfo[40].startHealth);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
break;
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
case kDudeBeast:
|
2021-06-16 19:13:04 +00:00
|
|
|
if (damageType == kDamageBurn && pXSprite->medium == kMediumNormal)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
pSprite->type = kDudeBurningBeast;
|
|
|
|
aiNewState(actor, &beastBurnGoto);
|
|
|
|
actHealDude(actor, dudeInfo[53].startHealth, dudeInfo[53].startHealth);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
case kDudeInnocent:
|
2021-06-16 19:13:04 +00:00
|
|
|
if (damageType == kDamageBurn && pXSprite->medium == kMediumNormal)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
pSprite->type = kDudeBurningInnocent;
|
|
|
|
aiNewState(actor, &innocentBurnGoto);
|
|
|
|
actHealDude(actor, dudeInfo[39].startHealth, dudeInfo[39].startHealth);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
static void checkAddFrag(DBloodActor* killerActor, DBloodActor* actor)
|
|
|
|
{
|
|
|
|
auto pKillerSprite = &killerActor->s();
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
if (VanillaMode())
|
|
|
|
{
|
|
|
|
if (killerActor->IsPlayerActor())
|
|
|
|
{
|
|
|
|
PLAYER* pPlayer = &gPlayer[pKillerSprite->type - kDudePlayer1];
|
|
|
|
if (gGameOptions.nGameType == 1)
|
|
|
|
pPlayer->fragCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (gGameOptions.nGameType == 1 && killerActor->IsPlayerActor() && pSprite->statnum == kStatDude)
|
|
|
|
{
|
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
|
|
|
case kDudeBat:
|
|
|
|
case kDudeRat:
|
|
|
|
case kDudeInnocent:
|
|
|
|
case kDudeBurningInnocent:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
PLAYER* pKillerPlayer = &gPlayer[pKillerSprite->type - kDudePlayer1];
|
|
|
|
pKillerPlayer->fragCount++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void checkDropObjects(DBloodActor* actor)
|
|
|
|
{
|
|
|
|
auto pXSprite = &actor->x();
|
|
|
|
|
|
|
|
if (pXSprite->key > 0) actDropObject(actor, kItemKeyBase + pXSprite->key - 1);
|
|
|
|
if (pXSprite->dropMsg > 0) actDropObject(actor, pXSprite->dropMsg);
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
switch (actor->s().type)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
case kDudeCultistTommy:
|
|
|
|
{
|
|
|
|
int nRand = Random(100);
|
|
|
|
if (nRand < 10) actDropObject(actor, kItemWeaponTommygun);
|
|
|
|
else if (nRand < 50) actDropObject(actor, kItemAmmoTommygunFew);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case kDudeCultistShotgun:
|
|
|
|
{
|
|
|
|
int nRand = Random(100);
|
|
|
|
if (nRand <= 10) actDropObject(actor, kItemWeaponSawedoff);
|
|
|
|
else if (nRand <= 50) actDropObject(actor, kItemAmmoSawedoffFew);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static int checkDamageType(DBloodActor* actor, DAMAGE_TYPE damageType)
|
|
|
|
{
|
|
|
|
int nSeq;
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
|
|
|
|
switch (damageType)
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
case kDamageExplode:
|
2020-12-02 23:20:14 +00:00
|
|
|
nSeq = 2;
|
2021-05-04 16:41:59 +00:00
|
|
|
switch (pSprite->type)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2020-12-02 23:20:14 +00:00
|
|
|
case kDudeModernCustom:
|
2021-05-04 16:41:59 +00:00
|
|
|
case kDudeModernCustomBurning:
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
playGenDudeSound(pSprite, kGenDudeSndDeathExplode);
|
|
|
|
GENDUDEEXTRA* pExtra = &actor->genDudeExtra();
|
2021-05-04 16:41:59 +00:00
|
|
|
if (!pExtra->availDeaths[damageType])
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
nSeq = 1;
|
2021-06-16 19:13:04 +00:00
|
|
|
damageType = kDamageFall;
|
2020-12-02 23:20:14 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
case kDudeCultistTommy:
|
|
|
|
case kDudeCultistShotgun:
|
|
|
|
case kDudeCultistTommyProne:
|
|
|
|
case kDudeBurningInnocent:
|
|
|
|
case kDudeBurningCultist:
|
|
|
|
case kDudeInnocent:
|
|
|
|
case kDudeCultistShotgunProne:
|
|
|
|
case kDudeCultistTesla:
|
|
|
|
case kDudeCultistTNT:
|
|
|
|
case kDudeCultistBeast:
|
|
|
|
case kDudeTinyCaleb:
|
|
|
|
case kDudeBurningTinyCaleb:
|
|
|
|
sfxPlay3DSound(pSprite, 717, -1, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2021-06-16 19:13:04 +00:00
|
|
|
case kDamageBurn:
|
2020-12-02 23:20:14 +00:00
|
|
|
nSeq = 3;
|
|
|
|
sfxPlay3DSound(pSprite, 351, -1, 0);
|
|
|
|
break;
|
2021-06-16 19:13:04 +00:00
|
|
|
case kDamageSpirit:
|
2020-12-02 23:20:14 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kDudeZombieAxeNormal:
|
|
|
|
case kDudeZombieAxeBuried:
|
|
|
|
nSeq = 14;
|
|
|
|
break;
|
|
|
|
case kDudeZombieButcher:
|
|
|
|
nSeq = 11;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
nSeq = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2021-06-16 19:13:04 +00:00
|
|
|
case kDamageFall:
|
2020-12-02 23:20:14 +00:00
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
|
|
|
case kDudeCultistTommy:
|
|
|
|
case kDudeCultistShotgun:
|
|
|
|
nSeq = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
nSeq = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
nSeq = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return nSeq;
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
static void spawnGibs(DBloodActor* actor, int type, int velz)
|
|
|
|
{
|
|
|
|
int top, bottom;
|
|
|
|
GetActorExtents(actor, &top, &bottom);
|
|
|
|
CGibPosition gibPos(actor->s().x, actor->s().y, top);
|
|
|
|
CGibVelocity gibVel(actor->xvel() >> 1, actor->yvel() >> 1, velz);
|
|
|
|
GibSprite(&actor->s(), GIBTYPE_27, &gibPos, &gibVel);
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void zombieAxeNormalDeath(DBloodActor* actor, int nSeq)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
int nType = pSprite->type - kDudeBase;
|
|
|
|
|
|
|
|
sfxPlay3DSound(pSprite, 1107 + Random(2), -1, 0);
|
|
|
|
if (nSeq == 2)
|
|
|
|
{
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nDudeToGibClient1);
|
2021-05-04 16:41:59 +00:00
|
|
|
spawnGibs(actor, GIBTYPE_27, -0xccccc);
|
2020-12-02 23:20:14 +00:00
|
|
|
}
|
|
|
|
else if (nSeq == 1 && Chance(0x4000))
|
|
|
|
{
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 7, actor, nDudeToGibClient1);
|
2020-12-03 17:00:07 +00:00
|
|
|
evPost(actor, 0, kCallbackFXZombieSpurt);
|
2020-12-02 23:20:14 +00:00
|
|
|
sfxPlay3DSound(pSprite, 362, -1, 0);
|
|
|
|
actor->x().data1 = 35;
|
|
|
|
actor->x().data2 = 5;
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
spawnGibs(actor, GIBTYPE_27, -0x111111);
|
2020-12-02 23:20:14 +00:00
|
|
|
}
|
|
|
|
else if (nSeq == 14)seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
|
|
|
|
else if (nSeq == 3) seqSpawn(dudeInfo[nType].seqStartID + 13, actor, nDudeToGibClient2);
|
|
|
|
else seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nDudeToGibClient1);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void burningCultistDeath(DBloodActor* actor, int nSeq)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
if (Chance(0x4000) && nSeq == 3) sfxPlay3DSound(pSprite, 718, -1, 0);
|
|
|
|
else sfxPlay3DSound(pSprite, 1018 + Random(2), -1, 0);
|
|
|
|
|
|
|
|
int nType = pSprite->type - kDudeBase;
|
|
|
|
if (Chance(0x8000))
|
|
|
|
{
|
|
|
|
for (int i = 0; i < 3; i++)
|
2020-12-03 17:00:07 +00:00
|
|
|
GibSprite(pSprite, GIBTYPE_7, nullptr, nullptr);
|
2020-12-02 23:20:14 +00:00
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 16 - Random(1), actor, nDudeToGibClient1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 15, actor, nDudeToGibClient2);
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void modernCustomDudeDeath(DBloodActor* actor, int nSeq, int damageType)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
auto pXSprite = &actor->x();
|
|
|
|
|
|
|
|
playGenDudeSound(pSprite, kGenDudeSndDeathNormal);
|
|
|
|
int dudeToGib = (actCheckRespawn(pSprite)) ? -1 : ((nSeq == 3) ? nDudeToGibClient2 : nDudeToGibClient1);
|
2021-05-04 16:41:59 +00:00
|
|
|
if (nSeq == 3)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
GENDUDEEXTRA* pExtra = genDudeExtra(pSprite);
|
|
|
|
if (pExtra->availDeaths[kDmgBurn] == 3) seqSpawn((15 + Random(2)) + pXSprite->data2, actor, dudeToGib);
|
|
|
|
else if (pExtra->availDeaths[kDmgBurn] == 2) seqSpawn(16 + pXSprite->data2, actor, dudeToGib);
|
|
|
|
else if (pExtra->availDeaths[kDmgBurn] == 1) seqSpawn(15 + pXSprite->data2, actor, dudeToGib);
|
|
|
|
else if (getSequence(pXSprite->data2 + nSeq))seqSpawn(nSeq + pXSprite->data2, actor, dudeToGib);
|
|
|
|
else seqSpawn(1 + pXSprite->data2, actor, dudeToGib);
|
|
|
|
|
|
|
|
}
|
2021-05-04 16:41:59 +00:00
|
|
|
else
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
seqSpawn(nSeq + pXSprite->data2, actor, dudeToGib);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void modernCustomDudeBurningDeath(DBloodActor* actor, int nSeq)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
|
|
|
|
playGenDudeSound(pSprite, kGenDudeSndDeathExplode);
|
|
|
|
int dudeToGib = (actCheckRespawn(pSprite)) ? -1 : nDudeToGibClient1;
|
|
|
|
|
|
|
|
if (Chance(0x4000)) spawnGibs(actor, GIBTYPE_27, -0xccccc);
|
|
|
|
|
|
|
|
GENDUDEEXTRA* pExtra = &actor->genDudeExtra();
|
|
|
|
int seqofs = actor->x().data2;
|
|
|
|
if (pExtra->availDeaths[kDmgBurn] == 3) seqSpawn((15 + Random(2)) + seqofs, actor, dudeToGib);
|
|
|
|
else if (pExtra->availDeaths[kDmgBurn] == 2) seqSpawn(16 + seqofs, actor, dudeToGib);
|
|
|
|
else if (pExtra->availDeaths[kDmgBurn] == 1) seqSpawn(15 + seqofs, actor, dudeToGib);
|
|
|
|
else seqSpawn(1 + seqofs, actor, dudeToGib);
|
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2020-12-02 23:20:14 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void zombieAxeBurningDeath(DBloodActor* actor, int nSeq)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
int nType = pSprite->type - kDudeBase;
|
|
|
|
|
|
|
|
if (Chance(0x8000) && nSeq == 3)
|
|
|
|
sfxPlay3DSound(pSprite, 1109, -1, 0);
|
|
|
|
else
|
|
|
|
sfxPlay3DSound(pSprite, 1107 + Random(2), -1, 0);
|
|
|
|
|
|
|
|
if (Chance(0x8000))
|
|
|
|
{
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 13, actor, nDudeToGibClient1);
|
|
|
|
spawnGibs(actor, GIBTYPE_27, -0xccccc);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 13, actor, nDudeToGibClient2);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void zombieButcherDeath(DBloodActor* actor, int nSeq)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
int nType = pSprite->type - kDudeBase;
|
|
|
|
|
|
|
|
if (nSeq == 14)
|
|
|
|
{
|
|
|
|
sfxPlay3DSound(pSprite, 1206, -1, 0);
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 11, actor, -1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
sfxPlay3DSound(pSprite, 1204 + Random(2), -1, 0);
|
|
|
|
if (nSeq == 3)
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 10, actor, -1);
|
|
|
|
else
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void genericDeath(DBloodActor* actor, int nSeq, int sound1, int seqnum)
|
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
auto pSprite = &actor->s();
|
|
|
|
if (Chance(0x4000) && nSeq == 3) sfxPlay3DSound(pSprite, sound1 + 2, -1, 0);
|
|
|
|
else sfxPlay3DSound(pSprite, sound1 + Random(2), -1, 0);
|
|
|
|
seqSpawn(seqnum, actor, -1);
|
2020-12-02 23:20:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damageType, int damage)
|
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
spritetype* pKillerSprite = &killerActor->s();
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax&& actor->hasX());
|
|
|
|
int nType = pSprite->type - kDudeBase;
|
|
|
|
XSPRITE* pXSprite = &actor->x();
|
2020-12-02 23:20:14 +00:00
|
|
|
|
|
|
|
if (actKillDudeStage1(actor, damageType)) return;
|
|
|
|
|
|
|
|
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
|
|
|
{
|
|
|
|
if (gPlayer[p].fragger() == actor && gPlayer[p].deathTime > 0)
|
|
|
|
gPlayer[p].setFragger(nullptr);
|
|
|
|
}
|
|
|
|
if (pSprite->type != kDudeCultistBeast)
|
2020-12-03 17:00:07 +00:00
|
|
|
trTriggerSprite(actor, kCmdOff);
|
2020-12-02 23:20:14 +00:00
|
|
|
|
|
|
|
pSprite->flags |= 7;
|
|
|
|
checkAddFrag(killerActor, actor);
|
|
|
|
checkDropObjects(actor);
|
|
|
|
|
|
|
|
int nSeq = checkDamageType(actor, damageType);
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
if (!getSequence(getDudeInfo(nType + kDudeBase)->seqStartID + nSeq))
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
seqKill(actor);
|
|
|
|
gKillMgr.AddKill(pSprite);
|
|
|
|
actPostSprite(actor, kStatFree);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-05-04 16:41:59 +00:00
|
|
|
switch (pSprite->type)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
case kDudeZombieAxeNormal:
|
|
|
|
zombieAxeNormalDeath(actor, nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeCultistTommy:
|
|
|
|
case kDudeCultistShotgun:
|
|
|
|
case kDudeCultistTesla:
|
|
|
|
case kDudeCultistTNT:
|
2021-05-04 16:41:59 +00:00
|
|
|
sfxPlay3DSound(pSprite, 1018 + Random(2), -1, 0);
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nSeq == 3 ? nDudeToGibClient2 : nDudeToGibClient1);
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeBurningCultist:
|
|
|
|
burningCultistDeath(actor, nSeq);
|
2021-06-16 19:13:04 +00:00
|
|
|
damageType = kDamageExplode;
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
case kDudeModernCustom:
|
|
|
|
modernCustomDudeDeath(actor, nSeq, damageType);
|
|
|
|
genDudePostDeath(pSprite, damageType, damage);
|
|
|
|
return;
|
|
|
|
|
|
|
|
case kDudeModernCustomBurning:
|
|
|
|
modernCustomDudeBurningDeath(actor, nSeq);
|
2021-06-16 19:13:04 +00:00
|
|
|
genDudePostDeath(pSprite, kDamageExplode, damage);
|
2020-12-02 23:20:14 +00:00
|
|
|
return;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
case kDudeBurningZombieAxe:
|
|
|
|
zombieAxeBurningDeath(actor, nSeq);
|
2021-06-16 19:13:04 +00:00
|
|
|
damageType = kDamageExplode;
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeBurningZombieButcher:
|
|
|
|
genericDeath(actor, nSeq, 1204, dudeInfo[4].seqStartID + 10);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeBurningInnocent:
|
2021-06-16 19:13:04 +00:00
|
|
|
damageType = kDamageExplode;
|
2021-05-04 16:41:59 +00:00
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 7, actor, nDudeToGibClient1);
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeZombieButcher:
|
|
|
|
zombieButcherDeath(actor, nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeGargoyleFlesh:
|
|
|
|
genericDeath(actor, nSeq, 1403, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeGargoyleStone:
|
|
|
|
genericDeath(actor, nSeq, 1453, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudePhantasm:
|
|
|
|
genericDeath(actor, nSeq, 1603, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeHellHound:
|
|
|
|
genericDeath(actor, nSeq, 1303, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeHand:
|
|
|
|
genericDeath(actor, nSeq, 1903, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeSpiderBrown:
|
2021-05-04 16:41:59 +00:00
|
|
|
if (pSprite->owner != -1)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
spritetype* pOwner = &sprite[pSprite->owner];
|
2020-12-02 23:20:14 +00:00
|
|
|
gDudeExtra[pOwner->extra].at6.u1.xval2--;
|
|
|
|
}
|
|
|
|
genericDeath(actor, nSeq, 1803, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeSpiderRed:
|
2021-05-04 16:41:59 +00:00
|
|
|
if (pSprite->owner != -1)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
spritetype* pOwner = &sprite[pSprite->owner];
|
2020-12-02 23:20:14 +00:00
|
|
|
gDudeExtra[pOwner->extra].at6.u1.xval2--;
|
|
|
|
}
|
|
|
|
genericDeath(actor, nSeq, 1803, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeSpiderBlack:
|
2021-05-04 16:41:59 +00:00
|
|
|
if (pSprite->owner != -1)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
spritetype* pOwner = &sprite[pSprite->owner];
|
2020-12-02 23:20:14 +00:00
|
|
|
gDudeExtra[pOwner->extra].at6.u1.xval2--;
|
|
|
|
}
|
|
|
|
genericDeath(actor, nSeq, 1803, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeSpiderMother:
|
|
|
|
sfxPlay3DSound(pSprite, 1850, -1, 0);
|
2021-05-04 16:41:59 +00:00
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeGillBeast:
|
|
|
|
genericDeath(actor, nSeq, 1703, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeBoneEel:
|
|
|
|
genericDeath(actor, nSeq, 1503, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeBat:
|
|
|
|
genericDeath(actor, nSeq, 2003, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeRat:
|
|
|
|
genericDeath(actor, nSeq, 2103, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudePodGreen:
|
|
|
|
case kDudeTentacleGreen:
|
|
|
|
case kDudePodFire:
|
|
|
|
case kDudeTentacleFire:
|
|
|
|
if ((pSprite->cstat & CSTAT_SPRITE_YFLIP)) pSprite->cstat &= ~CSTAT_SPRITE_YFLIP;
|
2021-05-04 16:41:59 +00:00
|
|
|
switch (pSprite->type)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
|
|
|
case kDudePodGreen:
|
|
|
|
genericDeath(actor, nSeq, 2203, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
case kDudeTentacleGreen:
|
|
|
|
sfxPlay3DSound(pSprite, damage == 5 ? 2471 : 2472, -1, 0);
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
|
|
|
|
break;
|
|
|
|
case kDudePodFire:
|
|
|
|
sfxPlay3DSound(pSprite, damage == 5 ? 2451 : 2452, -1, 0);
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
|
|
|
|
break;
|
|
|
|
case kDudeTentacleFire:
|
|
|
|
sfxPlay3DSound(pSprite, 2501, -1, 0);
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudePodMother:
|
|
|
|
case kDudeTentacleMother:
|
|
|
|
genericDeath(actor, nSeq, 2203, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeCerberusTwoHead:
|
|
|
|
case kDudeCerberusOneHead:
|
|
|
|
genericDeath(actor, nSeq, 2303, dudeInfo[nType].seqStartID + nSeq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeTchernobog:
|
|
|
|
sfxPlay3DSound(pSprite, 2380, -1, 0);
|
2021-05-04 16:41:59 +00:00
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeBurningTinyCaleb:
|
2021-06-16 19:13:04 +00:00
|
|
|
damageType = kDamageExplode;
|
2021-05-04 16:41:59 +00:00
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 11, actor, nDudeToGibClient1);
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeBeast:
|
2021-05-04 16:41:59 +00:00
|
|
|
sfxPlay3DSound(pSprite, 9000 + Random(2), -1, 0);
|
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nSeq == 3 ? nDudeToGibClient2 : nDudeToGibClient1);
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeBurningBeast:
|
2021-06-16 19:13:04 +00:00
|
|
|
damageType = kDamageExplode;
|
2021-05-04 16:41:59 +00:00
|
|
|
seqSpawn(dudeInfo[nType].seqStartID + 12, actor, nDudeToGibClient1);
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2021-05-04 16:41:59 +00:00
|
|
|
seqSpawn(getDudeInfo(nType + kDudeBase)->seqStartID + nSeq, actor, -1);
|
2020-12-02 23:20:14 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-05-04 16:41:59 +00:00
|
|
|
|
2021-06-16 19:13:04 +00:00
|
|
|
if (damageType == kDamageExplode)
|
2020-12-02 23:20:14 +00:00
|
|
|
{
|
2021-05-04 16:41:59 +00:00
|
|
|
DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type);
|
2020-12-02 23:20:14 +00:00
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
|
if (pDudeInfo->nGibType[i] > -1)
|
|
|
|
GibSprite(pSprite, (GIBTYPE)pDudeInfo->nGibType[i], nullptr, nullptr);
|
|
|
|
for (int i = 0; i < 4; i++)
|
|
|
|
fxSpawnBlood(pSprite, damage);
|
|
|
|
}
|
|
|
|
gKillMgr.AddKill(pSprite);
|
|
|
|
actCheckRespawn(pSprite);
|
|
|
|
pSprite->type = kThingBloodChunks;
|
|
|
|
actPostSprite(actor, kStatThing);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
static int actDamageDude(DBloodActor* source, DBloodActor* actor, int damage, DAMAGE_TYPE damageType)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
XSPRITE* pXSprite = &actor->x();
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
if (!actor->IsDudeActor())
|
|
|
|
{
|
|
|
|
Printf(PRINT_HIGH, "Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & kHitagRespawn) ? "RESPAWN" : "NORMAL");
|
|
|
|
return damage >> 4;
|
|
|
|
//I_Error("Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & 16) ? "RESPAWN" : "NORMAL");
|
|
|
|
}
|
2019-10-12 20:45:46 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
int nType = pSprite->type - kDudeBase;
|
|
|
|
int nDamageFactor = getDudeInfo(nType + kDudeBase)->damageVal[damageType];
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
if (pSprite->type == kDudeModernCustom)
|
|
|
|
nDamageFactor = actor->genDudeExtra().dmgControl[damageType];
|
|
|
|
#endif
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
if (!nDamageFactor) return 0;
|
|
|
|
else if (nDamageFactor != 256) damage = MulScale(damage, nDamageFactor, 8);
|
2019-11-08 19:57:01 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
if (!IsPlayerSprite(pSprite))
|
|
|
|
{
|
|
|
|
if (pXSprite->health <= 0) return 0;
|
|
|
|
damage = aiDamageSprite(source, actor, damageType, damage);
|
|
|
|
if (pXSprite->health <= 0)
|
2021-06-16 19:13:04 +00:00
|
|
|
actKillDude(source, actor, ((damageType == kDamageExplode && damage < 160) ? kDamageFall : damageType), damage);
|
2020-12-02 23:30:19 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PLAYER* pPlayer = &gPlayer[pSprite->type - kDudePlayer1];
|
|
|
|
if (pXSprite->health > 0 || playerSeqPlaying(pPlayer, 16))
|
|
|
|
damage = playerDamageSprite(source, pPlayer, damageType, damage);
|
2019-10-12 20:45:46 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
}
|
|
|
|
return damage;
|
|
|
|
}
|
2019-10-12 20:45:46 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2019-10-12 20:45:46 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
static int actDamageThing(DBloodActor* source, DBloodActor* actor, int damage, DAMAGE_TYPE damageType, PLAYER* pSourcePlayer)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
XSPRITE* pXSprite = &actor->x();
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
assert(pSprite->type >= kThingBase && pSprite->type < kThingMax);
|
|
|
|
int nType = pSprite->type - kThingBase;
|
|
|
|
int nDamageFactor = thingInfo[nType].dmgControl[damageType];
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
if (!nDamageFactor) return 0;
|
|
|
|
else if (nDamageFactor != 256) damage = MulScale(damage, nDamageFactor, 8);
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
pXSprite->health = ClipLow(pXSprite->health - damage, 0);
|
|
|
|
if (pXSprite->health <= 0)
|
|
|
|
{
|
|
|
|
auto Owner = actor->GetOwner();
|
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
|
|
|
case kThingDroppedLifeLeech:
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
case kModernThingEnemyLifeLeech:
|
|
|
|
#endif
|
2020-12-03 17:00:07 +00:00
|
|
|
GibSprite(pSprite, GIBTYPE_14, nullptr, nullptr);
|
2020-12-02 23:30:19 +00:00
|
|
|
pXSprite->data1 = pXSprite->data2 = pXSprite->data3 = pXSprite->DudeLockout = 0;
|
|
|
|
pXSprite->stateTimer = pXSprite->data4 = pXSprite->isTriggered = 0;
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
if (Owner && Owner->s().type == kDudeModernCustom)
|
|
|
|
Owner->SetSpecialOwner(); // indicates if custom dude had life leech.
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
if (!(pSprite->flags & kHitagRespawn))
|
|
|
|
actor->SetOwner(source);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-12-03 17:00:07 +00:00
|
|
|
trTriggerSprite(actor, kCmdOff);
|
2020-12-02 23:30:19 +00:00
|
|
|
|
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
|
|
|
case kThingObjectGib:
|
|
|
|
case kThingObjectExplode:
|
|
|
|
case kThingBloodBits:
|
|
|
|
case kThingBloodChunks:
|
|
|
|
case kThingZombieHead:
|
|
|
|
if (damageType == 3 && pSourcePlayer && PlayClock > pSourcePlayer->laughCount && Chance(0x4000))
|
|
|
|
{
|
|
|
|
sfxPlay3DSound(pSourcePlayer->pSprite, gPlayerGibThingComments[Random(10)], 0, 2);
|
|
|
|
pSourcePlayer->laughCount = PlayClock + 3600;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case kTrapMachinegun:
|
|
|
|
seqSpawn(28, 3, pSprite->extra, -1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kThingFluorescent:
|
|
|
|
seqSpawn(12, 3, pSprite->extra, -1);
|
2020-12-03 17:00:07 +00:00
|
|
|
GibSprite(pSprite, GIBTYPE_6, nullptr, nullptr);
|
2020-12-02 23:30:19 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kThingSpiderWeb:
|
|
|
|
seqSpawn(15, 3, pSprite->extra, -1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kThingMetalGrate:
|
|
|
|
seqSpawn(21, 3, pSprite->extra, -1);
|
2020-12-03 17:00:07 +00:00
|
|
|
GibSprite(pSprite, GIBTYPE_4, nullptr, nullptr);
|
2020-12-02 23:30:19 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kThingFlammableTree:
|
|
|
|
switch (pXSprite->data1)
|
|
|
|
{
|
|
|
|
case -1:
|
2020-12-03 17:00:07 +00:00
|
|
|
GibSprite(pSprite, GIBTYPE_14, nullptr, nullptr);
|
2020-12-02 23:30:19 +00:00
|
|
|
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 312, pSprite->sectnum);
|
|
|
|
actPostSprite(actor, kStatFree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
seqSpawn(25, actor, nTreeToGibClient);
|
|
|
|
sfxPlay3DSound(pSprite, 351, -1, 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
seqSpawn(26, 3, pSprite->extra, nTreeToGibClient);
|
|
|
|
sfxPlay3DSound(pSprite, 351, -1, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return damage;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
int actDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE damageType, int damage)
|
2020-12-02 19:55:08 +00:00
|
|
|
{
|
2020-12-02 23:30:19 +00:00
|
|
|
auto pSprite = &actor->s();
|
|
|
|
|
|
|
|
if (pSprite->flags & 32 || !actor->hasX())
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
XSPRITE* pXSprite = &actor->x();
|
|
|
|
if ((pXSprite->health == 0 && pSprite->statnum != kStatDude) || pXSprite->locked)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (source == nullptr) source = actor;
|
|
|
|
|
2020-12-03 17:00:07 +00:00
|
|
|
PLAYER* pSourcePlayer = nullptr;
|
2020-12-02 23:30:19 +00:00
|
|
|
if (source->IsPlayerActor()) pSourcePlayer = &gPlayer[source->s().type - kDudePlayer1];
|
|
|
|
if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pSourcePlayer, pSprite)) return 0;
|
|
|
|
|
|
|
|
switch (pSprite->statnum)
|
|
|
|
{
|
|
|
|
case kStatDude:
|
|
|
|
damage = actDamageDude(source, actor, damage, damageType);
|
|
|
|
break;
|
|
|
|
case kStatThing:
|
|
|
|
damage = actDamageThing(source, actor, damage, damageType, pSourcePlayer);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return damage >> 4;
|
2020-12-02 19:55:08 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-12-03 17:00:07 +00:00
|
|
|
// this was condensed to the parts actually in use.
|
2020-12-02 23:30:19 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-12-03 17:00:07 +00:00
|
|
|
void actHitcodeToData(int a1, HITINFO* pHitInfo, DBloodActor** pActor, walltype** a7)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-03 17:00:07 +00:00
|
|
|
assert(pHitInfo != nullptr);
|
|
|
|
int nSprite = -1;
|
|
|
|
int nWall = -1;
|
|
|
|
walltype* pWall = nullptr;
|
|
|
|
switch (a1)
|
|
|
|
{
|
|
|
|
case 3:
|
|
|
|
case 5:
|
|
|
|
nSprite = pHitInfo->hitsprite;
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
case 4:
|
|
|
|
nWall = pHitInfo->hitwall;
|
|
|
|
if (nWall >= 0 && nWall < kMaxWalls) pWall = &wall[nWall];
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (pActor) *pActor = nSprite == -1 ? nullptr : &bloodActors[nSprite];
|
|
|
|
if (a7) *a7 = pWall;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-03 17:00:07 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void actImpactMissile(DBloodActor* missileActor, int hitCode)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-03 17:00:07 +00:00
|
|
|
auto pMissile = &missileActor->s();
|
|
|
|
XSPRITE* pXMissile = &missileActor->x();
|
|
|
|
auto missileOwner = missileActor->GetOwner();
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2020-12-03 17:00:07 +00:00
|
|
|
DBloodActor* actorHit = nullptr;
|
|
|
|
walltype* pWallHit = nullptr;
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-12-03 17:00:07 +00:00
|
|
|
actHitcodeToData(hitCode, &gHitInfo, &actorHit, &pWallHit);
|
|
|
|
spritetype* pSpriteHit = actorHit ? &actorHit->s() : nullptr;
|
|
|
|
XSPRITE* pXSpriteHit = actorHit && actorHit->hasX() ? &actorHit->x() : nullptr;
|
|
|
|
|
|
|
|
const THINGINFO* pThingInfo = nullptr;
|
|
|
|
DUDEINFO* pDudeInfo = nullptr;
|
|
|
|
|
|
|
|
if (hitCode == 3 && pSpriteHit)
|
|
|
|
{
|
|
|
|
switch (pSpriteHit->statnum)
|
|
|
|
{
|
|
|
|
case kStatThing:
|
|
|
|
pThingInfo = &thingInfo[pSpriteHit->type - kThingBase];
|
|
|
|
break;
|
|
|
|
case kStatDude:
|
|
|
|
pDudeInfo = getDudeInfo(pSpriteHit->type);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch (pMissile->type)
|
|
|
|
{
|
|
|
|
case kMissileLifeLeechRegular:
|
|
|
|
if (hitCode == 3 && pSpriteHit && (pThingInfo || pDudeInfo))
|
|
|
|
{
|
|
|
|
DAMAGE_TYPE rand1 = (DAMAGE_TYPE)Random(7);
|
|
|
|
int rand2 = (7 + Random(7)) << 4;
|
|
|
|
int nDamage = actDamageSprite(missileOwner, actorHit, rand1, rand2);
|
|
|
|
|
2021-06-16 19:13:04 +00:00
|
|
|
if ((pThingInfo && pThingInfo->dmgControl[kDamageBurn] != 0) || (pDudeInfo && pDudeInfo->damageVal[kDamageBurn] != 0))
|
2020-12-03 17:00:07 +00:00
|
|
|
actBurnSprite(missileActor->GetOwner(), actorHit, 360);
|
|
|
|
|
|
|
|
// by NoOne: make Life Leech heal user, just like it was in 1.0x versions
|
|
|
|
if (gGameOptions.weaponsV10x && !VanillaMode() && !DemoRecordStatus() && pDudeInfo != nullptr)
|
|
|
|
{
|
|
|
|
if (missileOwner->IsDudeActor() && missileOwner->hasX() && missileOwner->x().health != 0)
|
|
|
|
actHealDude(missileOwner, nDamage >> 2, getDudeInfo(missileOwner->s().type)->startHealth);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pMissile->extra > 0)
|
|
|
|
{
|
|
|
|
actPostSprite(missileActor, kStatDecoration);
|
|
|
|
if (pMissile->ang == 1024) sfxPlay3DSound(pMissile, 307, -1, 0);
|
|
|
|
pMissile->type = kSpriteDecoration;
|
|
|
|
seqSpawn(9, missileActor, -1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
actPostSprite(pMissile->index, kStatFree);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
case kMissileTeslaAlt:
|
|
|
|
teslaHit(pMissile, hitCode);
|
|
|
|
switch (hitCode)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
case 4:
|
|
|
|
if (pWallHit)
|
|
|
|
{
|
|
|
|
spritetype* pFX = gFX.fxSpawn(FX_52, pMissile->sectnum, pMissile->x, pMissile->y, pMissile->z, 0);
|
|
|
|
if (pFX) pFX->ang = (GetWallAngle(pWallHit) + 512) & 2047;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
GibSprite(pMissile, GIBTYPE_24, NULL, NULL);
|
|
|
|
actPostSprite(missileActor, kStatFree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissilePukeGreen:
|
|
|
|
seqKill(missileActor);
|
|
|
|
if (hitCode == 3 && pSpriteHit && (pThingInfo || pDudeInfo))
|
|
|
|
{
|
|
|
|
int nOwner = pMissile->owner;
|
|
|
|
int nDamage = (15 + Random(7)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(nOwner, pSpriteHit, kDamageBullet, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
actPostSprite(missileActor, kStatFree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileArcGargoyle:
|
|
|
|
sfxKill3DSound(pMissile, -1, -1);
|
|
|
|
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 306, pMissile->sectnum);
|
|
|
|
GibSprite(pMissile, GIBTYPE_6, NULL, NULL);
|
|
|
|
|
|
|
|
if (hitCode == 3 && pSpriteHit && (pThingInfo || pDudeInfo))
|
|
|
|
{
|
|
|
|
int nDamage = (25 + Random(20)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageSpirit, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
actPostSprite(missileActor, kStatFree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileLifeLeechAltNormal:
|
|
|
|
case kMissileLifeLeechAltSmall:
|
|
|
|
sfxKill3DSound(pMissile, -1, -1);
|
|
|
|
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 306, pMissile->sectnum);
|
|
|
|
|
|
|
|
if (hitCode == 3 && pSpriteHit && (pThingInfo || pDudeInfo))
|
|
|
|
{
|
|
|
|
int nDmgMul = (pMissile->type == kMissileLifeLeechAltSmall) ? 6 : 3;
|
|
|
|
int nDamage = (nDmgMul + Random(nDmgMul)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageSpirit, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
actPostSprite(missileActor, kStatFree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileFireball:
|
|
|
|
case kMissileFireballNapam:
|
|
|
|
if (hitCode == 3 && pSpriteHit && (pThingInfo || pDudeInfo))
|
|
|
|
{
|
|
|
|
if (pThingInfo && pSpriteHit->type == kThingTNTBarrel && actorHit->x().burnTime == 0)
|
|
|
|
evPost(actorHit, 0, kCallbackFXFlameLick);
|
|
|
|
|
|
|
|
int nDamage = (50 + Random(50)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageBullet, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
actExplodeSprite(pMissile);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileFlareAlt:
|
|
|
|
sfxKill3DSound(pMissile, -1, -1);
|
|
|
|
actExplodeSprite(pMissile);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileFlareRegular:
|
|
|
|
sfxKill3DSound(pMissile, -1, -1);
|
|
|
|
if ((hitCode == 3 && pSpriteHit) && (pThingInfo || pDudeInfo))
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
if ((pThingInfo && pThingInfo->dmgControl[kDamageBurn] != 0) || (pDudeInfo && pDudeInfo->damageVal[kDamageBurn] != 0))
|
2020-12-03 17:00:07 +00:00
|
|
|
{
|
|
|
|
if (pThingInfo && pSpriteHit->type == kThingTNTBarrel && actorHit->x().burnTime == 0)
|
|
|
|
evPost(actorHit, 0, kCallbackFXFlameLick);
|
|
|
|
|
|
|
|
actBurnSprite(missileOwner, actorHit, 480);
|
2021-06-16 19:13:04 +00:00
|
|
|
actRadiusDamage(missileOwner, pMissile->x, pMissile->y, pMissile->z, pMissile->sectnum, 16, 20, 10, kDamageBullet, 6, 480);
|
2020-12-03 17:00:07 +00:00
|
|
|
|
|
|
|
// by NoOne: allow additional bullet damage for Flare Gun
|
|
|
|
if (gGameOptions.weaponsV10x && !VanillaMode() && !DemoRecordStatus())
|
|
|
|
{
|
|
|
|
int nDamage = (20 + Random(10)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageBullet, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int nDamage = (20 + Random(10)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageBullet, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (surfType[pSpriteHit->picnum] == kSurfFlesh)
|
|
|
|
{
|
|
|
|
pMissile->picnum = 2123;
|
|
|
|
missileActor->SetTarget(actorHit);
|
|
|
|
pXMissile->targetZ = pMissile->z - pSpriteHit->z;
|
|
|
|
pXMissile->goalAng = getangle(pMissile->x - pSpriteHit->x, pMissile->y - pSpriteHit->y) - pSpriteHit->ang;
|
|
|
|
pXMissile->state = 1;
|
|
|
|
actPostSprite(pMissile->index, kStatFlare);
|
|
|
|
pMissile->cstat &= ~257;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GibSprite(pMissile, GIBTYPE_17, NULL, NULL);
|
|
|
|
actPostSprite(missileActor, kStatFree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileFlameSpray:
|
|
|
|
case kMissileFlameHound:
|
|
|
|
if (hitCode == 3 && actorHit && actorHit->hasX())
|
|
|
|
{
|
|
|
|
if ((pSpriteHit->statnum == kStatThing || pSpriteHit->statnum == kStatDude) && pXSpriteHit->burnTime == 0)
|
|
|
|
evPost(actorHit, 0, kCallbackFXFlameLick);
|
|
|
|
|
|
|
|
actBurnSprite(missileOwner, actorHit, (4 + gGameOptions.nDifficulty) << 2);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageBurn, 8);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileFireballCerberus:
|
|
|
|
actExplodeSprite(pMissile);
|
|
|
|
if (hitCode == 3 && actorHit && actorHit->hasX())
|
|
|
|
{
|
|
|
|
if ((pSpriteHit->statnum == kStatThing || pSpriteHit->statnum == kStatDude) && pXSpriteHit->burnTime == 0)
|
|
|
|
evPost(actorHit, 0, kCallbackFXFlameLick);
|
|
|
|
|
|
|
|
actBurnSprite(missileOwner, actorHit, (4 + gGameOptions.nDifficulty) << 2);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageBurn, 8);
|
2020-12-03 17:00:07 +00:00
|
|
|
int nDamage = (25 + Random(10)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageBullet, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
actExplodeSprite(pMissile);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileFireballTchernobog:
|
|
|
|
actExplodeSprite(pMissile);
|
|
|
|
if (hitCode == 3 && actorHit && actorHit->hasX())
|
|
|
|
{
|
|
|
|
if ((pSpriteHit->statnum == kStatThing || pSpriteHit->statnum == kStatDude) && pXSpriteHit->burnTime == 0)
|
|
|
|
evPost(actorHit, 0, kCallbackFXFlameLick);
|
|
|
|
|
|
|
|
actBurnSprite(missileOwner, actorHit, 32);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageSpirit, 12);
|
2020-12-03 17:00:07 +00:00
|
|
|
int nDamage = (25 + Random(10)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageBullet, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
actExplodeSprite(pMissile);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileEctoSkull:
|
|
|
|
sfxKill3DSound(pMissile, -1, -1);
|
|
|
|
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 522, pMissile->sectnum);
|
|
|
|
actPostSprite(pMissile->index, kStatDebris);
|
|
|
|
seqSpawn(20, 3, pMissile->extra, -1);
|
|
|
|
if (hitCode == 3 && actorHit && actorHit->hasX())
|
|
|
|
{
|
|
|
|
if (pSpriteHit->statnum == kStatDude)
|
|
|
|
{
|
|
|
|
int nDamage = (25 + Random(10)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageSpirit, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileButcherKnife:
|
|
|
|
actPostSprite(missileActor, kStatDebris);
|
|
|
|
pMissile->cstat &= ~16;
|
|
|
|
pMissile->type = kSpriteDecoration;
|
|
|
|
seqSpawn(20, 3, pMissile->extra, -1);
|
|
|
|
if (hitCode == 3 && actorHit && actorHit->hasX())
|
|
|
|
{
|
|
|
|
if (pSpriteHit->statnum == kStatDude)
|
|
|
|
{
|
|
|
|
int nDamage = (10 + Random(10)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageSpirit, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
int nType = missileOwner->s().type - kDudeBase;
|
|
|
|
if (missileOwner->x().health > 0)
|
|
|
|
actHealDude(missileOwner, 10, getDudeInfo(nType + kDudeBase)->startHealth);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMissileTeslaRegular:
|
|
|
|
sfxKill3DSound(pMissile, -1, -1);
|
|
|
|
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 518, pMissile->sectnum);
|
|
|
|
GibSprite(pMissile, (hitCode == 2) ? GIBTYPE_23 : GIBTYPE_22, NULL, NULL);
|
|
|
|
evKill(missileActor);
|
|
|
|
seqKill(missileActor);
|
|
|
|
actPostSprite(missileActor, kStatFree);
|
|
|
|
if (hitCode == 3 && actorHit)
|
|
|
|
{
|
|
|
|
int nDamage = (15 + Random(10)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageTesla, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
seqKill(missileActor);
|
|
|
|
actPostSprite(missileActor, kStatFree);
|
|
|
|
if (hitCode == 3 && actorHit)
|
|
|
|
{
|
|
|
|
int nDamage = (10 + Random(10)) << 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(missileOwner, actorHit, kDamageFall, nDamage);
|
2020-12-03 17:00:07 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
if (gModernMap && pXSpriteHit && pXSpriteHit->state != pXSpriteHit->restState && pXSpriteHit->Impact)
|
|
|
|
trTriggerSprite(actorHit, kCmdSpriteImpact);
|
|
|
|
#endif
|
|
|
|
pMissile->cstat &= ~257;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-03 17:38:30 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void actKickObject(DBloodActor* kicker, DBloodActor* kicked)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-03 17:38:30 +00:00
|
|
|
int nSpeed = ClipLow(approxDist(kicker->xvel(), kicker->yvel()) * 2, 0xaaaaa);
|
|
|
|
kicked->xvel() = MulScale(nSpeed, Cos(kicker->s().ang + Random2(85)), 30);
|
|
|
|
kicked->yvel() = MulScale(nSpeed, Sin(kicker->s().ang + Random2(85)), 30);
|
|
|
|
kicked->zvel() = MulScale(nSpeed, -0x2000, 14);
|
|
|
|
kicked->s().flags = 7;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-03 17:38:30 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void actTouchFloor(DBloodActor* actor, int nSector)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-03 17:38:30 +00:00
|
|
|
assert(actor != nullptr);
|
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
|
|
|
sectortype* pSector = §or[nSector];
|
|
|
|
XSECTOR* pXSector = nullptr;
|
|
|
|
if (pSector->extra > 0) pXSector = &xsector[pSector->extra];
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-12-06 20:56:09 +00:00
|
|
|
bool doDamage = (pXSector && (pSector->type == kSectorDamage || pXSector->damageType > 0));
|
|
|
|
// don't allow damage for damage sectors if they are not enabled
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
if (gModernMap && doDamage && pSector->type == kSectorDamage && !pXSector->state)
|
|
|
|
doDamage = false;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (doDamage) {
|
2020-12-03 17:38:30 +00:00
|
|
|
DAMAGE_TYPE nDamageType;
|
2021-06-16 19:13:04 +00:00
|
|
|
if (pSector->type == kSectorDamage) nDamageType = (DAMAGE_TYPE)ClipRange(pXSector->damageType, kDamageFall, kDamageTesla);
|
|
|
|
else nDamageType = (DAMAGE_TYPE)ClipRange(pXSector->damageType - 1, kDamageFall, kDamageTesla);
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2020-12-03 17:38:30 +00:00
|
|
|
int nDamage;
|
|
|
|
if (pXSector->data) nDamage = ClipRange(pXSector->data, 0, 1000);
|
|
|
|
else nDamage = 1000;
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2020-12-03 17:38:30 +00:00
|
|
|
actDamageSprite(actor, actor, nDamageType, scale(4, nDamage, 120) << 4);
|
|
|
|
}
|
|
|
|
if (tileGetSurfType(nSector + 0x4000) == kSurfLava)
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(actor, actor, kDamageBurn, 16);
|
2020-12-03 17:38:30 +00:00
|
|
|
sfxPlay3DSound(&actor->s(), 352, 5, 2);
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-03 17:38:30 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-12-03 19:30:30 +00:00
|
|
|
static void checkCeilHit(DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-03 17:38:30 +00:00
|
|
|
auto pSprite = &actor->s();
|
2020-12-03 19:30:30 +00:00
|
|
|
auto pXSprite = actor->hasX() ? &actor->x() : nullptr;
|
2020-12-03 17:38:30 +00:00
|
|
|
|
2020-12-03 19:30:30 +00:00
|
|
|
Collision coll(actor->hit().ceilhit);
|
|
|
|
switch (coll.type)
|
|
|
|
{
|
|
|
|
case kHitWall:
|
|
|
|
break;
|
|
|
|
case kHitSprite:
|
|
|
|
if (coll.actor->hasX())
|
|
|
|
{
|
|
|
|
auto actor2 = coll.actor;
|
|
|
|
spritetype* pSprite2 = &actor2->s();
|
|
|
|
XSPRITE* pXSprite2 = &actor2->x();
|
|
|
|
if ((pSprite2->statnum == kStatThing || pSprite2->statnum == kStatDude) && (actor->xvel() != 0 || actor->yvel() != 0 || actor->zvel() != 0))
|
|
|
|
{
|
|
|
|
if (pSprite2->statnum == kStatThing)
|
|
|
|
{
|
|
|
|
int nType = pSprite2->type - kThingBase;
|
|
|
|
const THINGINFO* pThingInfo = &thingInfo[nType];
|
|
|
|
if (pThingInfo->flags & 1) pSprite2->flags |= 1;
|
|
|
|
if (pThingInfo->flags & 2) pSprite2->flags |= 4;
|
|
|
|
// Inlined ?
|
|
|
|
actor2->xvel() += MulScale(4, pSprite2->x - pSprite->x, 2);
|
|
|
|
actor2->yvel() += MulScale(4, pSprite2->y - pSprite->y, 2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pSprite2->flags |= 5;
|
|
|
|
actor2->xvel() += MulScale(4, pSprite2->x - pSprite->x, 2);
|
|
|
|
actor2->yvel() += MulScale(4, pSprite2->y - pSprite->y, 2);
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// add size shroom abilities
|
|
|
|
if ((actor->IsPlayerActor() && isShrinked(pSprite)) || (IsPlayerSprite(pSprite2) && isGrown(pSprite2))) {
|
|
|
|
|
|
|
|
int mass1 = getDudeInfo(pSprite2->type)->mass;
|
|
|
|
int mass2 = getDudeInfo(pSprite->type)->mass;
|
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
|
|
|
case kDudeModernCustom:
|
|
|
|
case kDudeModernCustomBurning:
|
|
|
|
mass2 = getSpriteMassBySize(pSprite);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (mass1 > mass2)
|
|
|
|
{
|
|
|
|
int dmg = abs((mass1 - mass2) * (pSprite2->clipdist - pSprite->clipdist));
|
|
|
|
if (actor2->IsDudeActor())
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
if (dmg > 0) actDamageSprite(pSprite2->index, pSprite, (Chance(0x2000)) ? kDamageFall : (Chance(0x4000)) ? kDamageExplode : kDamageBullet, dmg);
|
2020-12-03 19:30:30 +00:00
|
|
|
if (Chance(0x0200)) actKickObject(actor2, actor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (!actor->IsPlayerActor() || gPlayer[pSprite->type - kDudePlayer1].godMode == 0)
|
|
|
|
{
|
|
|
|
switch (pSprite2->type)
|
|
|
|
{
|
|
|
|
case kDudeTchernobog:
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(actor2, actor, kDamageExplode, pXSprite->health << 2);
|
2020-12-03 19:30:30 +00:00
|
|
|
break;
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
case kDudeModernCustom:
|
|
|
|
case kDudeModernCustomBurning:
|
|
|
|
int dmg = 0;
|
|
|
|
if (!actor->IsDudeActor() || (dmg = ClipLow((getSpriteMassBySize(pSprite2) - getSpriteMassBySize(pSprite)) >> 1, 0)) == 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (!actor->IsPlayerActor())
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(actor2, actor, kDamageFall, dmg);
|
2020-12-03 19:30:30 +00:00
|
|
|
if (pXSprite && !actor->isActive()) aiActivateDude(actor);
|
|
|
|
}
|
2021-06-16 19:13:04 +00:00
|
|
|
else if (powerupCheck(&gPlayer[pSprite->type - kDudePlayer1], kPwUpJumpBoots) > 0) actDamageSprite(actor2, actor, kDamageExplode, dmg);
|
|
|
|
else actDamageSprite(actor2, actor, kDamageFall, dmg);
|
2020-12-03 19:30:30 +00:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pSprite2->type == kTrapSawCircular)
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
if (!pXSprite2->state) actDamageSprite(actor, actor, kDamageBullet, 1);
|
2020-12-03 19:30:30 +00:00
|
|
|
else {
|
|
|
|
pXSprite2->data1 = 1;
|
|
|
|
pXSprite2->data2 = ClipHigh(pXSprite2->data2 + 8, 600);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(actor, actor, kDamageBullet, 16);
|
2020-12-03 19:30:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void checkHit(DBloodActor* actor)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
auto pXSprite = actor->hasX() ? &actor->x() : nullptr;
|
|
|
|
|
|
|
|
Collision coll(actor->hit().hit);
|
|
|
|
switch (coll.type)
|
|
|
|
{
|
|
|
|
case kHitWall:
|
|
|
|
break;
|
|
|
|
case kHitSprite:
|
|
|
|
if (coll.actor->hasX())
|
|
|
|
{
|
|
|
|
auto actor2 = coll.actor;
|
|
|
|
spritetype* pSprite2 = &actor2->s();
|
|
|
|
//XSPRITE *pXSprite2 = &Xsprite[pSprite2->extra];
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// add size shroom abilities
|
|
|
|
if ((actor2->IsPlayerActor() && isShrinked(pSprite2)) || (actor->IsPlayerActor() && isGrown(pSprite)))
|
|
|
|
{
|
|
|
|
if (actor->xvel() != 0 && actor2->IsDudeActor())
|
|
|
|
{
|
|
|
|
int mass1 = getDudeInfo(pSprite->type)->mass;
|
|
|
|
int mass2 = getDudeInfo(pSprite2->type)->mass;
|
|
|
|
switch (pSprite2->type)
|
|
|
|
{
|
|
|
|
case kDudeModernCustom:
|
|
|
|
case kDudeModernCustomBurning:
|
|
|
|
mass2 = getSpriteMassBySize(pSprite2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (mass1 > mass2)
|
|
|
|
{
|
|
|
|
actKickObject(actor, actor2);
|
|
|
|
sfxPlay3DSound(pSprite, 357, -1, 1);
|
|
|
|
int dmg = (mass1 - mass2) + abs(FixedToInt(actor->xvel()));
|
2021-06-16 19:13:04 +00:00
|
|
|
if (dmg > 0) actDamageSprite(actor, actor2, (Chance(0x2000)) ? kDamageFall : kDamageBullet, dmg);
|
2020-12-03 19:30:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
switch (pSprite2->type)
|
|
|
|
{
|
|
|
|
case kThingKickablePail:
|
|
|
|
actKickObject(actor, actor2);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kThingZombieHead:
|
|
|
|
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum);
|
|
|
|
actKickObject(actor, actor2);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(nullptr, actor2, kDamageFall, 80);
|
2020-12-03 19:30:30 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDudeBurningInnocent:
|
|
|
|
case kDudeBurningCultist:
|
|
|
|
case kDudeBurningZombieAxe:
|
|
|
|
case kDudeBurningZombieButcher:
|
|
|
|
// This does not make sense
|
|
|
|
pXSprite->burnTime = ClipLow(pXSprite->burnTime - 4, 0);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(actor->GetBurnSource(), actor, kDamageBurn, 8);
|
2020-12-03 19:30:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void checkFloorHit(DBloodActor* actor)
|
|
|
|
{
|
|
|
|
auto pSprite = &actor->s();
|
|
|
|
auto pXSprite = actor->hasX() ? &actor->x() : nullptr;
|
|
|
|
|
|
|
|
Collision coll(actor->hit().florhit);
|
|
|
|
switch (coll.type)
|
|
|
|
{
|
|
|
|
case kHitWall:
|
|
|
|
break;
|
|
|
|
case kHitSector:
|
|
|
|
actTouchFloor(actor, coll.index);
|
|
|
|
break;
|
|
|
|
case kHitSprite:
|
|
|
|
if (coll.actor->hasX())
|
|
|
|
{
|
|
|
|
auto actor2 = coll.actor;
|
|
|
|
spritetype* pSprite2 = &actor2->s();
|
|
|
|
XSPRITE* pXSprite2 = &actor2->x();
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// add size shroom abilities
|
|
|
|
if ((actor2->IsPlayerActor() && isShrinked(pSprite2)) || (actor->IsPlayerActor() && isGrown(pSprite)))
|
|
|
|
{
|
|
|
|
|
|
|
|
int mass1 = getDudeInfo(pSprite->type)->mass;
|
|
|
|
int mass2 = getDudeInfo(pSprite2->type)->mass;
|
|
|
|
switch (pSprite2->type)
|
|
|
|
{
|
|
|
|
case kDudeModernCustom:
|
|
|
|
case kDudeModernCustomBurning:
|
|
|
|
mass2 = getSpriteMassBySize(pSprite2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mass1 > mass2 && IsDudeSprite(pSprite2))
|
|
|
|
{
|
|
|
|
if ((IsPlayerSprite(pSprite2) && Chance(0x500)) || !IsPlayerSprite(pSprite2))
|
|
|
|
actKickObject(actor, actor2);
|
|
|
|
|
|
|
|
int dmg = (mass1 - mass2) + pSprite->clipdist;
|
2021-06-16 19:13:04 +00:00
|
|
|
if (dmg > 0) actDamageSprite(actor, actor2, (Chance(0x2000)) ? kDamageFall : kDamageBullet, dmg);
|
2020-12-03 19:30:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
PLAYER* pPlayer = nullptr;
|
|
|
|
if (actor->IsPlayerActor()) pPlayer = &gPlayer[pSprite->type - kDudePlayer1];
|
|
|
|
|
|
|
|
switch (pSprite2->type)
|
|
|
|
{
|
|
|
|
case kThingKickablePail:
|
|
|
|
if (pPlayer)
|
|
|
|
{
|
|
|
|
if (pPlayer->kickPower > PlayClock) return;
|
|
|
|
pPlayer->kickPower = PlayClock + 60;
|
|
|
|
}
|
|
|
|
actKickObject(actor, actor2);
|
|
|
|
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum);
|
|
|
|
sfxPlay3DSound(pSprite, 374, 0, 0);
|
|
|
|
break;
|
|
|
|
case kThingZombieHead:
|
|
|
|
if (pPlayer)
|
|
|
|
{
|
|
|
|
if (pPlayer->kickPower > PlayClock) return;
|
|
|
|
pPlayer->kickPower = PlayClock + 60;
|
|
|
|
}
|
|
|
|
actKickObject(actor, actor2);
|
|
|
|
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(-1, pSprite2, kDamageFall, 80);
|
2020-12-03 19:30:30 +00:00
|
|
|
break;
|
|
|
|
case kTrapSawCircular:
|
2021-06-16 19:13:04 +00:00
|
|
|
if (!pXSprite2->state) actDamageSprite(actor, actor, kDamageBullet, 1);
|
2020-12-03 19:30:30 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
pXSprite2->data1 = 1;
|
|
|
|
pXSprite2->data2 = ClipHigh(pXSprite2->data2 + 8, 600);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(actor, actor, kDamageBullet, 16);
|
2020-12-03 19:30:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case kDudeCultistTommy:
|
|
|
|
case kDudeCultistShotgun:
|
|
|
|
case kDudeZombieAxeNormal:
|
|
|
|
case kDudeZombieButcher:
|
|
|
|
case kDudeZombieAxeBuried:
|
|
|
|
case kDudeGargoyleFlesh:
|
|
|
|
case kDudeGargoyleStone:
|
|
|
|
case kDudePhantasm:
|
|
|
|
case kDudeHellHound:
|
|
|
|
case kDudeHand:
|
|
|
|
case kDudeSpiderBrown:
|
|
|
|
case kDudeSpiderRed:
|
|
|
|
case kDudeSpiderBlack:
|
|
|
|
case kDudeGillBeast:
|
|
|
|
case kDudeBat:
|
|
|
|
case kDudeRat:
|
|
|
|
case kDudePodGreen:
|
|
|
|
case kDudeTentacleGreen:
|
|
|
|
case kDudePodFire:
|
|
|
|
case kDudeTentacleFire:
|
|
|
|
case kDudePodMother:
|
|
|
|
case kDudeTentacleMother:
|
|
|
|
case kDudeCerberusTwoHead:
|
|
|
|
case kDudeCerberusOneHead:
|
|
|
|
case kDudeTchernobog:
|
|
|
|
case kDudePlayer1:
|
|
|
|
case kDudePlayer2:
|
|
|
|
case kDudePlayer3:
|
|
|
|
case kDudePlayer4:
|
|
|
|
case kDudePlayer5:
|
|
|
|
case kDudePlayer6:
|
|
|
|
case kDudePlayer7:
|
|
|
|
case kDudePlayer8:
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
if (pPlayer && !isShrinked(pSprite))
|
|
|
|
#else
|
|
|
|
if (pPlayer)
|
|
|
|
#endif
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(actor, actor2, kDamageBullet, 8);
|
2020-12-03 19:30:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void ProcessTouchObjects(DBloodActor* actor)
|
|
|
|
{
|
|
|
|
checkCeilHit(actor);
|
|
|
|
checkHit(actor);
|
|
|
|
checkFloorHit(actor);
|
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// add more trigger statements for Touch flag
|
|
|
|
if (gModernMap && actor->IsDudeActor())
|
|
|
|
{
|
|
|
|
DBloodActor* actor2 = nullptr;
|
|
|
|
for (int i : { actor->hit().hit, actor->hit().florhit, actor->hit().ceilhit})
|
|
|
|
{
|
|
|
|
Collision coll = i;
|
|
|
|
if (coll.type == kHitSprite)
|
|
|
|
{
|
|
|
|
actor2 = coll.actor;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-18 06:56:49 +00:00
|
|
|
if (actor2 && actor2->hasX())
|
2020-12-03 17:38:30 +00:00
|
|
|
{
|
2020-12-03 19:30:30 +00:00
|
|
|
XSPRITE* pXHSprite = &actor2->x();
|
|
|
|
if (pXHSprite->Touch && !pXHSprite->isTriggered && (!pXHSprite->DudeLockout || actor->IsPlayerActor()))
|
|
|
|
trTriggerSprite(actor2, kCmdSpriteTouch);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Touch walls
|
|
|
|
Collision coll = actor->hit().hit;
|
|
|
|
int nHWall = -1;
|
|
|
|
if (coll.type == kHitWall)
|
|
|
|
{
|
|
|
|
nHWall = coll.index;
|
|
|
|
if (wallRangeIsFine(nHWall) && xwallRangeIsFine(wall[nHWall].extra))
|
2020-12-03 17:38:30 +00:00
|
|
|
{
|
2020-12-03 19:30:30 +00:00
|
|
|
XWALL* pXHWall = &xwall[wall[nHWall].extra];
|
|
|
|
if (pXHWall->triggerTouch && !pXHWall->isTriggered && (!pXHWall->dudeLockout || actor->IsPlayerActor()))
|
|
|
|
trTriggerWall(nHWall, pXHWall, kCmdWallTouch);
|
|
|
|
}
|
|
|
|
}
|
2019-12-23 20:10:28 +00:00
|
|
|
|
2020-12-03 19:30:30 +00:00
|
|
|
// enough to reset SpriteHit values
|
|
|
|
if (nHWall != -1 || actor2) actor->xvel() += 5;
|
2020-01-01 20:53:29 +00:00
|
|
|
|
2020-12-03 19:30:30 +00:00
|
|
|
}
|
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-03 19:30:30 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
void actAirDrag(spritetype *pSprite, int a2)
|
|
|
|
{
|
|
|
|
int vbp = 0;
|
|
|
|
int v4 = 0;
|
|
|
|
int nSector = pSprite->sectnum;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
sectortype *pSector = §or[nSector];
|
|
|
|
int nXSector = pSector->extra;
|
|
|
|
if (nXSector > 0)
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXSector < kMaxXSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
XSECTOR *pXSector = &xsector[nXSector];
|
|
|
|
if (pXSector->windVel && (pXSector->windAlways || pXSector->busy))
|
|
|
|
{
|
|
|
|
int vcx = pXSector->windVel<<12;
|
|
|
|
if (!pXSector->windAlways && pXSector->busy)
|
2021-01-04 11:36:54 +00:00
|
|
|
vcx = MulScale(vcx, pXSector->busy, 16);
|
|
|
|
vbp = MulScale(vcx, Cos(pXSector->windAng), 30);
|
|
|
|
v4 = MulScale(vcx, Sin(pXSector->windAng), 30);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
2021-01-04 11:36:54 +00:00
|
|
|
xvel[pSprite->index] += MulScale(vbp-xvel[pSprite->index], a2, 16);
|
|
|
|
yvel[pSprite->index] += MulScale(v4-yvel[pSprite->index], a2, 16);
|
|
|
|
zvel[pSprite->index] -= MulScale(zvel[pSprite->index], a2, 16);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int MoveThing(spritetype *pSprite)
|
|
|
|
{
|
|
|
|
int nXSprite = pSprite->extra;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
int nSprite = pSprite->index;
|
|
|
|
int v8 = 0;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(pSprite->type >= kThingBase && pSprite->type < kThingMax);
|
2019-12-06 23:07:02 +00:00
|
|
|
const THINGINFO *pThingInfo = &thingInfo[pSprite->type-kThingBase];
|
2019-09-19 22:42:45 +00:00
|
|
|
int nSector = pSprite->sectnum;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
int top, bottom;
|
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
|
|
|
if (xvel[nSprite] || yvel[nSprite])
|
|
|
|
{
|
|
|
|
short bakCstat = pSprite->cstat;
|
|
|
|
pSprite->cstat &= ~257;
|
|
|
|
v8 = gSpriteHit[nXSprite].hit = ClipMove((int*)&pSprite->x, (int*)&pSprite->y, (int*)&pSprite->z, &nSector, xvel[nSprite]>>12, yvel[nSprite]>>12, pSprite->clipdist<<2, (pSprite->z-top)/4, (bottom-pSprite->z)/4, CLIPMASK0);
|
|
|
|
pSprite->cstat = bakCstat;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pSprite->sectnum != nSector)
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
ChangeSpriteSect(nSprite, nSector);
|
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
if ((gSpriteHit[nXSprite].hit&0xc000) == 0x8000) {
|
2019-06-28 12:24:46 +00:00
|
|
|
int nHitWall = gSpriteHit[nXSprite].hit&0x3fff;
|
2019-10-21 19:46:41 +00:00
|
|
|
actWallBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], nHitWall, pThingInfo->elastic);
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kThingZombieHead:
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pSprite, 607, 0, 0);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(-1, pSprite, kDamageFall, 80);
|
2019-10-20 14:50:47 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingKickablePail:
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pSprite, 374, 0, 0);
|
|
|
|
break;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector);
|
|
|
|
}
|
|
|
|
if (zvel[nSprite])
|
|
|
|
pSprite->z += zvel[nSprite]>>8;
|
|
|
|
int ceilZ, ceilHit, floorZ, floorHit;
|
|
|
|
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist<<2, CLIPMASK0);
|
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
2019-09-30 07:18:01 +00:00
|
|
|
if ((pSprite->flags & 2) && bottom < floorZ)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
pSprite->z += 455;
|
|
|
|
zvel[nSprite] += 58254;
|
2019-10-11 21:59:39 +00:00
|
|
|
if (pSprite->type == kThingZombieHead)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
spritetype *pFX = gFX.fxSpawn(FX_27, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
|
|
|
|
if (pFX)
|
|
|
|
{
|
2021-02-18 10:46:36 +00:00
|
|
|
int v34 = (PlayClock*3)&2047;
|
|
|
|
int v30 = (PlayClock*5)&2047;
|
|
|
|
int vbx = (PlayClock*11)&2047;
|
2019-09-19 22:42:45 +00:00
|
|
|
int v2c = 0x44444;
|
|
|
|
int v28 = 0;
|
|
|
|
int v24 = 0;
|
|
|
|
RotateVector(&v2c,&v28,vbx);
|
|
|
|
RotateVector(&v2c,&v24,v30);
|
|
|
|
RotateVector(&v28,&v24,v34);
|
|
|
|
xvel[pFX->index] = xvel[pSprite->index]+v2c;
|
|
|
|
yvel[pFX->index] = yvel[pSprite->index]+v28;
|
|
|
|
zvel[pFX->index] = zvel[pSprite->index]+v24;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (CheckLink(pSprite))
|
|
|
|
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist<<2, CLIPMASK0);
|
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
|
|
|
if (bottom >= floorZ)
|
|
|
|
{
|
2020-12-03 17:38:30 +00:00
|
|
|
actTouchFloor(&bloodActors[pSprite->index], pSprite->sectnum);
|
2019-09-19 22:42:45 +00:00
|
|
|
gSpriteHit[nXSprite].florhit = floorHit;
|
|
|
|
pSprite->z += floorZ-bottom;
|
|
|
|
int v20 = zvel[nSprite]-velFloor[pSprite->sectnum];
|
|
|
|
if (v20 > 0)
|
|
|
|
{
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags |= 4;
|
2019-10-21 19:46:41 +00:00
|
|
|
int vax = actFloorBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], (int*)&v20, pSprite->sectnum, pThingInfo->elastic);
|
2021-01-04 11:57:26 +00:00
|
|
|
int nDamage = MulScale(vax, vax, 30)-pThingInfo->dmgResist;
|
2019-09-19 22:42:45 +00:00
|
|
|
if (nDamage > 0)
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(nSprite, pSprite, kDamageFall, nDamage);
|
2019-09-19 22:42:45 +00:00
|
|
|
zvel[nSprite] = v20;
|
2021-01-04 12:02:00 +00:00
|
|
|
if (velFloor[pSprite->sectnum] == 0 && abs(zvel[nSprite]) < 0x10000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
zvel[nSprite] = 0;
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags &= ~4;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
|
|
|
|
switch (pSprite->type) {
|
|
|
|
case kThingNapalmBall:
|
2020-12-02 21:33:14 +00:00
|
|
|
if (zvel[nSprite] == 0 || Chance(0xA000)) actNapalmMove(&bloodActors[pXSprite->reference]);
|
2019-10-20 14:50:47 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingZombieHead:
|
2021-01-04 12:02:00 +00:00
|
|
|
if (abs(zvel[nSprite]) > 0x80000) {
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pSprite, 607, 0, 0);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(-1, pSprite, kDamageFall, 80);
|
2019-10-20 14:50:47 +00:00
|
|
|
}
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingKickablePail:
|
2021-01-04 12:02:00 +00:00
|
|
|
if (abs(zvel[nSprite]) > 0x80000)
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pSprite, 374, 0, 0);
|
|
|
|
break;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
v8 = 0x4000|nSector;
|
|
|
|
}
|
|
|
|
else if (zvel[nSprite] == 0)
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags &= ~4;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gSpriteHit[nXSprite].florhit = 0;
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags&2)
|
|
|
|
pSprite->flags |= 4;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
if (top <= ceilZ)
|
|
|
|
{
|
|
|
|
gSpriteHit[nXSprite].ceilhit = ceilHit;
|
|
|
|
pSprite->z += ClipLow(ceilZ-top, 0);
|
|
|
|
if (zvel[nSprite] < 0)
|
|
|
|
{
|
2021-01-04 11:36:54 +00:00
|
|
|
xvel[nSprite] = MulScale(xvel[nSprite], 0xc000, 16);
|
|
|
|
yvel[nSprite] = MulScale(yvel[nSprite], 0xc000, 16);
|
|
|
|
zvel[nSprite] = MulScale(-zvel[nSprite], 0x4000, 16);
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kThingZombieHead:
|
2021-01-04 12:02:00 +00:00
|
|
|
if (abs(zvel[nSprite]) > 0x80000) {
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pSprite, 607, 0, 0);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(-1, pSprite, kDamageFall, 80);
|
2019-10-20 14:50:47 +00:00
|
|
|
}
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingKickablePail:
|
2021-01-04 12:02:00 +00:00
|
|
|
if (abs(zvel[nSprite]) > 0x80000)
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pSprite, 374, 0, 0);
|
|
|
|
break;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gSpriteHit[nXSprite].ceilhit = 0;
|
|
|
|
if (bottom >= floorZ)
|
|
|
|
{
|
|
|
|
int nVel = approxDist(xvel[nSprite], yvel[nSprite]);
|
|
|
|
int nVelClipped = ClipHigh(nVel, 0x11111);
|
2019-06-28 12:24:46 +00:00
|
|
|
if ((floorHit & 0xc000) == 0xc000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-06-28 12:24:46 +00:00
|
|
|
int nHitSprite = floorHit & 0x3fff;
|
2019-09-19 22:42:45 +00:00
|
|
|
if ((sprite[nHitSprite].cstat & 0x30) == 0)
|
|
|
|
{
|
2021-01-04 11:57:26 +00:00
|
|
|
xvel[nSprite] += MulScale(4, pSprite->x - sprite[nHitSprite].x, 2);
|
|
|
|
yvel[nSprite] += MulScale(4, pSprite->y - sprite[nHitSprite].y, 2);
|
2019-09-19 22:42:45 +00:00
|
|
|
v8 = gSpriteHit[nXSprite].hit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (nVel > 0)
|
|
|
|
{
|
2021-01-04 11:51:41 +00:00
|
|
|
int t = DivScale(nVelClipped, nVel, 16);
|
2021-01-04 11:36:54 +00:00
|
|
|
xvel[nSprite] -= MulScale(t, xvel[nSprite], 16);
|
|
|
|
yvel[nSprite] -= MulScale(t, yvel[nSprite], 16);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (xvel[nSprite] || yvel[nSprite])
|
|
|
|
pSprite->ang = getangle(xvel[nSprite], yvel[nSprite]);
|
|
|
|
return v8;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MoveDude(spritetype *pSprite)
|
|
|
|
{
|
|
|
|
int nXSprite = pSprite->extra;
|
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
int nSprite = pSprite->index;
|
|
|
|
PLAYER *pPlayer = NULL;
|
|
|
|
if (IsPlayerSprite(pSprite))
|
|
|
|
pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
2019-11-24 20:53:51 +00:00
|
|
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
2020-10-11 10:38:17 +00:00
|
|
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
2019-11-24 20:53:51 +00:00
|
|
|
return;
|
|
|
|
}
|
2020-02-05 21:17:05 +00:00
|
|
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
2019-09-19 22:42:45 +00:00
|
|
|
int top, bottom;
|
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
|
|
|
int bz = (bottom-pSprite->z)/4;
|
|
|
|
int tz = (pSprite->z-top)/4;
|
|
|
|
int wd = pSprite->clipdist<<2;
|
|
|
|
int nSector = pSprite->sectnum;
|
2021-07-19 21:15:26 +00:00
|
|
|
int nAiStateType = (pXSprite->aiState) ? pXSprite->aiState->stateType : -1;
|
|
|
|
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (xvel[nSprite] || yvel[nSprite])
|
|
|
|
{
|
|
|
|
if (pPlayer && gNoClip)
|
|
|
|
{
|
|
|
|
pSprite->x += xvel[nSprite]>>12;
|
|
|
|
pSprite->y += yvel[nSprite]>>12;
|
|
|
|
if (!FindSector(pSprite->x, pSprite->y, &nSector))
|
|
|
|
nSector = pSprite->sectnum;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
short bakCstat = pSprite->cstat;
|
|
|
|
pSprite->cstat &= ~257;
|
2019-06-26 13:20:03 +00:00
|
|
|
gSpriteHit[nXSprite].hit = ClipMove((int*)&pSprite->x, (int*)&pSprite->y, (int*)&pSprite->z, &nSector, xvel[nSprite]>>12, yvel[nSprite]>>12, wd, tz, bz, CLIPMASK0);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (nSector == -1)
|
|
|
|
{
|
|
|
|
nSector = pSprite->sectnum;
|
2019-10-07 19:29:52 +00:00
|
|
|
if (pSprite->statnum == kStatDude || pSprite->statnum == kStatThing)
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(pSprite->index, pSprite, kDamageFall, 1000<<4);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-10-11 21:59:39 +00:00
|
|
|
if (sector[nSector].type >= kSectorPath && sector[nSector].type <= kSectorRotate)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
short nSector2 = nSector;
|
|
|
|
if (pushmove_old(&pSprite->x, &pSprite->y, &pSprite->z, &nSector2, wd, tz, bz, CLIPMASK0) == -1)
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(nSprite, pSprite, kDamageFall, 1000 << 4);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (nSector2 != -1)
|
|
|
|
nSector = nSector2;
|
|
|
|
}
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0);
|
2019-09-19 22:42:45 +00:00
|
|
|
pSprite->cstat = bakCstat;
|
|
|
|
}
|
2019-06-28 12:24:46 +00:00
|
|
|
switch (gSpriteHit[nXSprite].hit&0xc000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
case 0xc000:
|
|
|
|
{
|
2019-06-28 12:24:46 +00:00
|
|
|
int nHitSprite = gSpriteHit[nXSprite].hit&0x3fff;
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pHitSprite = &sprite[nHitSprite];
|
|
|
|
XSPRITE *pHitXSprite = NULL;
|
|
|
|
// Should be pHitSprite here
|
|
|
|
if (pSprite->extra > 0)
|
|
|
|
pHitXSprite = &xsprite[pHitSprite->extra];
|
2020-12-02 18:56:32 +00:00
|
|
|
int nOwner = pHitSprite->owner;
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-10-07 19:29:52 +00:00
|
|
|
if (pHitSprite->statnum == kStatProjectile && !(pHitSprite->flags&32) && pSprite->index != nOwner)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
HITINFO hitInfo = gHitInfo;
|
|
|
|
gHitInfo.hitsprite = nSprite;
|
2020-12-03 17:00:07 +00:00
|
|
|
actImpactMissile(&bloodActors[nHitSprite], 3);
|
2019-09-19 22:42:45 +00:00
|
|
|
gHitInfo = hitInfo;
|
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2019-12-23 20:10:28 +00:00
|
|
|
if (!gModernMap && pHitXSprite && pHitXSprite->Touch && !pHitXSprite->state && !pHitXSprite->isTriggered)
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpriteTouch);
|
2020-01-26 11:19:01 +00:00
|
|
|
#else
|
|
|
|
if (pHitXSprite && pHitXSprite->Touch && !pHitXSprite->state && !pHitXSprite->isTriggered)
|
|
|
|
trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpriteTouch);
|
|
|
|
#endif
|
2019-12-23 20:10:28 +00:00
|
|
|
|
2019-10-11 21:59:39 +00:00
|
|
|
if (pDudeInfo->lockOut && pHitXSprite && pHitXSprite->Push && !pHitXSprite->key && !pHitXSprite->DudeLockout && !pHitXSprite->state && !pHitXSprite->busy && !pPlayer)
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpritePush);
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x8000:
|
|
|
|
{
|
2019-06-28 12:24:46 +00:00
|
|
|
int nHitWall = gSpriteHit[nXSprite].hit&0x3fff;
|
2019-09-19 22:42:45 +00:00
|
|
|
walltype *pHitWall = &wall[nHitWall];
|
|
|
|
XWALL *pHitXWall = NULL;
|
|
|
|
if (pHitWall->extra > 0)
|
|
|
|
pHitXWall = &xwall[pHitWall->extra];
|
|
|
|
if (pDudeInfo->lockOut && pHitXWall && pHitXWall->triggerPush && !pHitXWall->key && !pHitXWall->dudeLockout && !pHitXWall->state && !pHitXWall->busy && !pPlayer)
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerWall(nHitWall, pHitXWall, kCmdWallPush);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pHitWall->nextsector != -1)
|
|
|
|
{
|
|
|
|
sectortype *pHitSector = §or[pHitWall->nextsector];
|
|
|
|
XSECTOR *pHitXSector = NULL;
|
|
|
|
if (pHitSector->extra > 0)
|
|
|
|
pHitXSector = &xsector[pHitSector->extra];
|
2019-10-25 20:53:41 +00:00
|
|
|
if (pDudeInfo->lockOut && pHitXSector && pHitXSector->Wallpush && !pHitXSector->Key && !pHitXSector->dudeLockout && !pHitXSector->state && !pHitXSector->busy && !pPlayer)
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerSector(pHitWall->nextsector, pHitXSector, kCmdSectorPush);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (top < pHitSector->ceilingz || bottom > pHitSector->floorz)
|
|
|
|
{
|
|
|
|
// ???
|
|
|
|
}
|
|
|
|
}
|
|
|
|
actWallBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], nHitWall, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector);
|
|
|
|
}
|
|
|
|
if (pSprite->sectnum != nSector)
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
XSECTOR *pXSector;
|
|
|
|
int nXSector = sector[pSprite->sectnum].extra;
|
|
|
|
if (nXSector > 0)
|
|
|
|
pXSector = &xsector[nXSector];
|
|
|
|
else
|
|
|
|
pXSector = NULL;
|
2019-10-25 20:53:41 +00:00
|
|
|
if (pXSector && pXSector->Exit && (pPlayer || !pXSector->dudeLockout))
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerSector(pSprite->sectnum, pXSector, kCmdSectorExit);
|
2019-09-19 22:42:45 +00:00
|
|
|
ChangeSpriteSect(nSprite, nSector);
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
nXSector = sector[nSector].extra;
|
2019-12-05 20:42:35 +00:00
|
|
|
pXSector = (nXSector > 0) ? &xsector[nXSector] : NULL;
|
2019-10-25 20:53:41 +00:00
|
|
|
if (pXSector && pXSector->Enter && (pPlayer || !pXSector->dudeLockout)) {
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-10-11 21:59:39 +00:00
|
|
|
if (sector[nSector].type == kSectorTeleport)
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSector->data = pPlayer ? nSprite : -1;
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerSector(nSector, pXSector, kCmdSectorEnter);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
nSector = pSprite->sectnum;
|
|
|
|
}
|
|
|
|
char bUnderwater = 0;
|
|
|
|
char bDepth = 0;
|
|
|
|
if (sector[nSector].extra > 0)
|
|
|
|
{
|
|
|
|
XSECTOR *pXSector = &xsector[sector[nSector].extra];
|
|
|
|
if (pXSector->Underwater)
|
|
|
|
bUnderwater = 1;
|
|
|
|
if (pXSector->Depth)
|
|
|
|
bDepth = 1;
|
|
|
|
}
|
|
|
|
int nUpperLink = gUpperLink[nSector];
|
|
|
|
int nLowerLink = gLowerLink[nSector];
|
2019-10-19 19:11:39 +00:00
|
|
|
if (nUpperLink >= 0 && (sprite[nUpperLink].type == kMarkerUpWater || sprite[nUpperLink].type == kMarkerUpGoo))
|
2019-09-19 22:42:45 +00:00
|
|
|
bDepth = 1;
|
2019-10-19 19:11:39 +00:00
|
|
|
if (nLowerLink >= 0 && (sprite[nLowerLink].type == kMarkerLowWater || sprite[nLowerLink].type == kMarkerLowGoo))
|
2019-09-19 22:42:45 +00:00
|
|
|
bDepth = 1;
|
|
|
|
if (pPlayer)
|
|
|
|
wd += 16;
|
|
|
|
if (zvel[nSprite])
|
|
|
|
pSprite->z += zvel[nSprite]>>8;
|
|
|
|
int ceilZ, ceilHit, floorZ, floorHit;
|
2019-09-07 13:53:42 +00:00
|
|
|
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, wd, CLIPMASK0, PARALLAXCLIP_CEILING|PARALLAXCLIP_FLOOR);
|
2019-09-19 22:42:45 +00:00
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags & 2)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
int vc = 58254;
|
|
|
|
if (bDepth)
|
|
|
|
{
|
|
|
|
if (bUnderwater)
|
|
|
|
{
|
|
|
|
int cz = getceilzofslope(nSector, pSprite->x, pSprite->y);
|
|
|
|
if (cz > top)
|
|
|
|
vc += ((bottom-cz)*-80099) / (bottom-top);
|
|
|
|
else
|
|
|
|
vc = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int fz = getflorzofslope(nSector, pSprite->x, pSprite->y);
|
|
|
|
if (fz < bottom)
|
|
|
|
vc += ((bottom-fz)*-80099) / (bottom-top);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (bUnderwater)
|
|
|
|
vc = 0;
|
|
|
|
else if (bottom >= floorZ)
|
|
|
|
vc = 0;
|
|
|
|
}
|
|
|
|
if (vc)
|
|
|
|
{
|
|
|
|
pSprite->z += ((vc*4)/2)>>8;
|
|
|
|
zvel[nSprite] += vc;
|
|
|
|
}
|
|
|
|
}
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pPlayer && zvel[nSprite] > 0x155555 && !pPlayer->fallScream && pXSprite->height > 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
pPlayer->fallScream = 1;
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 719, 0, 0);
|
|
|
|
}
|
2019-09-07 16:39:26 +00:00
|
|
|
vec3_t const oldpos = pSprite->pos;
|
2019-09-19 22:42:45 +00:00
|
|
|
int nLink = CheckLink(pSprite);
|
|
|
|
if (nLink)
|
|
|
|
{
|
2019-09-07 13:53:42 +00:00
|
|
|
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, wd, CLIPMASK0, PARALLAXCLIP_CEILING|PARALLAXCLIP_FLOOR);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pPlayer)
|
2020-09-16 00:14:04 +00:00
|
|
|
playerCorrectInertia(pPlayer, &oldpos);
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (nLink) {
|
|
|
|
case kMarkerLowStack:
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pPlayer == gView)
|
2021-05-09 07:05:42 +00:00
|
|
|
setgotpic(sector[pSprite->sectnum].floorpicnum);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMarkerUpStack:
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pPlayer == gView)
|
2021-05-09 07:05:42 +00:00
|
|
|
setgotpic(sector[pSprite->sectnum].ceilingpicnum);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMarkerLowWater:
|
|
|
|
case kMarkerLowGoo:
|
2019-10-19 19:11:39 +00:00
|
|
|
pXSprite->medium = kMediumNormal;
|
2019-10-11 21:59:39 +00:00
|
|
|
if (pPlayer) {
|
2019-10-21 19:46:41 +00:00
|
|
|
pPlayer->posture = 0;
|
|
|
|
pPlayer->bubbleTime = 0;
|
2020-08-28 20:51:05 +00:00
|
|
|
if (!pPlayer->cantJump && (pPlayer->input.actions & SB_JUMP)) {
|
2019-09-19 22:42:45 +00:00
|
|
|
zvel[nSprite] = -0x6aaaa;
|
2019-10-25 20:53:41 +00:00
|
|
|
pPlayer->cantJump = 1;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
sfxPlay3DSound(pSprite, 721, -1, 0);
|
2019-10-11 21:59:39 +00:00
|
|
|
} else {
|
2021-07-19 21:15:26 +00:00
|
|
|
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kDudeCultistTommy:
|
|
|
|
case kDudeCultistShotgun:
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(&bloodActors[pXSprite->reference], &cultistGoto);
|
2019-10-20 14:50:47 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeGillBeast:
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(&bloodActors[pXSprite->reference], &gillBeastGoto);
|
2019-10-20 14:50:47 +00:00
|
|
|
pSprite->flags |= 6;
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeBoneEel:
|
2021-06-16 19:13:04 +00:00
|
|
|
actKillDude(pSprite->index, pSprite, kDamageFall, 1000<<4);
|
2019-10-20 14:50:47 +00:00
|
|
|
break;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2021-07-19 21:15:26 +00:00
|
|
|
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
if (IsDudeSprite(pSprite) && pXSprite->health > 0 && aiInPatrolState(nAiStateType))
|
|
|
|
aiPatrolState(pSprite, kAiStatePatrolMoveL); // continue patrol when going from water
|
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case kMarkerUpWater:
|
|
|
|
case kMarkerUpGoo:
|
|
|
|
{
|
2020-01-26 11:19:01 +00:00
|
|
|
int chance = 0xa00; int medium = kMediumWater;
|
|
|
|
if (nLink == kMarkerUpGoo){
|
|
|
|
medium = kMediumGoo;
|
|
|
|
chance = 0x400;
|
|
|
|
}
|
|
|
|
|
|
|
|
pXSprite->medium = medium;
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
if (pPlayer)
|
|
|
|
{
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2019-09-19 22:42:45 +00:00
|
|
|
// look for palette in data2 of marker. If value <= 0, use default ones.
|
2021-07-19 21:15:26 +00:00
|
|
|
if (gModernMap) {
|
|
|
|
pPlayer->nWaterPal = 0;
|
|
|
|
int nXUpper = sprite[gUpperLink[nSector]].extra;
|
|
|
|
if (nXUpper >= 0)
|
|
|
|
pPlayer->nWaterPal = xsprite[nXUpper].data2;
|
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2019-10-21 19:46:41 +00:00
|
|
|
pPlayer->posture = 1;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2021-01-04 12:02:00 +00:00
|
|
|
pPlayer->bubbleTime = abs(zvel[nSprite]) >> 12;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackPlayerBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-07-19 21:15:26 +00:00
|
|
|
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kDudeCultistTommy:
|
|
|
|
case kDudeCultistShotgun:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(&bloodActors[pXSprite->reference], &cultistSwimGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeBurningCultist:
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-01-26 11:19:01 +00:00
|
|
|
if (Chance(chance))
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-10-11 21:59:39 +00:00
|
|
|
pSprite->type = kDudeCultistTommy;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(&bloodActors[pXSprite->reference], &cultistSwimGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-10-11 21:59:39 +00:00
|
|
|
pSprite->type = kDudeCultistShotgun;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(&bloodActors[pXSprite->reference], &cultistSwimGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeZombieAxeNormal:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(&bloodActors[pXSprite->reference], &zombieAGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeZombieButcher:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(&bloodActors[pXSprite->reference], &zombieFGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeGillBeast:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(&bloodActors[pXSprite->reference], &gillBeastSwimGoto);
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags &= ~6;
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeGargoyleFlesh:
|
|
|
|
case kDudeHellHound:
|
|
|
|
case kDudeSpiderBrown:
|
|
|
|
case kDudeSpiderRed:
|
|
|
|
case kDudeSpiderBlack:
|
|
|
|
case kDudeBat:
|
|
|
|
case kDudeRat:
|
|
|
|
case kDudeBurningInnocent:
|
2021-06-16 19:13:04 +00:00
|
|
|
actKillDude(pSprite->index, pSprite, kDamageFall, 1000 << 4);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2021-07-19 21:15:26 +00:00
|
|
|
}
|
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2021-07-19 21:15:26 +00:00
|
|
|
if (gModernMap) {
|
|
|
|
|
|
|
|
if (pSprite->type == kDudeModernCustom) {
|
|
|
|
|
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
|
|
|
if (!canSwim(pSprite))
|
|
|
|
actKillDude(pSprite->index, pSprite, kDamageFall, 1000 << 4);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// continue patrol when fall into water
|
|
|
|
if (IsDudeSprite(pSprite) && pXSprite->health > 0 && aiInPatrolState(nAiStateType))
|
|
|
|
aiPatrolState(pSprite, kAiStatePatrolMoveW);
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2021-07-19 21:15:26 +00:00
|
|
|
#endif
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/*case 13:
|
2019-10-19 19:11:39 +00:00
|
|
|
pXSprite->medium = kMediumGoo;
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pPlayer)
|
|
|
|
{
|
|
|
|
pPlayer->changeTargetKin = 1;
|
|
|
|
pXSprite->burnTime = 0;
|
2021-01-04 12:02:00 +00:00
|
|
|
pPlayer->bubbleTime = abs(zvel[nSprite])>>12;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackPlayerBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeCultistTommy:
|
|
|
|
case kDudeCultistShotgun:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(actor, &cultistSwimGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeBurningCultist:
|
2019-09-19 22:42:45 +00:00
|
|
|
if (Chance(0x400))
|
|
|
|
{
|
2019-10-11 21:59:39 +00:00
|
|
|
pSprite->type = kDudeCultistTommy;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(actor, &cultistSwimGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-10-11 21:59:39 +00:00
|
|
|
pSprite->type = kDudeCultistShotgun;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(actor, &cultistSwimGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeZombieAxeNormal:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(actor, &zombieAGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeZombieButcher:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(actor, &zombieFGoto);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeGillBeast:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnTime = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 720, -1, 0);
|
2020-11-07 12:46:03 +00:00
|
|
|
aiNewState(actor, &gillBeastSwimGoto);
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags &= ~6;
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeGargoyleFlesh:
|
|
|
|
case kDudeHellHound:
|
|
|
|
case kDudeSpiderBrown:
|
|
|
|
case kDudeSpiderRed:
|
|
|
|
case kDudeSpiderBlack:
|
|
|
|
case kDudeBat:
|
|
|
|
case kDudeRat:
|
|
|
|
case kDudeBurningInnocent:
|
2021-07-19 21:15:26 +00:00
|
|
|
actKillDude(pSprite->index, pSprite, kDamageFall, 1000<<4);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
|
|
|
if (pPlayer && bottom >= floorZ)
|
|
|
|
{
|
|
|
|
int floorZ2 = floorZ;
|
|
|
|
int floorHit2 = floorHit;
|
2019-09-07 13:53:42 +00:00
|
|
|
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist<<2, CLIPMASK0, PARALLAXCLIP_CEILING|PARALLAXCLIP_FLOOR);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (bottom <= floorZ && pSprite->z - floorZ2 < bz)
|
|
|
|
{
|
|
|
|
floorZ = floorZ2;
|
|
|
|
floorHit = floorHit2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (floorZ <= bottom)
|
|
|
|
{
|
|
|
|
gSpriteHit[nXSprite].florhit = floorHit;
|
|
|
|
pSprite->z += floorZ-bottom;
|
|
|
|
int v30 = zvel[nSprite]-velFloor[pSprite->sectnum];
|
|
|
|
if (v30 > 0)
|
|
|
|
{
|
|
|
|
int vax = actFloorBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], (int*)&v30, pSprite->sectnum, 0);
|
2021-01-04 11:57:26 +00:00
|
|
|
int nDamage = MulScale(vax, vax, 30);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pPlayer)
|
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
pPlayer->fallScream = 0;
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (nDamage > (15<<4) && (pSprite->flags&4))
|
2019-09-19 22:42:45 +00:00
|
|
|
playerLandingSound(pPlayer);
|
|
|
|
if (nDamage > (30<<4))
|
|
|
|
sfxPlay3DSound(pSprite, 701, 0, 0);
|
|
|
|
}
|
|
|
|
nDamage -= 100<<4;
|
|
|
|
if (nDamage > 0)
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(nSprite, pSprite, kDamageFall, nDamage);
|
2019-09-19 22:42:45 +00:00
|
|
|
zvel[nSprite] = v30;
|
2021-01-04 12:02:00 +00:00
|
|
|
if (abs(zvel[nSprite]) < 0x10000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
zvel[nSprite] = velFloor[pSprite->sectnum];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags &= ~4;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags |= 4;
|
2019-09-19 22:42:45 +00:00
|
|
|
switch (tileGetSurfType(floorHit))
|
|
|
|
{
|
2019-08-16 04:32:17 +00:00
|
|
|
case kSurfWater:
|
2019-09-19 22:42:45 +00:00
|
|
|
gFX.fxSpawn(FX_9, pSprite->sectnum, pSprite->x, pSprite->y, floorZ, 0);
|
|
|
|
break;
|
2019-08-16 04:32:17 +00:00
|
|
|
case kSurfLava:
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
spritetype *pFX = gFX.fxSpawn(FX_10, pSprite->sectnum, pSprite->x, pSprite->y, floorZ, 0);
|
|
|
|
if (pFX)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
|
{
|
|
|
|
spritetype *pFX2 = gFX.fxSpawn(FX_14, pFX->sectnum, pFX->x, pFX->y, pFX->z, 0);
|
|
|
|
if (pFX2)
|
|
|
|
{
|
|
|
|
xvel[pFX2->index] = Random2(0x6aaaa);
|
|
|
|
yvel[pFX2->index] = Random2(0x6aaaa);
|
2020-07-14 18:57:42 +00:00
|
|
|
zvel[pFX2->index] = -(int)Random(0xd5555);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (zvel[nSprite] == 0)
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags &= ~4;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gSpriteHit[nXSprite].florhit = 0;
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags&2)
|
|
|
|
pSprite->flags |= 4;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
if (top <= ceilZ)
|
|
|
|
{
|
|
|
|
gSpriteHit[nXSprite].ceilhit = ceilHit;
|
|
|
|
pSprite->z += ClipLow(ceilZ-top, 0);
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (zvel[nSprite] <= 0 && (pSprite->flags&4))
|
2021-01-04 11:36:54 +00:00
|
|
|
zvel[nSprite] = MulScale(-zvel[nSprite], 0x2000, 16);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
gSpriteHit[nXSprite].ceilhit = 0;
|
|
|
|
GetSpriteExtents(pSprite,&top,&bottom);
|
|
|
|
|
|
|
|
pXSprite->height = ClipLow(floorZ-bottom, 0)>>8;
|
|
|
|
if (xvel[nSprite] || yvel[nSprite])
|
|
|
|
{
|
2019-06-28 12:24:46 +00:00
|
|
|
if ((floorHit & 0xc000) == 0xc000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-06-28 12:24:46 +00:00
|
|
|
int nHitSprite = floorHit & 0x3fff;
|
2019-09-19 22:42:45 +00:00
|
|
|
if ((sprite[nHitSprite].cstat & 0x30) == 0)
|
|
|
|
{
|
2021-01-04 11:57:26 +00:00
|
|
|
xvel[nSprite] += MulScale(4, pSprite->x - sprite[nHitSprite].x, 2);
|
|
|
|
yvel[nSprite] += MulScale(4, pSprite->y - sprite[nHitSprite].y, 2);
|
2019-09-19 22:42:45 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int nXSector = sector[pSprite->sectnum].extra;
|
|
|
|
if (nXSector > 0 && xsector[nXSector].Underwater)
|
|
|
|
return;
|
|
|
|
if (pXSprite->height >= 0x100)
|
|
|
|
return;
|
|
|
|
int nDrag = gDudeDrag;
|
|
|
|
if (pXSprite->height > 0)
|
|
|
|
nDrag -= scale(gDudeDrag, pXSprite->height, 0x100);
|
|
|
|
xvel[nSprite] -= mulscale16r(xvel[nSprite], nDrag);
|
|
|
|
yvel[nSprite] -= mulscale16r(yvel[nSprite], nDrag);
|
|
|
|
|
|
|
|
if (approxDist(xvel[nSprite], yvel[nSprite]) < 0x1000)
|
|
|
|
xvel[nSprite] = yvel[nSprite] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int MoveMissile(spritetype *pSprite)
|
|
|
|
{
|
|
|
|
int nXSprite = pSprite->extra;
|
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
int vdi = -1;
|
|
|
|
spritetype *pOwner = NULL;
|
|
|
|
int bakCstat = 0;
|
|
|
|
if (pSprite->owner >= 0)
|
|
|
|
{
|
2020-12-02 18:56:32 +00:00
|
|
|
int nOwner = pSprite->owner;
|
2019-09-19 22:42:45 +00:00
|
|
|
pOwner = &sprite[nOwner];
|
|
|
|
if (IsDudeSprite(pOwner))
|
|
|
|
{
|
|
|
|
bakCstat = pOwner->cstat;
|
|
|
|
pOwner->cstat &= ~257;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pOwner = NULL;
|
|
|
|
}
|
|
|
|
gHitInfo.hitsect = -1;
|
|
|
|
gHitInfo.hitwall = -1;
|
|
|
|
gHitInfo.hitsprite = -1;
|
2019-10-11 21:59:39 +00:00
|
|
|
if (pSprite->type == kMissileFlameSpray)
|
2019-09-19 22:42:45 +00:00
|
|
|
actAirDrag(pSprite, 0x1000);
|
|
|
|
int nSprite = pSprite->index;
|
|
|
|
if (pXSprite->target != -1 && (xvel[nSprite] || yvel[nSprite] || zvel[nSprite]))
|
|
|
|
{
|
|
|
|
spritetype *pTarget = &sprite[pXSprite->target];
|
|
|
|
XSPRITE *pXTarget;
|
|
|
|
if (pTarget->extra > 0)
|
|
|
|
pXTarget = &xsprite[pTarget->extra];
|
|
|
|
else
|
|
|
|
pXTarget = NULL;
|
2019-10-07 19:29:52 +00:00
|
|
|
if (pTarget->statnum == kStatDude && pXTarget && pXTarget->health > 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
int nTargetAngle = getangle(-(pTarget->y-pSprite->y), pTarget->x-pSprite->x);
|
2019-10-21 19:46:41 +00:00
|
|
|
int vx = missileInfo[pSprite->type - kMissileBase].velocity;
|
2019-09-19 22:42:45 +00:00
|
|
|
int vy = 0;
|
|
|
|
RotatePoint(&vx, &vy, (nTargetAngle+1536)&2047, 0, 0);
|
|
|
|
xvel[nSprite] = vx;
|
|
|
|
yvel[nSprite] = vy;
|
|
|
|
int dx = pTarget->x-pSprite->x;
|
|
|
|
int dy = pTarget->y-pSprite->y;
|
|
|
|
int dz = pTarget->z-pSprite->z;
|
|
|
|
// Inlined
|
|
|
|
int vax = dz/10;
|
|
|
|
if (pTarget->z < pSprite->z)
|
|
|
|
vax = -vax;
|
|
|
|
zvel[nSprite] += vax;
|
|
|
|
ksqrt(dx*dx+dy*dy+dz*dz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int vx = xvel[nSprite]>>12;
|
|
|
|
int vy = yvel[nSprite]>>12;
|
|
|
|
int vz = zvel[nSprite]>>8;
|
|
|
|
int top, bottom;
|
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
|
|
|
int i = 1;
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
int x = pSprite->x;
|
|
|
|
int y = pSprite->y;
|
|
|
|
int z = pSprite->z;
|
|
|
|
int nSector2 = pSprite->sectnum;
|
|
|
|
clipmoveboxtracenum = 1;
|
|
|
|
int vdx = ClipMove(&x, &y, &z, &nSector2, vx, vy, pSprite->clipdist<<2, (z-top)/4, (bottom-z)/4, CLIPMASK0);
|
|
|
|
clipmoveboxtracenum = 3;
|
|
|
|
short nSector = nSector2;
|
|
|
|
if (nSector2 < 0)
|
|
|
|
{
|
|
|
|
vdi = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (vdx)
|
|
|
|
{
|
2019-06-28 12:24:46 +00:00
|
|
|
int nHitSprite = vdx & 0x3fff;
|
|
|
|
if ((vdx&0xc000) == 0xc000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
gHitInfo.hitsprite = nHitSprite;
|
|
|
|
vdi = 3;
|
|
|
|
}
|
2019-06-28 12:24:46 +00:00
|
|
|
else if ((vdx & 0xc000) == 0x8000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
gHitInfo.hitwall = nHitSprite;
|
|
|
|
if (wall[nHitSprite].nextsector == -1)
|
|
|
|
vdi = 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int32_t fz, cz;
|
|
|
|
getzsofslope(wall[nHitSprite].nextsector, x, y, &cz, &fz);
|
|
|
|
if (z <= cz || z >= fz)
|
|
|
|
vdi = 0;
|
|
|
|
else
|
|
|
|
vdi = 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (vdi == 4)
|
|
|
|
{
|
|
|
|
walltype *pWall = &wall[gHitInfo.hitwall];
|
|
|
|
if (pWall->extra > 0)
|
|
|
|
{
|
|
|
|
XWALL *pXWall = &xwall[pWall->extra];
|
|
|
|
if (pXWall->triggerVector)
|
|
|
|
{
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerWall(gHitInfo.hitwall, pXWall, kCmdWallImpact);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (!(pWall->cstat&64))
|
|
|
|
{
|
|
|
|
vdi = -1;
|
|
|
|
if (i-- > 0)
|
|
|
|
continue;
|
|
|
|
vdi = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (vdi >= 0 && vdi != 3)
|
|
|
|
{
|
|
|
|
int nAngle = getangle(xvel[nSprite], yvel[nSprite]);
|
2021-01-04 11:36:54 +00:00
|
|
|
x -= MulScale(Cos(nAngle), 16, 30);
|
|
|
|
y -= MulScale(Sin(nAngle), 16, 30);
|
2019-09-19 22:42:45 +00:00
|
|
|
int nVel = approxDist(xvel[nSprite], yvel[nSprite]);
|
|
|
|
vz -= scale(0x100, zvel[nSprite], nVel);
|
|
|
|
updatesector(x, y, &nSector);
|
|
|
|
nSector2 = nSector;
|
|
|
|
}
|
|
|
|
int ceilZ, ceilHit, floorZ, floorHit;
|
|
|
|
GetZRangeAtXYZ(x, y, z, nSector2, &ceilZ, &ceilHit, &floorZ, &floorHit, pSprite->clipdist<<2, CLIPMASK0);
|
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
|
|
|
top += vz;
|
|
|
|
bottom += vz;
|
|
|
|
if (bottom >= floorZ)
|
|
|
|
{
|
|
|
|
gSpriteHit[nXSprite].florhit = floorHit;
|
|
|
|
vz += floorZ-bottom;
|
|
|
|
vdi = 2;
|
|
|
|
}
|
|
|
|
if (top <= ceilZ)
|
|
|
|
{
|
|
|
|
gSpriteHit[nXSprite].ceilhit = ceilHit;
|
|
|
|
vz += ClipLow(ceilZ-top, 0);
|
|
|
|
vdi = 1;
|
|
|
|
}
|
|
|
|
pSprite->x = x;
|
|
|
|
pSprite->y = y;
|
|
|
|
pSprite->z = z+vz;
|
|
|
|
updatesector(x, y, &nSector);
|
|
|
|
if (nSector >= 0 && nSector != pSprite->sectnum)
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
ChangeSpriteSect(nSprite, nSector);
|
|
|
|
}
|
|
|
|
CheckLink(pSprite);
|
|
|
|
gHitInfo.hitsect = pSprite->sectnum;
|
|
|
|
gHitInfo.hitx = pSprite->x;
|
|
|
|
gHitInfo.hity = pSprite->y;
|
|
|
|
gHitInfo.hitz = pSprite->z;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (pOwner)
|
|
|
|
pOwner->cstat = bakCstat;
|
|
|
|
return vdi;
|
|
|
|
}
|
|
|
|
|
|
|
|
void actExplodeSprite(spritetype *pSprite)
|
|
|
|
{
|
|
|
|
int nXSprite = pSprite->extra;
|
|
|
|
if (nXSprite <= 0 || nXSprite >= kMaxXSprites)
|
|
|
|
return;
|
2019-10-07 19:29:52 +00:00
|
|
|
if (pSprite->statnum == kStatExplosion)
|
2019-09-19 22:42:45 +00:00
|
|
|
return;
|
|
|
|
sfxKill3DSound(pSprite, -1, -1);
|
|
|
|
evKill(pSprite->index, 3);
|
2020-05-22 16:28:03 +00:00
|
|
|
int nType = kExplosionStandard;
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFireballNapam:
|
2020-01-02 15:17:32 +00:00
|
|
|
nType = kExplosionNapalm;
|
2019-09-19 22:42:45 +00:00
|
|
|
seqSpawn(4, 3, nXSprite, -1);
|
|
|
|
if (Chance(0x8000))
|
|
|
|
pSprite->cstat |= 4;
|
|
|
|
sfxPlay3DSound(pSprite, 303, -1, 0);
|
|
|
|
GibSprite(pSprite, GIBTYPE_5, NULL, NULL);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFlareAlt:
|
2020-01-02 15:17:32 +00:00
|
|
|
nType = kExplosionFireball;
|
2019-09-19 22:42:45 +00:00
|
|
|
seqSpawn(9, 3, nXSprite, -1);
|
|
|
|
if (Chance(0x8000))
|
|
|
|
pSprite->cstat |= 4;
|
|
|
|
sfxPlay3DSound(pSprite, 306, 24+(pSprite->index&3), 1);
|
|
|
|
GibSprite(pSprite, GIBTYPE_5, NULL, NULL);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFireballCerberus:
|
|
|
|
case kMissileFireballTchernobog:
|
2020-01-02 15:17:32 +00:00
|
|
|
nType = kExplosionFireball;
|
2019-09-19 22:42:45 +00:00
|
|
|
seqSpawn(5, 3, nXSprite, -1);
|
|
|
|
sfxPlay3DSound(pSprite, 304, -1, 0);
|
|
|
|
GibSprite(pSprite, GIBTYPE_5, NULL, NULL);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingArmedTNTStick:
|
2020-01-02 15:17:32 +00:00
|
|
|
nType = kExplosionSmall;
|
2019-10-11 21:59:39 +00:00
|
|
|
if (gSpriteHit[nXSprite].florhit == 0) seqSpawn(4,3,nXSprite,-1);
|
|
|
|
else seqSpawn(3,3,nXSprite,-1);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 303, -1, 0);
|
|
|
|
GibSprite(pSprite, GIBTYPE_5, NULL, NULL);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingArmedProxBomb:
|
|
|
|
case kThingArmedRemoteBomb:
|
|
|
|
case kThingArmedTNTBundle:
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2019-10-11 21:59:39 +00:00
|
|
|
case kModernThingTNTProx:
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2020-01-02 15:17:32 +00:00
|
|
|
nType = kExplosionStandard;
|
2019-09-19 22:42:45 +00:00
|
|
|
if (gSpriteHit[nXSprite].florhit == 0)
|
|
|
|
seqSpawn(4,3,nXSprite,-1);
|
|
|
|
else
|
|
|
|
seqSpawn(3,3,nXSprite,-1);
|
|
|
|
sfxPlay3DSound(pSprite, 304, -1, 0);
|
|
|
|
GibSprite(pSprite, GIBTYPE_5, NULL, NULL);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingArmedSpray:
|
2020-01-02 15:17:32 +00:00
|
|
|
nType = kExplosionSpray;
|
2019-09-19 22:42:45 +00:00
|
|
|
seqSpawn(5, 3, nXSprite, -1);
|
|
|
|
sfxPlay3DSound(pSprite, 307, -1, 0);
|
|
|
|
GibSprite(pSprite, GIBTYPE_5, NULL, NULL);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingTNTBarrel:
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 22:39:38 +00:00
|
|
|
spritetype *pSprite2 = actSpawnSprite_(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0, 1);
|
2019-09-19 22:42:45 +00:00
|
|
|
pSprite2->owner = pSprite->owner;
|
|
|
|
if (actCheckRespawn(pSprite))
|
|
|
|
{
|
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
pXSprite->state = 1;
|
2019-10-21 19:46:41 +00:00
|
|
|
pXSprite->health = thingInfo[0].startHealth<<4;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
2019-10-07 19:29:52 +00:00
|
|
|
actPostSprite(pSprite->index, kStatFree);
|
2020-01-02 15:17:32 +00:00
|
|
|
nType = kExplosionLarge;
|
2019-09-19 22:42:45 +00:00
|
|
|
nXSprite = pSprite2->extra;
|
|
|
|
seqSpawn(4, 3, nXSprite, -1);
|
|
|
|
sfxPlay3DSound(pSprite2, 305, -1, 0);
|
|
|
|
GibSprite(pSprite2, GIBTYPE_14, NULL, NULL);
|
|
|
|
pSprite = pSprite2;
|
|
|
|
break;
|
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
case kTrapExploder:
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
// Defaults for exploder
|
|
|
|
nType = 1; int nSnd = 304; int nSeq = 4;
|
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2020-02-07 19:47:43 +00:00
|
|
|
// allow to customize hidden exploder trap
|
2019-10-11 21:59:39 +00:00
|
|
|
if (gModernMap) {
|
2019-10-20 14:50:47 +00:00
|
|
|
// Temp variables for override via data fields
|
|
|
|
int tSnd = 0; int tSeq = 0;
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
|
2019-10-11 21:59:39 +00:00
|
|
|
XSPRITE* pXSPrite = &xsprite[nXSprite];
|
2019-10-20 14:50:47 +00:00
|
|
|
nType = pXSPrite->data1; // Explosion type
|
|
|
|
tSeq = pXSPrite->data2; // SEQ id
|
|
|
|
tSnd = pXSPrite->data3; // Sound Id
|
|
|
|
|
|
|
|
if (nType <= 1 || nType > kExplodeMax) { nType = 1; nSeq = 4; nSnd = 304; }
|
|
|
|
else if (nType == 2) { nSeq = 4; nSnd = 305; }
|
|
|
|
else if (nType == 3) { nSeq = 9; nSnd = 307; }
|
|
|
|
else if (nType == 4) { nSeq = 5; nSnd = 307; }
|
|
|
|
else if (nType <= 6) { nSeq = 4; nSnd = 303; }
|
|
|
|
else if (nType == 7) { nSeq = 4; nSnd = 303; }
|
|
|
|
else if (nType == 8) { nType = 0; nSeq = 3; nSnd = 303; }
|
|
|
|
|
|
|
|
// Override previous sound and seq assigns
|
|
|
|
if (tSeq > 0) nSeq = tSeq;
|
|
|
|
if (tSnd > 0) nSnd = tSnd;
|
2019-10-11 21:59:39 +00:00
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2020-07-25 20:47:46 +00:00
|
|
|
if (getSequence(nSeq))
|
2019-09-21 11:02:17 +00:00
|
|
|
seqSpawn(nSeq, 3, nXSprite, -1);
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
sfxPlay3DSound(pSprite, nSnd, -1, 0);
|
|
|
|
}
|
|
|
|
break;
|
2019-11-08 19:57:01 +00:00
|
|
|
case kThingPodFireBall:
|
2020-01-02 15:17:32 +00:00
|
|
|
nType = kExplosionFireball;
|
2019-09-19 22:42:45 +00:00
|
|
|
seqSpawn(9, 3, nXSprite, -1);
|
|
|
|
sfxPlay3DSound(pSprite, 307, -1, 0);
|
|
|
|
GibSprite(pSprite, GIBTYPE_5, NULL, NULL);
|
|
|
|
sub_746D4(pSprite, 240);
|
|
|
|
break;
|
|
|
|
default:
|
2020-01-02 15:17:32 +00:00
|
|
|
nType = kExplosionStandard;
|
2019-09-19 22:42:45 +00:00
|
|
|
seqSpawn(4, 3, nXSprite, -1);
|
|
|
|
if (Chance(0x8000))
|
|
|
|
pSprite->cstat |= 4;
|
|
|
|
sfxPlay3DSound(pSprite, 303, -1, 0);
|
|
|
|
GibSprite(pSprite, GIBTYPE_5, NULL, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
int nSprite = pSprite->index;
|
|
|
|
xvel[nSprite] = yvel[nSprite] = zvel[nSprite] = 0;
|
2019-10-07 19:29:52 +00:00
|
|
|
actPostSprite(nSprite, kStatExplosion);
|
2019-10-21 19:46:41 +00:00
|
|
|
pSprite->xrepeat = pSprite->yrepeat = explodeInfo[nType].repeat;
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags &= ~3;
|
2019-09-19 22:42:45 +00:00
|
|
|
pSprite->type = nType;
|
2020-02-11 22:15:25 +00:00
|
|
|
const EXPLOSION *pExplodeInfo = &explodeInfo[nType];
|
2019-09-19 22:42:45 +00:00
|
|
|
xsprite[nXSprite].target = 0;
|
2019-10-21 19:46:41 +00:00
|
|
|
xsprite[nXSprite].data1 = pExplodeInfo->ticks;
|
|
|
|
xsprite[nXSprite].data2 = pExplodeInfo->quakeEffect;
|
|
|
|
xsprite[nXSprite].data3 = pExplodeInfo->flashEffect;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-11-06 21:48:22 +00:00
|
|
|
void actActivateGibObject(DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-06 21:48:22 +00:00
|
|
|
auto pXSprite = &actor->x();
|
|
|
|
auto pSprite = &actor->s();
|
2019-09-19 22:42:45 +00:00
|
|
|
int vdx = ClipRange(pXSprite->data1, 0, 31);
|
|
|
|
int vc = ClipRange(pXSprite->data2, 0, 31);
|
|
|
|
int v4 = ClipRange(pXSprite->data3, 0, 31);
|
|
|
|
int vbp = pXSprite->data4;
|
|
|
|
int v8 = pXSprite->dropMsg;
|
|
|
|
if (vdx > 0)
|
|
|
|
GibSprite(pSprite, (GIBTYPE)(vdx-1), NULL, NULL);
|
|
|
|
if (vc > 0)
|
|
|
|
GibSprite(pSprite, (GIBTYPE)(vc-1), NULL, NULL);
|
|
|
|
if (v4 > 0 && pXSprite->burnTime > 0)
|
|
|
|
GibSprite(pSprite, (GIBTYPE)(v4-1), NULL, NULL);
|
|
|
|
if (vbp > 0)
|
|
|
|
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, vbp, pSprite->sectnum);
|
|
|
|
if (v8 > 0)
|
|
|
|
actDropObject(pSprite, v8);
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-10-15 12:36:50 +00:00
|
|
|
if (!(pSprite->cstat&32768) && !(pSprite->flags&kHitagRespawn))
|
2019-10-07 19:29:52 +00:00
|
|
|
actPostSprite(pSprite->index, kStatFree);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool IsUnderWater(spritetype *pSprite)
|
|
|
|
{
|
|
|
|
int nSector = pSprite->sectnum;
|
|
|
|
int nXSector = sector[nSector].extra;
|
|
|
|
if (nXSector > 0 && nXSector < kMaxXSectors)
|
|
|
|
if (xsector[nXSector].Underwater)
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-11-06 21:48:22 +00:00
|
|
|
void MakeSplash(DBloodActor *actor);
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
void actProcessSprites(void)
|
|
|
|
{
|
|
|
|
int nSprite;
|
|
|
|
int nNextSprite;
|
2020-02-07 19:47:43 +00:00
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2020-02-07 19:47:43 +00:00
|
|
|
if (gModernMap) nnExtProcessSuperSprites();
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-10-15 15:08:21 +00:00
|
|
|
StatIterator it(kStatThing);
|
|
|
|
while ((nSprite = it.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags&32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
int nXSprite = pSprite->extra;
|
2019-10-11 21:59:39 +00:00
|
|
|
if (nXSprite > 0) {
|
2019-09-19 22:42:45 +00:00
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kThingBloodBits:
|
|
|
|
case kThingBloodChunks:
|
|
|
|
case kThingZombieHead:
|
2021-02-18 10:46:36 +00:00
|
|
|
if (pXSprite->locked && PlayClock >= pXSprite->targetX) pXSprite->locked = 0;
|
2019-10-11 21:59:39 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pXSprite->burnTime > 0)
|
|
|
|
{
|
|
|
|
pXSprite->burnTime = ClipLow(pXSprite->burnTime-4,0);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(pXSprite->burnSource, pSprite, kDamageBurn, 8);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
|
|
|
|
if (pXSprite->Proximity) {
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// don't process locked or 1-shot things for proximity
|
2019-10-11 21:59:39 +00:00
|
|
|
if (gModernMap && (pXSprite->locked || pXSprite->isTriggered))
|
|
|
|
continue;
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2019-10-15 13:30:05 +00:00
|
|
|
if (pSprite->type == kThingDroppedLifeLeech) pXSprite->target = -1;
|
2020-10-15 15:08:21 +00:00
|
|
|
int nSprite2;
|
|
|
|
StatIterator it1(kStatDude);
|
|
|
|
while ((nSprite2 = it1.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-10-15 15:15:45 +00:00
|
|
|
nNextSprite = it1.PeekIndex();
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pSprite2 = &sprite[nSprite2];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite2->flags&32) continue;
|
2019-09-19 22:42:45 +00:00
|
|
|
XSPRITE *pXSprite2 = &xsprite[pSprite2->extra];
|
2019-10-11 21:59:39 +00:00
|
|
|
if ((unsigned int)pXSprite2->health > 0) {
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// allow dudeLockout for proximity flag
|
2019-10-11 21:59:39 +00:00
|
|
|
if (gModernMap && pSprite->type != kThingDroppedLifeLeech && pXSprite->DudeLockout && !IsPlayerSprite(pSprite2))
|
2019-09-21 11:02:17 +00:00
|
|
|
continue;
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
int proxyDist = 96;
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2019-10-11 21:59:39 +00:00
|
|
|
if (pSprite->type == kModernThingEnemyLifeLeech) proxyDist = 512;
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
|
|
|
if (pSprite->type == kThingDroppedLifeLeech && pXSprite->target == -1) {
|
2020-12-02 18:56:32 +00:00
|
|
|
int nOwner = pSprite->owner;
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pOwner = &sprite[nOwner];
|
2020-02-06 08:48:45 +00:00
|
|
|
if (!IsPlayerSprite(pOwner))
|
|
|
|
continue;
|
2019-10-19 19:11:39 +00:00
|
|
|
PLAYER *pPlayer = &gPlayer[pOwner->type - kDudePlayer1];
|
2019-09-19 22:42:45 +00:00
|
|
|
PLAYER *pPlayer2 = NULL;
|
|
|
|
if (IsPlayerSprite(pSprite2))
|
2019-10-19 19:11:39 +00:00
|
|
|
pPlayer2 = &gPlayer[pSprite2->type - kDudePlayer1];
|
2019-10-11 21:59:39 +00:00
|
|
|
if (nSprite2 == nOwner || pSprite2->type == kDudeZombieAxeBuried || pSprite2->type == kDudeRat || pSprite2->type == kDudeBat)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
2019-10-21 19:46:41 +00:00
|
|
|
if (gGameOptions.nGameType == 3 && pPlayer2 && pPlayer->teamId == pPlayer2->teamId)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
if (gGameOptions.nGameType == 1 && pPlayer2)
|
|
|
|
continue;
|
|
|
|
proxyDist = 512;
|
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
if (CheckProximity(pSprite2, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, proxyDist)) {
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
switch (pSprite->type) {
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingDroppedLifeLeech:
|
2019-09-19 22:42:45 +00:00
|
|
|
if (!Chance(0x4000) && nNextSprite >= 0) continue;
|
2019-09-07 13:53:42 +00:00
|
|
|
if (pSprite2->cstat & CLIPMASK0) pXSprite->target = pSprite2->index;
|
2019-09-19 22:42:45 +00:00
|
|
|
else continue;
|
|
|
|
break;
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
case kModernThingTNTProx:
|
|
|
|
if (!IsPlayerSprite(pSprite2)) continue;
|
|
|
|
pSprite->pal = 0;
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kModernThingEnemyLifeLeech:
|
2020-02-07 19:47:43 +00:00
|
|
|
if (pXSprite->target != pSprite2->index) continue;
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2020-12-02 18:56:32 +00:00
|
|
|
if (pSprite->owner == -1) pSprite->owner = pSprite2->index;
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-10-15 15:08:21 +00:00
|
|
|
|
|
|
|
it.Reset(kStatThing);
|
|
|
|
while ((nSprite = it.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags & 32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
int nSector = pSprite->sectnum;
|
|
|
|
int nXSprite = pSprite->extra;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
int nXSector = sector[nSector].extra;
|
|
|
|
XSECTOR *pXSector = NULL;
|
|
|
|
if (nXSector > 0)
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
|
|
|
assert(xsector[nXSector].reference == nSector);
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSector = &xsector[nXSector];
|
|
|
|
}
|
|
|
|
if (pXSector && pXSector->panVel && (pXSector->panAlways || pXSector->state || pXSector->busy))
|
|
|
|
{
|
|
|
|
int nType = pSprite->type - kThingBase;
|
2019-12-06 23:07:02 +00:00
|
|
|
const THINGINFO *pThingInfo = &thingInfo[nType];
|
2019-10-12 20:45:46 +00:00
|
|
|
if (pThingInfo->flags & 1)
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags |= 1;
|
2019-10-12 20:45:46 +00:00
|
|
|
if (pThingInfo->flags & 2)
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags |= 4;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags&3)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
viewBackupSpriteLoc(nSprite, pSprite);
|
|
|
|
if (pXSector && pXSector->panVel)
|
|
|
|
{
|
|
|
|
int top, bottom;
|
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
|
|
|
if (getflorzofslope(nSector, pSprite->x, pSprite->y) <= bottom)
|
|
|
|
{
|
|
|
|
int angle = pXSector->panAngle;
|
|
|
|
int speed = 0;
|
|
|
|
if (pXSector->panAlways || pXSector->state || pXSector->busy)
|
|
|
|
{
|
|
|
|
speed = pXSector->panVel << 9;
|
|
|
|
if (!pXSector->panAlways && pXSector->busy)
|
2021-01-04 11:36:54 +00:00
|
|
|
speed = MulScale(speed, pXSector->busy, 16);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
if (sector[nSector].floorstat&64)
|
|
|
|
angle = (angle+GetWallAngle(sector[nSector].wallptr)+512)&2047;
|
2021-01-04 11:36:54 +00:00
|
|
|
int dx = MulScale(speed, Cos(angle), 30);
|
|
|
|
int dy = MulScale(speed, Sin(angle), 30);
|
2019-09-19 22:42:45 +00:00
|
|
|
xvel[nSprite] += dx;
|
|
|
|
yvel[nSprite] += dy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
actAirDrag(pSprite, 128);
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2020-08-26 10:55:46 +00:00
|
|
|
if (((pSprite->index>>8)&15) == (gFrameCount&15) && (pSprite->flags&2))
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags |= 4;
|
|
|
|
if ((pSprite->flags&4) || xvel[nSprite] || yvel[nSprite] || zvel[nSprite] ||
|
2019-09-19 22:42:45 +00:00
|
|
|
velFloor[pSprite->sectnum] || velCeil[pSprite->sectnum])
|
|
|
|
{
|
|
|
|
int hit = MoveThing(pSprite);
|
|
|
|
if (hit)
|
|
|
|
{
|
|
|
|
int nXSprite = pSprite->extra;
|
|
|
|
if (nXSprite)
|
|
|
|
{
|
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
if (pXSprite->Impact)
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerSprite(nSprite, pXSprite, kCmdOff);
|
2019-10-25 20:53:41 +00:00
|
|
|
switch (pSprite->type) {
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingDripWater:
|
|
|
|
case kThingDripBlood:
|
2020-11-06 21:48:22 +00:00
|
|
|
MakeSplash(&bloodActors[pXSprite->reference]);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2019-10-11 21:59:39 +00:00
|
|
|
case kModernThingThrowableRock:
|
2019-09-19 22:42:45 +00:00
|
|
|
seqSpawn(24, 3, nXSprite, -1);
|
2019-06-28 12:24:46 +00:00
|
|
|
if ((hit & 0xc000) == 0xc000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
pSprite->xrepeat = 32;
|
|
|
|
pSprite->yrepeat = 32;
|
2019-06-28 12:24:46 +00:00
|
|
|
int nObject = hit & 0x3fff;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype * pObject = &sprite[nObject];
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(pSprite->owner, pObject, kDamageFall, pXSprite->data1);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
break;
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingBone:
|
2019-09-19 22:42:45 +00:00
|
|
|
seqSpawn(24, 3, nXSprite, -1);
|
2019-06-28 12:24:46 +00:00
|
|
|
if ((hit&0xc000) == 0xc000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-06-28 12:24:46 +00:00
|
|
|
int nObject = hit & 0x3fff;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pObject = &sprite[nObject];
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(pSprite->owner, pObject, kDamageFall, 12);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
break;
|
2019-11-08 19:57:01 +00:00
|
|
|
case kThingPodGreenBall:
|
2019-06-28 12:24:46 +00:00
|
|
|
if ((hit&0xc000) == 0x4000)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
actRadiusDamage(&bloodActors[pSprite->owner], pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 200, 1, 20, kDamageExplode, 6, 0);
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(pSprite->index, 3, 0, kCallbackFXPodBloodSplat);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-06-28 12:24:46 +00:00
|
|
|
int nObject = hit & 0x3fff;
|
|
|
|
if ((hit&0xc000) != 0xc000 && (nObject < 0 || nObject >= 4096))
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pObject = &sprite[nObject];
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(pSprite->owner, pObject, kDamageFall, 12);
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(pSprite->index, 3, 0, kCallbackFXPodBloodSplat);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
break;
|
2019-11-08 19:57:01 +00:00
|
|
|
case kThingPodFireBall:
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-06-28 12:24:46 +00:00
|
|
|
int nObject = hit & 0x3fff;
|
|
|
|
if ((hit&0xc000) != 0xc000 && (nObject < 0 || nObject >= 4096))
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
actExplodeSprite(pSprite);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-10-15 15:08:21 +00:00
|
|
|
it.Reset(kStatProjectile);
|
|
|
|
while ((nSprite = it.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags & 32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
viewBackupSpriteLoc(nSprite, pSprite);
|
|
|
|
int hit = MoveMissile(pSprite);
|
|
|
|
if (hit >= 0)
|
2020-12-03 17:00:07 +00:00
|
|
|
actImpactMissile(&bloodActors[pSprite->index], hit);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2020-10-15 15:08:21 +00:00
|
|
|
it.Reset(kStatExplosion);
|
|
|
|
while ((nSprite = it.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-10-15 15:08:21 +00:00
|
|
|
uint8_t v24c[(kMaxSectors+7)>>3];
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags & 32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
2020-12-02 18:56:32 +00:00
|
|
|
int nOwner = pSprite->owner;
|
2020-12-02 19:55:08 +00:00
|
|
|
auto pOwner = nOwner == -1? nullptr : &bloodActors[pSprite->owner];
|
2019-09-19 22:42:45 +00:00
|
|
|
int nType = pSprite->type;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nType >= 0 && nType < kExplodeMax);
|
2020-02-11 22:15:25 +00:00
|
|
|
const EXPLOSION *pExplodeInfo = &explodeInfo[nType];
|
2019-09-19 22:42:45 +00:00
|
|
|
int nXSprite = pSprite->extra;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
int x = pSprite->x;
|
|
|
|
int y = pSprite->y;
|
|
|
|
int z = pSprite->z;
|
|
|
|
int nSector = pSprite->sectnum;
|
2019-10-11 21:59:39 +00:00
|
|
|
int radius = pExplodeInfo->radius;
|
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// Allow to override explosion radius by data4 field of any sprite which have statnum 2 set in editor
|
2019-09-19 22:42:45 +00:00
|
|
|
// or of Hidden Exploder.
|
2019-10-11 21:59:39 +00:00
|
|
|
if (gModernMap && pXSprite->data4 > 0)
|
|
|
|
radius = pXSprite->data4;
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-11-21 20:31:50 +00:00
|
|
|
short gAffectedXWalls[kMaxXWalls];
|
|
|
|
GetClosestSpriteSectors(nSector, x, y, radius, v24c, gAffectedXWalls);
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
for (int i = 0; i < kMaxXWalls; i++)
|
|
|
|
{
|
|
|
|
int nWall = gAffectedXWalls[i];
|
|
|
|
if (nWall == -1)
|
|
|
|
break;
|
|
|
|
XWALL *pXWall = &xwall[wall[nWall].extra];
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerWall(nWall, pXWall, kCmdWallImpact);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-10-15 15:08:21 +00:00
|
|
|
int nSprite2;
|
|
|
|
StatIterator it1(kStatDude);
|
|
|
|
while ((nSprite2 = it1.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 19:55:08 +00:00
|
|
|
DBloodActor* act2 = &bloodActors[nSprite2];
|
|
|
|
spritetype *pDude = &act2->s();
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pDude->flags & 32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
if (TestBitString(v24c, pDude->sectnum))
|
|
|
|
{
|
|
|
|
if (pXSprite->data1 && CheckProximity(pDude, x, y, z, nSector, radius))
|
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pExplodeInfo->dmg && pXSprite->target == 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
pXSprite->target = 1;
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(nOwner, pDude, kDamageFall, (pExplodeInfo->dmg+Random(pExplodeInfo->dmgRng))<<4);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-09-21 11:02:17 +00:00
|
|
|
if (pExplodeInfo->dmgType)
|
2020-12-02 19:55:08 +00:00
|
|
|
ConcussSprite(pOwner, act2, x, y, z, pExplodeInfo->dmgType);
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pExplodeInfo->burnTime)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(pDude->extra > 0 && pDude->extra < kMaxXSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
XSPRITE *pXDude = &xsprite[pDude->extra];
|
|
|
|
if (!pXDude->burnTime)
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite2, 3, 0, kCallbackFXFlameLick);
|
2019-10-21 19:46:41 +00:00
|
|
|
actBurnSprite(pSprite->owner, pXDude, pExplodeInfo->burnTime<<2);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-10-15 15:08:21 +00:00
|
|
|
it1.Reset(kStatThing);
|
|
|
|
while ((nSprite2 = it1.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-12-02 19:55:08 +00:00
|
|
|
auto act2 = &bloodActors[nSprite2];
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pThing = &sprite[nSprite2];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pThing->flags & 32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
if (TestBitString(v24c, pThing->sectnum))
|
|
|
|
{
|
|
|
|
if (pXSprite->data1 && CheckProximity(pThing, x, y, z, nSector, radius))
|
|
|
|
{
|
|
|
|
XSPRITE *pXSprite2 = &xsprite[pThing->extra];
|
|
|
|
if (!pXSprite2->locked)
|
|
|
|
{
|
2019-09-21 11:02:17 +00:00
|
|
|
if (pExplodeInfo->dmgType)
|
2020-12-02 19:55:08 +00:00
|
|
|
ConcussSprite(pOwner, act2, x, y, z, pExplodeInfo->dmgType);
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pExplodeInfo->burnTime)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(pThing->extra > 0 && pThing->extra < kMaxXSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
XSPRITE *pXThing = &xsprite[pThing->extra];
|
2019-10-11 21:59:39 +00:00
|
|
|
if (pThing->type == kThingTNTBarrel && !pXThing->burnTime)
|
|
|
|
evPost(nSprite2, 3, 0, kCallbackFXFlameLick);
|
2019-10-21 19:46:41 +00:00
|
|
|
actBurnSprite(pSprite->owner, pXThing, pExplodeInfo->burnTime<<2);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-03-01 20:36:28 +00:00
|
|
|
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
|
|
|
{
|
|
|
|
spritetype *pSprite2 = gPlayer[p].pSprite;
|
|
|
|
int dx = (x - pSprite2->x)>>4;
|
|
|
|
int dy = (y - pSprite2->y)>>4;
|
|
|
|
int dz = (z - pSprite2->z)>>8;
|
|
|
|
int nDist = dx*dx+dy*dy+dz*dz+0x40000;
|
2021-01-04 11:51:41 +00:00
|
|
|
int t = DivScale(pXSprite->data2, nDist, 16);
|
2020-03-01 20:36:28 +00:00
|
|
|
gPlayer[p].flickerEffect += t;
|
|
|
|
}
|
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2020-03-01 20:36:28 +00:00
|
|
|
if (pXSprite->data1 != 0) {
|
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
// add impulse for sprites from physics list
|
2020-03-01 20:36:28 +00:00
|
|
|
if (gPhysSpritesCount > 0 && pExplodeInfo->dmgType != 0) {
|
2019-09-21 11:02:17 +00:00
|
|
|
for (int i = 0; i < gPhysSpritesCount; i++) {
|
|
|
|
if (gPhysSpritesList[i] == -1) continue;
|
2019-09-30 07:18:01 +00:00
|
|
|
else if (sprite[gPhysSpritesList[i]].sectnum < 0 || (sprite[gPhysSpritesList[i]].flags & kHitagFree) != 0)
|
2019-09-21 11:02:17 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
spritetype* pDebris = &sprite[gPhysSpritesList[i]];
|
|
|
|
if (!TestBitString(v24c, pDebris->sectnum) || !CheckProximity(pDebris, x, y, z, nSector, radius)) continue;
|
|
|
|
else debrisConcuss(nOwner, i, x, y, z, pExplodeInfo->dmgType);
|
|
|
|
}
|
|
|
|
}
|
2020-03-01 20:36:28 +00:00
|
|
|
|
|
|
|
// trigger sprites from impact list
|
|
|
|
if (gImpactSpritesCount > 0) {
|
|
|
|
for (int i = 0; i < gImpactSpritesCount; i++) {
|
|
|
|
if (gImpactSpritesList[i] == -1) continue;
|
|
|
|
else if (sprite[gImpactSpritesList[i]].sectnum < 0 || (sprite[gImpactSpritesList[i]].flags & kHitagFree) != 0)
|
|
|
|
continue;
|
|
|
|
|
2021-07-26 07:34:16 +00:00
|
|
|
spritetype* pImpact = &sprite[gImpactSpritesList[i]];
|
|
|
|
if (pImpact->extra <= 0)
|
|
|
|
continue;
|
|
|
|
XSPRITE* pXImpact = &xsprite[pImpact->extra];
|
2020-03-01 20:36:28 +00:00
|
|
|
if (/*pXImpact->state == pXImpact->restState ||*/ !TestBitString(v24c, pImpact->sectnum) || !CheckProximity(pImpact, x, y, z, nSector, radius))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
trTriggerSprite(pImpact->index, pXImpact, kCmdSpriteImpact);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2020-03-01 20:36:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-10-11 21:59:39 +00:00
|
|
|
if (!gModernMap || !(pSprite->flags & kModernTypeFlag1)) {
|
2020-01-26 11:19:01 +00:00
|
|
|
// if data4 > 0, do not remove explosion. This can be useful when designer wants put explosion generator in map manually
|
|
|
|
// via sprite statnum 2.
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->data1 = ClipLow(pXSprite->data1 - 4, 0);
|
|
|
|
pXSprite->data2 = ClipLow(pXSprite->data2 - 4, 0);
|
|
|
|
pXSprite->data3 = ClipLow(pXSprite->data3 - 4, 0);
|
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#else
|
|
|
|
pXSprite->data1 = ClipLow(pXSprite->data1 - 4, 0);
|
|
|
|
pXSprite->data2 = ClipLow(pXSprite->data2 - 4, 0);
|
|
|
|
pXSprite->data3 = ClipLow(pXSprite->data3 - 4, 0);
|
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
if (pXSprite->data1 == 0 && pXSprite->data2 == 0 && pXSprite->data3 == 0 && seqGetStatus(3, nXSprite) < 0)
|
2019-10-07 19:29:52 +00:00
|
|
|
actPostSprite(nSprite, kStatFree);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-10-15 15:08:21 +00:00
|
|
|
it.Reset(kStatTraps);
|
|
|
|
while ((nSprite = it.NextIndex()) >= 0)
|
|
|
|
{
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags & 32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
int nXSprite = pSprite->extra;
|
2020-10-11 10:38:17 +00:00
|
|
|
//assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
2020-03-29 10:27:54 +00:00
|
|
|
if (nXSprite <= 0 || nXSprite >= kMaxXSprites)
|
|
|
|
continue;
|
2019-09-19 22:42:45 +00:00
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kTrapSawCircular:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->data2 = ClipLow(pXSprite->data2-4, 0);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kTrapFlame:
|
|
|
|
if (pXSprite->state && seqGetStatus(3, nXSprite) < 0) {
|
2019-09-19 22:42:45 +00:00
|
|
|
int x = pSprite->x;
|
|
|
|
int y = pSprite->y;
|
|
|
|
int z = pSprite->z;
|
|
|
|
int t = (pXSprite->data1<<23)/120;
|
2021-01-04 11:36:54 +00:00
|
|
|
int dx = MulScale(t, Cos(pSprite->ang), 30);
|
|
|
|
int dy = MulScale(t, Sin(pSprite->ang), 30);
|
2019-09-19 22:42:45 +00:00
|
|
|
for (int i = 0; i < 2; i++)
|
|
|
|
{
|
|
|
|
spritetype *pFX = gFX.fxSpawn(FX_32, pSprite->sectnum, x, y, z, 0);
|
|
|
|
if (pFX)
|
|
|
|
{
|
|
|
|
xvel[pFX->index] = dx + Random2(0x8888);
|
|
|
|
yvel[pFX->index] = dy + Random2(0x8888);
|
|
|
|
zvel[pFX->index] = Random2(0x8888);
|
|
|
|
}
|
|
|
|
x += (dx/2)>>12;
|
|
|
|
y += (dy/2)>>12;
|
|
|
|
}
|
2020-09-01 13:00:35 +00:00
|
|
|
dy = SinScale16(pSprite->ang);
|
|
|
|
dx = CosScale16(pSprite->ang);
|
2021-06-16 19:13:04 +00:00
|
|
|
gVectorData[kVectorTchernobogBurn].maxDist = pXSprite->data1<<9;
|
|
|
|
actFireVector(pSprite, 0, 0, dx, dy, Random2(0x8888), kVectorTchernobogBurn);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-10-15 15:08:21 +00:00
|
|
|
it.Reset(kStatDude);
|
|
|
|
while ((nSprite = it.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags & 32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
int nXSprite = pSprite->extra;
|
|
|
|
if (nXSprite > 0)
|
|
|
|
{
|
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
if (pXSprite->burnTime > 0)
|
|
|
|
{
|
|
|
|
switch (pSprite->type)
|
|
|
|
{
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeBurningInnocent:
|
|
|
|
case kDudeBurningCultist:
|
|
|
|
case kDudeBurningZombieAxe:
|
|
|
|
case kDudeBurningZombieButcher:
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(pXSprite->burnSource, pSprite, kDamageBurn, 8);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
pXSprite->burnTime = ClipLow(pXSprite->burnTime-4, 0);
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(pXSprite->burnSource, pSprite, kDamageBurn, 8);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// handle incarnations of custom dude
|
2019-12-05 20:42:35 +00:00
|
|
|
if (pSprite->type == kDudeModernCustom && pXSprite->txID > 0 && pXSprite->sysData1 == kGenDudeTransformStatus) {
|
|
|
|
xvel[pSprite->index] = yvel[pSprite->index] = 0;
|
2020-02-07 19:47:43 +00:00
|
|
|
if (seqGetStatus(3, nXSprite) < 0)
|
|
|
|
genDudeTransform(pSprite);
|
2019-09-21 11:02:17 +00:00
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-10-11 21:59:39 +00:00
|
|
|
if (pSprite->type == kDudeCerberusTwoHead)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
if (pXSprite->health <= 0 && seqGetStatus(3, nXSprite) < 0)
|
|
|
|
{
|
|
|
|
pXSprite->health = dudeInfo[28].startHealth<<4;
|
2019-10-11 21:59:39 +00:00
|
|
|
pSprite->type = kDudeCerberusOneHead;
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pXSprite->target != -1)
|
|
|
|
aiSetTarget(pXSprite, pXSprite->target);
|
2020-11-06 21:48:22 +00:00
|
|
|
aiActivateDude(&bloodActors[pXSprite->reference]);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pXSprite->Proximity && !pXSprite->isTriggered)
|
|
|
|
{
|
2020-10-15 15:08:21 +00:00
|
|
|
int nSprite2;
|
|
|
|
StatIterator it1(kStatDude);
|
|
|
|
while ((nSprite2 = it1.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-10-15 15:15:45 +00:00
|
|
|
nNextSprite = it1.PeekIndex();
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pSprite2 = &sprite[nSprite2];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite2->flags&32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
XSPRITE *pXSprite2 = &xsprite[pSprite2->extra];
|
2019-10-25 20:53:41 +00:00
|
|
|
if ((unsigned int)pXSprite2->health > 0 && IsPlayerSprite(pSprite2)) {
|
2019-09-19 22:42:45 +00:00
|
|
|
if (CheckProximity(pSprite2, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 128))
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (IsPlayerSprite(pSprite))
|
|
|
|
{
|
|
|
|
PLAYER *pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pPlayer->voodooTargets)
|
2020-11-21 19:10:45 +00:00
|
|
|
voodooTarget(pPlayer);
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pPlayer->hand && Chance(0x8000))
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(nSprite, pSprite, kDamageDrown, 12);
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pPlayer->isUnderwater)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
char bActive = packItemActive(pPlayer, 1);
|
2019-10-21 19:46:41 +00:00
|
|
|
if (bActive || pPlayer->godMode)
|
|
|
|
pPlayer->underwaterTime = 1200;
|
2019-09-19 22:42:45 +00:00
|
|
|
else
|
2019-10-21 19:46:41 +00:00
|
|
|
pPlayer->underwaterTime = ClipLow(pPlayer->underwaterTime-4, 0);
|
|
|
|
if (pPlayer->underwaterTime < 1080 && packCheckItem(pPlayer, 1) && !bActive)
|
2019-09-19 22:42:45 +00:00
|
|
|
packUseItem(pPlayer, 1);
|
2019-10-21 19:46:41 +00:00
|
|
|
if (!pPlayer->underwaterTime)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
pPlayer->chokeEffect += 4;
|
|
|
|
if (Chance(pPlayer->chokeEffect))
|
2021-06-16 19:13:04 +00:00
|
|
|
actDamageSprite(nSprite, pSprite, kDamageDrown, 3<<4);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
2019-10-21 19:46:41 +00:00
|
|
|
pPlayer->chokeEffect = 0;
|
2019-09-19 22:42:45 +00:00
|
|
|
if (xvel[nSprite] || yvel[nSprite])
|
|
|
|
sfxPlay3DSound(pSprite, 709, 100, 2);
|
2019-10-21 19:46:41 +00:00
|
|
|
pPlayer->bubbleTime = ClipLow(pPlayer->bubbleTime-4, 0);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else if (gGameOptions.nGameType == 0)
|
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pPlayer->pXSprite->health > 0 && pPlayer->restTime >= 1200 && Chance(0x200))
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
pPlayer->restTime = -1;
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 3100+Random(11), 0, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-03 17:38:30 +00:00
|
|
|
ProcessTouchObjects(&bloodActors[pSprite->index]);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-15 15:08:21 +00:00
|
|
|
it.Reset(kStatDude);
|
|
|
|
while ((nSprite = it.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags & 32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
int nXSprite = pSprite->extra;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
int nSector = pSprite->sectnum;
|
|
|
|
viewBackupSpriteLoc(nSprite, pSprite);
|
|
|
|
int nXSector = sector[nSector].extra;
|
|
|
|
XSECTOR *pXSector = NULL;
|
|
|
|
if (nXSector > 0)
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
|
|
|
assert(xsector[nXSector].reference == nSector);
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSector = &xsector[nXSector];
|
|
|
|
}
|
|
|
|
if (pXSector)
|
|
|
|
{
|
|
|
|
int top, bottom;
|
|
|
|
GetSpriteExtents(pSprite, &top, &bottom);
|
|
|
|
if (getflorzofslope(nSector, pSprite->x, pSprite->y) <= bottom)
|
|
|
|
{
|
|
|
|
int angle = pXSector->panAngle;
|
|
|
|
int speed = 0;
|
|
|
|
if (pXSector->panAlways || pXSector->state || pXSector->busy)
|
|
|
|
{
|
|
|
|
speed = pXSector->panVel << 9;
|
|
|
|
if (!pXSector->panAlways && pXSector->busy)
|
2021-01-04 11:36:54 +00:00
|
|
|
speed = MulScale(speed, pXSector->busy, 16);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
if (sector[nSector].floorstat&64)
|
|
|
|
angle = (angle+GetWallAngle(sector[nSector].wallptr)+512)&2047;
|
2021-01-04 11:36:54 +00:00
|
|
|
int dx = MulScale(speed, Cos(angle), 30);
|
|
|
|
int dy = MulScale(speed, Sin(angle), 30);
|
2019-09-19 22:42:45 +00:00
|
|
|
xvel[nSprite] += dx;
|
|
|
|
yvel[nSprite] += dy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pXSector && pXSector->Underwater)
|
|
|
|
actAirDrag(pSprite, 5376);
|
|
|
|
else
|
|
|
|
actAirDrag(pSprite, 128);
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if ((pSprite->flags&4) || xvel[nSprite] || yvel[nSprite] || zvel[nSprite] ||
|
2019-09-19 22:42:45 +00:00
|
|
|
velFloor[pSprite->sectnum] || velCeil[pSprite->sectnum])
|
|
|
|
MoveDude(pSprite);
|
|
|
|
}
|
2020-10-15 15:08:21 +00:00
|
|
|
it.Reset(kStatFlare);
|
|
|
|
while ((nSprite = it.NextIndex()) >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-20 14:50:47 +00:00
|
|
|
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags & 32)
|
2019-09-19 22:42:45 +00:00
|
|
|
continue;
|
|
|
|
int nXSprite = pSprite->extra;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
int nTarget = pXSprite->target;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nTarget >= 0);
|
2019-09-19 22:42:45 +00:00
|
|
|
viewBackupSpriteLoc(nSprite, pSprite);
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nTarget < kMaxSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pTarget = &sprite[nTarget];
|
|
|
|
if (pTarget->statnum == kMaxStatus)
|
|
|
|
{
|
|
|
|
GibSprite(pSprite, GIBTYPE_17, NULL, NULL);
|
2019-10-07 19:29:52 +00:00
|
|
|
actPostSprite(pSprite->index, kStatFree);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-08-26 03:12:57 +00:00
|
|
|
if (pTarget->extra > 0 && xsprite[pTarget->extra].health > 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
int x = pTarget->x+mulscale30r(Cos(pXSprite->goalAng+pTarget->ang), pTarget->clipdist*2);
|
|
|
|
int y = pTarget->y+mulscale30r(Sin(pXSprite->goalAng+pTarget->ang), pTarget->clipdist*2);
|
|
|
|
int z = pTarget->z+pXSprite->targetZ;
|
|
|
|
vec3_t pos = { x, y, z };
|
|
|
|
setsprite(nSprite,&pos);
|
|
|
|
xvel[nSprite] = xvel[nTarget];
|
|
|
|
yvel[nSprite] = yvel[nTarget];
|
|
|
|
zvel[nSprite] = zvel[nTarget];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GibSprite(pSprite, GIBTYPE_17, NULL, NULL);
|
2019-10-07 19:29:52 +00:00
|
|
|
actPostSprite(pSprite->index, kStatFree);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
aiProcessDudes();
|
|
|
|
gFX.fxProcess();
|
|
|
|
}
|
|
|
|
|
2020-12-02 22:39:38 +00:00
|
|
|
spritetype * actSpawnSprite_(int nSector, int x, int y, int z, int nStat, char a6)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
int nSprite = InsertSprite(nSector, nStat);
|
|
|
|
if (nSprite >= 0)
|
|
|
|
sprite[nSprite].extra = -1;
|
|
|
|
else
|
|
|
|
{
|
2020-10-15 15:08:21 +00:00
|
|
|
StatIterator it(kStatPurge);
|
|
|
|
nSprite = it.NextIndex();
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSprite >= 0);
|
|
|
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
ChangeSpriteSect(nSprite, nSector);
|
|
|
|
actPostSprite(nSprite, nStat);
|
|
|
|
}
|
|
|
|
vec3_t pos = { x, y, z };
|
|
|
|
setsprite(nSprite, &pos);
|
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-19 19:11:39 +00:00
|
|
|
pSprite->type = kSpriteDecoration;
|
2019-09-19 22:42:45 +00:00
|
|
|
if (a6 && pSprite->extra == -1)
|
|
|
|
{
|
|
|
|
int nXSprite = dbInsertXSprite(nSprite);
|
|
|
|
gSpriteHit[nXSprite].florhit = 0;
|
|
|
|
gSpriteHit[nXSprite].ceilhit = 0;
|
2019-10-15 13:30:05 +00:00
|
|
|
if (!VanillaMode())
|
|
|
|
xsprite[nXSprite].target = -1;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
return pSprite;
|
|
|
|
}
|
|
|
|
|
2020-12-02 22:39:38 +00:00
|
|
|
DBloodActor* actSpawnSprite(int nSector, int x, int y, int z, int nStat, bool a6)
|
|
|
|
{
|
|
|
|
auto spr = actSpawnSprite_(nSector, x, y, z, nStat, a6);
|
|
|
|
return &bloodActors[spr->index];
|
|
|
|
}
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype * actSpawnSprite(spritetype *pSource, int nStat);
|
|
|
|
|
|
|
|
spritetype *actSpawnDude(spritetype *pSource, short nType, int a3, int a4)
|
|
|
|
{
|
|
|
|
XSPRITE* pXSource = &xsprite[pSource->extra];
|
2019-10-21 11:59:33 +00:00
|
|
|
spritetype *pSprite2 = actSpawnSprite(pSource, kStatDude);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (!pSprite2) return NULL;
|
|
|
|
XSPRITE *pXSprite2 = &xsprite[pSprite2->extra];
|
|
|
|
int angle = pSource->ang;
|
|
|
|
int nDude = nType-kDudeBase;
|
|
|
|
int x, y, z;
|
|
|
|
z = a4 + pSource->z;
|
|
|
|
if (a3 < 0)
|
|
|
|
{
|
|
|
|
x = pSource->x;
|
|
|
|
y = pSource->y;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x = pSource->x+mulscale30r(Cos(angle), a3);
|
|
|
|
y = pSource->y+mulscale30r(Sin(angle), a3);
|
|
|
|
}
|
|
|
|
pSprite2->type = nType;
|
|
|
|
pSprite2->ang = angle;
|
|
|
|
vec3_t pos = { x, y, z };
|
|
|
|
setsprite(pSprite2->index, &pos);
|
|
|
|
pSprite2->cstat |= 0x1101;
|
2020-02-05 21:17:05 +00:00
|
|
|
pSprite2->clipdist = getDudeInfo(nDude+kDudeBase)->clipdist;
|
|
|
|
pXSprite2->health = getDudeInfo(nDude+kDudeBase)->startHealth<<4;
|
2019-10-21 11:59:33 +00:00
|
|
|
pXSprite2->respawn = 1;
|
2020-07-25 20:47:46 +00:00
|
|
|
if (getSequence(getDudeInfo(nDude+kDudeBase)->seqStartID))
|
2020-02-05 21:17:05 +00:00
|
|
|
seqSpawn(getDudeInfo(nDude+kDudeBase)->seqStartID, 3, pSprite2->extra, -1);
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// add a way to inherit some values of spawner type 18 by dude.
|
2019-09-19 22:42:45 +00:00
|
|
|
// This way designer can count enemies via switches and do many other interesting things.
|
2019-10-11 21:59:39 +00:00
|
|
|
if (gModernMap && pSource->flags & kModernTypeFlag1) {
|
2019-09-21 11:02:17 +00:00
|
|
|
switch (pSource->type) { // allow inheriting only for selected source types
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMarkerDudeSpawn:
|
2019-09-21 11:02:17 +00:00
|
|
|
//inherit pal?
|
|
|
|
if (pSprite2->pal <= 0) pSprite2->pal = pSource->pal;
|
|
|
|
|
|
|
|
// inherit spawn sprite trigger settings, so designer can count monsters.
|
|
|
|
pXSprite2->txID = pXSource->txID;
|
|
|
|
pXSprite2->command = pXSource->command;
|
|
|
|
pXSprite2->triggerOn = pXSource->triggerOn;
|
|
|
|
pXSprite2->triggerOff = pXSource->triggerOff;
|
|
|
|
|
|
|
|
// inherit drop items
|
|
|
|
pXSprite2->dropMsg = pXSource->dropMsg;
|
|
|
|
|
|
|
|
// inherit dude flags
|
|
|
|
pXSprite2->dudeDeaf = pXSource->dudeDeaf;
|
|
|
|
pXSprite2->dudeGuard = pXSource->dudeGuard;
|
|
|
|
pXSprite2->dudeAmbush = pXSource->dudeAmbush;
|
|
|
|
pXSprite2->dudeFlag4 = pXSource->dudeFlag4;
|
2021-01-07 12:33:20 +00:00
|
|
|
pXSprite2->unused1 = pXSource->unused1;
|
2019-09-21 11:02:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
|
|
|
|
aiInitSprite(pSprite2);
|
|
|
|
return pSprite2;
|
|
|
|
}
|
|
|
|
|
|
|
|
spritetype * actSpawnSprite(spritetype *pSource, int nStat)
|
|
|
|
{
|
|
|
|
int nSprite = InsertSprite(pSource->sectnum, nStat);
|
|
|
|
if (nSprite < 0)
|
|
|
|
{
|
2020-10-15 15:08:21 +00:00
|
|
|
StatIterator it(kStatPurge);
|
|
|
|
nSprite = it.NextIndex();
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSprite >= 0);
|
|
|
|
assert(pSource->sectnum >= 0 && pSource->sectnum < kMaxSectors);
|
2019-09-19 22:42:45 +00:00
|
|
|
ChangeSpriteSect(nSprite, pSource->sectnum);
|
|
|
|
actPostSprite(nSprite, nStat);
|
|
|
|
}
|
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
|
|
|
pSprite->x = pSource->x;
|
|
|
|
pSprite->y = pSource->y;
|
|
|
|
pSprite->z = pSource->z;
|
|
|
|
xvel[nSprite] = xvel[pSource->index];
|
|
|
|
yvel[nSprite] = yvel[pSource->index];
|
|
|
|
zvel[nSprite] = zvel[pSource->index];
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags = 0;
|
2019-09-19 22:42:45 +00:00
|
|
|
int nXSprite = dbInsertXSprite(nSprite);
|
|
|
|
gSpriteHit[nXSprite].florhit = 0;
|
|
|
|
gSpriteHit[nXSprite].ceilhit = 0;
|
2019-10-15 13:30:05 +00:00
|
|
|
if (!VanillaMode())
|
|
|
|
xsprite[nXSprite].target = -1;
|
2019-09-19 22:42:45 +00:00
|
|
|
return pSprite;
|
|
|
|
}
|
|
|
|
|
|
|
|
spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType)
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nThingType >= kThingBase && nThingType < kThingMax);
|
2020-12-02 22:39:38 +00:00
|
|
|
spritetype *pSprite = actSpawnSprite_(nSector, x, y, z, 4, 1);
|
2019-09-19 22:42:45 +00:00
|
|
|
int nType = nThingType-kThingBase;
|
|
|
|
int nThing = pSprite->index;
|
|
|
|
int nXThing = pSprite->extra;
|
|
|
|
pSprite->type = nThingType;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXThing > 0 && nXThing < kMaxXSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
XSPRITE *pXThing = &xsprite[nXThing];
|
2019-12-06 23:07:02 +00:00
|
|
|
const THINGINFO *pThingInfo = &thingInfo[nType];
|
2019-10-21 19:46:41 +00:00
|
|
|
pXThing->health = pThingInfo->startHealth<<4;
|
2019-10-12 20:45:46 +00:00
|
|
|
pSprite->clipdist = pThingInfo->clipdist;
|
|
|
|
pSprite->flags = pThingInfo->flags;
|
2019-09-30 07:18:01 +00:00
|
|
|
if (pSprite->flags & 2)
|
|
|
|
pSprite->flags |= 4;
|
2019-10-21 19:46:41 +00:00
|
|
|
pSprite->cstat |= pThingInfo->cstat;
|
|
|
|
pSprite->picnum = pThingInfo->picnum;
|
|
|
|
pSprite->shade = pThingInfo->shade;
|
|
|
|
pSprite->pal = pThingInfo->pal;
|
|
|
|
if (pThingInfo->xrepeat)
|
|
|
|
pSprite->xrepeat = pThingInfo->xrepeat;
|
|
|
|
if (pThingInfo->yrepeat)
|
|
|
|
pSprite->yrepeat = pThingInfo->yrepeat;
|
2020-09-06 10:44:58 +00:00
|
|
|
show2dsprite.Set(pSprite->index);
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (nThingType) {
|
|
|
|
case kThingVoodooHead:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXThing->data1 = 0;
|
|
|
|
pXThing->data2 = 0;
|
|
|
|
pXThing->data3 = 0;
|
|
|
|
pXThing->data4 = 0;
|
|
|
|
pXThing->state = 1;
|
|
|
|
pXThing->triggerOnce = 1;
|
|
|
|
pXThing->isTriggered = 0;
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingDroppedLifeLeech:
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2019-10-11 21:59:39 +00:00
|
|
|
case kModernThingEnemyLifeLeech:
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
pXThing->data1 = 0;
|
|
|
|
pXThing->data2 = 0;
|
|
|
|
pXThing->data3 = 0;
|
|
|
|
pXThing->data4 = 0;
|
|
|
|
pXThing->state = 1;
|
|
|
|
pXThing->triggerOnce = 0;
|
|
|
|
pXThing->isTriggered = 0;
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingZombieHead:
|
2019-09-19 22:42:45 +00:00
|
|
|
pXThing->data1 = 8;
|
|
|
|
pXThing->data2 = 0;
|
|
|
|
pXThing->data3 = 0;
|
|
|
|
pXThing->data4 = 318;
|
2021-02-18 10:46:36 +00:00
|
|
|
pXThing->targetX = PlayClock+180;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXThing->locked = 1;
|
|
|
|
pXThing->state = 1;
|
|
|
|
pXThing->triggerOnce = 0;
|
|
|
|
pXThing->isTriggered = 0;
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingBloodBits:
|
|
|
|
case kThingBloodChunks:
|
|
|
|
pXThing->data1 = (nThingType == kThingBloodBits) ? 19 : 8;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXThing->data2 = 0;
|
|
|
|
pXThing->data3 = 0;
|
|
|
|
pXThing->data4 = 318;
|
2021-02-18 10:46:36 +00:00
|
|
|
pXThing->targetX = PlayClock+180;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXThing->locked = 1;
|
|
|
|
pXThing->state = 1;
|
|
|
|
pXThing->triggerOnce = 0;
|
|
|
|
pXThing->isTriggered = 0;
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingArmedTNTStick:
|
|
|
|
evPost(nThing, 3, 0, kCallbackFXDynPuff);
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 450, 0, 0);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingArmedTNTBundle:
|
2019-09-19 22:42:45 +00:00
|
|
|
sfxPlay3DSound(pSprite, 450, 0, 0);
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nThing, 3, 0, kCallbackFXDynPuff);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingArmedSpray:
|
|
|
|
evPost(nThing, 3, 0, kCallbackFXDynPuff);
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return pSprite;
|
|
|
|
}
|
|
|
|
|
2020-12-02 21:33:14 +00:00
|
|
|
spritetype * actFireThing_(spritetype *pSprite, int a2, int a3, int a4, int thingType, int a6)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(thingType >= kThingBase && thingType < kThingMax);
|
2021-01-04 11:36:54 +00:00
|
|
|
int x = pSprite->x+MulScale(a2, Cos(pSprite->ang+512), 30);
|
|
|
|
int y = pSprite->y+MulScale(a2, Sin(pSprite->ang+512), 30);
|
2019-09-19 22:42:45 +00:00
|
|
|
int z = pSprite->z+a3;
|
2021-01-04 11:36:54 +00:00
|
|
|
x += MulScale(pSprite->clipdist, Cos(pSprite->ang), 28);
|
|
|
|
y += MulScale(pSprite->clipdist, Sin(pSprite->ang), 28);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (HitScan(pSprite, z, x-pSprite->x, y-pSprite->y, 0, CLIPMASK0, pSprite->clipdist) != -1)
|
|
|
|
{
|
2021-01-04 11:36:54 +00:00
|
|
|
x = gHitInfo.hitx-MulScale(pSprite->clipdist<<1, Cos(pSprite->ang), 28);
|
|
|
|
y = gHitInfo.hity-MulScale(pSprite->clipdist<<1, Sin(pSprite->ang), 28);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
spritetype *pThing = actSpawnThing(pSprite->sectnum, x, y, z, thingType);
|
2020-12-02 18:56:32 +00:00
|
|
|
pThing->owner = pSprite->index;
|
2019-09-19 22:42:45 +00:00
|
|
|
pThing->ang = pSprite->ang;
|
2021-01-04 11:36:54 +00:00
|
|
|
xvel[pThing->index] = MulScale(a6, Cos(pThing->ang), 30);
|
|
|
|
yvel[pThing->index] = MulScale(a6, Sin(pThing->ang), 30);
|
2021-01-04 11:57:26 +00:00
|
|
|
zvel[pThing->index] = MulScale(a6, a4, 14);
|
2019-09-19 22:42:45 +00:00
|
|
|
xvel[pThing->index] += xvel[pSprite->index]/2;
|
|
|
|
yvel[pThing->index] += yvel[pSprite->index]/2;
|
|
|
|
zvel[pThing->index] += zvel[pSprite->index]/2;
|
|
|
|
return pThing;
|
|
|
|
}
|
|
|
|
|
2020-12-02 21:33:14 +00:00
|
|
|
DBloodActor* actFireThing(DBloodActor* pSprite, int a2, int a3, int a4, int thingType, int a6)
|
|
|
|
{
|
|
|
|
auto spr = actFireThing_(&pSprite->s(), a2, a3, a4, thingType, a6);
|
|
|
|
return &bloodActors[spr->index];
|
|
|
|
}
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype* actFireMissile(spritetype *pSprite, int a2, int a3, int a4, int a5, int a6, int nType)
|
|
|
|
{
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nType >= kMissileBase && nType < kMissileMax);
|
2019-09-19 22:42:45 +00:00
|
|
|
char v4 = 0;
|
|
|
|
int nSprite = pSprite->index;
|
2020-02-11 22:15:25 +00:00
|
|
|
const MissileType *pMissileInfo = &missileInfo[nType-kMissileBase];
|
2021-01-04 11:36:54 +00:00
|
|
|
int x = pSprite->x+MulScale(a2, Cos(pSprite->ang+512), 30);
|
|
|
|
int y = pSprite->y+MulScale(a2, Sin(pSprite->ang+512), 30);
|
2019-09-19 22:42:45 +00:00
|
|
|
int z = pSprite->z+a3;
|
2019-10-21 19:46:41 +00:00
|
|
|
int clipdist = pMissileInfo->clipDist+pSprite->clipdist;
|
2021-01-04 11:36:54 +00:00
|
|
|
x += MulScale(clipdist, Cos(pSprite->ang), 28);
|
|
|
|
y += MulScale(clipdist, Sin(pSprite->ang), 28);
|
2019-09-19 22:42:45 +00:00
|
|
|
int hit = HitScan(pSprite, z, x-pSprite->x, y-pSprite->y, 0, CLIPMASK0, clipdist);
|
|
|
|
if (hit != -1)
|
|
|
|
{
|
|
|
|
if (hit == 3 || hit == 0)
|
|
|
|
{
|
|
|
|
v4 = 1;
|
2021-01-04 11:36:54 +00:00
|
|
|
x = gHitInfo.hitx-MulScale(Cos(pSprite->ang), 16, 30);
|
|
|
|
y = gHitInfo.hity-MulScale(Sin(pSprite->ang), 16, 30);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-01-04 11:36:54 +00:00
|
|
|
x = gHitInfo.hitx-MulScale(pMissileInfo->clipDist<<1, Cos(pSprite->ang), 28);
|
|
|
|
y = gHitInfo.hity-MulScale(pMissileInfo->clipDist<<1, Sin(pSprite->ang), 28);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-02 22:39:38 +00:00
|
|
|
spritetype *pMissile = actSpawnSprite_(pSprite->sectnum, x, y, z, 5, 1);
|
2019-09-19 22:42:45 +00:00
|
|
|
int nMissile = pMissile->index;
|
2020-09-06 10:44:58 +00:00
|
|
|
show2dsprite.Set(nMissile);
|
2019-09-19 22:42:45 +00:00
|
|
|
pMissile->type = nType;
|
2019-10-21 19:46:41 +00:00
|
|
|
pMissile->shade = pMissileInfo->shade;
|
2019-09-19 22:42:45 +00:00
|
|
|
pMissile->pal = 0;
|
2019-10-21 19:46:41 +00:00
|
|
|
pMissile->clipdist = pMissileInfo->clipDist;
|
2019-09-30 07:18:01 +00:00
|
|
|
pMissile->flags = 1;
|
2019-10-21 19:46:41 +00:00
|
|
|
pMissile->xrepeat = pMissileInfo->xrepeat;
|
|
|
|
pMissile->yrepeat = pMissileInfo->yrepeat;
|
2019-09-19 22:42:45 +00:00
|
|
|
pMissile->picnum = pMissileInfo->picnum;
|
2019-10-21 19:46:41 +00:00
|
|
|
pMissile->ang = (pSprite->ang+pMissileInfo->angleOfs)&2047;
|
2021-01-04 11:57:26 +00:00
|
|
|
xvel[nMissile] = MulScale(pMissileInfo->velocity, a4, 14);
|
|
|
|
yvel[nMissile] = MulScale(pMissileInfo->velocity, a5, 14);
|
|
|
|
zvel[nMissile] = MulScale(pMissileInfo->velocity, a6, 14);
|
2020-12-02 18:56:32 +00:00
|
|
|
pMissile->owner = pSprite->index;
|
2019-09-19 22:42:45 +00:00
|
|
|
pMissile->cstat |= 1;
|
|
|
|
int nXSprite = pMissile->extra;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
xsprite[nXSprite].target = -1;
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nMissile, 3, 600, kCallbackRemove);
|
2019-09-21 11:02:17 +00:00
|
|
|
|
|
|
|
actBuildMissile(pMissile, nXSprite, nSprite);
|
|
|
|
|
|
|
|
if (v4)
|
|
|
|
{
|
2020-12-03 17:00:07 +00:00
|
|
|
actImpactMissile(&bloodActors[pMissile->index], hit);
|
2019-09-21 11:02:17 +00:00
|
|
|
pMissile = NULL;
|
|
|
|
}
|
|
|
|
return pMissile;
|
|
|
|
}
|
|
|
|
|
|
|
|
void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite) {
|
|
|
|
int nMissile = pMissile->index;
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (pMissile->type) {
|
|
|
|
case kMissileLifeLeechRegular:
|
|
|
|
evPost(nMissile, 3, 0, kCallbackFXFlameLick);
|
2019-10-20 14:50:47 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileTeslaAlt:
|
|
|
|
evPost(nMissile, 3, 0, kCallbackFXTeslaAlt);
|
2019-10-20 14:50:47 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissilePukeGreen:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(29, 3, nXSprite, -1);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileButcherKnife:
|
2019-10-20 14:50:47 +00:00
|
|
|
pMissile->cstat |= 16;
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileTeslaRegular:
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pMissile, 251, 0, 0);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileEctoSkull:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(2, 3, nXSprite, -1);
|
|
|
|
sfxPlay3DSound(pMissile, 493, 0, 0);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFireballNapam:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(61, 3, nXSprite, nNapalmClient);
|
|
|
|
sfxPlay3DSound(pMissile, 441, 0, 0);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFireball:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(22, 3, nXSprite, nFireballClient);
|
|
|
|
sfxPlay3DSound(pMissile, 441, 0, 0);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFlameHound:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(27, 3, nXSprite, -1);
|
|
|
|
xvel[nMissile] += xvel[nSprite] / 2 + Random2(0x11111);
|
|
|
|
yvel[nMissile] += yvel[nSprite] / 2 + Random2(0x11111);
|
|
|
|
zvel[nMissile] += zvel[nSprite] / 2 + Random2(0x11111);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFireballCerberus:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(61, 3, nXSprite, dword_2192E0);
|
|
|
|
sfxPlay3DSound(pMissile, 441, 0, 0);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFireballTchernobog:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(23, 3, nXSprite, dword_2192D8);
|
|
|
|
xvel[nMissile] += xvel[nSprite] / 2 + Random2(0x11111);
|
|
|
|
yvel[nMissile] += yvel[nSprite] / 2 + Random2(0x11111);
|
|
|
|
zvel[nMissile] += zvel[nSprite] / 2 + Random2(0x11111);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFlameSpray:
|
2019-10-20 14:50:47 +00:00
|
|
|
if (Chance(0x8000))
|
|
|
|
seqSpawn(0, 3, nXSprite, -1);
|
|
|
|
else
|
|
|
|
seqSpawn(1, 3, nXSprite, -1);
|
|
|
|
xvel[nMissile] += xvel[nSprite] + Random2(0x11111);
|
|
|
|
yvel[nMissile] += yvel[nSprite] + Random2(0x11111);
|
|
|
|
zvel[nMissile] += zvel[nSprite] + Random2(0x11111);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFlareAlt:
|
|
|
|
evPost(nMissile, 3, 30, kCallbackFXFlareBurst);
|
|
|
|
evPost(nMissile, 3, 0, kCallbackFXFlareSpark);
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pMissile, 422, 0, 0);
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileFlareRegular:
|
|
|
|
evPost(nMissile, 3, 0, kCallbackFXFlareSpark);
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pMissile, 422, 0, 0);
|
|
|
|
break;
|
2019-10-13 22:29:19 +00:00
|
|
|
case kMissileLifeLeechAltSmall:
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nMissile, 3, 0, kCallbackFXArcSpark);
|
2019-10-20 14:50:47 +00:00
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kMissileArcGargoyle:
|
2019-10-20 14:50:47 +00:00
|
|
|
sfxPlay3DSound(pMissile, 252, 0, 0);
|
|
|
|
break;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-13 22:29:19 +00:00
|
|
|
int actGetRespawnTime(spritetype *pSprite) {
|
|
|
|
if (pSprite->extra <= 0) return -1;
|
|
|
|
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
|
|
|
if (IsDudeSprite(pSprite) && !IsPlayerSprite(pSprite)) {
|
|
|
|
if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nMonsterSettings == 2))
|
2019-09-19 22:42:45 +00:00
|
|
|
return gGameOptions.nMonsterRespawnTime;
|
|
|
|
return -1;
|
|
|
|
}
|
2019-10-13 22:29:19 +00:00
|
|
|
|
|
|
|
if (IsWeaponSprite(pSprite)) {
|
|
|
|
if (pXSprite->respawn == 3 || gGameOptions.nWeaponSettings == 1) return 0;
|
|
|
|
else if (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
return gGameOptions.nWeaponRespawnTime;
|
|
|
|
return -1;
|
|
|
|
}
|
2019-10-13 22:29:19 +00:00
|
|
|
|
|
|
|
if (IsAmmoSprite(pSprite)) {
|
|
|
|
if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nWeaponSettings != 0))
|
2019-09-19 22:42:45 +00:00
|
|
|
return gGameOptions.nWeaponRespawnTime;
|
|
|
|
return -1;
|
|
|
|
}
|
2019-10-13 22:29:19 +00:00
|
|
|
|
|
|
|
if (IsItemSprite(pSprite)) {
|
|
|
|
if (pXSprite->respawn == 3 && gGameOptions.nGameType == 1) return 0;
|
|
|
|
else if (pXSprite->respawn == 2 || (pXSprite->respawn != 1 && gGameOptions.nItemSettings != 0)) {
|
|
|
|
switch (pSprite->type) {
|
|
|
|
case kItemShadowCloak:
|
|
|
|
case kItemTwoGuns:
|
|
|
|
case kItemReflectShots:
|
2019-10-20 14:50:47 +00:00
|
|
|
return gGameOptions.nSpecialRespawnTime;
|
2019-10-13 22:29:19 +00:00
|
|
|
case kItemDeathMask:
|
2019-10-20 14:50:47 +00:00
|
|
|
return gGameOptions.nSpecialRespawnTime<<1;
|
|
|
|
default:
|
|
|
|
return gGameOptions.nItemRespawnTime;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool actCheckRespawn(spritetype *pSprite)
|
|
|
|
{
|
|
|
|
int nSprite = pSprite->index;
|
|
|
|
int nXSprite = pSprite->extra;
|
|
|
|
if (nXSprite > 0)
|
|
|
|
{
|
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
int nRespawnTime = actGetRespawnTime(pSprite);
|
|
|
|
if (nRespawnTime < 0)
|
|
|
|
return 0;
|
|
|
|
pXSprite->respawnPending = 1;
|
|
|
|
if (pSprite->type >= kThingBase && pSprite->type < kThingMax)
|
|
|
|
{
|
|
|
|
pXSprite->respawnPending = 3;
|
2019-10-11 21:59:39 +00:00
|
|
|
if (pSprite->type == kThingTNTBarrel)
|
2019-09-19 22:42:45 +00:00
|
|
|
pSprite->cstat |= 32768;
|
|
|
|
}
|
|
|
|
if (nRespawnTime > 0)
|
|
|
|
{
|
|
|
|
if (pXSprite->respawnPending == 1)
|
2021-01-04 11:36:54 +00:00
|
|
|
nRespawnTime = MulScale(nRespawnTime, 0xa000, 16);
|
2019-09-19 22:42:45 +00:00
|
|
|
pSprite->owner = pSprite->statnum;
|
2019-10-07 19:29:52 +00:00
|
|
|
actPostSprite(pSprite->index, kStatRespawn);
|
2019-10-15 12:36:50 +00:00
|
|
|
pSprite->flags |= kHitagRespawn;
|
2019-10-07 12:42:06 +00:00
|
|
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax))
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
pSprite->cstat &= ~257;
|
|
|
|
pSprite->x = baseSprite[nSprite].x;
|
|
|
|
pSprite->y = baseSprite[nSprite].y;
|
|
|
|
pSprite->z = baseSprite[nSprite].z;
|
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, nRespawnTime, kCallbackRespawn);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool actCanSplatWall(int nWall)
|
|
|
|
{
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
2019-09-19 22:42:45 +00:00
|
|
|
walltype *pWall = &wall[nWall];
|
|
|
|
if (pWall->cstat & 16384)
|
|
|
|
return 0;
|
|
|
|
if (pWall->cstat & 32768)
|
|
|
|
return 0;
|
2019-06-26 14:02:01 +00:00
|
|
|
int nType = GetWallType(nWall);
|
2019-10-11 21:59:39 +00:00
|
|
|
if (nType >= kWallBase && nType < kWallMax)
|
2019-09-19 22:42:45 +00:00
|
|
|
return 0;
|
|
|
|
if (pWall->nextsector != -1)
|
|
|
|
{
|
|
|
|
sectortype *pSector = §or[pWall->nextsector];
|
2019-10-11 21:59:39 +00:00
|
|
|
if (pSector->type >= kSectorBase && pSector->type < kSectorMax)
|
2019-09-19 22:42:45 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, VECTOR_TYPE vectorType)
|
|
|
|
{
|
|
|
|
int nShooter = pShooter->index;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(vectorType >= 0 && vectorType < kVectorMax);
|
2020-02-11 22:15:25 +00:00
|
|
|
const VECTORDATA *pVectorData = &gVectorData[vectorType];
|
2019-09-19 22:42:45 +00:00
|
|
|
int nRange = pVectorData->maxDist;
|
|
|
|
int hit = VectorScan(pShooter, a2, a3, a4, a5, a6, nRange, 1);
|
|
|
|
if (hit == 3)
|
|
|
|
{
|
|
|
|
int nSprite = gHitInfo.hitsprite;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-10-19 19:11:39 +00:00
|
|
|
if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pShooter, pSprite)) return;
|
|
|
|
if (IsPlayerSprite(pSprite)) {
|
2019-09-19 22:42:45 +00:00
|
|
|
PLAYER *pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
2019-10-19 19:11:39 +00:00
|
|
|
if (powerupCheck(pPlayer, kPwUpReflectShots))
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
gHitInfo.hitsprite = nShooter;
|
|
|
|
gHitInfo.hitx = pShooter->x;
|
|
|
|
gHitInfo.hity = pShooter->y;
|
|
|
|
gHitInfo.hitz = pShooter->z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-01-04 11:57:26 +00:00
|
|
|
int x = gHitInfo.hitx-MulScale(a4, 16, 14);
|
|
|
|
int y = gHitInfo.hity-MulScale(a5, 16, 14);
|
|
|
|
int z = gHitInfo.hitz-MulScale(a6, 256, 14);
|
2019-09-19 22:42:45 +00:00
|
|
|
short nSector = gHitInfo.hitsect;
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t nSurf = kSurfNone;
|
2019-09-19 22:42:45 +00:00
|
|
|
if (nRange == 0 || approxDist(gHitInfo.hitx-pShooter->x, gHitInfo.hity-pShooter->y) < nRange)
|
|
|
|
{
|
|
|
|
switch (hit)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
int nSector = gHitInfo.hitsect;
|
|
|
|
if (sector[nSector].ceilingstat&1)
|
2019-08-16 04:32:17 +00:00
|
|
|
nSurf = kSurfNone;
|
2019-09-19 22:42:45 +00:00
|
|
|
else
|
|
|
|
nSurf = surfType[sector[nSector].ceilingpicnum];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
{
|
|
|
|
int nSector = gHitInfo.hitsect;
|
|
|
|
if (sector[nSector].floorstat&1)
|
2019-08-16 04:32:17 +00:00
|
|
|
nSurf = kSurfNone;
|
2019-09-19 22:42:45 +00:00
|
|
|
else
|
|
|
|
nSurf = surfType[sector[nSector].floorpicnum];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0:
|
|
|
|
{
|
|
|
|
int nWall = gHitInfo.hitwall;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
2019-09-19 22:42:45 +00:00
|
|
|
nSurf = surfType[wall[nWall].picnum];
|
|
|
|
if (actCanSplatWall(nWall))
|
|
|
|
{
|
2021-01-04 11:57:26 +00:00
|
|
|
int x = gHitInfo.hitx-MulScale(a4, 16, 14);
|
|
|
|
int y = gHitInfo.hity-MulScale(a5, 16, 14);
|
|
|
|
int z = gHitInfo.hitz-MulScale(a6, 256, 14);
|
2019-09-19 22:42:45 +00:00
|
|
|
int nSurf = surfType[wall[nWall].picnum];
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSurf < kSurfMax);
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pVectorData->surfHit[nSurf].fx1 >= 0)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
spritetype *pFX = gFX.fxSpawn(pVectorData->surfHit[nSurf].fx1, nSector, x, y, z, 0);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pFX)
|
|
|
|
{
|
|
|
|
pFX->ang = (GetWallAngle(nWall)+512)&2047;
|
|
|
|
pFX->cstat |= 16;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 4:
|
|
|
|
{
|
|
|
|
int nWall = gHitInfo.hitwall;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
2019-09-19 22:42:45 +00:00
|
|
|
nSurf = surfType[wall[nWall].overpicnum];
|
|
|
|
int nXWall = wall[nWall].extra;
|
|
|
|
if (nXWall > 0)
|
|
|
|
{
|
|
|
|
XWALL *pXWall = &xwall[nXWall];
|
|
|
|
if (pXWall->triggerVector)
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerWall(nWall, pXWall, kCmdWallImpact);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
{
|
|
|
|
int nSprite = gHitInfo.hitsprite;
|
|
|
|
nSurf = surfType[sprite[nSprite].picnum];
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2021-01-04 11:57:26 +00:00
|
|
|
x -= MulScale(a4, 112, 14);
|
|
|
|
y -= MulScale(a5, 112, 14);
|
|
|
|
z -= MulScale(a6, 112<<4, 14);
|
2019-09-19 22:42:45 +00:00
|
|
|
int shift = 4;
|
2021-06-16 19:13:04 +00:00
|
|
|
if (vectorType == kVectorTine && !IsPlayerSprite(pSprite))
|
2019-09-19 22:42:45 +00:00
|
|
|
shift = 3;
|
2019-10-21 19:46:41 +00:00
|
|
|
actDamageSprite(nShooter, pSprite, pVectorData->dmgType, pVectorData->dmg<<shift);
|
2019-09-19 22:42:45 +00:00
|
|
|
int nXSprite = pSprite->extra;
|
|
|
|
if (nXSprite > 0)
|
|
|
|
{
|
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
if (pXSprite->Vector)
|
2020-01-11 21:07:05 +00:00
|
|
|
trTriggerSprite(nSprite, pXSprite, kCmdSpriteImpact);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-07 19:29:52 +00:00
|
|
|
if (pSprite->statnum == kStatThing)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2019-10-12 20:45:46 +00:00
|
|
|
int t = thingInfo[pSprite->type-kThingBase].mass;
|
2019-10-21 19:46:41 +00:00
|
|
|
if (t > 0 && pVectorData->impulse)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-01-04 11:59:00 +00:00
|
|
|
int t2 = DivScale(pVectorData->impulse, t, 8);
|
2021-01-04 11:36:54 +00:00
|
|
|
xvel[nSprite] += MulScale(a4, t2, 16);
|
|
|
|
yvel[nSprite] += MulScale(a5, t2, 16);
|
|
|
|
zvel[nSprite] += MulScale(a6, t2, 16);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pVectorData->burnTime)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
if (!pXSprite->burnTime)
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackFXFlameLick);
|
2020-12-02 18:56:32 +00:00
|
|
|
actBurnSprite(sprite[nShooter].owner, pXSprite, pVectorData->burnTime);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-07 19:29:52 +00:00
|
|
|
if (pSprite->statnum == kStatDude)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-02-05 21:17:05 +00:00
|
|
|
int t = getDudeInfo(pSprite->type)->mass;
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2019-09-19 22:42:45 +00:00
|
|
|
if (IsDudeSprite(pSprite)) {
|
2019-09-30 07:18:01 +00:00
|
|
|
switch (pSprite->type) {
|
2019-10-11 21:59:39 +00:00
|
|
|
case kDudeModernCustom:
|
|
|
|
case kDudeModernCustomBurning:
|
2019-10-20 14:50:47 +00:00
|
|
|
t = getSpriteMassBySize(pSprite);
|
|
|
|
break;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2019-10-21 19:46:41 +00:00
|
|
|
if (t > 0 && pVectorData->impulse)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-01-04 11:59:00 +00:00
|
|
|
int t2 = DivScale(pVectorData->impulse, t, 8);
|
2021-01-04 11:36:54 +00:00
|
|
|
xvel[nSprite] += MulScale(a4, t2, 16);
|
|
|
|
yvel[nSprite] += MulScale(a5, t2, 16);
|
|
|
|
zvel[nSprite] += MulScale(a6, t2, 16);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pVectorData->burnTime)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
|
|
|
if (!pXSprite->burnTime)
|
2019-10-11 21:59:39 +00:00
|
|
|
evPost(nSprite, 3, 0, kCallbackFXFlameLick);
|
2020-12-02 18:56:32 +00:00
|
|
|
actBurnSprite(sprite[nShooter].owner, pXSprite, pVectorData->burnTime);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-21 19:46:41 +00:00
|
|
|
if (Chance(pVectorData->fxChance))
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
int t = gVectorData[19].maxDist;
|
|
|
|
a4 += Random3(4000);
|
|
|
|
a5 += Random3(4000);
|
|
|
|
a6 += Random3(4000);
|
|
|
|
if (HitScan(pSprite, gHitInfo.hitz, a4, a5, a6, CLIPMASK1, t) == 0)
|
|
|
|
{
|
|
|
|
if (approxDist(gHitInfo.hitx-pSprite->x, gHitInfo.hity-pSprite->y) <= t)
|
|
|
|
{
|
|
|
|
int nWall = gHitInfo.hitwall;
|
|
|
|
int nSector = gHitInfo.hitsect;
|
|
|
|
if (actCanSplatWall(nWall))
|
|
|
|
{
|
2021-01-04 11:57:26 +00:00
|
|
|
int x = gHitInfo.hitx - MulScale(a4, 16, 14);
|
|
|
|
int y = gHitInfo.hity - MulScale(a5, 16, 14);
|
|
|
|
int z = gHitInfo.hitz - MulScale(a6, 16<<4, 14);
|
2019-09-19 22:42:45 +00:00
|
|
|
int nSurf = surfType[wall[nWall].picnum];
|
2020-02-11 22:15:25 +00:00
|
|
|
const VECTORDATA *pVectorData = &gVectorData[19];
|
2019-10-21 19:46:41 +00:00
|
|
|
FX_ID t2 = pVectorData->surfHit[nSurf].fx2;
|
|
|
|
FX_ID t3 = pVectorData->surfHit[nSurf].fx3;
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pFX = NULL;
|
|
|
|
if (t2 > FX_NONE && (t3 == FX_NONE || Chance(0x4000)))
|
|
|
|
pFX = gFX.fxSpawn(t2, nSector, x, y, z, 0);
|
|
|
|
else if(t3 > FX_NONE)
|
|
|
|
pFX = gFX.fxSpawn(t3, nSector, x, y, z, 0);
|
|
|
|
if (pFX)
|
|
|
|
{
|
|
|
|
zvel[pFX->index] = 0x2222;
|
|
|
|
pFX->ang = (GetWallAngle(nWall)+512)&2047;
|
|
|
|
pFX->cstat |= 16;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-21 19:46:41 +00:00
|
|
|
for (int i = 0; i < pVectorData->bloodSplats; i++)
|
|
|
|
if (Chance(pVectorData->splatChance))
|
|
|
|
fxSpawnBlood(pSprite, pVectorData->dmg<<4);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// add impulse for sprites from physics list
|
2019-10-21 19:46:41 +00:00
|
|
|
if (gPhysSpritesCount > 0 && pVectorData->impulse) {
|
2021-07-19 21:15:26 +00:00
|
|
|
|
|
|
|
if (xspriRangeIsFine(pSprite->extra)) {
|
|
|
|
|
|
|
|
XSPRITE* pXSprite = &xsprite[pSprite->extra];
|
|
|
|
if (pXSprite->physAttr & kPhysDebrisVector) {
|
|
|
|
|
|
|
|
int impulse = DivScale(pVectorData->impulse, ClipLow(gSpriteMass[pSprite->extra].mass, 10), 6);
|
|
|
|
xvel[nSprite] += MulScale(a4, impulse, 16);
|
|
|
|
yvel[nSprite] += MulScale(a5, impulse, 16);
|
|
|
|
zvel[nSprite] += MulScale(a6, impulse, 16);
|
|
|
|
|
|
|
|
if (pVectorData->burnTime != 0) {
|
|
|
|
if (!xsprite[nXSprite].burnTime) evPost(nSprite, 3, 0, kCallbackFXFlameLick);
|
|
|
|
actBurnSprite(sprite[nShooter].owner, &xsprite[nXSprite], pVectorData->burnTime);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pSprite->type >= kThingBase && pSprite->type < kThingMax) {
|
|
|
|
pSprite->statnum = kStatThing; // temporary change statnum property
|
|
|
|
actDamageSprite(nShooter, pSprite, pVectorData->dmgType, pVectorData->dmg << 4);
|
|
|
|
pSprite->statnum = kStatDecoration; // return statnum property back
|
|
|
|
}
|
|
|
|
|
2019-09-21 11:02:17 +00:00
|
|
|
}
|
|
|
|
|
2021-07-19 21:15:26 +00:00
|
|
|
|
2019-09-21 11:02:17 +00:00
|
|
|
}
|
2021-07-19 21:15:26 +00:00
|
|
|
|
|
|
|
|
2019-09-21 11:02:17 +00:00
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(nSurf < kSurfMax);
|
2021-07-19 21:15:26 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
|
|
|
|
// let the patrol enemies hear surface hit sounds!
|
|
|
|
|
|
|
|
if (pVectorData->surfHit[nSurf].fx2 >= 0) {
|
|
|
|
|
|
|
|
spritetype* pFX2 = gFX.fxSpawn(pVectorData->surfHit[nSurf].fx2, nSector, x, y, z, 0);
|
|
|
|
if (pFX2 && gModernMap)
|
|
|
|
pFX2->owner = pShooter->index;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pVectorData->surfHit[nSurf].fx3 >= 0) {
|
|
|
|
|
|
|
|
spritetype* pFX3 = gFX.fxSpawn(pVectorData->surfHit[nSurf].fx3, nSector, x, y, z, 0);
|
|
|
|
if (pFX3 && gModernMap)
|
|
|
|
pFX3->owner = pShooter->index;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pVectorData->surfHit[nSurf].fx2 >= 0)
|
|
|
|
gFX.fxSpawn(pVectorData->surfHit[nSurf].fx2, nSector, x, y, z, 0);
|
|
|
|
if (pVectorData->surfHit[nSurf].fx3 >= 0)
|
|
|
|
gFX.fxSpawn(pVectorData->surfHit[nSurf].fx3, nSector, x, y, z, 0);
|
2021-07-19 21:15:26 +00:00
|
|
|
#endif
|
|
|
|
|
2019-10-21 19:46:41 +00:00
|
|
|
if (pVectorData->surfHit[nSurf].fxSnd >= 0)
|
|
|
|
sfxPlay3DSound(x, y, z, pVectorData->surfHit[nSurf].fxSnd, nSector);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-11-07 14:16:12 +00:00
|
|
|
void FireballSeqCallback(int, DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-07 14:16:12 +00:00
|
|
|
XSPRITE* pXSprite = &actor->x();
|
2019-09-19 22:42:45 +00:00
|
|
|
int nSprite = pXSprite->reference;
|
2020-11-07 14:16:12 +00:00
|
|
|
spritetype *pSprite = &actor->s();
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pFX = gFX.fxSpawn(FX_11, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
|
|
|
|
if (pFX)
|
|
|
|
{
|
|
|
|
int nFX = pFX->index;
|
2020-11-07 14:16:12 +00:00
|
|
|
xvel[nFX] = actor->xvel();
|
|
|
|
yvel[nFX] = actor->yvel();
|
|
|
|
zvel[nFX] = actor->zvel();
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-07 14:16:12 +00:00
|
|
|
|
|
|
|
void NapalmSeqCallback(int, DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-07 14:16:12 +00:00
|
|
|
XSPRITE* pXSprite = &actor->x();
|
|
|
|
spritetype *pSprite = &actor->s();
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pFX = gFX.fxSpawn(FX_12, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
|
|
|
|
if (pFX)
|
|
|
|
{
|
|
|
|
int nFX = pFX->index;
|
2020-11-07 14:16:12 +00:00
|
|
|
xvel[nFX] = actor->xvel();
|
|
|
|
yvel[nFX] = actor->yvel();
|
|
|
|
zvel[nFX] = actor->zvel();
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-07 14:16:12 +00:00
|
|
|
void sub_3888C(int, DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-07 14:16:12 +00:00
|
|
|
spritetype* pSprite = &actor->s();
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pFX = gFX.fxSpawn(FX_32, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
|
|
|
|
if (pFX)
|
|
|
|
{
|
|
|
|
int nFX = pFX->index;
|
2020-11-07 14:16:12 +00:00
|
|
|
xvel[nFX] = actor->xvel();
|
|
|
|
yvel[nFX] = actor->yvel();
|
|
|
|
zvel[nFX] = actor->zvel();
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-07 14:16:12 +00:00
|
|
|
void sub_38938(int, DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-07 14:16:12 +00:00
|
|
|
spritetype *pSprite = &actor->s();
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pFX = gFX.fxSpawn(FX_33, pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 0);
|
|
|
|
if (pFX)
|
|
|
|
{
|
|
|
|
int nFX = pFX->index;
|
2020-11-07 14:16:12 +00:00
|
|
|
xvel[nFX] = actor->xvel();
|
|
|
|
yvel[nFX] = actor->yvel();
|
|
|
|
zvel[nFX] = actor->zvel();
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-07 14:16:12 +00:00
|
|
|
void TreeToGibCallback(int, DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-07 14:16:12 +00:00
|
|
|
XSPRITE* pXSprite = &actor->x();
|
|
|
|
spritetype *pSprite = &actor->s();
|
2019-10-11 21:59:39 +00:00
|
|
|
pSprite->type = kThingObjectExplode;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->state = 1;
|
|
|
|
pXSprite->data1 = 15;
|
|
|
|
pXSprite->data2 = 0;
|
|
|
|
pXSprite->data3 = 0;
|
2019-10-21 19:46:41 +00:00
|
|
|
pXSprite->health = thingInfo[17].startHealth;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->data4 = 312;
|
|
|
|
pSprite->cstat |= 257;
|
|
|
|
}
|
|
|
|
|
2020-11-07 14:16:12 +00:00
|
|
|
void DudeToGibCallback1(int, DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-07 14:16:12 +00:00
|
|
|
XSPRITE* pXSprite = &actor->x();
|
|
|
|
spritetype* pSprite = &actor->s();
|
2019-10-11 21:59:39 +00:00
|
|
|
pSprite->type = kThingBloodChunks;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->data1 = 8;
|
|
|
|
pXSprite->data2 = 0;
|
|
|
|
pXSprite->data3 = 0;
|
2019-10-21 19:46:41 +00:00
|
|
|
pXSprite->health = thingInfo[26].startHealth;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->data4 = 319;
|
|
|
|
pXSprite->triggerOnce = 0;
|
|
|
|
pXSprite->isTriggered = 0;
|
|
|
|
pXSprite->locked = 0;
|
2021-02-18 10:46:36 +00:00
|
|
|
pXSprite->targetX = PlayClock;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->state = 1;
|
|
|
|
}
|
|
|
|
|
2020-11-07 14:16:12 +00:00
|
|
|
void DudeToGibCallback2(int, DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-07 14:16:12 +00:00
|
|
|
XSPRITE* pXSprite = &actor->x();
|
|
|
|
spritetype* pSprite = &actor->s();
|
2019-10-11 21:59:39 +00:00
|
|
|
pSprite->type = kThingBloodChunks;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->data1 = 3;
|
|
|
|
pXSprite->data2 = 0;
|
|
|
|
pXSprite->data3 = 0;
|
2019-10-21 19:46:41 +00:00
|
|
|
pXSprite->health = thingInfo[26].startHealth;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->data4 = 319;
|
|
|
|
pXSprite->triggerOnce = 0;
|
|
|
|
pXSprite->isTriggered = 0;
|
|
|
|
pXSprite->locked = 0;
|
2021-02-18 10:46:36 +00:00
|
|
|
pXSprite->targetX = PlayClock;
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->state = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void actPostSprite(int nSprite, int nStatus)
|
|
|
|
{
|
|
|
|
int n;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(gPostCount < kMaxSprites);
|
|
|
|
assert(nSprite < kMaxSprites && sprite[nSprite].statnum < kMaxStatus);
|
|
|
|
assert(nStatus >= 0 && nStatus <= kStatFree);
|
2019-09-30 07:18:01 +00:00
|
|
|
if (sprite[nSprite].flags&32)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
|
|
|
for (n = 0; n < gPostCount; n++)
|
2020-11-21 20:31:50 +00:00
|
|
|
if (gPost[n].sprite == nSprite)
|
2019-09-19 22:42:45 +00:00
|
|
|
break;
|
2020-10-11 10:38:17 +00:00
|
|
|
assert(n < gPostCount);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
n = gPostCount;
|
2019-09-30 07:18:01 +00:00
|
|
|
sprite[nSprite].flags |= 32;
|
2019-09-19 22:42:45 +00:00
|
|
|
gPostCount++;
|
|
|
|
}
|
2020-11-21 20:31:50 +00:00
|
|
|
gPost[n].sprite = nSprite;
|
|
|
|
gPost[n].status = nStatus;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 21:33:14 +00:00
|
|
|
void actPostSprite(DBloodActor* actor, int status)
|
|
|
|
{
|
|
|
|
actPostSprite(actor->s().index, status);
|
|
|
|
}
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
void actPostProcess(void)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < gPostCount; i++)
|
|
|
|
{
|
|
|
|
POSTPONE *pPost = &gPost[i];
|
2020-11-21 20:31:50 +00:00
|
|
|
int nSprite = pPost->sprite;
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *pSprite = &sprite[nSprite];
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags &= ~32;
|
2020-11-21 20:31:50 +00:00
|
|
|
int nStatus = pPost->status;
|
2019-09-19 22:42:45 +00:00
|
|
|
if (nStatus == kStatFree)
|
|
|
|
{
|
|
|
|
evKill(nSprite, 3);
|
|
|
|
if (sprite[nSprite].extra > 0)
|
|
|
|
seqKill(3, sprite[nSprite].extra);
|
|
|
|
DeleteSprite(nSprite);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ChangeSpriteStat(nSprite, nStatus);
|
|
|
|
}
|
|
|
|
gPostCount = 0;
|
|
|
|
}
|
|
|
|
|
2020-11-06 21:48:22 +00:00
|
|
|
void MakeSplash(DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-06 21:48:22 +00:00
|
|
|
auto pXSprite = &actor->x();
|
|
|
|
auto pSprite = &actor->s();
|
2019-09-30 07:18:01 +00:00
|
|
|
pSprite->flags &= ~2;
|
2019-09-19 22:42:45 +00:00
|
|
|
int nXSprite = pSprite->extra;
|
2019-10-11 21:59:39 +00:00
|
|
|
pSprite->z -= 4 << 8;
|
2019-09-19 22:42:45 +00:00
|
|
|
int nSurface = tileGetSurfType(gSpriteHit[nXSprite].florhit);
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kThingDripWater:
|
|
|
|
switch (nSurface) {
|
|
|
|
case kSurfWater:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(6, 3, nXSprite, -1);
|
|
|
|
sfxPlay3DSound(pSprite, 356, -1, 0);
|
2019-10-11 21:59:39 +00:00
|
|
|
break;
|
|
|
|
default:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(7, 3, nXSprite, -1);
|
|
|
|
sfxPlay3DSound(pSprite, 354, -1, 0);
|
2019-10-11 21:59:39 +00:00
|
|
|
break;
|
2019-10-20 14:50:47 +00:00
|
|
|
}
|
|
|
|
break;
|
2019-10-11 21:59:39 +00:00
|
|
|
case kThingDripBlood:
|
2019-10-20 14:50:47 +00:00
|
|
|
seqSpawn(8, 3, nXSprite, -1);
|
|
|
|
sfxPlay3DSound(pSprite, 354, -1, 0);
|
|
|
|
break;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-21 20:31:50 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-11-21 20:31:50 +00:00
|
|
|
FSerializer& Serialize(FSerializer& arc, const char* keyname, POSTPONE& w, POSTPONE* def)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-21 20:31:50 +00:00
|
|
|
if (arc.BeginObject(keyname))
|
|
|
|
{
|
|
|
|
arc("sprite", w.sprite)
|
|
|
|
("status", w.status)
|
|
|
|
.EndObject();
|
|
|
|
}
|
|
|
|
return arc;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-11-21 22:40:33 +00:00
|
|
|
FSerializer& Serialize(FSerializer& arc, const char* keyname, SPRITEHIT& w, SPRITEHIT* def)
|
|
|
|
{
|
2020-11-22 11:48:01 +00:00
|
|
|
int empty = 0;
|
|
|
|
if (arc.isReading()) w = {};
|
2020-11-21 22:40:33 +00:00
|
|
|
if (arc.BeginObject(keyname))
|
|
|
|
{
|
2020-11-22 11:48:01 +00:00
|
|
|
arc("hit", w.hit, &empty)
|
|
|
|
("ceilhit", w.ceilhit, &empty)
|
|
|
|
("florhit", w.florhit, &empty)
|
2020-11-21 22:40:33 +00:00
|
|
|
.EndObject();
|
|
|
|
}
|
|
|
|
return arc;
|
|
|
|
}
|
|
|
|
|
2020-11-21 20:31:50 +00:00
|
|
|
void SerializeActor(FSerializer& arc)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-11-21 20:31:50 +00:00
|
|
|
if (arc.BeginObject("actor"))
|
|
|
|
{
|
2021-06-16 19:13:04 +00:00
|
|
|
arc("maxdist20", gVectorData[kVectorTchernobogBurn].maxDist) // The code messes around with this field so better save it.
|
2020-11-21 22:40:33 +00:00
|
|
|
.SparseArray("spritehit", gSpriteHit, kMaxSprites, activeXSprites)
|
2020-11-21 20:31:50 +00:00
|
|
|
("postcount", gPostCount)
|
|
|
|
.Array("post", gPost, gPostCount)
|
|
|
|
.EndObject();
|
|
|
|
|
|
|
|
if (arc.isReading() && gGameOptions.nMonsterSettings != 0)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < kDudeMax - kDudeBase; i++)
|
|
|
|
for (int j = 0; j < 7; j++)
|
2020-12-02 23:30:19 +00:00
|
|
|
dudeInfo[i].damageVal[j] = MulScale(DudeDifficulty[gGameOptions.nDifficulty], dudeInfo[i].startDamage[j], 8);
|
2020-11-21 20:31:50 +00:00
|
|
|
}
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 22:39:38 +00:00
|
|
|
spritetype* actDropObject(spritetype* pSprite, int nType)
|
|
|
|
{
|
|
|
|
auto act = actDropObject(&bloodActors[pSprite->index], nType);
|
|
|
|
return act ? &act->s() : nullptr;
|
|
|
|
}
|
|
|
|
|
2020-12-02 23:00:03 +00:00
|
|
|
bool actHealDude(XSPRITE* pXDude, int a2, int a3)
|
|
|
|
{
|
|
|
|
return actHealDude(&bloodActors[pXDude->reference], a2, a3);
|
|
|
|
}
|
|
|
|
|
2020-12-02 23:20:14 +00:00
|
|
|
void actKillDude(int a1, spritetype* pSprite, DAMAGE_TYPE a3, int a4)
|
|
|
|
{
|
|
|
|
actKillDude(&bloodActors[a1], &bloodActors[pSprite->index], a3, a4);
|
|
|
|
}
|
|
|
|
|
2020-12-02 23:30:19 +00:00
|
|
|
int actDamageSprite(int nSource, spritetype* pSprite, DAMAGE_TYPE damageType, int damage)
|
|
|
|
{
|
|
|
|
return actDamageSprite(nSource == -1 ? nullptr : &bloodActors[nSource], &bloodActors[pSprite->index], damageType, damage);
|
|
|
|
}
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
END_BLD_NS
|