2008-01-27 11:25:03 +00:00
|
|
|
/*
|
|
|
|
** thingdef.cpp
|
|
|
|
**
|
|
|
|
** Code pointers for Actor definitions
|
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
** Copyright 2002-2006 Christoph Oelckers
|
|
|
|
** Copyright 2004-2006 Randy Heit
|
|
|
|
** All rights reserved.
|
|
|
|
**
|
|
|
|
** Redistribution and use in source and binary forms, with or without
|
|
|
|
** modification, are permitted provided that the following conditions
|
|
|
|
** are met:
|
|
|
|
**
|
|
|
|
** 1. Redistributions of source code must retain the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer.
|
|
|
|
** 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer in the
|
|
|
|
** documentation and/or other materials provided with the distribution.
|
|
|
|
** 3. The name of the author may not be used to endorse or promote products
|
|
|
|
** derived from this software without specific prior written permission.
|
|
|
|
** 4. When not used as part of ZDoom or a ZDoom derivative, this code will be
|
|
|
|
** covered by the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation; either version 2 of the License, or (at
|
|
|
|
** your option) any later version.
|
|
|
|
**
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "gi.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
#include "g_level.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
#include "actor.h"
|
|
|
|
#include "info.h"
|
|
|
|
#include "sc_man.h"
|
|
|
|
#include "tarray.h"
|
|
|
|
#include "w_wad.h"
|
|
|
|
#include "templates.h"
|
|
|
|
#include "r_defs.h"
|
|
|
|
#include "r_draw.h"
|
|
|
|
#include "a_pickups.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "cmdlib.h"
|
|
|
|
#include "p_lnspec.h"
|
|
|
|
#include "p_enemy.h"
|
|
|
|
#include "a_action.h"
|
|
|
|
#include "decallib.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "i_system.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "c_console.h"
|
|
|
|
#include "doomerrors.h"
|
|
|
|
#include "a_sharedglobal.h"
|
|
|
|
#include "thingdef/thingdef.h"
|
|
|
|
#include "v_video.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
#include "v_font.h"
|
|
|
|
#include "doomstat.h"
|
|
|
|
#include "v_palette.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
static FRandom pr_camissile ("CustomActorfire");
|
|
|
|
static FRandom pr_camelee ("CustomMelee");
|
|
|
|
static FRandom pr_cabullet ("CustomBullet");
|
|
|
|
static FRandom pr_cajump ("CustomJump");
|
|
|
|
static FRandom pr_cwbullet ("CustomWpBullet");
|
|
|
|
static FRandom pr_cwjump ("CustomWpJump");
|
|
|
|
static FRandom pr_cwpunch ("CustomWpPunch");
|
|
|
|
static FRandom pr_grenade ("ThrowGrenade");
|
|
|
|
static FRandom pr_crailgun ("CustomRailgun");
|
|
|
|
static FRandom pr_spawndebris ("SpawnDebris");
|
|
|
|
static FRandom pr_spawnitemex ("SpawnItemEx");
|
|
|
|
static FRandom pr_burst ("Burst");
|
2009-06-06 15:24:18 +00:00
|
|
|
static FRandom pr_monsterrefire ("MonsterRefire");
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// ACustomInventory :: CallStateChain
|
|
|
|
//
|
|
|
|
// Executes the code pointers in a chain of states
|
|
|
|
// until there is no next state
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
bool ACustomInventory::CallStateChain (AActor *actor, FState * State)
|
|
|
|
{
|
|
|
|
StateCallData StateCall;
|
|
|
|
bool result = false;
|
|
|
|
int counter = 0;
|
|
|
|
|
|
|
|
StateCall.Item = this;
|
|
|
|
while (State != NULL)
|
|
|
|
{
|
|
|
|
// Assume success. The code pointer will set this to false if necessary
|
2008-08-12 23:22:08 +00:00
|
|
|
StateCall.State = State;
|
|
|
|
StateCall.Result = true;
|
2009-01-18 09:42:37 +00:00
|
|
|
if (State->CallAction(actor, this, &StateCall))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// collect all the results. Even one successful call signifies overall success.
|
|
|
|
result |= StateCall.Result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Since there are no delays it is a good idea to check for infinite loops here!
|
|
|
|
counter++;
|
|
|
|
if (counter >= 10000) break;
|
|
|
|
|
|
|
|
if (StateCall.State == State)
|
|
|
|
{
|
|
|
|
// Abort immediately if the state jumps to itself!
|
|
|
|
if (State == State->GetNextState())
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If both variables are still the same there was no jump
|
|
|
|
// so we must advance to the next state.
|
|
|
|
State = State->GetNextState();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
State = StateCall.State;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Simple flag changers
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_SetSolid)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
self->flags |= MF_SOLID;
|
|
|
|
}
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_UnsetSolid)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
self->flags &= ~MF_SOLID;
|
|
|
|
}
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_SetFloat)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
self->flags |= MF_FLOAT;
|
|
|
|
}
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_UnsetFloat)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
self->flags &= ~(MF_FLOAT|MF_INFLOAT);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Customizable attack functions which use actor parameters.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
static void DoAttack (AActor *self, bool domelee, bool domissile,
|
|
|
|
int MeleeDamage, FSoundID MeleeSound, const PClass *MissileType,fixed_t MissileHeight)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (self->target == NULL) return;
|
|
|
|
|
|
|
|
A_FaceTarget (self);
|
|
|
|
if (domelee && MeleeDamage>0 && self->CheckMeleeRange ())
|
|
|
|
{
|
|
|
|
int damage = pr_camelee.HitDice(MeleeDamage);
|
2008-06-15 17:17:31 +00:00
|
|
|
if (MeleeSound) S_Sound (self, CHAN_WEAPON, MeleeSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
|
|
|
P_TraceBleed (damage, self->target, self);
|
|
|
|
}
|
2008-08-12 23:22:08 +00:00
|
|
|
else if (domissile && MissileType != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-12 23:22:08 +00:00
|
|
|
// This seemingly senseless code is needed for proper aiming.
|
|
|
|
self->z+=MissileHeight-32*FRACUNIT;
|
|
|
|
AActor * missile = P_SpawnMissileXYZ (self->x, self->y, self->z + 32*FRACUNIT, self, self->target, MissileType, false);
|
|
|
|
self->z-=MissileHeight-32*FRACUNIT;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
if (missile)
|
|
|
|
{
|
|
|
|
// automatic handling of seeker missiles
|
|
|
|
if (missile->flags2&MF2_SEEKERMISSILE)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-12 23:22:08 +00:00
|
|
|
missile->tracer=self->target;
|
|
|
|
}
|
|
|
|
// set the health value so that the missile works properly
|
|
|
|
if (missile->flags4&MF4_SPECTRAL)
|
|
|
|
{
|
|
|
|
missile->health=-2;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-08-12 23:22:08 +00:00
|
|
|
P_CheckMissileSpawn(missile);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_MeleeAttack)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-12 23:22:08 +00:00
|
|
|
int MeleeDamage = self->GetClass()->Meta.GetMetaInt (ACMETA_MeleeDamage, 0);
|
|
|
|
FSoundID MeleeSound = self->GetClass()->Meta.GetMetaInt (ACMETA_MeleeSound, 0);
|
|
|
|
DoAttack(self, true, false, MeleeDamage, MeleeSound, NULL, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_MissileAttack)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-12 23:22:08 +00:00
|
|
|
const PClass *MissileType=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None));
|
|
|
|
fixed_t MissileHeight= self->GetClass()->Meta.GetMetaFixed (ACMETA_MissileHeight, 32*FRACUNIT);
|
|
|
|
DoAttack(self, false, true, 0, 0, MissileType, MissileHeight);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_ComboAttack)
|
|
|
|
{
|
2008-08-12 23:22:08 +00:00
|
|
|
int MeleeDamage = self->GetClass()->Meta.GetMetaInt (ACMETA_MeleeDamage, 0);
|
|
|
|
FSoundID MeleeSound = self->GetClass()->Meta.GetMetaInt (ACMETA_MeleeSound, 0);
|
|
|
|
const PClass *MissileType=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None));
|
|
|
|
fixed_t MissileHeight= self->GetClass()->Meta.GetMetaFixed (ACMETA_MissileHeight, 32*FRACUNIT);
|
|
|
|
DoAttack(self, true, true, MeleeDamage, MeleeSound, MissileType, MissileHeight);
|
2008-08-12 08:00:28 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BasicAttack)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(4);
|
|
|
|
ACTION_PARAM_INT(MeleeDamage, 0);
|
|
|
|
ACTION_PARAM_SOUND(MeleeSound, 1);
|
|
|
|
ACTION_PARAM_CLASS(MissileType, 2);
|
|
|
|
ACTION_PARAM_FIXED(MissileHeight, 3);
|
2008-08-12 23:22:08 +00:00
|
|
|
|
2008-10-25 21:48:56 +00:00
|
|
|
if (MissileType == NULL) return;
|
2008-08-14 11:28:02 +00:00
|
|
|
DoAttack(self, true, true, MeleeDamage, MeleeSound, MissileType, MissileHeight);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2009-04-19 06:46:53 +00:00
|
|
|
// Custom sound functions.
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlaySound)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-04-19 06:46:53 +00:00
|
|
|
ACTION_PARAM_START(5);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_SOUND(soundid, 0);
|
2009-04-19 06:46:53 +00:00
|
|
|
ACTION_PARAM_INT(channel, 1);
|
|
|
|
ACTION_PARAM_FLOAT(volume, 2);
|
|
|
|
ACTION_PARAM_BOOL(looping, 3);
|
|
|
|
ACTION_PARAM_FLOAT(attenuation, 4);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-04-19 06:46:53 +00:00
|
|
|
if (!looping)
|
|
|
|
{
|
|
|
|
S_Sound (self, channel, soundid, volume, attenuation);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!S_IsActorPlayingSomething (self, channel&7, soundid))
|
|
|
|
{
|
|
|
|
S_Sound (self, channel | CHAN_LOOP, soundid, volume, attenuation);
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2009-04-19 06:46:53 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StopSound)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
2009-04-19 06:46:53 +00:00
|
|
|
ACTION_PARAM_INT(slot, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-04-19 06:46:53 +00:00
|
|
|
S_StopSound(self, slot);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2009-04-19 06:46:53 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// These come from a time when DECORATE constants did not exist yet and
|
|
|
|
// the sound interface was less flexible. As a result the parameters are
|
|
|
|
// not optimal and these functions have been deprecated in favor of extending
|
|
|
|
// A_PlaySound and A_StopSound.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlayWeaponSound)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-04-19 06:46:53 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_SOUND(soundid, 0);
|
|
|
|
|
|
|
|
S_Sound (self, CHAN_WEAPON, soundid, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlaySoundEx)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(4);
|
|
|
|
ACTION_PARAM_SOUND(soundid, 0);
|
|
|
|
ACTION_PARAM_NAME(channel, 1);
|
|
|
|
ACTION_PARAM_BOOL(looping, 2);
|
|
|
|
ACTION_PARAM_INT(attenuation_raw, 3);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
Update to ZDoom r1585:
- Added ACS GetChar function.
- Added Gez's submission for polyobjects being able to crush corpses but made
it an explicit MAPINFO option only.
- Changed APlayerPawn::DamageFade to a PalEntry from 3 floats.
- Removed #pragma warnings from cmdlib.h and fixed the places where they were
still triggered.
These #pragmas were responsible for >90% of the GCC warnings that were not
listed in VC++.
- Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the
parameter handling of the sound functions for attenuation was changed.
Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values.
Also added the option to specify attenuation with direct values in addition
to the predefined names.
- fixed a few Heretic actors:
* The pod generator's attacksound was wrong
* The teleglitter generators need different flags if they are supposed to work
with z-aware spawning of the glitter.
* The knight's axes need the THRUGHOST flag.
- Fixed non-POD passing in G_BuildSaveName() and other things GCC warned
about.
- Added support for imploded zips.
- Fixed: Some missile spawning functions ignored the FastSpeed setting.
- Fixed: P_CheckSwitchRange tried to access a line's backsector without
checking if it is valid.
- Fixed: Fast projectile could not be frozen by the Time freezer.
- Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight,
SetActivator, SetActivatorToTarget.
- Added Species property for actors and separated Hexen's Demon1 and Demon2
into different species.
- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC.
- Fixed: The short lump name for embedded files must be cleared so that they
are not found by a normal lump search.
- Added AProp_Notarget actor property.
- Fixed: TraceBleed was missing a NULL pointer check,
- Fixed: P_RandomChaseDir could crash for friendly monsters that belong to
a player which left the game.
- Changed A_PodGrow so that it plays the generator's attack sound instead of
"misc/podgrow".
- Added transference of a select few flags from PowerProtection to its owner.
- Added actor type parameters to A_PodPain() and A_MakePod().
- The savegame path is now passed through NicePath(), since it's user-
specifiable.
- Added save_dir cvar. When non-empty, it controls where savegames go.
- SBARINFO update:
* Added the ability to center things with fullscreenoffsets enabled. Due
to some limitations the syntax is [-]<integer> [+ center].
* Fixed: the translucent flag on drawinventorybar didn't work quite right.
* Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The
fullscreen inventory bar wasn't scaled correctly.
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
- Added more compatibility settings, submitted by Gez.
- Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be
the same as 'next endgame4'.
- GCC nitpick fix: Classes being used as template parameters may not be
defined locally in a function. Fixed FWadFile::SetNamespace for that.
- Improved error reporting for incorrect textures in maps.
- Fixed: When music was stopped this was not set in the global music state.
- Fixed: Friendly monsters did not target enemy players in deathmatch.
- Fixed: Completely empty patches (8 0-bytes) could not be handled by the
texture manager. They now get assigned a new FEmptyTexture object
that is just a 1x1 pixel transparent texture.
- Fixed: Multiple namespace markers of the same type were no longer detected.
- Fixed sprite renaming.
- Maps defined with Hexen-style MAPINFOs now run their scripts in the proper
order.
- Fixed: FWadCollection::CheckNumForName() read the lump each iteration before
checking for the end marker. On 32-bit systems, this is -1, but on 64-bit
systems, it is a very large integer that is highly unlikely to be in mapped
memory.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
|
|
|
float attenuation;
|
2008-01-27 11:25:03 +00:00
|
|
|
switch (attenuation_raw)
|
|
|
|
{
|
2008-03-21 21:15:56 +00:00
|
|
|
case -1: attenuation = ATTN_STATIC; break; // drop off rapidly
|
2008-01-27 11:25:03 +00:00
|
|
|
default:
|
2008-03-21 21:15:56 +00:00
|
|
|
case 0: attenuation = ATTN_NORM; break; // normal
|
|
|
|
case 1:
|
|
|
|
case 2: attenuation = ATTN_NONE; break; // full volume
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (channel < NAME_Auto || channel > NAME_SoundSlot7)
|
|
|
|
{
|
|
|
|
channel = NAME_Auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!looping)
|
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
S_Sound (self, int(channel) - NAME_Auto, soundid, 1, attenuation);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
if (!S_IsActorPlayingSomething (self, int(channel) - NAME_Auto, soundid))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
S_Sound (self, (int(channel) - NAME_Auto) | CHAN_LOOP, soundid, 1, attenuation);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StopSoundEx)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_NAME(channel, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (channel > NAME_Auto && channel <= NAME_SoundSlot7)
|
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
S_StopSound (self, int(channel) - NAME_Auto);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Generic seeker missile function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-10-10 11:37:36 +00:00
|
|
|
static FRandom pr_seekermissile ("SeekerMissile");
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
SMF_LOOK = 1,
|
|
|
|
};
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SeekerMissile)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-10-10 11:37:36 +00:00
|
|
|
ACTION_PARAM_START(5);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_INT(ang1, 0);
|
|
|
|
ACTION_PARAM_INT(ang2, 1);
|
2009-10-10 11:37:36 +00:00
|
|
|
ACTION_PARAM_INT(flags, 2);
|
|
|
|
ACTION_PARAM_INT(chance, 3);
|
|
|
|
ACTION_PARAM_INT(distance, 4);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-10-10 11:37:36 +00:00
|
|
|
if ((flags & SMF_LOOK) && (self->tracer == 0) && (pr_seekermissile()<chance))
|
|
|
|
{
|
|
|
|
self->tracer = P_RoughMonsterSearch (self, distance);
|
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
P_SeekerMissile(self, clamp<int>(ang1, 0, 90) * ANGLE_1, clamp<int>(ang2, 0, 90) * ANGLE_1);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Hitscan attack with a customizable amount of bullets (specified in damage)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-14 11:28:02 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_BulletAttack)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int bangle;
|
|
|
|
int slope;
|
|
|
|
|
|
|
|
if (!self->target) return;
|
|
|
|
|
|
|
|
A_FaceTarget (self);
|
|
|
|
bangle = self->angle;
|
|
|
|
|
|
|
|
slope = P_AimLineAttack (self, bangle, MISSILERANGE);
|
|
|
|
|
2008-06-15 17:17:31 +00:00
|
|
|
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
for (i = self->GetMissileDamage (0, 1); i > 0; --i)
|
|
|
|
{
|
|
|
|
int angle = bangle + (pr_cabullet.Random2() << 20);
|
|
|
|
int damage = ((pr_cabullet()%5)+1)*3;
|
|
|
|
P_LineAttack(self, angle, MISSILERANGE, slope, damage,
|
|
|
|
NAME_None, NAME_BulletPuff);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Do the state jump
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-10-25 21:48:56 +00:00
|
|
|
static void DoJump(AActor * self, FState * CallingState, FState *jumpto, StateCallData *statecall)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-10-25 21:48:56 +00:00
|
|
|
if (jumpto == NULL) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (statecall != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
statecall->State = jumpto;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (self->player != NULL && CallingState == self->player->psprites[ps_weapon].state)
|
|
|
|
{
|
|
|
|
P_SetPsprite(self->player, ps_weapon, jumpto);
|
|
|
|
}
|
|
|
|
else if (self->player != NULL && CallingState == self->player->psprites[ps_flash].state)
|
|
|
|
{
|
|
|
|
P_SetPsprite(self->player, ps_flash, jumpto);
|
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
else if (CallingState == self->state)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
self->SetState (jumpto);
|
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// something went very wrong. This should never happen.
|
|
|
|
assert(false);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
|
|
|
|
// This is just to avoid having to directly reference the internally defined
|
|
|
|
// CallingState and statecall parameters in the code below.
|
|
|
|
#define ACTION_JUMP(offset) DoJump(self, CallingState, offset, statecall)
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// State jump function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Jump)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(3);
|
2008-10-25 21:48:56 +00:00
|
|
|
ACTION_PARAM_INT(count, 0);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_INT(maxchance, 1);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (count >= 2 && (maxchance >= 256 || pr_cajump() < maxchance))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-10-25 21:48:56 +00:00
|
|
|
int jumps = 2 + (count == 2? 0 : (pr_cajump() % (count - 1)));
|
|
|
|
ACTION_PARAM_STATE(jumpto, jumps);
|
|
|
|
ACTION_JUMP(jumpto);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// State jump function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHealthLower)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_INT(health, 0);
|
|
|
|
ACTION_PARAM_STATE(jump, 1);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (self->health < health) ACTION_JUMP(jump);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// State jump function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfCloser)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_FIXED(dist, 0);
|
|
|
|
ACTION_PARAM_STATE(jump, 1);
|
|
|
|
|
|
|
|
AActor *target;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!self->player)
|
|
|
|
{
|
|
|
|
target=self->target;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Does the player aim at something that can be shot?
|
Update to ZDoom r905:
- Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
concern here and the worst that can happen is that the wrong actor is spawned.
This was a constant hassle when testing with WADs that contain duplicate resources.
- Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.
- Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
of the new wave data uninitialized.
- Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
tables.cpp. (And interestingly, VC++ automatically renamed the object file,
so I wasn't aware of the problem with GCC.)
- Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config and sound patches from Zips.
I put this on hold though after finding out that the sound quality
isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
can be loaded
- Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
event which only has 1 in 127 chance of being for a note that's playing
on that channel. Then I decided it would probably be a good idea to reset
all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
(copied from the OPL player) improved its sound dramatically, so apparently
Timidity has issues with short stream buffers. It's now at 1/2 sec in
length. However, there seems to be something weird going on with
corazonazul_ff6boss.mid near the beginning where it stops and immediately
restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
oscilloscopes and spectrums.
- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.)
- Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :(
- Changed the progdir global variable into an FString.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
|
|
|
P_BulletSlope(self, &target);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// No target - no jump
|
|
|
|
if (target==NULL) return;
|
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (P_AproxDistance(self->x-target->x, self->y-target->y) < dist &&
|
2008-03-19 11:19:03 +00:00
|
|
|
( (self->z > target->z && self->z - (target->z + target->height) < dist) ||
|
|
|
|
(self->z <=target->z && target->z - (self->z + self->height) < dist)
|
|
|
|
)
|
|
|
|
)
|
2008-08-14 11:28:02 +00:00
|
|
|
{
|
|
|
|
ACTION_JUMP(jump);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// State jump function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-10-25 21:48:56 +00:00
|
|
|
void DoJumpIfInventory(AActor * owner, DECLARE_PARAMINFO)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(3);
|
|
|
|
ACTION_PARAM_CLASS(Type, 0);
|
|
|
|
ACTION_PARAM_INT(ItemAmount, 1);
|
|
|
|
ACTION_PARAM_STATE(JumpOffset, 2);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!Type || owner == NULL) return;
|
|
|
|
|
2009-09-02 06:19:49 +00:00
|
|
|
AInventory *Item = owner->FindInventory(Type);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (Item)
|
|
|
|
{
|
2009-09-02 06:19:49 +00:00
|
|
|
if (ItemAmount > 0)
|
|
|
|
{
|
|
|
|
if (Item->Amount >= ItemAmount)
|
|
|
|
ACTION_JUMP(JumpOffset);
|
|
|
|
}
|
|
|
|
else if (Item->Amount >= Item->MaxAmount)
|
|
|
|
{
|
|
|
|
ACTION_JUMP(JumpOffset);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInventory)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-10-25 21:48:56 +00:00
|
|
|
DoJumpIfInventory(self, PUSH_PARAMINFO);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetInventory)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-10-25 21:48:56 +00:00
|
|
|
DoJumpIfInventory(self->target, PUSH_PARAMINFO);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2009-06-06 15:24:18 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// State jump function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfArmorType)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(3);
|
|
|
|
ACTION_PARAM_NAME(Type, 0);
|
|
|
|
ACTION_PARAM_STATE(JumpOffset, 1);
|
2009-06-14 18:05:00 +00:00
|
|
|
ACTION_PARAM_INT(amount, 2);
|
2009-06-06 15:24:18 +00:00
|
|
|
|
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
|
|
|
|
|
|
|
ABasicArmor * armor = (ABasicArmor *) self->FindInventory(NAME_BasicArmor);
|
|
|
|
|
2009-06-14 18:05:00 +00:00
|
|
|
if (armor && armor->ArmorType == Type && armor->Amount >= amount)
|
2009-06-06 15:24:18 +00:00
|
|
|
ACTION_JUMP(JumpOffset);
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Parameterized version of A_Explode
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Explode)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-09-15 06:19:39 +00:00
|
|
|
ACTION_PARAM_START(7);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_INT(damage, 0);
|
2008-08-22 07:36:50 +00:00
|
|
|
ACTION_PARAM_INT(distance, 1);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_BOOL(hurtSource, 2);
|
|
|
|
ACTION_PARAM_BOOL(alert, 3);
|
2009-06-27 21:02:41 +00:00
|
|
|
ACTION_PARAM_INT(fulldmgdistance, 4);
|
2009-09-15 06:19:39 +00:00
|
|
|
ACTION_PARAM_INT(nails, 5);
|
|
|
|
ACTION_PARAM_INT(naildamage, 6);
|
2008-08-12 23:22:08 +00:00
|
|
|
|
|
|
|
if (damage < 0) // get parameters from metadata
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
damage = self->GetClass()->Meta.GetMetaInt (ACMETA_ExplosionDamage, 128);
|
|
|
|
distance = self->GetClass()->Meta.GetMetaInt (ACMETA_ExplosionRadius, damage);
|
|
|
|
hurtSource = !self->GetClass()->Meta.GetMetaInt (ACMETA_DontHurtShooter);
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
alert = false;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-08-12 23:22:08 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (distance <= 0) distance = damage;
|
|
|
|
}
|
2009-09-15 06:19:39 +00:00
|
|
|
// NailBomb effect, from SMMU but not from its source code: instead it was implemented and
|
|
|
|
// generalized from the documentation at http://www.doomworld.com/eternity/engine/codeptrs.html
|
|
|
|
|
|
|
|
if (nails)
|
|
|
|
{
|
|
|
|
angle_t ang;
|
|
|
|
for (int i = 0; i < nails; i++)
|
|
|
|
{
|
|
|
|
ang = i*(ANGLE_MAX/nails);
|
|
|
|
// Comparing the results of a test wad with Eternity, it seems A_NailBomb does not aim
|
|
|
|
P_LineAttack (self, ang, MISSILERANGE, 0,
|
|
|
|
//P_AimLineAttack (self, ang, MISSILERANGE),
|
|
|
|
naildamage, NAME_None, NAME_BulletPuff);
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-06-27 21:02:41 +00:00
|
|
|
P_RadiusAttack (self, self->target, damage, distance, self->DamageType, hurtSource, true, fulldmgdistance);
|
2009-10-17 16:33:44 +00:00
|
|
|
P_CheckSplash(self, distance<<FRACBITS);
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
if (alert && self->target != NULL && self->target->player != NULL)
|
|
|
|
{
|
|
|
|
validcount++;
|
|
|
|
P_RecursiveSound (self->Sector, self->target, false, 0);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// A_RadiusThrust
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusThrust)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(3);
|
|
|
|
ACTION_PARAM_INT(force, 0);
|
|
|
|
ACTION_PARAM_FIXED(distance, 1);
|
|
|
|
ACTION_PARAM_BOOL(affectSource, 2);
|
2008-08-12 23:22:08 +00:00
|
|
|
|
|
|
|
if (force <= 0) force = 128;
|
|
|
|
if (distance <= 0) distance = force;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
P_RadiusAttack (self, self->target, force, distance, self->DamageType, affectSource, false);
|
2009-10-17 16:33:44 +00:00
|
|
|
P_CheckSplash(self, distance<<FRACBITS);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Execute a line special / script
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CallSpecial)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(6);
|
|
|
|
ACTION_PARAM_INT(special, 0);
|
|
|
|
ACTION_PARAM_INT(arg1, 1);
|
|
|
|
ACTION_PARAM_INT(arg2, 2);
|
|
|
|
ACTION_PARAM_INT(arg3, 3);
|
|
|
|
ACTION_PARAM_INT(arg4, 4);
|
|
|
|
ACTION_PARAM_INT(arg5, 5);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
bool res = !!LineSpecials[special](NULL, self, false, arg1, arg2, arg3, arg4, arg5);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(res);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Checks whether this actor is a missile
|
|
|
|
// Unfortunately this was buggy in older versions of the code and many
|
|
|
|
// released DECORATE monsters rely on this bug so it can only be fixed
|
|
|
|
// with an optional flag
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
inline static bool isMissile(AActor * self, bool precise=true)
|
|
|
|
{
|
|
|
|
return self->flags&MF_MISSILE || (precise && self->GetDefault()->flags&MF_MISSILE);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// The ultimate code pointer: Fully customizable missiles!
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
enum CM_Flags
|
|
|
|
{
|
|
|
|
CMF_AIMMODE = 3,
|
|
|
|
CMF_TRACKOWNER = 4,
|
|
|
|
CMF_CHECKTARGETDEAD = 8,
|
|
|
|
};
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(6);
|
|
|
|
ACTION_PARAM_CLASS(ti, 0);
|
|
|
|
ACTION_PARAM_FIXED(SpawnHeight, 1);
|
|
|
|
ACTION_PARAM_INT(Spawnofs_XY, 2);
|
|
|
|
ACTION_PARAM_ANGLE(Angle, 3);
|
|
|
|
ACTION_PARAM_INT(flags, 4);
|
|
|
|
ACTION_PARAM_ANGLE(pitch, 5);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
int aimmode = flags & CMF_AIMMODE;
|
|
|
|
|
|
|
|
AActor * targ;
|
|
|
|
AActor * missile;
|
|
|
|
|
|
|
|
if (self->target != NULL || aimmode==2)
|
|
|
|
{
|
|
|
|
if (ti)
|
|
|
|
{
|
|
|
|
angle_t ang = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT;
|
|
|
|
fixed_t x = Spawnofs_XY * finecosine[ang];
|
|
|
|
fixed_t y = Spawnofs_XY * finesine[ang];
|
|
|
|
fixed_t z = SpawnHeight - 32*FRACUNIT + (self->player? self->player->crouchoffset : 0);
|
|
|
|
|
|
|
|
switch (aimmode)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
default:
|
|
|
|
// same adjustment as above (in all 3 directions this time) - for better aiming!
|
|
|
|
self->x+=x;
|
|
|
|
self->y+=y;
|
|
|
|
self->z+=z;
|
2008-07-06 17:32:31 +00:00
|
|
|
missile = P_SpawnMissileXYZ(self->x, self->y, self->z + 32*FRACUNIT, self, self->target, ti, false);
|
2008-01-27 11:25:03 +00:00
|
|
|
self->x-=x;
|
|
|
|
self->y-=y;
|
|
|
|
self->z-=z;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
2008-07-06 17:32:31 +00:00
|
|
|
missile = P_SpawnMissileXYZ(self->x+x, self->y+y, self->z+SpawnHeight, self, self->target, ti, false);
|
2008-01-27 11:25:03 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2008-03-20 21:19:20 +00:00
|
|
|
self->x+=x;
|
|
|
|
self->y+=y;
|
2008-07-06 17:32:31 +00:00
|
|
|
missile = P_SpawnMissileAngleZSpeed(self, self->z+SpawnHeight, ti, self->angle, 0, GetDefaultByType(ti)->Speed, self, false);
|
2008-03-20 21:19:20 +00:00
|
|
|
self->x-=x;
|
|
|
|
self->y-=y;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// It is not necessary to use the correct angle here.
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
// The only important thing is that the horizontal velocity is correct.
|
2008-01-27 11:25:03 +00:00
|
|
|
// Therefore use 0 as the missile's angle and simplify the calculations accordingly.
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
// The actual velocity vector is set below.
|
2008-01-27 11:25:03 +00:00
|
|
|
if (missile)
|
|
|
|
{
|
|
|
|
fixed_t vx = finecosine[pitch>>ANGLETOFINESHIFT];
|
|
|
|
fixed_t vz = finesine[pitch>>ANGLETOFINESHIFT];
|
|
|
|
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
missile->velx = FixedMul (vx, missile->Speed);
|
|
|
|
missile->vely = 0;
|
|
|
|
missile->velz = FixedMul (vz, missile->Speed);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (missile)
|
|
|
|
{
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
// Use the actual velocity instead of the missile's Speed property
|
2008-01-27 11:25:03 +00:00
|
|
|
// so that this can handle missiles with a high vertical velocity
|
|
|
|
// component properly.
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
FVector3 velocity (missile->velx, missile->vely, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
fixed_t missilespeed = (fixed_t)velocity.Length();
|
|
|
|
|
|
|
|
missile->angle += Angle;
|
|
|
|
ang = missile->angle >> ANGLETOFINESHIFT;
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
missile->velx = FixedMul (missilespeed, finecosine[ang]);
|
|
|
|
missile->vely = FixedMul (missilespeed, finesine[ang]);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// handle projectile shooting projectiles - track the
|
|
|
|
// links back to a real owner
|
|
|
|
if (isMissile(self, !!(flags & CMF_TRACKOWNER)))
|
|
|
|
{
|
|
|
|
AActor * owner=self ;//->target;
|
|
|
|
while (isMissile(owner, !!(flags & CMF_TRACKOWNER)) && owner->target) owner=owner->target;
|
|
|
|
targ=owner;
|
|
|
|
missile->target=owner;
|
|
|
|
// automatic handling of seeker missiles
|
|
|
|
if (self->flags & missile->flags2 & MF2_SEEKERMISSILE)
|
|
|
|
{
|
|
|
|
missile->tracer=self->tracer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (missile->flags2&MF2_SEEKERMISSILE)
|
|
|
|
{
|
|
|
|
// automatic handling of seeker missiles
|
|
|
|
missile->tracer=self->target;
|
|
|
|
}
|
|
|
|
// set the health value so that the missile works properly
|
|
|
|
if (missile->flags4&MF4_SPECTRAL)
|
|
|
|
{
|
|
|
|
missile->health=-2;
|
|
|
|
}
|
2008-07-06 17:32:31 +00:00
|
|
|
P_CheckMissileSpawn(missile);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (flags & CMF_CHECKTARGETDEAD)
|
|
|
|
{
|
|
|
|
// Target is dead and the attack shall be aborted.
|
|
|
|
if (self->SeeState != NULL) self->SetState(self->SeeState);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// An even more customizable hitscan attack
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(7);
|
|
|
|
ACTION_PARAM_ANGLE(Spread_XY, 0);
|
|
|
|
ACTION_PARAM_ANGLE(Spread_Z, 1);
|
|
|
|
ACTION_PARAM_INT(NumBullets, 2);
|
|
|
|
ACTION_PARAM_INT(DamagePerBullet, 3);
|
|
|
|
ACTION_PARAM_CLASS(pufftype, 4);
|
|
|
|
ACTION_PARAM_FIXED(Range, 5);
|
|
|
|
ACTION_PARAM_BOOL(AimFacing, 6);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if(Range==0) Range=MISSILERANGE;
|
|
|
|
|
|
|
|
int i;
|
|
|
|
int bangle;
|
|
|
|
int bslope;
|
|
|
|
|
|
|
|
if (self->target || AimFacing)
|
|
|
|
{
|
|
|
|
if (!AimFacing) A_FaceTarget (self);
|
|
|
|
bangle = self->angle;
|
|
|
|
|
|
|
|
if (!pufftype) pufftype = PClass::FindClass(NAME_BulletPuff);
|
|
|
|
|
|
|
|
bslope = P_AimLineAttack (self, bangle, MISSILERANGE);
|
|
|
|
|
2008-06-15 17:17:31 +00:00
|
|
|
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
for (i=0 ; i<NumBullets ; i++)
|
|
|
|
{
|
|
|
|
int angle = bangle + pr_cabullet.Random2() * (Spread_XY / 255);
|
|
|
|
int slope = bslope + pr_cabullet.Random2() * (Spread_Z / 255);
|
|
|
|
int damage = ((pr_cabullet()%3)+1) * DamagePerBullet;
|
2009-12-17 14:16:00 +00:00
|
|
|
P_LineAttack(self, angle, Range, slope, damage, NAME_None, pufftype);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// A fully customizable melee attack
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMeleeAttack)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(5);
|
|
|
|
ACTION_PARAM_INT(damage, 0);
|
|
|
|
ACTION_PARAM_SOUND(MeleeSound, 1);
|
|
|
|
ACTION_PARAM_SOUND(MissSound, 2);
|
|
|
|
ACTION_PARAM_NAME(DamageType, 3);
|
|
|
|
ACTION_PARAM_BOOL(bleed, 4);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (DamageType==NAME_None) DamageType = NAME_Melee; // Melee is the default type
|
|
|
|
|
|
|
|
if (!self->target)
|
|
|
|
return;
|
|
|
|
|
|
|
|
A_FaceTarget (self);
|
|
|
|
if (self->CheckMeleeRange ())
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
if (MeleeSound) S_Sound (self, CHAN_WEAPON, MeleeSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
P_DamageMobj (self->target, self, self, damage, DamageType);
|
|
|
|
if (bleed) P_TraceBleed (damage, self->target, self);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
if (MissSound) S_Sound (self, CHAN_WEAPON, MissSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// A fully customizable combo attack
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomComboAttack)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(6);
|
|
|
|
ACTION_PARAM_CLASS(ti, 0);
|
|
|
|
ACTION_PARAM_FIXED(SpawnHeight, 1);
|
|
|
|
ACTION_PARAM_INT(damage, 2);
|
|
|
|
ACTION_PARAM_SOUND(MeleeSound, 3);
|
|
|
|
ACTION_PARAM_NAME(DamageType, 4);
|
|
|
|
ACTION_PARAM_BOOL(bleed, 5);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!self->target)
|
|
|
|
return;
|
|
|
|
|
|
|
|
A_FaceTarget (self);
|
|
|
|
if (self->CheckMeleeRange ())
|
|
|
|
{
|
|
|
|
if (DamageType==NAME_None) DamageType = NAME_Melee; // Melee is the default type
|
2008-06-15 17:17:31 +00:00
|
|
|
if (MeleeSound) S_Sound (self, CHAN_WEAPON, MeleeSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
P_DamageMobj (self->target, self, self, damage, DamageType);
|
|
|
|
if (bleed) P_TraceBleed (damage, self->target, self);
|
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
else if (ti)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
// This seemingly senseless code is needed for proper aiming.
|
|
|
|
self->z+=SpawnHeight-32*FRACUNIT;
|
|
|
|
AActor * missile = P_SpawnMissileXYZ (self->x, self->y, self->z + 32*FRACUNIT, self, self->target, ti, false);
|
|
|
|
self->z-=SpawnHeight-32*FRACUNIT;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (missile)
|
|
|
|
{
|
|
|
|
// automatic handling of seeker missiles
|
|
|
|
if (missile->flags2&MF2_SEEKERMISSILE)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
missile->tracer=self->target;
|
|
|
|
}
|
|
|
|
// set the health value so that the missile works properly
|
|
|
|
if (missile->flags4&MF4_SPECTRAL)
|
|
|
|
{
|
|
|
|
missile->health=-2;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
P_CheckMissileSpawn(missile);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// State jump function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfNoAmmo)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_STATE(jump, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
|
|
|
if (!ACTION_CALL_FROM_WEAPON()) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!self->player->ReadyWeapon->CheckAmmo(self->player->ReadyWeapon->bAltFire, false, true))
|
2008-08-14 11:28:02 +00:00
|
|
|
{
|
|
|
|
ACTION_JUMP(jump);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// An even more customizable hitscan attack
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireBullets)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(7);
|
|
|
|
ACTION_PARAM_ANGLE(Spread_XY, 0);
|
|
|
|
ACTION_PARAM_ANGLE(Spread_Z, 1);
|
|
|
|
ACTION_PARAM_INT(NumberOfBullets, 2);
|
|
|
|
ACTION_PARAM_INT(DamagePerBullet, 3);
|
|
|
|
ACTION_PARAM_CLASS(PuffType, 4);
|
|
|
|
ACTION_PARAM_BOOL(UseAmmo, 5);
|
|
|
|
ACTION_PARAM_FIXED(Range, 6);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (!self->player) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
player_t * player=self->player;
|
|
|
|
AWeapon * weapon=player->ReadyWeapon;
|
|
|
|
|
|
|
|
int i;
|
|
|
|
int bangle;
|
|
|
|
int bslope;
|
|
|
|
|
|
|
|
if (UseAmmo && weapon)
|
|
|
|
{
|
|
|
|
if (!weapon->DepleteAmmo(weapon->bAltFire, true)) return; // out of ammo
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Range == 0) Range = PLAYERMISSILERANGE;
|
|
|
|
|
|
|
|
static_cast<APlayerPawn *>(self)->PlayAttacking2 ();
|
|
|
|
|
Update to ZDoom r905:
- Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
concern here and the worst that can happen is that the wrong actor is spawned.
This was a constant hassle when testing with WADs that contain duplicate resources.
- Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.
- Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
of the new wave data uninitialized.
- Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
tables.cpp. (And interestingly, VC++ automatically renamed the object file,
so I wasn't aware of the problem with GCC.)
- Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config and sound patches from Zips.
I put this on hold though after finding out that the sound quality
isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
can be loaded
- Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
event which only has 1 in 127 chance of being for a note that's playing
on that channel. Then I decided it would probably be a good idea to reset
all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
(copied from the OPL player) improved its sound dramatically, so apparently
Timidity has issues with short stream buffers. It's now at 1/2 sec in
length. However, there seems to be something weird going on with
corazonazul_ff6boss.mid near the beginning where it stops and immediately
restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
oscilloscopes and spectrums.
- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.)
- Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :(
- Changed the progdir global variable into an FString.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
|
|
|
bslope = P_BulletSlope(self);
|
2008-01-27 11:25:03 +00:00
|
|
|
bangle = self->angle;
|
|
|
|
|
|
|
|
if (!PuffType) PuffType = PClass::FindClass(NAME_BulletPuff);
|
|
|
|
|
2008-06-15 17:17:31 +00:00
|
|
|
S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if ((NumberOfBullets==1 && !player->refire) || NumberOfBullets==0)
|
|
|
|
{
|
|
|
|
int damage = ((pr_cwbullet()%3)+1)*DamagePerBullet;
|
2009-12-17 14:16:00 +00:00
|
|
|
P_LineAttack(self, bangle, Range, bslope, damage, NAME_None, PuffType);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (NumberOfBullets == -1) NumberOfBullets = 1;
|
|
|
|
for (i=0 ; i<NumberOfBullets ; i++)
|
|
|
|
{
|
|
|
|
int angle = bangle + pr_cwbullet.Random2() * (Spread_XY / 255);
|
|
|
|
int slope = bslope + pr_cwbullet.Random2() * (Spread_Z / 255);
|
|
|
|
int damage = ((pr_cwbullet()%3)+1) * DamagePerBullet;
|
2009-12-17 14:16:00 +00:00
|
|
|
P_LineAttack(self, angle, Range, slope, damage, NAME_None, PuffType);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// A_FireProjectile
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-06-27 21:02:41 +00:00
|
|
|
ACTION_PARAM_START(7);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_CLASS(ti, 0);
|
|
|
|
ACTION_PARAM_ANGLE(Angle, 1);
|
|
|
|
ACTION_PARAM_BOOL(UseAmmo, 2);
|
|
|
|
ACTION_PARAM_INT(SpawnOfs_XY, 3);
|
|
|
|
ACTION_PARAM_FIXED(SpawnHeight, 4);
|
|
|
|
ACTION_PARAM_BOOL(AimAtAngle, 5);
|
2009-06-27 21:02:41 +00:00
|
|
|
ACTION_PARAM_ANGLE(pitch, 6);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (!self->player) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
player_t *player=self->player;
|
|
|
|
AWeapon * weapon=player->ReadyWeapon;
|
Update to ZDoom r905:
- Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
concern here and the worst that can happen is that the wrong actor is spawned.
This was a constant hassle when testing with WADs that contain duplicate resources.
- Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.
- Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
of the new wave data uninitialized.
- Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
tables.cpp. (And interestingly, VC++ automatically renamed the object file,
so I wasn't aware of the problem with GCC.)
- Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config and sound patches from Zips.
I put this on hold though after finding out that the sound quality
isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
can be loaded
- Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
event which only has 1 in 127 chance of being for a note that's playing
on that channel. Then I decided it would probably be a good idea to reset
all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
(copied from the OPL player) improved its sound dramatically, so apparently
Timidity has issues with short stream buffers. It's now at 1/2 sec in
length. However, there seems to be something weird going on with
corazonazul_ff6boss.mid near the beginning where it stops and immediately
restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
oscilloscopes and spectrums.
- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.)
- Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :(
- Changed the progdir global variable into an FString.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
|
|
|
AActor *linetarget;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (UseAmmo && weapon)
|
|
|
|
{
|
|
|
|
if (!weapon->DepleteAmmo(weapon->bAltFire, true)) return; // out of ammo
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ti)
|
|
|
|
{
|
|
|
|
angle_t ang = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT;
|
|
|
|
fixed_t x = SpawnOfs_XY * finecosine[ang];
|
|
|
|
fixed_t y = SpawnOfs_XY * finesine[ang];
|
|
|
|
fixed_t z = SpawnHeight;
|
|
|
|
fixed_t shootangle = self->angle;
|
|
|
|
|
|
|
|
if (AimAtAngle) shootangle+=Angle;
|
|
|
|
|
2009-06-27 21:02:41 +00:00
|
|
|
// Temporarily adjusts the pitch
|
|
|
|
fixed_t SavedPlayerPitch = self->pitch;
|
|
|
|
self->pitch -= pitch;
|
Update to ZDoom r905:
- Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
concern here and the worst that can happen is that the wrong actor is spawned.
This was a constant hassle when testing with WADs that contain duplicate resources.
- Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.
- Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
of the new wave data uninitialized.
- Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
tables.cpp. (And interestingly, VC++ automatically renamed the object file,
so I wasn't aware of the problem with GCC.)
- Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config and sound patches from Zips.
I put this on hold though after finding out that the sound quality
isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
can be loaded
- Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
event which only has 1 in 127 chance of being for a note that's playing
on that channel. Then I decided it would probably be a good idea to reset
all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
(copied from the OPL player) improved its sound dramatically, so apparently
Timidity has issues with short stream buffers. It's now at 1/2 sec in
length. However, there seems to be something weird going on with
corazonazul_ff6boss.mid near the beginning where it stops and immediately
restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
oscilloscopes and spectrums.
- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.)
- Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :(
- Changed the progdir global variable into an FString.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
|
|
|
AActor * misl=P_SpawnPlayerMissile (self, x, y, z, ti, shootangle, &linetarget);
|
2009-06-27 21:02:41 +00:00
|
|
|
self->pitch = SavedPlayerPitch;
|
2008-01-27 11:25:03 +00:00
|
|
|
// automatic handling of seeker missiles
|
|
|
|
if (misl)
|
|
|
|
{
|
|
|
|
if (linetarget && misl->flags2&MF2_SEEKERMISSILE) misl->tracer=linetarget;
|
|
|
|
if (!AimAtAngle)
|
|
|
|
{
|
|
|
|
// This original implementation is to aim straight ahead and then offset
|
|
|
|
// the angle from the resulting direction.
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
FVector3 velocity(misl->velx, misl->vely, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
fixed_t missilespeed = (fixed_t)velocity.Length();
|
|
|
|
misl->angle += Angle;
|
|
|
|
angle_t an = misl->angle >> ANGLETOFINESHIFT;
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
misl->velx = FixedMul (missilespeed, finecosine[an]);
|
|
|
|
misl->vely = FixedMul (missilespeed, finesine[an]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// A_CustomPunch
|
|
|
|
//
|
|
|
|
// Berserk is not handled here. That can be done with A_CheckIfInventory
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(5);
|
|
|
|
ACTION_PARAM_INT(Damage, 0);
|
|
|
|
ACTION_PARAM_BOOL(norandom, 1);
|
|
|
|
ACTION_PARAM_BOOL(UseAmmo, 2);
|
|
|
|
ACTION_PARAM_CLASS(PuffType, 3);
|
|
|
|
ACTION_PARAM_FIXED(Range, 4);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (!self->player) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
player_t *player=self->player;
|
|
|
|
AWeapon * weapon=player->ReadyWeapon;
|
|
|
|
|
|
|
|
|
|
|
|
angle_t angle;
|
|
|
|
int pitch;
|
Update to ZDoom r905:
- Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
concern here and the worst that can happen is that the wrong actor is spawned.
This was a constant hassle when testing with WADs that contain duplicate resources.
- Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.
- Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
of the new wave data uninitialized.
- Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
tables.cpp. (And interestingly, VC++ automatically renamed the object file,
so I wasn't aware of the problem with GCC.)
- Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config and sound patches from Zips.
I put this on hold though after finding out that the sound quality
isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
can be loaded
- Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
event which only has 1 in 127 chance of being for a note that's playing
on that channel. Then I decided it would probably be a good idea to reset
all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
(copied from the OPL player) improved its sound dramatically, so apparently
Timidity has issues with short stream buffers. It's now at 1/2 sec in
length. However, there seems to be something weird going on with
corazonazul_ff6boss.mid near the beginning where it stops and immediately
restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
oscilloscopes and spectrums.
- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.)
- Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :(
- Changed the progdir global variable into an FString.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
|
|
|
AActor * linetarget;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!norandom) Damage *= (pr_cwpunch()%8+1);
|
|
|
|
|
|
|
|
angle = self->angle + (pr_cwpunch.Random2() << 18);
|
|
|
|
if (Range == 0) Range = MELEERANGE;
|
Update to ZDoom r905:
- Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
concern here and the worst that can happen is that the wrong actor is spawned.
This was a constant hassle when testing with WADs that contain duplicate resources.
- Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.
- Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
of the new wave data uninitialized.
- Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
tables.cpp. (And interestingly, VC++ automatically renamed the object file,
so I wasn't aware of the problem with GCC.)
- Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config and sound patches from Zips.
I put this on hold though after finding out that the sound quality
isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
can be loaded
- Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
event which only has 1 in 127 chance of being for a note that's playing
on that channel. Then I decided it would probably be a good idea to reset
all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
(copied from the OPL player) improved its sound dramatically, so apparently
Timidity has issues with short stream buffers. It's now at 1/2 sec in
length. However, there seems to be something weird going on with
corazonazul_ff6boss.mid near the beginning where it stops and immediately
restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
oscilloscopes and spectrums.
- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.)
- Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :(
- Changed the progdir global variable into an FString.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
|
|
|
pitch = P_AimLineAttack (self, angle, Range, &linetarget);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// only use ammo when actually hitting something!
|
|
|
|
if (UseAmmo && linetarget && weapon)
|
|
|
|
{
|
|
|
|
if (!weapon->DepleteAmmo(weapon->bAltFire, true)) return; // out of ammo
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!PuffType) PuffType = PClass::FindClass(NAME_BulletPuff);
|
|
|
|
|
2009-12-17 14:16:00 +00:00
|
|
|
P_LineAttack (self, angle, Range, pitch, Damage, NAME_None, PuffType, true);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// turn to face target
|
|
|
|
if (linetarget)
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
self->angle = R_PointToAngle2 (self->x,
|
|
|
|
self->y,
|
|
|
|
linetarget->x,
|
|
|
|
linetarget->y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-07-11 07:17:20 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
RAF_SILENT = 1,
|
|
|
|
RAF_NOPIERCE = 2
|
|
|
|
};
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// customizable railgun attack function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RailAttack)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(8);
|
|
|
|
ACTION_PARAM_INT(Damage, 0);
|
|
|
|
ACTION_PARAM_INT(Spawnofs_XY, 1);
|
|
|
|
ACTION_PARAM_BOOL(UseAmmo, 2);
|
|
|
|
ACTION_PARAM_COLOR(Color1, 3);
|
|
|
|
ACTION_PARAM_COLOR(Color2, 4);
|
2009-07-11 07:17:20 +00:00
|
|
|
ACTION_PARAM_INT(Flags, 5);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_FLOAT(MaxDiff, 6);
|
2009-07-11 07:17:20 +00:00
|
|
|
ACTION_PARAM_CLASS(PuffType, 7);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (!self->player) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
AWeapon * weapon=self->player->ReadyWeapon;
|
|
|
|
|
|
|
|
// only use ammo when actually hitting something!
|
|
|
|
if (UseAmmo)
|
|
|
|
{
|
|
|
|
if (!weapon->DepleteAmmo(weapon->bAltFire, true)) return; // out of ammo
|
|
|
|
}
|
|
|
|
|
2009-07-11 07:17:20 +00:00
|
|
|
P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, (Flags & RAF_SILENT), PuffType, (!(Flags & RAF_NOPIERCE)));
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// also for monsters
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-01-01 16:47:46 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
CRF_DONTAIM = 0,
|
|
|
|
CRF_AIMPARALLEL = 1,
|
|
|
|
CRF_AIMDIRECT = 2
|
|
|
|
};
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(8);
|
|
|
|
ACTION_PARAM_INT(Damage, 0);
|
|
|
|
ACTION_PARAM_INT(Spawnofs_XY, 1);
|
|
|
|
ACTION_PARAM_COLOR(Color1, 2);
|
|
|
|
ACTION_PARAM_COLOR(Color2, 3);
|
2009-07-11 07:17:20 +00:00
|
|
|
ACTION_PARAM_INT(Flags, 4);
|
2009-01-01 16:47:46 +00:00
|
|
|
ACTION_PARAM_INT(aim, 5);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_FLOAT(MaxDiff, 6);
|
2008-10-28 22:56:10 +00:00
|
|
|
ACTION_PARAM_CLASS(PuffType, 7);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- fixed: Calculating sector heights with transparent door hacks was wrong.
- fixed: Sector height was wrong for sectors that have a slope transfer for
a horizontal plane.
- better error reporting for shader compile errors.
Update to ZDoom r1942:
- Changes to both A_MonsterRail() and A_CustomRailgun(): Save actor's pitch,
use a larger aiming range, ignore non-targets in P_AimLineAttack(), and
aim at the target anyway even if P_AimLineAttack() decides it has no
chance of hitting.
- Added another parameter to P_AimLineAttack(): A target to be aimed at. If
this is non-NULL, then all actors between the shooter and the target will
be ignored.
- Added new sound sequence ACS functions:
SoundSequenceOnActor(int tid, string seqname);
SoundSequenceOnSector(int tag, string seqname, int location);
SoundSequenceOnPolyobj(int polynum, string seqname);
SoundSequenceOnSector takes an extra parameter that specifies where in the
sector the sound comes from (floor, ceiling, interior, or all of it). See
the SECSEQ defines in zdefs.acs.
- Fixed: R_RenderDecal() must save various Wall globals, because the originals
may still be needed. In particular, when drawing a seg with a midtexture is
split by foreground geometry, the first drawseg generated from it will have
the correct WallSZ1,2 values, but subsequent ones will have whatever
R_RenderDecal() left behind. These values are used to calculate the upper
and lower bounds of the midtexture. (Ironically, my work to Build-ify things
had done away with these globals, but that's gone now.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@581 b0f79afe-0144-0410-b225-9a4edf0717df
2009-10-28 20:14:24 +00:00
|
|
|
AActor *linetarget;
|
|
|
|
|
2009-01-01 16:47:46 +00:00
|
|
|
fixed_t saved_x = self->x;
|
|
|
|
fixed_t saved_y = self->y;
|
|
|
|
angle_t saved_angle = self->angle;
|
- fixed: Calculating sector heights with transparent door hacks was wrong.
- fixed: Sector height was wrong for sectors that have a slope transfer for
a horizontal plane.
- better error reporting for shader compile errors.
Update to ZDoom r1942:
- Changes to both A_MonsterRail() and A_CustomRailgun(): Save actor's pitch,
use a larger aiming range, ignore non-targets in P_AimLineAttack(), and
aim at the target anyway even if P_AimLineAttack() decides it has no
chance of hitting.
- Added another parameter to P_AimLineAttack(): A target to be aimed at. If
this is non-NULL, then all actors between the shooter and the target will
be ignored.
- Added new sound sequence ACS functions:
SoundSequenceOnActor(int tid, string seqname);
SoundSequenceOnSector(int tag, string seqname, int location);
SoundSequenceOnPolyobj(int polynum, string seqname);
SoundSequenceOnSector takes an extra parameter that specifies where in the
sector the sound comes from (floor, ceiling, interior, or all of it). See
the SECSEQ defines in zdefs.acs.
- Fixed: R_RenderDecal() must save various Wall globals, because the originals
may still be needed. In particular, when drawing a seg with a midtexture is
split by foreground geometry, the first drawseg generated from it will have
the correct WallSZ1,2 values, but subsequent ones will have whatever
R_RenderDecal() left behind. These values are used to calculate the upper
and lower bounds of the midtexture. (Ironically, my work to Build-ify things
had done away with these globals, but that's gone now.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@581 b0f79afe-0144-0410-b225-9a4edf0717df
2009-10-28 20:14:24 +00:00
|
|
|
fixed_t saved_pitch = self->pitch;
|
2009-01-01 16:47:46 +00:00
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
if (aim && self->target == NULL)
|
2008-01-27 15:34:47 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
// [RH] Andy Baker's stealth monsters
|
2008-08-12 08:00:28 +00:00
|
|
|
if (self->flags & MF_STEALTH)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-12 08:00:28 +00:00
|
|
|
self->visdir = 1;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
self->flags &= ~MF_AMBUSH;
|
2008-01-27 15:34:47 +00:00
|
|
|
|
2009-01-01 16:47:46 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if (aim)
|
|
|
|
{
|
2008-08-12 08:00:28 +00:00
|
|
|
self->angle = R_PointToAngle2 (self->x,
|
|
|
|
self->y,
|
|
|
|
self->target->x,
|
|
|
|
self->target->y);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
- fixed: Calculating sector heights with transparent door hacks was wrong.
- fixed: Sector height was wrong for sectors that have a slope transfer for
a horizontal plane.
- better error reporting for shader compile errors.
Update to ZDoom r1942:
- Changes to both A_MonsterRail() and A_CustomRailgun(): Save actor's pitch,
use a larger aiming range, ignore non-targets in P_AimLineAttack(), and
aim at the target anyway even if P_AimLineAttack() decides it has no
chance of hitting.
- Added another parameter to P_AimLineAttack(): A target to be aimed at. If
this is non-NULL, then all actors between the shooter and the target will
be ignored.
- Added new sound sequence ACS functions:
SoundSequenceOnActor(int tid, string seqname);
SoundSequenceOnSector(int tag, string seqname, int location);
SoundSequenceOnPolyobj(int polynum, string seqname);
SoundSequenceOnSector takes an extra parameter that specifies where in the
sector the sound comes from (floor, ceiling, interior, or all of it). See
the SECSEQ defines in zdefs.acs.
- Fixed: R_RenderDecal() must save various Wall globals, because the originals
may still be needed. In particular, when drawing a seg with a midtexture is
split by foreground geometry, the first drawseg generated from it will have
the correct WallSZ1,2 values, but subsequent ones will have whatever
R_RenderDecal() left behind. These values are used to calculate the upper
and lower bounds of the midtexture. (Ironically, my work to Build-ify things
had done away with these globals, but that's gone now.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@581 b0f79afe-0144-0410-b225-9a4edf0717df
2009-10-28 20:14:24 +00:00
|
|
|
self->pitch = P_AimLineAttack (self, self->angle, MISSILERANGE, &linetarget, ANGLE_1*60, false, false, false, aim ? self->target : NULL);
|
|
|
|
if (linetarget == NULL && aim)
|
|
|
|
{
|
|
|
|
// We probably won't hit the target, but aim at it anyway so we don't look stupid.
|
|
|
|
FVector2 xydiff(self->target->x - self->x, self->target->y - self->y);
|
|
|
|
double zdiff = (self->target->z + (self->target->height>>1)) -
|
|
|
|
(self->z + (self->height>>1) - self->floorclip);
|
|
|
|
self->pitch = int(atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
// Let the aim trail behind the player
|
|
|
|
if (aim)
|
|
|
|
{
|
2009-01-01 16:47:46 +00:00
|
|
|
saved_angle = self->angle = R_PointToAngle2 (self->x, self->y,
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
self->target->x - self->target->velx * 3,
|
|
|
|
self->target->y - self->target->vely * 3);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-01-01 16:47:46 +00:00
|
|
|
if (aim == CRF_AIMDIRECT)
|
|
|
|
{
|
|
|
|
// Tricky: We must offset to the angle of the current position
|
|
|
|
// but then change the angle again to ensure proper aim.
|
|
|
|
self->x += Spawnofs_XY * finecosine[self->angle];
|
|
|
|
self->y += Spawnofs_XY * finesine[self->angle];
|
|
|
|
Spawnofs_XY = 0;
|
|
|
|
self->angle = R_PointToAngle2 (self->x, self->y,
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
self->target->x - self->target->velx * 3,
|
|
|
|
self->target->y - self->target->vely * 3);
|
2009-01-01 16:47:46 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
if (self->target->flags & MF_SHADOW)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-01-01 16:47:46 +00:00
|
|
|
angle_t rnd = pr_crailgun.Random2() << 21;
|
|
|
|
self->angle += rnd;
|
|
|
|
saved_angle = rnd;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-01 16:47:46 +00:00
|
|
|
angle_t angle = (self->angle - ANG90) >> ANGLETOFINESHIFT;
|
|
|
|
|
2009-07-11 07:17:20 +00:00
|
|
|
P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, (Flags & RAF_SILENT), PuffType, (!(Flags & RAF_NOPIERCE)));
|
2009-01-01 16:47:46 +00:00
|
|
|
|
|
|
|
self->x = saved_x;
|
|
|
|
self->y = saved_y;
|
|
|
|
self->angle = saved_angle;
|
- fixed: Calculating sector heights with transparent door hacks was wrong.
- fixed: Sector height was wrong for sectors that have a slope transfer for
a horizontal plane.
- better error reporting for shader compile errors.
Update to ZDoom r1942:
- Changes to both A_MonsterRail() and A_CustomRailgun(): Save actor's pitch,
use a larger aiming range, ignore non-targets in P_AimLineAttack(), and
aim at the target anyway even if P_AimLineAttack() decides it has no
chance of hitting.
- Added another parameter to P_AimLineAttack(): A target to be aimed at. If
this is non-NULL, then all actors between the shooter and the target will
be ignored.
- Added new sound sequence ACS functions:
SoundSequenceOnActor(int tid, string seqname);
SoundSequenceOnSector(int tag, string seqname, int location);
SoundSequenceOnPolyobj(int polynum, string seqname);
SoundSequenceOnSector takes an extra parameter that specifies where in the
sector the sound comes from (floor, ceiling, interior, or all of it). See
the SECSEQ defines in zdefs.acs.
- Fixed: R_RenderDecal() must save various Wall globals, because the originals
may still be needed. In particular, when drawing a seg with a midtexture is
split by foreground geometry, the first drawseg generated from it will have
the correct WallSZ1,2 values, but subsequent ones will have whatever
R_RenderDecal() left behind. These values are used to calculate the upper
and lower bounds of the midtexture. (Ironically, my work to Build-ify things
had done away with these globals, but that's gone now.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@581 b0f79afe-0144-0410-b225-9a4edf0717df
2009-10-28 20:14:24 +00:00
|
|
|
self->pitch = saved_pitch;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// DoGiveInventory
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2008-10-25 21:48:56 +00:00
|
|
|
static void DoGiveInventory(AActor * receiver, DECLARE_PARAMINFO)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_CLASS(mi, 0);
|
|
|
|
ACTION_PARAM_INT(amount, 1);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
bool res=true;
|
|
|
|
if (receiver == NULL) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (amount==0) amount=1;
|
|
|
|
if (mi)
|
|
|
|
{
|
|
|
|
AInventory *item = static_cast<AInventory *>(Spawn (mi, 0, 0, 0, NO_REPLACE));
|
|
|
|
if (item->IsKindOf(RUNTIME_CLASS(AHealth)))
|
|
|
|
{
|
|
|
|
item->Amount *= amount;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
item->Amount = amount;
|
|
|
|
}
|
|
|
|
item->flags |= MF_DROPPED;
|
|
|
|
if (item->flags & MF_COUNTITEM)
|
|
|
|
{
|
|
|
|
item->flags&=~MF_COUNTITEM;
|
|
|
|
level.total_items--;
|
|
|
|
}
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- Since loading of the sound lump is now done in S_LoadSound I added an IsNull
method to the SoundRenderer class so that this function doesn't need to
load the sound for the NullSoundRenderer.
- Took some more non-FMOD related code out of fmodsound.cpp, including the
code that checks for raw and Doom sounds. This means that sfxinfo_t is no
longer needed in the SoundRenderer class so I took out all references to it.
- Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing
to the rolloff information back to NULL when starting the sound fails.
- Fixed: Rolloff information was taken from the sfxinfo that contained the
actual sound data, not the one that was used for starting the sound.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
if (!item->CallTryPickup (receiver))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
item->Destroy ();
|
|
|
|
res = false;
|
|
|
|
}
|
|
|
|
else res = true;
|
|
|
|
}
|
|
|
|
else res = false;
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(res);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveInventory)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-10-25 21:48:56 +00:00
|
|
|
DoGiveInventory(self, PUSH_PARAMINFO);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveToTarget)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-10-25 21:48:56 +00:00
|
|
|
DoGiveInventory(self->target, PUSH_PARAMINFO);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_TakeInventory
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2008-10-25 21:48:56 +00:00
|
|
|
void DoTakeInventory(AActor * receiver, DECLARE_PARAMINFO)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_CLASS(item, 0);
|
|
|
|
ACTION_PARAM_INT(amount, 1);
|
|
|
|
|
2008-10-25 21:48:56 +00:00
|
|
|
if (item == NULL || receiver == NULL) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
bool res = false;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
AInventory * inv = receiver->FindInventory(item);
|
|
|
|
|
|
|
|
if (inv && !inv->IsKindOf(RUNTIME_CLASS(AHexenArmor)))
|
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
if (inv->Amount > 0)
|
|
|
|
{
|
|
|
|
res = true;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
if (!amount || amount>=inv->Amount)
|
|
|
|
{
|
|
|
|
if (inv->ItemFlags&IF_KEEPDEPLETED) inv->Amount=0;
|
|
|
|
else inv->Destroy();
|
|
|
|
}
|
|
|
|
else inv->Amount-=amount;
|
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(res);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeInventory)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-10-25 21:48:56 +00:00
|
|
|
DoTakeInventory(self, PUSH_PARAMINFO);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeFromTarget)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-10-25 21:48:56 +00:00
|
|
|
DoTakeInventory(self->target, PUSH_PARAMINFO);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// Common code for A_SpawnItem and A_SpawnItemEx
|
|
|
|
//
|
|
|
|
//===========================================================================
|
Update to ZDoom r1017:
- Fixed: MAPINFO's 'lookup' option should only work for actual strings but
not for lump and file names.
- Added a few 'activator == NULL' checks to some ACS functions.
- Added line and vertex lists to polyobjects so that I can do some
changes that won't work with only a seg list being maintained.
(SBarInfo update #23)
- Fixed: Drawing the amount of an inventory item in the player's inventory did
not work
- Added: PowerupTime to drawnumber and drawbar. You must specify a
powerupgiver. Although drawnumber goes in seconds the powerup has left
drawbar will use ticks for extra accuracy.
- I have increased cross-port compatibility with Skulltag. If an unknown
game mode is provided for sbarinfo's gamemode command it will ignore it and
continue.
- Added an option to consider intermission screens gameplay for purposes of
capturing the mouse.
- Changed: Telefragging should not thrust the victim if it isn't in precisely the
same position as the killer.
- fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned
object's position.
- Fixed: Ouch state was far to easy to achieve.
- Made all the basic texture classes local to their implementation.
They are not needed anywhere else.
- Changed the HackHack hack for corrupt 256 pixel high textures that
FMultiPatchTexture only calls a virtual function instead of doing any
type checks of the patch itself.
- Cleaned up the constant definitions in doomdata.h.
- Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp
because they are used only in this one file.
- Removed some more typedefs from r_defs.h and doomdata.h
- Moved local polyobject data definitions from p_local.h to po_man.cpp.
- Renamed player_s to player_t globally to get rid of the duplicate names
for this class.
- Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid
potential crashes in the situation that con_scaletext is 2 and somebody
uses a hud message as if a hud size was specified, but forgot to actually
set the hud size.
- Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar
into a single place.
- Fixed: Setting an invalid mug shot state crashed the game.
- Fixed my attempts to be clever with strings yesterday.
- If an actor's current target temporarily goes unshootable, its threshold
is now reset to 0, so it will more readily switch back to it.
- Fixed: Deactivating the game no longer allows reverb effects to continue
playing while the sound is paused.
- Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of
Flags.
- Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung
leaks and didn't allocate enough space for the fullStateName string.
- Disabled DUMB's mono destination mixers. It's not like I'm ever going to
target an original SoundBlaster, so they're a waste of space to have around.
This trims resample.obj down to ~60k now.
- Fixed: PrtScn/SysRq key did not work on Linux.
- Added an alternate module replay engine that uses foo_dumb's replayer, a
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque).
It has been slightly modified by me:
* Added support for Ogg Vorbis-compressed samples in XM files ala FMOD.
* Removed excessive mallocs from the replay core.
* Rerolled the loops in resample.c. Unrolling them made the object file
~250k large while providing little benefit. Even at ~100k, I think it's
still larger than it ought to be, but I'll live with it for now.
Other than that, it's essentially the same thing you'd hear in foobar2000,
minus some subsong detection features. Release builds of the library look
like they might even be slightly faster than FMOD, which is a plus.
- Fixed: Timidity::font_add() did not release the file reader it created.
- Fixed: The SF2 loader did not free the sample headers in its destructor.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
|
|
|
enum SIX_Flags
|
|
|
|
{
|
|
|
|
SIXF_TRANSFERTRANSLATION=1,
|
|
|
|
SIXF_ABSOLUTEPOSITION=2,
|
|
|
|
SIXF_ABSOLUTEANGLE=4,
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
SIXF_ABSOLUTEVELOCITY=8,
|
Update to ZDoom r1017:
- Fixed: MAPINFO's 'lookup' option should only work for actual strings but
not for lump and file names.
- Added a few 'activator == NULL' checks to some ACS functions.
- Added line and vertex lists to polyobjects so that I can do some
changes that won't work with only a seg list being maintained.
(SBarInfo update #23)
- Fixed: Drawing the amount of an inventory item in the player's inventory did
not work
- Added: PowerupTime to drawnumber and drawbar. You must specify a
powerupgiver. Although drawnumber goes in seconds the powerup has left
drawbar will use ticks for extra accuracy.
- I have increased cross-port compatibility with Skulltag. If an unknown
game mode is provided for sbarinfo's gamemode command it will ignore it and
continue.
- Added an option to consider intermission screens gameplay for purposes of
capturing the mouse.
- Changed: Telefragging should not thrust the victim if it isn't in precisely the
same position as the killer.
- fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned
object's position.
- Fixed: Ouch state was far to easy to achieve.
- Made all the basic texture classes local to their implementation.
They are not needed anywhere else.
- Changed the HackHack hack for corrupt 256 pixel high textures that
FMultiPatchTexture only calls a virtual function instead of doing any
type checks of the patch itself.
- Cleaned up the constant definitions in doomdata.h.
- Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp
because they are used only in this one file.
- Removed some more typedefs from r_defs.h and doomdata.h
- Moved local polyobject data definitions from p_local.h to po_man.cpp.
- Renamed player_s to player_t globally to get rid of the duplicate names
for this class.
- Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid
potential crashes in the situation that con_scaletext is 2 and somebody
uses a hud message as if a hud size was specified, but forgot to actually
set the hud size.
- Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar
into a single place.
- Fixed: Setting an invalid mug shot state crashed the game.
- Fixed my attempts to be clever with strings yesterday.
- If an actor's current target temporarily goes unshootable, its threshold
is now reset to 0, so it will more readily switch back to it.
- Fixed: Deactivating the game no longer allows reverb effects to continue
playing while the sound is paused.
- Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of
Flags.
- Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung
leaks and didn't allocate enough space for the fullStateName string.
- Disabled DUMB's mono destination mixers. It's not like I'm ever going to
target an original SoundBlaster, so they're a waste of space to have around.
This trims resample.obj down to ~60k now.
- Fixed: PrtScn/SysRq key did not work on Linux.
- Added an alternate module replay engine that uses foo_dumb's replayer, a
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque).
It has been slightly modified by me:
* Added support for Ogg Vorbis-compressed samples in XM files ala FMOD.
* Removed excessive mallocs from the replay core.
* Rerolled the loops in resample.c. Unrolling them made the object file
~250k large while providing little benefit. Even at ~100k, I think it's
still larger than it ought to be, but I'll live with it for now.
Other than that, it's essentially the same thing you'd hear in foobar2000,
minus some subsong detection features. Release builds of the library look
like they might even be slightly faster than FMOD, which is a plus.
- Fixed: Timidity::font_add() did not release the file reader it created.
- Fixed: The SF2 loader did not free the sample headers in its destructor.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
|
|
|
SIXF_SETMASTER=16,
|
|
|
|
SIXF_NOCHECKPOSITION=32,
|
|
|
|
SIXF_TELEFRAG=64,
|
|
|
|
// 128 is used by Skulltag!
|
|
|
|
SIXF_TRANSFERAMBUSHFLAG=256,
|
2009-06-04 13:59:08 +00:00
|
|
|
SIXF_TRANSFERPITCH=512,
|
2009-06-07 20:15:36 +00:00
|
|
|
SIXF_TRANSFERPOINTERS=1024,
|
Update to ZDoom r1017:
- Fixed: MAPINFO's 'lookup' option should only work for actual strings but
not for lump and file names.
- Added a few 'activator == NULL' checks to some ACS functions.
- Added line and vertex lists to polyobjects so that I can do some
changes that won't work with only a seg list being maintained.
(SBarInfo update #23)
- Fixed: Drawing the amount of an inventory item in the player's inventory did
not work
- Added: PowerupTime to drawnumber and drawbar. You must specify a
powerupgiver. Although drawnumber goes in seconds the powerup has left
drawbar will use ticks for extra accuracy.
- I have increased cross-port compatibility with Skulltag. If an unknown
game mode is provided for sbarinfo's gamemode command it will ignore it and
continue.
- Added an option to consider intermission screens gameplay for purposes of
capturing the mouse.
- Changed: Telefragging should not thrust the victim if it isn't in precisely the
same position as the killer.
- fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned
object's position.
- Fixed: Ouch state was far to easy to achieve.
- Made all the basic texture classes local to their implementation.
They are not needed anywhere else.
- Changed the HackHack hack for corrupt 256 pixel high textures that
FMultiPatchTexture only calls a virtual function instead of doing any
type checks of the patch itself.
- Cleaned up the constant definitions in doomdata.h.
- Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp
because they are used only in this one file.
- Removed some more typedefs from r_defs.h and doomdata.h
- Moved local polyobject data definitions from p_local.h to po_man.cpp.
- Renamed player_s to player_t globally to get rid of the duplicate names
for this class.
- Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid
potential crashes in the situation that con_scaletext is 2 and somebody
uses a hud message as if a hud size was specified, but forgot to actually
set the hud size.
- Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar
into a single place.
- Fixed: Setting an invalid mug shot state crashed the game.
- Fixed my attempts to be clever with strings yesterday.
- If an actor's current target temporarily goes unshootable, its threshold
is now reset to 0, so it will more readily switch back to it.
- Fixed: Deactivating the game no longer allows reverb effects to continue
playing while the sound is paused.
- Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of
Flags.
- Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung
leaks and didn't allocate enough space for the fullStateName string.
- Disabled DUMB's mono destination mixers. It's not like I'm ever going to
target an original SoundBlaster, so they're a waste of space to have around.
This trims resample.obj down to ~60k now.
- Fixed: PrtScn/SysRq key did not work on Linux.
- Added an alternate module replay engine that uses foo_dumb's replayer, a
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque).
It has been slightly modified by me:
* Added support for Ogg Vorbis-compressed samples in XM files ala FMOD.
* Removed excessive mallocs from the replay core.
* Rerolled the loops in resample.c. Unrolling them made the object file
~250k large while providing little benefit. Even at ~100k, I think it's
still larger than it ought to be, but I'll live with it for now.
Other than that, it's essentially the same thing you'd hear in foobar2000,
minus some subsong detection features. Release builds of the library look
like they might even be slightly faster than FMOD, which is a plus.
- Fixed: Timidity::font_add() did not release the file reader it created.
- Fixed: The SF2 loader did not free the sample headers in its destructor.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
|
|
|
};
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (mo)
|
|
|
|
{
|
|
|
|
AActor * originator = self;
|
|
|
|
|
Update to ZDoom r1017:
- Fixed: MAPINFO's 'lookup' option should only work for actual strings but
not for lump and file names.
- Added a few 'activator == NULL' checks to some ACS functions.
- Added line and vertex lists to polyobjects so that I can do some
changes that won't work with only a seg list being maintained.
(SBarInfo update #23)
- Fixed: Drawing the amount of an inventory item in the player's inventory did
not work
- Added: PowerupTime to drawnumber and drawbar. You must specify a
powerupgiver. Although drawnumber goes in seconds the powerup has left
drawbar will use ticks for extra accuracy.
- I have increased cross-port compatibility with Skulltag. If an unknown
game mode is provided for sbarinfo's gamemode command it will ignore it and
continue.
- Added an option to consider intermission screens gameplay for purposes of
capturing the mouse.
- Changed: Telefragging should not thrust the victim if it isn't in precisely the
same position as the killer.
- fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned
object's position.
- Fixed: Ouch state was far to easy to achieve.
- Made all the basic texture classes local to their implementation.
They are not needed anywhere else.
- Changed the HackHack hack for corrupt 256 pixel high textures that
FMultiPatchTexture only calls a virtual function instead of doing any
type checks of the patch itself.
- Cleaned up the constant definitions in doomdata.h.
- Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp
because they are used only in this one file.
- Removed some more typedefs from r_defs.h and doomdata.h
- Moved local polyobject data definitions from p_local.h to po_man.cpp.
- Renamed player_s to player_t globally to get rid of the duplicate names
for this class.
- Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid
potential crashes in the situation that con_scaletext is 2 and somebody
uses a hud message as if a hud size was specified, but forgot to actually
set the hud size.
- Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar
into a single place.
- Fixed: Setting an invalid mug shot state crashed the game.
- Fixed my attempts to be clever with strings yesterday.
- If an actor's current target temporarily goes unshootable, its threshold
is now reset to 0, so it will more readily switch back to it.
- Fixed: Deactivating the game no longer allows reverb effects to continue
playing while the sound is paused.
- Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of
Flags.
- Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung
leaks and didn't allocate enough space for the fullStateName string.
- Disabled DUMB's mono destination mixers. It's not like I'm ever going to
target an original SoundBlaster, so they're a waste of space to have around.
This trims resample.obj down to ~60k now.
- Fixed: PrtScn/SysRq key did not work on Linux.
- Added an alternate module replay engine that uses foo_dumb's replayer, a
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque).
It has been slightly modified by me:
* Added support for Ogg Vorbis-compressed samples in XM files ala FMOD.
* Removed excessive mallocs from the replay core.
* Rerolled the loops in resample.c. Unrolling them made the object file
~250k large while providing little benefit. Even at ~100k, I think it's
still larger than it ought to be, but I'll live with it for now.
Other than that, it's essentially the same thing you'd hear in foobar2000,
minus some subsong detection features. Release builds of the library look
like they might even be slightly faster than FMOD, which is a plus.
- Fixed: Timidity::font_add() did not release the file reader it created.
- Fixed: The SF2 loader did not free the sample headers in its destructor.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
|
|
|
if ((flags & SIXF_TRANSFERTRANSLATION) && !(mo->flags2 & MF2_DONTTRANSLATE))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
mo->Translation = self->Translation;
|
|
|
|
}
|
2009-06-07 20:15:36 +00:00
|
|
|
if (flags & SIXF_TRANSFERPOINTERS)
|
|
|
|
{
|
|
|
|
mo->target = self->target;
|
|
|
|
mo->master = self->master; // This will be overridden later if SIXF_SETMASTER is set
|
|
|
|
mo->tracer = self->tracer;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
mo->angle=self->angle;
|
2009-06-04 13:59:08 +00:00
|
|
|
if (flags & SIXF_TRANSFERPITCH) mo->pitch = self->pitch;
|
2008-01-27 11:25:03 +00:00
|
|
|
while (originator && isMissile(originator)) originator = originator->target;
|
|
|
|
|
Update to ZDoom r1017:
- Fixed: MAPINFO's 'lookup' option should only work for actual strings but
not for lump and file names.
- Added a few 'activator == NULL' checks to some ACS functions.
- Added line and vertex lists to polyobjects so that I can do some
changes that won't work with only a seg list being maintained.
(SBarInfo update #23)
- Fixed: Drawing the amount of an inventory item in the player's inventory did
not work
- Added: PowerupTime to drawnumber and drawbar. You must specify a
powerupgiver. Although drawnumber goes in seconds the powerup has left
drawbar will use ticks for extra accuracy.
- I have increased cross-port compatibility with Skulltag. If an unknown
game mode is provided for sbarinfo's gamemode command it will ignore it and
continue.
- Added an option to consider intermission screens gameplay for purposes of
capturing the mouse.
- Changed: Telefragging should not thrust the victim if it isn't in precisely the
same position as the killer.
- fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned
object's position.
- Fixed: Ouch state was far to easy to achieve.
- Made all the basic texture classes local to their implementation.
They are not needed anywhere else.
- Changed the HackHack hack for corrupt 256 pixel high textures that
FMultiPatchTexture only calls a virtual function instead of doing any
type checks of the patch itself.
- Cleaned up the constant definitions in doomdata.h.
- Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp
because they are used only in this one file.
- Removed some more typedefs from r_defs.h and doomdata.h
- Moved local polyobject data definitions from p_local.h to po_man.cpp.
- Renamed player_s to player_t globally to get rid of the duplicate names
for this class.
- Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid
potential crashes in the situation that con_scaletext is 2 and somebody
uses a hud message as if a hud size was specified, but forgot to actually
set the hud size.
- Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar
into a single place.
- Fixed: Setting an invalid mug shot state crashed the game.
- Fixed my attempts to be clever with strings yesterday.
- If an actor's current target temporarily goes unshootable, its threshold
is now reset to 0, so it will more readily switch back to it.
- Fixed: Deactivating the game no longer allows reverb effects to continue
playing while the sound is paused.
- Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of
Flags.
- Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung
leaks and didn't allocate enough space for the fullStateName string.
- Disabled DUMB's mono destination mixers. It's not like I'm ever going to
target an original SoundBlaster, so they're a waste of space to have around.
This trims resample.obj down to ~60k now.
- Fixed: PrtScn/SysRq key did not work on Linux.
- Added an alternate module replay engine that uses foo_dumb's replayer, a
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque).
It has been slightly modified by me:
* Added support for Ogg Vorbis-compressed samples in XM files ala FMOD.
* Removed excessive mallocs from the replay core.
* Rerolled the loops in resample.c. Unrolling them made the object file
~250k large while providing little benefit. Even at ~100k, I think it's
still larger than it ought to be, but I'll live with it for now.
Other than that, it's essentially the same thing you'd hear in foobar2000,
minus some subsong detection features. Release builds of the library look
like they might even be slightly faster than FMOD, which is a plus.
- Fixed: Timidity::font_add() did not release the file reader it created.
- Fixed: The SF2 loader did not free the sample headers in its destructor.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
|
|
|
if (flags & SIXF_TELEFRAG)
|
|
|
|
{
|
|
|
|
P_TeleportMove(mo, mo->x, mo->y, mo->z, true);
|
|
|
|
// This is needed to ensure consistent behavior.
|
|
|
|
// Otherwise it will only spawn if nothing gets telefragged
|
|
|
|
flags |= SIXF_NOCHECKPOSITION;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
if (mo->flags3&MF3_ISMONSTER)
|
|
|
|
{
|
Update to ZDoom r1017:
- Fixed: MAPINFO's 'lookup' option should only work for actual strings but
not for lump and file names.
- Added a few 'activator == NULL' checks to some ACS functions.
- Added line and vertex lists to polyobjects so that I can do some
changes that won't work with only a seg list being maintained.
(SBarInfo update #23)
- Fixed: Drawing the amount of an inventory item in the player's inventory did
not work
- Added: PowerupTime to drawnumber and drawbar. You must specify a
powerupgiver. Although drawnumber goes in seconds the powerup has left
drawbar will use ticks for extra accuracy.
- I have increased cross-port compatibility with Skulltag. If an unknown
game mode is provided for sbarinfo's gamemode command it will ignore it and
continue.
- Added an option to consider intermission screens gameplay for purposes of
capturing the mouse.
- Changed: Telefragging should not thrust the victim if it isn't in precisely the
same position as the killer.
- fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned
object's position.
- Fixed: Ouch state was far to easy to achieve.
- Made all the basic texture classes local to their implementation.
They are not needed anywhere else.
- Changed the HackHack hack for corrupt 256 pixel high textures that
FMultiPatchTexture only calls a virtual function instead of doing any
type checks of the patch itself.
- Cleaned up the constant definitions in doomdata.h.
- Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp
because they are used only in this one file.
- Removed some more typedefs from r_defs.h and doomdata.h
- Moved local polyobject data definitions from p_local.h to po_man.cpp.
- Renamed player_s to player_t globally to get rid of the duplicate names
for this class.
- Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid
potential crashes in the situation that con_scaletext is 2 and somebody
uses a hud message as if a hud size was specified, but forgot to actually
set the hud size.
- Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar
into a single place.
- Fixed: Setting an invalid mug shot state crashed the game.
- Fixed my attempts to be clever with strings yesterday.
- If an actor's current target temporarily goes unshootable, its threshold
is now reset to 0, so it will more readily switch back to it.
- Fixed: Deactivating the game no longer allows reverb effects to continue
playing while the sound is paused.
- Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of
Flags.
- Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung
leaks and didn't allocate enough space for the fullStateName string.
- Disabled DUMB's mono destination mixers. It's not like I'm ever going to
target an original SoundBlaster, so they're a waste of space to have around.
This trims resample.obj down to ~60k now.
- Fixed: PrtScn/SysRq key did not work on Linux.
- Added an alternate module replay engine that uses foo_dumb's replayer, a
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque).
It has been slightly modified by me:
* Added support for Ogg Vorbis-compressed samples in XM files ala FMOD.
* Removed excessive mallocs from the replay core.
* Rerolled the loops in resample.c. Unrolling them made the object file
~250k large while providing little benefit. Even at ~100k, I think it's
still larger than it ought to be, but I'll live with it for now.
Other than that, it's essentially the same thing you'd hear in foobar2000,
minus some subsong detection features. Release builds of the library look
like they might even be slightly faster than FMOD, which is a plus.
- Fixed: Timidity::font_add() did not release the file reader it created.
- Fixed: The SF2 loader did not free the sample headers in its destructor.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
|
|
|
if (!(flags&SIXF_NOCHECKPOSITION) && !P_TestMobjLocation(mo))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// The monster is blocked so don't spawn it at all!
|
|
|
|
if (mo->CountsAsKill()) level.total_monsters--;
|
|
|
|
mo->Destroy();
|
2008-08-14 11:28:02 +00:00
|
|
|
return false;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (originator)
|
|
|
|
{
|
|
|
|
if (originator->flags3&MF3_ISMONSTER)
|
|
|
|
{
|
|
|
|
// If this is a monster transfer all friendliness information
|
|
|
|
mo->CopyFriendliness(originator, true);
|
Update to ZDoom r1017:
- Fixed: MAPINFO's 'lookup' option should only work for actual strings but
not for lump and file names.
- Added a few 'activator == NULL' checks to some ACS functions.
- Added line and vertex lists to polyobjects so that I can do some
changes that won't work with only a seg list being maintained.
(SBarInfo update #23)
- Fixed: Drawing the amount of an inventory item in the player's inventory did
not work
- Added: PowerupTime to drawnumber and drawbar. You must specify a
powerupgiver. Although drawnumber goes in seconds the powerup has left
drawbar will use ticks for extra accuracy.
- I have increased cross-port compatibility with Skulltag. If an unknown
game mode is provided for sbarinfo's gamemode command it will ignore it and
continue.
- Added an option to consider intermission screens gameplay for purposes of
capturing the mouse.
- Changed: Telefragging should not thrust the victim if it isn't in precisely the
same position as the killer.
- fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned
object's position.
- Fixed: Ouch state was far to easy to achieve.
- Made all the basic texture classes local to their implementation.
They are not needed anywhere else.
- Changed the HackHack hack for corrupt 256 pixel high textures that
FMultiPatchTexture only calls a virtual function instead of doing any
type checks of the patch itself.
- Cleaned up the constant definitions in doomdata.h.
- Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp
because they are used only in this one file.
- Removed some more typedefs from r_defs.h and doomdata.h
- Moved local polyobject data definitions from p_local.h to po_man.cpp.
- Renamed player_s to player_t globally to get rid of the duplicate names
for this class.
- Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid
potential crashes in the situation that con_scaletext is 2 and somebody
uses a hud message as if a hud size was specified, but forgot to actually
set the hud size.
- Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar
into a single place.
- Fixed: Setting an invalid mug shot state crashed the game.
- Fixed my attempts to be clever with strings yesterday.
- If an actor's current target temporarily goes unshootable, its threshold
is now reset to 0, so it will more readily switch back to it.
- Fixed: Deactivating the game no longer allows reverb effects to continue
playing while the sound is paused.
- Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of
Flags.
- Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung
leaks and didn't allocate enough space for the fullStateName string.
- Disabled DUMB's mono destination mixers. It's not like I'm ever going to
target an original SoundBlaster, so they're a waste of space to have around.
This trims resample.obj down to ~60k now.
- Fixed: PrtScn/SysRq key did not work on Linux.
- Added an alternate module replay engine that uses foo_dumb's replayer, a
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque).
It has been slightly modified by me:
* Added support for Ogg Vorbis-compressed samples in XM files ala FMOD.
* Removed excessive mallocs from the replay core.
* Rerolled the loops in resample.c. Unrolling them made the object file
~250k large while providing little benefit. Even at ~100k, I think it's
still larger than it ought to be, but I'll live with it for now.
Other than that, it's essentially the same thing you'd hear in foobar2000,
minus some subsong detection features. Release builds of the library look
like they might even be slightly faster than FMOD, which is a plus.
- Fixed: Timidity::font_add() did not release the file reader it created.
- Fixed: The SF2 loader did not free the sample headers in its destructor.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
|
|
|
if (flags&SIXF_SETMASTER) mo->master = originator; // don't let it attack you (optional)!
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (originator->player)
|
|
|
|
{
|
|
|
|
// A player always spawns a monster friendly to him
|
|
|
|
mo->flags|=MF_FRIENDLY;
|
Update to ZDoom r1585:
- Added ACS GetChar function.
- Added Gez's submission for polyobjects being able to crush corpses but made
it an explicit MAPINFO option only.
- Changed APlayerPawn::DamageFade to a PalEntry from 3 floats.
- Removed #pragma warnings from cmdlib.h and fixed the places where they were
still triggered.
These #pragmas were responsible for >90% of the GCC warnings that were not
listed in VC++.
- Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the
parameter handling of the sound functions for attenuation was changed.
Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values.
Also added the option to specify attenuation with direct values in addition
to the predefined names.
- fixed a few Heretic actors:
* The pod generator's attacksound was wrong
* The teleglitter generators need different flags if they are supposed to work
with z-aware spawning of the glitter.
* The knight's axes need the THRUGHOST flag.
- Fixed non-POD passing in G_BuildSaveName() and other things GCC warned
about.
- Added support for imploded zips.
- Fixed: Some missile spawning functions ignored the FastSpeed setting.
- Fixed: P_CheckSwitchRange tried to access a line's backsector without
checking if it is valid.
- Fixed: Fast projectile could not be frozen by the Time freezer.
- Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight,
SetActivator, SetActivatorToTarget.
- Added Species property for actors and separated Hexen's Demon1 and Demon2
into different species.
- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC.
- Fixed: The short lump name for embedded files must be cleared so that they
are not found by a normal lump search.
- Added AProp_Notarget actor property.
- Fixed: TraceBleed was missing a NULL pointer check,
- Fixed: P_RandomChaseDir could crash for friendly monsters that belong to
a player which left the game.
- Changed A_PodGrow so that it plays the generator's attack sound instead of
"misc/podgrow".
- Added transference of a select few flags from PowerProtection to its owner.
- Added actor type parameters to A_PodPain() and A_MakePod().
- The savegame path is now passed through NicePath(), since it's user-
specifiable.
- Added save_dir cvar. When non-empty, it controls where savegames go.
- SBARINFO update:
* Added the ability to center things with fullscreenoffsets enabled. Due
to some limitations the syntax is [-]<integer> [+ center].
* Fixed: the translucent flag on drawinventorybar didn't work quite right.
* Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The
fullscreen inventory bar wasn't scaled correctly.
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
- Added more compatibility settings, submitted by Gez.
- Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be
the same as 'next endgame4'.
- GCC nitpick fix: Classes being used as template parameters may not be
defined locally in a function. Fixed FWadFile::SetNamespace for that.
- Improved error reporting for incorrect textures in maps.
- Fixed: When music was stopped this was not set in the global music state.
- Fixed: Friendly monsters did not target enemy players in deathmatch.
- Fixed: Completely empty patches (8 0-bytes) could not be handled by the
texture manager. They now get assigned a new FEmptyTexture object
that is just a 1x1 pixel transparent texture.
- Fixed: Multiple namespace markers of the same type were no longer detected.
- Fixed sprite renaming.
- Maps defined with Hexen-style MAPINFOs now run their scripts in the proper
order.
- Fixed: FWadCollection::CheckNumForName() read the lump each iteration before
checking for the end marker. On 32-bit systems, this is -1, but on 64-bit
systems, it is a very large integer that is highly unlikely to be in mapped
memory.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
|
|
|
mo->FriendPlayer = int(originator->player-players+1);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
AActor * attacker=originator->player->attacker;
|
|
|
|
if (attacker)
|
|
|
|
{
|
|
|
|
if (!(attacker->flags&MF_FRIENDLY) ||
|
|
|
|
(deathmatch && attacker->FriendPlayer!=0 && attacker->FriendPlayer!=mo->FriendPlayer))
|
|
|
|
{
|
|
|
|
// Target the monster which last attacked the player
|
2008-06-28 13:29:59 +00:00
|
|
|
mo->LastHeard = mo->target = attacker;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-06-07 20:15:36 +00:00
|
|
|
else if (!(flags & SIXF_TRANSFERPOINTERS))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// If this is a missile or something else set the target to the originator
|
|
|
|
mo->target=originator? originator : self;
|
|
|
|
}
|
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
return true;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SpawnItem
|
|
|
|
//
|
|
|
|
// Spawns an item in front of the caller like Heretic's time bomb
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItem)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(5);
|
|
|
|
ACTION_PARAM_CLASS(missile, 0);
|
|
|
|
ACTION_PARAM_FIXED(distance, 1);
|
|
|
|
ACTION_PARAM_FIXED(zheight, 2);
|
|
|
|
ACTION_PARAM_BOOL(useammo, 3);
|
|
|
|
ACTION_PARAM_BOOL(transfer_translation, 4);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!missile)
|
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false);
|
2008-01-27 11:25:03 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Don't spawn monsters if this actor has been massacred
|
|
|
|
if (self->DamageType == NAME_Massacre && GetDefaultByType(missile)->flags3&MF3_ISMONSTER) return;
|
|
|
|
|
|
|
|
if (distance==0)
|
|
|
|
{
|
|
|
|
// use the minimum distance that does not result in an overlap
|
|
|
|
distance=(self->radius+GetDefaultByType(missile)->radius)>>FRACBITS;
|
|
|
|
}
|
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (ACTION_CALL_FROM_WEAPON())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// Used from a weapon so use some ammo
|
|
|
|
AWeapon * weapon=self->player->ReadyWeapon;
|
|
|
|
|
|
|
|
if (!weapon) return;
|
|
|
|
if (useammo && !weapon->DepleteAmmo(weapon->bAltFire)) return;
|
|
|
|
}
|
|
|
|
|
|
|
|
AActor * mo = Spawn( missile,
|
|
|
|
self->x + FixedMul(distance, finecosine[self->angle>>ANGLETOFINESHIFT]),
|
|
|
|
self->y + FixedMul(distance, finesine[self->angle>>ANGLETOFINESHIFT]),
|
|
|
|
self->z - self->floorclip + zheight, ALLOW_REPLACE);
|
|
|
|
|
Update to ZDoom r1017:
- Fixed: MAPINFO's 'lookup' option should only work for actual strings but
not for lump and file names.
- Added a few 'activator == NULL' checks to some ACS functions.
- Added line and vertex lists to polyobjects so that I can do some
changes that won't work with only a seg list being maintained.
(SBarInfo update #23)
- Fixed: Drawing the amount of an inventory item in the player's inventory did
not work
- Added: PowerupTime to drawnumber and drawbar. You must specify a
powerupgiver. Although drawnumber goes in seconds the powerup has left
drawbar will use ticks for extra accuracy.
- I have increased cross-port compatibility with Skulltag. If an unknown
game mode is provided for sbarinfo's gamemode command it will ignore it and
continue.
- Added an option to consider intermission screens gameplay for purposes of
capturing the mouse.
- Changed: Telefragging should not thrust the victim if it isn't in precisely the
same position as the killer.
- fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned
object's position.
- Fixed: Ouch state was far to easy to achieve.
- Made all the basic texture classes local to their implementation.
They are not needed anywhere else.
- Changed the HackHack hack for corrupt 256 pixel high textures that
FMultiPatchTexture only calls a virtual function instead of doing any
type checks of the patch itself.
- Cleaned up the constant definitions in doomdata.h.
- Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp
because they are used only in this one file.
- Removed some more typedefs from r_defs.h and doomdata.h
- Moved local polyobject data definitions from p_local.h to po_man.cpp.
- Renamed player_s to player_t globally to get rid of the duplicate names
for this class.
- Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid
potential crashes in the situation that con_scaletext is 2 and somebody
uses a hud message as if a hud size was specified, but forgot to actually
set the hud size.
- Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar
into a single place.
- Fixed: Setting an invalid mug shot state crashed the game.
- Fixed my attempts to be clever with strings yesterday.
- If an actor's current target temporarily goes unshootable, its threshold
is now reset to 0, so it will more readily switch back to it.
- Fixed: Deactivating the game no longer allows reverb effects to continue
playing while the sound is paused.
- Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of
Flags.
- Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung
leaks and didn't allocate enough space for the fullStateName string.
- Disabled DUMB's mono destination mixers. It's not like I'm ever going to
target an original SoundBlaster, so they're a waste of space to have around.
This trims resample.obj down to ~60k now.
- Fixed: PrtScn/SysRq key did not work on Linux.
- Added an alternate module replay engine that uses foo_dumb's replayer, a
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque).
It has been slightly modified by me:
* Added support for Ogg Vorbis-compressed samples in XM files ala FMOD.
* Removed excessive mallocs from the replay core.
* Rerolled the loops in resample.c. Unrolling them made the object file
~250k large while providing little benefit. Even at ~100k, I think it's
still larger than it ought to be, but I'll live with it for now.
Other than that, it's essentially the same thing you'd hear in foobar2000,
minus some subsong detection features. Release builds of the library look
like they might even be slightly faster than FMOD, which is a plus.
- Fixed: Timidity::font_add() did not release the file reader it created.
- Fixed: The SF2 loader did not free the sample headers in its destructor.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
|
|
|
int flags = (transfer_translation? SIXF_TRANSFERTRANSLATION:0) + (useammo? SIXF_SETMASTER:0);
|
2008-08-14 11:28:02 +00:00
|
|
|
bool res = InitSpawnedItem(self, mo, flags);
|
|
|
|
ACTION_SET_RESULT(res); // for an inventory item's use state
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SpawnItemEx
|
|
|
|
//
|
|
|
|
// Enhanced spawning function
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItemEx)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(10);
|
|
|
|
ACTION_PARAM_CLASS(missile, 0);
|
|
|
|
ACTION_PARAM_FIXED(xofs, 1);
|
|
|
|
ACTION_PARAM_FIXED(yofs, 2);
|
|
|
|
ACTION_PARAM_FIXED(zofs, 3);
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
ACTION_PARAM_FIXED(xvel, 4);
|
|
|
|
ACTION_PARAM_FIXED(yvel, 5);
|
|
|
|
ACTION_PARAM_FIXED(zvel, 6);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_ANGLE(Angle, 7);
|
|
|
|
ACTION_PARAM_INT(flags, 8);
|
|
|
|
ACTION_PARAM_INT(chance, 9);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!missile)
|
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false);
|
2008-01-27 11:25:03 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (chance > 0 && pr_spawnitemex()<chance) return;
|
|
|
|
|
|
|
|
// Don't spawn monsters if this actor has been massacred
|
|
|
|
if (self->DamageType == NAME_Massacre && GetDefaultByType(missile)->flags3&MF3_ISMONSTER) return;
|
|
|
|
|
|
|
|
fixed_t x,y;
|
|
|
|
|
|
|
|
if (!(flags & SIXF_ABSOLUTEANGLE))
|
|
|
|
{
|
|
|
|
Angle += self->angle;
|
|
|
|
}
|
|
|
|
|
|
|
|
angle_t ang = Angle >> ANGLETOFINESHIFT;
|
|
|
|
|
|
|
|
if (flags & SIXF_ABSOLUTEPOSITION)
|
|
|
|
{
|
|
|
|
x = self->x + xofs;
|
|
|
|
y = self->y + yofs;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// in relative mode negative y values mean 'left' and positive ones mean 'right'
|
|
|
|
// This is the inverse orientation of the absolute mode!
|
|
|
|
x = self->x + FixedMul(xofs, finecosine[ang]) + FixedMul(yofs, finesine[ang]);
|
|
|
|
y = self->y + FixedMul(xofs, finesine[ang]) - FixedMul(yofs, finecosine[ang]);
|
|
|
|
}
|
|
|
|
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
if (!(flags & SIXF_ABSOLUTEVELOCITY))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// Same orientation issue here!
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
fixed_t newxvel = FixedMul(xvel, finecosine[ang]) + FixedMul(yvel, finesine[ang]);
|
|
|
|
yvel = FixedMul(xvel, finesine[ang]) - FixedMul(yvel, finecosine[ang]);
|
|
|
|
xvel = newxvel;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
AActor * mo = Spawn(missile, x, y, self->z - self->floorclip + zofs, ALLOW_REPLACE);
|
2008-08-14 11:28:02 +00:00
|
|
|
bool res = InitSpawnedItem(self, mo, flags);
|
|
|
|
ACTION_SET_RESULT(res); // for an inventory item's use state
|
2008-01-27 11:25:03 +00:00
|
|
|
if (mo)
|
|
|
|
{
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
mo->velx = xvel;
|
|
|
|
mo->vely = yvel;
|
|
|
|
mo->velz = zvel;
|
|
|
|
mo->angle = Angle;
|
|
|
|
if (flags & SIXF_TRANSFERAMBUSHFLAG)
|
|
|
|
mo->flags = (mo->flags&~MF_AMBUSH) | (self->flags & MF_AMBUSH);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_ThrowGrenade
|
|
|
|
//
|
|
|
|
// Throws a grenade (like Hexen's fighter flechette)
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(5);
|
|
|
|
ACTION_PARAM_CLASS(missile, 0);
|
|
|
|
ACTION_PARAM_FIXED(zheight, 1);
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
ACTION_PARAM_FIXED(xyvel, 2);
|
|
|
|
ACTION_PARAM_FIXED(zvel, 3);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_BOOL(useammo, 4);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-10-25 21:48:56 +00:00
|
|
|
if (missile == NULL) return;
|
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (ACTION_CALL_FROM_WEAPON())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// Used from a weapon so use some ammo
|
|
|
|
AWeapon * weapon=self->player->ReadyWeapon;
|
|
|
|
|
|
|
|
if (!weapon) return;
|
|
|
|
if (useammo && !weapon->DepleteAmmo(weapon->bAltFire)) return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AActor * bo;
|
|
|
|
|
|
|
|
bo = Spawn(missile, self->x, self->y,
|
|
|
|
self->z - self->floorclip + zheight + 35*FRACUNIT + (self->player? self->player->crouchoffset : 0),
|
|
|
|
ALLOW_REPLACE);
|
|
|
|
if (bo)
|
|
|
|
{
|
|
|
|
int pitch = self->pitch;
|
|
|
|
|
|
|
|
P_PlaySpawnSound(bo, self);
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
if (xyvel)
|
|
|
|
bo->Speed = xyvel;
|
|
|
|
bo->angle = self->angle + (((pr_grenade()&7) - 4) << 24);
|
|
|
|
bo->velz = zvel + 2*finesine[pitch>>ANGLETOFINESHIFT];
|
2008-01-27 11:25:03 +00:00
|
|
|
bo->z += 2 * finesine[pitch>>ANGLETOFINESHIFT];
|
|
|
|
P_ThrustMobj(bo, bo->angle, bo->Speed);
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
bo->velx += self->velx >> 1;
|
|
|
|
bo->vely += self->vely >> 1;
|
2008-01-27 11:25:03 +00:00
|
|
|
bo->target= self;
|
|
|
|
P_CheckMissileSpawn (bo);
|
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
else ACTION_SET_RESULT(false);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_Recoil
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Recoil)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
ACTION_PARAM_FIXED(xyvel, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
angle_t angle = self->angle + ANG180;
|
2008-01-27 11:25:03 +00:00
|
|
|
angle >>= ANGLETOFINESHIFT;
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
self->velx += FixedMul (xyvel, finecosine[angle]);
|
|
|
|
self->vely += FixedMul (xyvel, finesine[angle]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SelectWeapon
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SelectWeapon)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_CLASS(cls, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-10-25 21:48:56 +00:00
|
|
|
if (cls == NULL || self->player == NULL)
|
|
|
|
{
|
|
|
|
ACTION_SET_RESULT(false);
|
|
|
|
return;
|
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
|
|
|
|
AWeapon * weaponitem = static_cast<AWeapon*>(self->FindInventory(cls));
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (weaponitem != NULL && weaponitem->IsKindOf(RUNTIME_CLASS(AWeapon)))
|
|
|
|
{
|
2008-08-12 08:00:28 +00:00
|
|
|
if (self->player->ReadyWeapon != weaponitem)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-12 08:00:28 +00:00
|
|
|
self->player->PendingWeapon = weaponitem;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
2008-08-14 11:28:02 +00:00
|
|
|
else ACTION_SET_RESULT(false);
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_Print
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
EXTERN_CVAR(Float, con_midtime)
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Print)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(3);
|
|
|
|
ACTION_PARAM_STRING(text, 0);
|
|
|
|
ACTION_PARAM_FLOAT(time, 1);
|
|
|
|
ACTION_PARAM_NAME(fontname, 2);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
if (self->CheckLocalView (consoleplayer) ||
|
|
|
|
(self->target!=NULL && self->target->CheckLocalView (consoleplayer)))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
float saved = con_midtime;
|
2008-11-27 23:28:48 +00:00
|
|
|
FFont *font = NULL;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (fontname != NAME_None)
|
|
|
|
{
|
2008-11-27 23:28:48 +00:00
|
|
|
font = V_GetFont(fontname);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
if (time > 0)
|
|
|
|
{
|
|
|
|
con_midtime = time;
|
|
|
|
}
|
|
|
|
|
2009-10-16 16:17:24 +00:00
|
|
|
FString formatted = strbin1(text);
|
|
|
|
C_MidPrint(font != NULL ? font : SmallFont, formatted.GetChars());
|
2008-01-27 11:25:03 +00:00
|
|
|
con_midtime = saved;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-15 06:19:39 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_PrintBold
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PrintBold)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(3);
|
|
|
|
ACTION_PARAM_STRING(text, 0);
|
|
|
|
ACTION_PARAM_FLOAT(time, 1);
|
|
|
|
ACTION_PARAM_NAME(fontname, 2);
|
|
|
|
|
|
|
|
float saved = con_midtime;
|
|
|
|
FFont *font = NULL;
|
|
|
|
|
|
|
|
if (fontname != NAME_None)
|
|
|
|
{
|
|
|
|
font = V_GetFont(fontname);
|
|
|
|
}
|
|
|
|
if (time > 0)
|
|
|
|
{
|
|
|
|
con_midtime = time;
|
|
|
|
}
|
|
|
|
|
2009-10-16 16:17:24 +00:00
|
|
|
FString formatted = strbin1(text);
|
|
|
|
C_MidPrintBold(font != NULL ? font : SmallFont, formatted.GetChars());
|
2009-09-15 06:19:39 +00:00
|
|
|
con_midtime = saved;
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_Log
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Log)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_STRING(text, 0);
|
|
|
|
Printf("%s\n", text);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-10-25 15:31:09 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_LogInt
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LogInt)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_INT(num, 0);
|
|
|
|
Printf("%d\n", num);
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SetTranslucent
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTranslucent)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_FIXED(alpha, 0);
|
|
|
|
ACTION_PARAM_INT(mode, 1);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
mode = mode == 0 ? STYLE_Translucent : mode == 2 ? STYLE_Fuzzy : STYLE_Add;
|
|
|
|
|
2008-01-27 15:34:47 +00:00
|
|
|
self->RenderStyle.Flags &= ~STYLEF_Alpha1;
|
|
|
|
self->alpha = clamp<fixed_t>(alpha, 0, FRACUNIT);
|
|
|
|
self->RenderStyle = ERenderStyle(mode);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_FadeIn
|
|
|
|
//
|
|
|
|
// Fades the actor in
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeIn)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_FIXED(reduce, 0);
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if (reduce == 0) reduce = FRACUNIT/10;
|
|
|
|
|
2008-01-27 15:34:47 +00:00
|
|
|
self->RenderStyle.Flags &= ~STYLEF_Alpha1;
|
2008-01-27 11:25:03 +00:00
|
|
|
self->alpha += reduce;
|
|
|
|
//if (self->alpha<=0) self->Destroy();
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_FadeOut
|
|
|
|
//
|
|
|
|
// fades the actor out and destroys it when done
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeOut)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-06-14 18:05:00 +00:00
|
|
|
ACTION_PARAM_START(2);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_FIXED(reduce, 0);
|
2009-06-14 18:05:00 +00:00
|
|
|
ACTION_PARAM_BOOL(remove, 1);
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if (reduce == 0) reduce = FRACUNIT/10;
|
|
|
|
|
2008-01-27 15:34:47 +00:00
|
|
|
self->RenderStyle.Flags &= ~STYLEF_Alpha1;
|
2008-01-27 11:25:03 +00:00
|
|
|
self->alpha -= reduce;
|
2009-06-14 18:05:00 +00:00
|
|
|
if (self->alpha<=0 && remove) self->Destroy();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SpawnDebris
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnDebris)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
AActor * mo;
|
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(4);
|
|
|
|
ACTION_PARAM_CLASS(debris, 0);
|
|
|
|
ACTION_PARAM_BOOL(transfer_translation, 1);
|
|
|
|
ACTION_PARAM_FIXED(mult_h, 2);
|
|
|
|
ACTION_PARAM_FIXED(mult_v, 3);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (debris == NULL) return;
|
|
|
|
|
|
|
|
// only positive values make sense here
|
|
|
|
if (mult_v<=0) mult_v=FRACUNIT;
|
|
|
|
if (mult_h<=0) mult_h=FRACUNIT;
|
|
|
|
|
|
|
|
for (i = 0; i < GetDefaultByType(debris)->health; i++)
|
|
|
|
{
|
|
|
|
mo = Spawn(debris, self->x+((pr_spawndebris()-128)<<12),
|
|
|
|
self->y+((pr_spawndebris()-128)<<12),
|
|
|
|
self->z+(pr_spawndebris()*self->height/256), ALLOW_REPLACE);
|
|
|
|
if (mo && transfer_translation)
|
|
|
|
{
|
|
|
|
mo->Translation = self->Translation;
|
|
|
|
}
|
|
|
|
if (mo && i < mo->GetClass()->ActorInfo->NumOwnedStates)
|
|
|
|
{
|
|
|
|
mo->SetState (mo->GetClass()->ActorInfo->OwnedStates + i);
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
mo->velz = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT);
|
|
|
|
mo->velx = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
|
|
|
|
mo->vely = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_CheckSight
|
|
|
|
// jumps if no player can see this actor
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckSight)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_STATE(jump, 0);
|
|
|
|
|
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
for (int i=0;i<MAXPLAYERS;i++)
|
|
|
|
{
|
|
|
|
if (playeringame[i] && P_CheckSight(players[i].camera,self,true)) return;
|
|
|
|
}
|
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_JUMP(jump);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// Inventory drop
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropInventory)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_CLASS(drop, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-10-25 21:48:56 +00:00
|
|
|
if (drop)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-10-25 21:48:56 +00:00
|
|
|
AInventory * inv = self->FindInventory(drop);
|
|
|
|
if (inv)
|
|
|
|
{
|
|
|
|
self->DropInventory(inv);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SetBlend
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetBlend)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(4);
|
|
|
|
ACTION_PARAM_COLOR(color, 0);
|
|
|
|
ACTION_PARAM_FLOAT(alpha, 1);
|
|
|
|
ACTION_PARAM_INT(tics, 2);
|
|
|
|
ACTION_PARAM_COLOR(color2, 3);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (color == MAKEARGB(255,255,255,255)) color=0;
|
|
|
|
if (color2 == MAKEARGB(255,255,255,255)) color2=0;
|
|
|
|
if (!color2.a)
|
|
|
|
color2 = color;
|
|
|
|
|
|
|
|
new DFlashFader(color.r/255.0f, color.g/255.0f, color.b/255.0f, alpha,
|
|
|
|
color2.r/255.0f, color2.g/255.0f, color2.b/255.0f, 0,
|
|
|
|
(float)tics/TICRATE, self);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_JumpIf
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIf)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_BOOL(expression, 0);
|
|
|
|
ACTION_PARAM_STATE(jump, 1);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
|
|
|
if (expression) ACTION_JUMP(jump);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_KillMaster
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2009-12-13 09:47:09 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillMaster)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-12-13 09:47:09 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_NAME(damagetype, 0);
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if (self->master != NULL)
|
|
|
|
{
|
2009-12-13 09:47:09 +00:00
|
|
|
P_DamageMobj(self->master, self, self, self->master->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_KillChildren
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2009-12-13 09:47:09 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillChildren)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-12-13 09:47:09 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_NAME(damagetype, 0);
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
TThinkerIterator<AActor> it;
|
2009-12-13 09:47:09 +00:00
|
|
|
AActor *mo;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
while ( (mo = it.Next()) )
|
|
|
|
{
|
|
|
|
if (mo->master == self)
|
|
|
|
{
|
2009-12-13 09:47:09 +00:00
|
|
|
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-06 23:37:13 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_KillSiblings
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2009-12-13 09:47:09 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillSiblings)
|
2008-12-06 23:37:13 +00:00
|
|
|
{
|
2009-12-13 09:47:09 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_NAME(damagetype, 0);
|
|
|
|
|
2008-12-06 23:37:13 +00:00
|
|
|
TThinkerIterator<AActor> it;
|
2009-12-13 09:47:09 +00:00
|
|
|
AActor *mo;
|
2008-12-06 23:37:13 +00:00
|
|
|
|
|
|
|
while ( (mo = it.Next()) )
|
|
|
|
{
|
|
|
|
if (mo->master == self->master && mo != self)
|
|
|
|
{
|
2009-12-13 09:47:09 +00:00
|
|
|
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
|
2008-12-06 23:37:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_CountdownArg
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CountdownArg)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-10-16 16:17:24 +00:00
|
|
|
ACTION_PARAM_START(2);
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_INT(cnt, 0);
|
2009-10-16 16:17:24 +00:00
|
|
|
ACTION_PARAM_STATE(state, 1);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
if (cnt<0 || cnt>=5) return;
|
|
|
|
if (!self->args[cnt]--)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (self->flags&MF_MISSILE)
|
|
|
|
{
|
|
|
|
P_ExplodeMissile(self, NULL, NULL);
|
|
|
|
}
|
|
|
|
else if (self->flags&MF_SHOOTABLE)
|
|
|
|
{
|
2009-05-23 10:24:33 +00:00
|
|
|
P_DamageMobj (self, NULL, NULL, self->health, NAME_None, DMG_FORCED);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-10-16 16:17:24 +00:00
|
|
|
// can't use "Death" as default parameter with current DECORATE parser.
|
|
|
|
if (state == NULL) state = self->FindState(NAME_Death);
|
|
|
|
self->SetState(state);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// A_Burst
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_CLASS(chunk, 0);
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
int i, numChunks;
|
|
|
|
AActor * mo;
|
2008-08-14 11:28:02 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if (chunk == NULL) return;
|
|
|
|
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
self->velx = self->vely = self->velz = 0;
|
2008-08-12 08:00:28 +00:00
|
|
|
self->height = self->GetDefault()->height;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// [RH] In Hexen, this creates a random number of shards (range [24,56])
|
2008-08-12 08:00:28 +00:00
|
|
|
// with no relation to the size of the self shattering. I think it should
|
2008-01-27 11:25:03 +00:00
|
|
|
// base the number of shards on the size of the dead thing, so bigger
|
|
|
|
// things break up into more shards than smaller things.
|
2008-08-12 08:00:28 +00:00
|
|
|
// An self with radius 20 and height 64 creates ~40 chunks.
|
|
|
|
numChunks = MAX<int> (4, (self->radius>>FRACBITS)*(self->height>>FRACBITS)/32);
|
2008-01-27 11:25:03 +00:00
|
|
|
i = (pr_burst.Random2()) % (numChunks/4);
|
|
|
|
for (i = MAX (24, numChunks + i); i >= 0; i--)
|
|
|
|
{
|
|
|
|
mo = Spawn(chunk,
|
2008-08-12 08:00:28 +00:00
|
|
|
self->x + (((pr_burst()-128)*self->radius)>>7),
|
|
|
|
self->y + (((pr_burst()-128)*self->radius)>>7),
|
|
|
|
self->z + (pr_burst()*self->height/255), ALLOW_REPLACE);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (mo)
|
|
|
|
{
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
mo->velz = FixedDiv(mo->z - self->z, self->height)<<2;
|
|
|
|
mo->velx = pr_burst.Random2 () << (FRACBITS-7);
|
|
|
|
mo->vely = pr_burst.Random2 () << (FRACBITS-7);
|
2008-08-12 08:00:28 +00:00
|
|
|
mo->RenderStyle = self->RenderStyle;
|
|
|
|
mo->alpha = self->alpha;
|
|
|
|
mo->CopyFriendliness(self, true);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] Do some stuff to make this more useful outside Hexen
|
2008-08-12 08:00:28 +00:00
|
|
|
if (self->flags4 & MF4_BOSSDEATH)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-12 08:00:28 +00:00
|
|
|
CALL_ACTION(A_BossDeath, self);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-08-12 08:00:28 +00:00
|
|
|
CALL_ACTION(A_NoBlocking, self);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
self->Destroy ();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_CheckFloor
|
|
|
|
// [GRB] Jumps if actor is standing on floor
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckFloor)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_STATE(jump, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
|
|
|
if (self->z <= self->floorz)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_JUMP(jump);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-04-28 21:31:02 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_CheckCeiling
|
|
|
|
// [GZ] Totally copied on A_CheckFloor, jumps if actor touches ceiling
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckCeiling)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_STATE(jump, 0);
|
|
|
|
|
|
|
|
ACTION_SET_RESULT(false);
|
|
|
|
if (self->z+self->height >= self->ceilingz) // Height needs to be counted
|
|
|
|
{
|
|
|
|
ACTION_JUMP(jump);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_Stop
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
// resets all velocity of the actor to 0
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_Stop)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
self->velx = self->vely = self->velz = 0;
|
2008-07-06 17:32:31 +00:00
|
|
|
if (self->player && self->player->mo == self && !(self->player->cheats & CF_PREDICTING))
|
|
|
|
{
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
self->player->mo->PlayIdle();
|
|
|
|
self->player->velx = self->player->vely = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void CheckStopped(AActor *self)
|
|
|
|
{
|
|
|
|
if (self->player != NULL &&
|
|
|
|
self->player->mo == self &&
|
|
|
|
!(self->player->cheats & CF_PREDICTING) &&
|
|
|
|
!(self->velx | self->vely | self->velz))
|
|
|
|
{
|
|
|
|
self->player->mo->PlayIdle();
|
|
|
|
self->player->velx = self->player->vely = 0;
|
2008-07-06 17:32:31 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_Respawn
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2009-09-15 22:09:18 +00:00
|
|
|
|
|
|
|
enum RS_Flags
|
|
|
|
{
|
|
|
|
RSF_FOG=1,
|
|
|
|
RSF_KEEPTARGET=2,
|
|
|
|
RSF_TELEFRAG=4,
|
|
|
|
};
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
2009-09-15 22:09:18 +00:00
|
|
|
ACTION_PARAM_INT(flags, 0);
|
2008-08-14 11:28:02 +00:00
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
fixed_t x = self->SpawnPoint[0];
|
|
|
|
fixed_t y = self->SpawnPoint[1];
|
2009-09-15 22:09:18 +00:00
|
|
|
bool oktorespawn = false;
|
2008-01-27 11:25:03 +00:00
|
|
|
sector_t *sec;
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
self->flags |= MF_SOLID;
|
2008-01-27 11:25:03 +00:00
|
|
|
sec = P_PointInSector (x, y);
|
2008-08-12 08:00:28 +00:00
|
|
|
self->height = self->GetDefault()->height;
|
2009-09-15 22:09:18 +00:00
|
|
|
|
|
|
|
if (flags & RSF_TELEFRAG)
|
|
|
|
{
|
|
|
|
// [KS] DIE DIE DIE DIE erm *ahem* =)
|
|
|
|
if (P_TeleportMove (self, x, y, sec->floorplane.ZatPoint (x, y), true)) oktorespawn = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
self->SetOrigin (x, y, sec->floorplane.ZatPoint (x, y));
|
|
|
|
if (P_TestMobjLocation (self)) oktorespawn = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (oktorespawn)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-12 08:00:28 +00:00
|
|
|
AActor *defs = self->GetDefault();
|
|
|
|
self->health = defs->health;
|
2009-09-15 22:09:18 +00:00
|
|
|
|
|
|
|
// [KS] Don't keep target, because it could be self if the monster committed suicide
|
|
|
|
// ...Actually it's better off an option, so you have better control over monster behavior.
|
|
|
|
if (!(flags & RSF_KEEPTARGET))
|
|
|
|
{
|
|
|
|
self->target = NULL;
|
|
|
|
self->LastHeard = NULL;
|
|
|
|
self->lastenemy = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Don't attack yourself (Re: "Marine targets itself after suicide")
|
|
|
|
if (self->target == self) self->target = NULL;
|
|
|
|
if (self->lastenemy == self) self->lastenemy = NULL;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
self->flags = (defs->flags & ~MF_FRIENDLY) | (self->flags & MF_FRIENDLY);
|
|
|
|
self->flags2 = defs->flags2;
|
|
|
|
self->flags3 = (defs->flags3 & ~(MF3_NOSIGHTCHECK | MF3_HUNTPLAYERS)) | (self->flags3 & (MF3_NOSIGHTCHECK | MF3_HUNTPLAYERS));
|
|
|
|
self->flags4 = (defs->flags4 & ~MF4_NOHATEPLAYERS) | (self->flags4 & MF4_NOHATEPLAYERS);
|
|
|
|
self->flags5 = defs->flags5;
|
|
|
|
self->SetState (self->SpawnState);
|
|
|
|
self->renderflags &= ~RF_INVISIBLE;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-09-15 22:09:18 +00:00
|
|
|
if (flags & RSF_FOG)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-12 08:00:28 +00:00
|
|
|
Spawn<ATeleportFog> (x, y, self->z + TELEFOGHEIGHT, ALLOW_REPLACE);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-08-12 08:00:28 +00:00
|
|
|
if (self->CountsAsKill()) level.total_monsters++;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-12 08:00:28 +00:00
|
|
|
self->flags &= ~MF_SOLID;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// A_PlayerSkinCheck
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlayerSkinCheck)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_STATE(jump, 0);
|
|
|
|
|
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
2008-08-12 08:00:28 +00:00
|
|
|
if (self->player != NULL &&
|
|
|
|
skins[self->player->userinfo.skin].othergame)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_JUMP(jump);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SetGravity
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetGravity)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_FIXED(val, 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
self->gravity = clamp<fixed_t> (val, 0, FRACUNIT*10);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// [KS] *** Start of my modifications ***
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_ClearTarget
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_ClearTarget)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
self->target = NULL;
|
|
|
|
self->LastHeard = NULL;
|
|
|
|
self->lastenemy = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-05-17 08:47:26 +00:00
|
|
|
// A_JumpIfTargetInLOS (state label, optional fixed fov, optional bool
|
|
|
|
// projectiletarget)
|
|
|
|
//
|
2008-01-27 11:25:03 +00:00
|
|
|
// Jumps if the actor can see its target, or if the player has a linetarget.
|
2008-05-17 08:47:26 +00:00
|
|
|
// ProjectileTarget affects how projectiles are treated. If set, it will use
|
|
|
|
// the target of the projectile for seekers, and ignore the target for
|
|
|
|
// normal projectiles. If not set, it will use the missile's owner instead
|
|
|
|
// (the default).
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInLOS)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(3);
|
|
|
|
ACTION_PARAM_STATE(jump, 0);
|
|
|
|
ACTION_PARAM_ANGLE(fov, 1);
|
|
|
|
ACTION_PARAM_BOOL(projtarg, 2);
|
2008-08-12 23:22:08 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
angle_t an;
|
2008-05-17 08:47:26 +00:00
|
|
|
AActor *target;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!self->player)
|
|
|
|
{
|
2008-05-17 08:47:26 +00:00
|
|
|
if (self->flags & MF_MISSILE && projtarg)
|
|
|
|
{
|
|
|
|
if (self->flags2 & MF2_SEEKERMISSILE)
|
|
|
|
target = self->tracer;
|
|
|
|
else
|
|
|
|
target = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
target = self->target;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!target) return; // [KS] Let's not call P_CheckSight unnecessarily in this case.
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!P_CheckSight (self, target, 1))
|
2008-05-17 08:47:26 +00:00
|
|
|
return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (fov && (fov < ANGLE_MAX))
|
|
|
|
{
|
|
|
|
an = R_PointToAngle2 (self->x,
|
|
|
|
self->y,
|
|
|
|
target->x,
|
|
|
|
target->y)
|
|
|
|
- self->angle;
|
|
|
|
|
|
|
|
if (an > (fov / 2) && an < (ANGLE_MAX - (fov / 2)))
|
|
|
|
{
|
|
|
|
return; // [KS] Outside of FOV - return
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Does the player aim at something that can be shot?
|
Update to ZDoom r905:
- Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
concern here and the worst that can happen is that the wrong actor is spawned.
This was a constant hassle when testing with WADs that contain duplicate resources.
- Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.
- Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
of the new wave data uninitialized.
- Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
tables.cpp. (And interestingly, VC++ automatically renamed the object file,
so I wasn't aware of the problem with GCC.)
- Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config and sound patches from Zips.
I put this on hold though after finding out that the sound quality
isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
can be loaded
- Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
event which only has 1 in 127 chance of being for a note that's playing
on that channel. Then I decided it would probably be a good idea to reset
all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
(copied from the OPL player) improved its sound dramatically, so apparently
Timidity has issues with short stream buffers. It's now at 1/2 sec in
length. However, there seems to be something weird going on with
corazonazul_ff6boss.mid near the beginning where it stops and immediately
restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
oscilloscopes and spectrums.
- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.)
- Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :(
- Changed the progdir global variable into an FString.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
|
|
|
P_BulletSlope(self, &target);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-05-17 08:47:26 +00:00
|
|
|
if (!target) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_JUMP(jump);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2009-06-14 18:05:00 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// A_JumpIfInTargetLOS (state label, optional fixed fov, optional bool
|
|
|
|
// projectiletarget)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetLOS)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(3);
|
|
|
|
ACTION_PARAM_STATE(jump, 0);
|
|
|
|
ACTION_PARAM_ANGLE(fov, 1);
|
|
|
|
ACTION_PARAM_BOOL(projtarg, 2);
|
|
|
|
|
|
|
|
angle_t an;
|
|
|
|
AActor *target;
|
|
|
|
|
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
|
|
|
|
|
|
|
if (self->flags & MF_MISSILE && projtarg)
|
|
|
|
{
|
|
|
|
if (self->flags2 & MF2_SEEKERMISSILE)
|
|
|
|
target = self->tracer;
|
|
|
|
else
|
|
|
|
target = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
target = self->target;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!target) return; // [KS] Let's not call P_CheckSight unnecessarily in this case.
|
|
|
|
|
|
|
|
if (!P_CheckSight (target, self, 1))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (fov && (fov < ANGLE_MAX))
|
|
|
|
{
|
|
|
|
an = R_PointToAngle2 (self->x,
|
|
|
|
self->y,
|
|
|
|
target->x,
|
|
|
|
target->y)
|
|
|
|
- self->angle;
|
|
|
|
|
|
|
|
if (an > (fov / 2) && an < (ANGLE_MAX - (fov / 2)))
|
|
|
|
{
|
|
|
|
return; // [KS] Outside of FOV - return
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ACTION_JUMP(jump);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-30 08:34:44 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_DamageMaster (int amount)
|
|
|
|
// Damages the master of this child by the specified amount. Negative values heal.
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageMaster)
|
2008-03-30 08:34:44 +00:00
|
|
|
{
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_INT(amount, 0);
|
|
|
|
ACTION_PARAM_NAME(DamageType, 1);
|
2008-03-30 08:34:44 +00:00
|
|
|
|
|
|
|
if (self->master != NULL)
|
|
|
|
{
|
|
|
|
if (amount > 0)
|
|
|
|
{
|
|
|
|
P_DamageMobj(self->master, self, self, amount, DamageType, DMG_NO_ARMOR);
|
|
|
|
}
|
|
|
|
else if (amount < 0)
|
|
|
|
{
|
|
|
|
amount = -amount;
|
|
|
|
P_GiveBody(self->master, amount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_DamageChildren (amount)
|
|
|
|
// Damages the children of this master by the specified amount. Negative values heal.
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageChildren)
|
2008-03-30 08:34:44 +00:00
|
|
|
{
|
|
|
|
TThinkerIterator<AActor> it;
|
|
|
|
AActor * mo;
|
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_INT(amount, 0);
|
|
|
|
ACTION_PARAM_NAME(DamageType, 1);
|
2008-03-30 08:34:44 +00:00
|
|
|
|
|
|
|
while ( (mo = it.Next()) )
|
|
|
|
{
|
|
|
|
if (mo->master == self)
|
|
|
|
{
|
|
|
|
if (amount > 0)
|
|
|
|
{
|
|
|
|
P_DamageMobj(mo, self, self, amount, DamageType, DMG_NO_ARMOR);
|
|
|
|
}
|
|
|
|
else if (amount < 0)
|
|
|
|
{
|
|
|
|
amount = -amount;
|
|
|
|
P_GiveBody(mo, amount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// [KS] *** End of my modifications ***
|
2008-06-28 13:29:59 +00:00
|
|
|
|
2008-12-06 23:37:13 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_DamageSiblings (amount)
|
|
|
|
// Damages the siblings of this master by the specified amount. Negative values heal.
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageSiblings)
|
|
|
|
{
|
|
|
|
TThinkerIterator<AActor> it;
|
|
|
|
AActor * mo;
|
|
|
|
|
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_INT(amount, 0);
|
|
|
|
ACTION_PARAM_NAME(DamageType, 1);
|
|
|
|
|
|
|
|
while ( (mo = it.Next()) )
|
|
|
|
{
|
|
|
|
if (mo->master == self->master && mo != self)
|
|
|
|
{
|
|
|
|
if (amount > 0)
|
|
|
|
{
|
|
|
|
P_DamageMobj(mo, self, self, amount, DamageType, DMG_NO_ARMOR);
|
|
|
|
}
|
|
|
|
else if (amount < 0)
|
|
|
|
{
|
|
|
|
amount = -amount;
|
|
|
|
P_GiveBody(mo, amount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// Modified code pointer from Skulltag
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2008-08-12 23:22:08 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckForReload)
|
2008-06-28 13:29:59 +00:00
|
|
|
{
|
|
|
|
if ( self->player == NULL || self->player->ReadyWeapon == NULL )
|
|
|
|
return;
|
|
|
|
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_INT(count, 0);
|
|
|
|
ACTION_PARAM_STATE(jump, 1);
|
2008-08-22 07:36:50 +00:00
|
|
|
ACTION_PARAM_BOOL(dontincrement, 2)
|
|
|
|
|
|
|
|
if (count <= 0) return;
|
2008-08-14 11:28:02 +00:00
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
AWeapon *weapon = self->player->ReadyWeapon;
|
2008-08-22 07:36:50 +00:00
|
|
|
|
|
|
|
int ReloadCounter = weapon->ReloadCounter;
|
|
|
|
if(!dontincrement || ReloadCounter != 0)
|
|
|
|
ReloadCounter = (weapon->ReloadCounter+1) % count;
|
|
|
|
else // 0 % 1 = 1? So how do we check if the weapon was never fired? We should only do this when we're not incrementing the counter though.
|
|
|
|
ReloadCounter = 1;
|
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
// If we have not made our last shot...
|
2008-08-22 07:36:50 +00:00
|
|
|
if (ReloadCounter != 0)
|
2008-06-28 13:29:59 +00:00
|
|
|
{
|
|
|
|
// Go back to the refire frames, instead of continuing on to the reload frames.
|
2008-08-14 11:28:02 +00:00
|
|
|
ACTION_JUMP(jump);
|
2008-06-28 13:29:59 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// We need to reload. However, don't reload if we're out of ammo.
|
|
|
|
weapon->CheckAmmo( false, false );
|
|
|
|
}
|
2008-08-22 07:36:50 +00:00
|
|
|
|
|
|
|
if(!dontincrement)
|
|
|
|
weapon->ReloadCounter = ReloadCounter;
|
2008-06-28 13:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// Resets the counter for the above function
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2008-08-12 08:00:28 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_ResetReloadCounter)
|
2008-06-28 13:29:59 +00:00
|
|
|
{
|
|
|
|
if ( self->player == NULL || self->player->ReadyWeapon == NULL )
|
|
|
|
return;
|
|
|
|
|
|
|
|
AWeapon *weapon = self->player->ReadyWeapon;
|
|
|
|
weapon->ReloadCounter = 0;
|
|
|
|
}
|
2008-09-23 21:41:49 +00:00
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_ChangeFlag
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeFlag)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_STRING(flagname, 0);
|
|
|
|
ACTION_PARAM_BOOL(expression, 1);
|
|
|
|
|
|
|
|
const char *dot = strchr (flagname, '.');
|
|
|
|
FFlagDef *fd;
|
|
|
|
const PClass *cls = self->GetClass();
|
|
|
|
|
|
|
|
if (dot != NULL)
|
|
|
|
{
|
|
|
|
FString part1(flagname, dot-flagname);
|
|
|
|
fd = FindFlag (cls, part1, dot+1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fd = FindFlag (cls, flagname, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fd != NULL)
|
|
|
|
{
|
2008-11-15 09:16:06 +00:00
|
|
|
bool kill_before, kill_after;
|
2009-03-29 11:21:36 +00:00
|
|
|
INTBOOL item_before, item_after;
|
2008-11-15 09:16:06 +00:00
|
|
|
|
|
|
|
kill_before = self->CountsAsKill();
|
2009-03-29 11:21:36 +00:00
|
|
|
item_before = self->flags & MF_COUNTITEM;
|
|
|
|
|
2008-09-23 21:41:49 +00:00
|
|
|
if (fd->structoffset == -1)
|
|
|
|
{
|
|
|
|
HandleDeprecatedFlags(self, cls->ActorInfo, expression, fd->flagbit);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-03-29 11:21:36 +00:00
|
|
|
DWORD *flagp = (DWORD*) (((char*)self) + fd->structoffset);
|
|
|
|
|
|
|
|
// If these 2 flags get changed we need to update the blockmap and sector links.
|
|
|
|
bool linkchange = flagp == &self->flags && (fd->flagbit == MF_NOBLOCKMAP || fd->flagbit == MF_NOSECTOR);
|
2008-09-23 21:41:49 +00:00
|
|
|
|
2009-03-29 11:21:36 +00:00
|
|
|
if (linkchange) self->UnlinkFromWorld();
|
2008-11-15 09:16:06 +00:00
|
|
|
if (expression)
|
|
|
|
{
|
|
|
|
*flagp |= fd->flagbit;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*flagp &= ~fd->flagbit;
|
|
|
|
}
|
2009-03-29 11:21:36 +00:00
|
|
|
if (linkchange) self->LinkToWorld();
|
2008-11-15 09:16:06 +00:00
|
|
|
}
|
|
|
|
kill_after = self->CountsAsKill();
|
2009-03-29 11:21:36 +00:00
|
|
|
item_after = self->flags & MF_COUNTITEM;
|
2008-11-15 09:16:06 +00:00
|
|
|
// Was this monster previously worth a kill but no longer is?
|
|
|
|
// Or vice versa?
|
|
|
|
if (kill_before != kill_after)
|
|
|
|
{
|
|
|
|
if (kill_after)
|
|
|
|
{ // It counts as a kill now.
|
|
|
|
level.total_monsters++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // It no longer counts as a kill.
|
|
|
|
level.total_monsters--;
|
|
|
|
}
|
2008-09-23 21:41:49 +00:00
|
|
|
}
|
2009-03-29 11:21:36 +00:00
|
|
|
// same for items
|
|
|
|
if (item_before != item_after)
|
|
|
|
{
|
|
|
|
if (item_after)
|
|
|
|
{ // It counts as an item now.
|
|
|
|
level.total_items++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // It no longer counts as an item
|
|
|
|
level.total_items--;
|
|
|
|
}
|
|
|
|
}
|
2008-09-23 21:41:49 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Printf("Unknown flag '%s' in '%s'\n", flagname, cls->TypeName.GetChars());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-06 23:37:13 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_RemoveMaster
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_RemoveMaster)
|
|
|
|
{
|
|
|
|
if (self->master != NULL)
|
|
|
|
{
|
|
|
|
P_RemoveThing(self->master);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_RemoveChildren
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveChildren)
|
|
|
|
{
|
|
|
|
TThinkerIterator<AActor> it;
|
|
|
|
AActor * mo;
|
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_BOOL(removeall,0);
|
|
|
|
|
|
|
|
while ( (mo = it.Next()) )
|
|
|
|
{
|
|
|
|
if ( ( mo->master == self ) && ( ( mo->health <= 0 ) || removeall) )
|
|
|
|
{
|
|
|
|
P_RemoveThing(mo);
|
|
|
|
}
|
|
|
|
}
|
2009-06-06 15:24:18 +00:00
|
|
|
}
|
|
|
|
|
Update to ZDoom r1735:
- Added extra states to dehsupp for the MBF additions.
- Removed specific Button_Speed handling from the controllers' AddAxes()
methods. Analog axes now respond to Button_Speed and cl_run in exactly the
same way as digital buttons do.
- Changed rounding slightly for analog axis -> integer in G_BuildTiccmd().
- Fixed: FXInputController::ProcessThumbstick() was slightly off when it
converted to the range [-1.0,+1.0].
- Added default bindings for the Xbox 360 controller buttons.
- Fixed: Redefining an existing skill would set that skills ACSReturn to be
the same as the next new skill defined, if neither definition explicitly set
the value for ACSReturn.
- Added a DefaultSkill property. Adding it to a skill will cause that skill
to be the default one selected in the menu. If none is specified as the
default, then the middle skill is the default.
- Slider controls in the options menu now display their values
numerically next to the slider.
- The minimum value for m_yaw, m_pitch, m_forward, and m_side from the
menu has been dropped from 0.5 to 0, so those particular mouse motions can
be disabled entirely without using the console.
- added compat_anybossdeath to MAPINFO.
- fixed blue colormap
- Added parameters to A_VileAttack.
- Removed redundant definition of use_joystick from SDL/i_input.cpp.
- Turned net decompression into a non fatal error. It now drops the packet
and waits for the sender to send a new, hopefully good, packet.
- Reduced potential for overflow in R_ProjectSprite().
- Moved the IF_ADDITIVETIME check earlier in APowerup::HandlePickup so
that additive time powerups can be activated before the existing
power has entered its blink threshold.
- Added a "BlueMap" for powerup colors.
- Added a NULL screen check when detaching HUD messages.
- Added HotWax's A_SetArg.
- Gez's patch for more A_WeaponReady flags:
* WRF_NOBOB (1): Weapon won't bob
* WRF_NOFIRE (12): Weapon won't fire at all
* WRF_NOSWITCH (2): Weapon can't be switched off
* WRF_NOPRIMARY (4): Weapon will not fire its main attack
* WRF_NOSECONDARY (8): Weapon will not fire its alt attack
- Attempt to add support for Microsoft's SideWinder Strategic Commander.
- Split the joystick menu into two parts: A top level with general options
and a list of all attached controllers, and a second level for configuring
an individual controller.
- Fixed: Pressing Up at the top of a menu with more lines than fit on screen
would find an incorrect bottom position if the menu had a custom top height.
- Added the cvars joy_dinput, joy_ps2raw, and joy_xinput to enable/disable
specific game controller input systems independant of each other.
- Device change broadcasts are now sent to the Doom event queue, so
device scanning can be handled in one common place.
- Added a fast version of IsXInputDevice that uses the Raw Input device
list, because querying WMI for this information is painfully slow.
- Added support for compiling with FMOD Ex 4.26+ and running the game
with an older DLL. This combination will now produce sound.
- added submission for raising master/children/siblings.
- added submission for no decals on wall option.
- removed some useless code from SpawnMissile function.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@402 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-24 13:47:25 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_RemoveSiblings
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveSiblings)
|
|
|
|
{
|
|
|
|
TThinkerIterator<AActor> it;
|
|
|
|
AActor * mo;
|
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_BOOL(removeall,0);
|
|
|
|
|
|
|
|
while ( (mo = it.Next()) )
|
|
|
|
{
|
|
|
|
if ( ( mo->master == self->master ) && ( mo != self ) && ( ( mo->health <= 0 ) || removeall) )
|
|
|
|
{
|
|
|
|
P_RemoveThing(mo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_RaiseMaster
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_RaiseMaster)
|
|
|
|
{
|
|
|
|
if (self->master != NULL)
|
|
|
|
{
|
|
|
|
P_Thing_Raise(self->master);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_RaiseChildren
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren)
|
|
|
|
{
|
|
|
|
TThinkerIterator<AActor> it;
|
|
|
|
AActor * mo;
|
|
|
|
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
while ((mo = it.Next()))
|
Update to ZDoom r1735:
- Added extra states to dehsupp for the MBF additions.
- Removed specific Button_Speed handling from the controllers' AddAxes()
methods. Analog axes now respond to Button_Speed and cl_run in exactly the
same way as digital buttons do.
- Changed rounding slightly for analog axis -> integer in G_BuildTiccmd().
- Fixed: FXInputController::ProcessThumbstick() was slightly off when it
converted to the range [-1.0,+1.0].
- Added default bindings for the Xbox 360 controller buttons.
- Fixed: Redefining an existing skill would set that skills ACSReturn to be
the same as the next new skill defined, if neither definition explicitly set
the value for ACSReturn.
- Added a DefaultSkill property. Adding it to a skill will cause that skill
to be the default one selected in the menu. If none is specified as the
default, then the middle skill is the default.
- Slider controls in the options menu now display their values
numerically next to the slider.
- The minimum value for m_yaw, m_pitch, m_forward, and m_side from the
menu has been dropped from 0.5 to 0, so those particular mouse motions can
be disabled entirely without using the console.
- added compat_anybossdeath to MAPINFO.
- fixed blue colormap
- Added parameters to A_VileAttack.
- Removed redundant definition of use_joystick from SDL/i_input.cpp.
- Turned net decompression into a non fatal error. It now drops the packet
and waits for the sender to send a new, hopefully good, packet.
- Reduced potential for overflow in R_ProjectSprite().
- Moved the IF_ADDITIVETIME check earlier in APowerup::HandlePickup so
that additive time powerups can be activated before the existing
power has entered its blink threshold.
- Added a "BlueMap" for powerup colors.
- Added a NULL screen check when detaching HUD messages.
- Added HotWax's A_SetArg.
- Gez's patch for more A_WeaponReady flags:
* WRF_NOBOB (1): Weapon won't bob
* WRF_NOFIRE (12): Weapon won't fire at all
* WRF_NOSWITCH (2): Weapon can't be switched off
* WRF_NOPRIMARY (4): Weapon will not fire its main attack
* WRF_NOSECONDARY (8): Weapon will not fire its alt attack
- Attempt to add support for Microsoft's SideWinder Strategic Commander.
- Split the joystick menu into two parts: A top level with general options
and a list of all attached controllers, and a second level for configuring
an individual controller.
- Fixed: Pressing Up at the top of a menu with more lines than fit on screen
would find an incorrect bottom position if the menu had a custom top height.
- Added the cvars joy_dinput, joy_ps2raw, and joy_xinput to enable/disable
specific game controller input systems independant of each other.
- Device change broadcasts are now sent to the Doom event queue, so
device scanning can be handled in one common place.
- Added a fast version of IsXInputDevice that uses the Raw Input device
list, because querying WMI for this information is painfully slow.
- Added support for compiling with FMOD Ex 4.26+ and running the game
with an older DLL. This combination will now produce sound.
- added submission for raising master/children/siblings.
- added submission for no decals on wall option.
- removed some useless code from SpawnMissile function.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@402 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-24 13:47:25 +00:00
|
|
|
{
|
|
|
|
if ( mo->master == self )
|
|
|
|
{
|
|
|
|
P_Thing_Raise(mo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_RaiseSiblings
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_RaiseSiblings)
|
|
|
|
{
|
|
|
|
TThinkerIterator<AActor> it;
|
|
|
|
AActor * mo;
|
|
|
|
|
|
|
|
while ( (mo = it.Next()) )
|
|
|
|
{
|
|
|
|
if ( ( mo->master == self->master ) && ( mo != self ) )
|
|
|
|
{
|
|
|
|
P_Thing_Raise(mo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-06 15:24:18 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
// A_MonsterRefire
|
|
|
|
//
|
|
|
|
// Keep firing unless target got out of sight
|
2009-06-06 15:24:18 +00:00
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MonsterRefire)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_INT(prob, 0);
|
|
|
|
ACTION_PARAM_STATE(jump, 1);
|
|
|
|
|
|
|
|
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
|
|
|
A_FaceTarget (self);
|
|
|
|
|
|
|
|
if (pr_monsterrefire() < prob)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!self->target
|
|
|
|
|| P_HitFriend (self)
|
|
|
|
|| self->target->health <= 0
|
|
|
|
|| !P_CheckSight (self, self->target, 0) )
|
|
|
|
{
|
|
|
|
ACTION_JUMP(jump);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SetAngle
|
|
|
|
//
|
|
|
|
// Set actor's angle (in degrees).
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetAngle)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_ANGLE(angle, 0);
|
|
|
|
self->angle = angle;
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SetPitch
|
|
|
|
//
|
|
|
|
// Set actor's pitch (in degrees).
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_ANGLE(pitch, 0);
|
|
|
|
self->pitch = pitch;
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_ScaleVelocity
|
|
|
|
//
|
|
|
|
// Scale actor's velocity.
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ScaleVelocity)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_FIXED(scale, 0);
|
|
|
|
|
|
|
|
INTBOOL was_moving = self->velx | self->vely | self->velz;
|
|
|
|
|
|
|
|
self->velx = FixedMul(self->velx, scale);
|
|
|
|
self->vely = FixedMul(self->vely, scale);
|
|
|
|
self->velz = FixedMul(self->velz, scale);
|
|
|
|
|
|
|
|
// If the actor was previously moving but now is not, and is a player,
|
|
|
|
// update its player variables. (See A_Stop.)
|
|
|
|
if (was_moving)
|
|
|
|
{
|
|
|
|
CheckStopped(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_ChangeVelocity
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeVelocity)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(4);
|
|
|
|
ACTION_PARAM_FIXED(x, 0);
|
|
|
|
ACTION_PARAM_FIXED(y, 1);
|
|
|
|
ACTION_PARAM_FIXED(z, 2);
|
|
|
|
ACTION_PARAM_INT(flags, 3);
|
|
|
|
|
|
|
|
INTBOOL was_moving = self->velx | self->vely | self->velz;
|
|
|
|
|
|
|
|
fixed_t vx = x, vy = y, vz = z;
|
|
|
|
fixed_t sina = finesine[self->angle >> ANGLETOFINESHIFT];
|
|
|
|
fixed_t cosa = finecosine[self->angle >> ANGLETOFINESHIFT];
|
|
|
|
|
|
|
|
if (flags & 1) // relative axes - make x, y relative to actor's current angle
|
|
|
|
{
|
|
|
|
vx = DMulScale16(x, cosa, -y, sina);
|
|
|
|
vy = DMulScale16(x, sina, y, cosa);
|
|
|
|
}
|
|
|
|
if (flags & 2) // discard old velocity - replace old velocity with new velocity
|
|
|
|
{
|
|
|
|
self->velx = vx;
|
|
|
|
self->vely = vy;
|
|
|
|
self->velz = vz;
|
|
|
|
}
|
|
|
|
else // add new velocity to old velocity
|
|
|
|
{
|
|
|
|
self->velx += vx;
|
|
|
|
self->vely += vy;
|
|
|
|
self->velz += vz;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (was_moving)
|
|
|
|
{
|
|
|
|
CheckStopped(self);
|
|
|
|
}
|
|
|
|
}
|
Update to ZDoom r1735:
- Added extra states to dehsupp for the MBF additions.
- Removed specific Button_Speed handling from the controllers' AddAxes()
methods. Analog axes now respond to Button_Speed and cl_run in exactly the
same way as digital buttons do.
- Changed rounding slightly for analog axis -> integer in G_BuildTiccmd().
- Fixed: FXInputController::ProcessThumbstick() was slightly off when it
converted to the range [-1.0,+1.0].
- Added default bindings for the Xbox 360 controller buttons.
- Fixed: Redefining an existing skill would set that skills ACSReturn to be
the same as the next new skill defined, if neither definition explicitly set
the value for ACSReturn.
- Added a DefaultSkill property. Adding it to a skill will cause that skill
to be the default one selected in the menu. If none is specified as the
default, then the middle skill is the default.
- Slider controls in the options menu now display their values
numerically next to the slider.
- The minimum value for m_yaw, m_pitch, m_forward, and m_side from the
menu has been dropped from 0.5 to 0, so those particular mouse motions can
be disabled entirely without using the console.
- added compat_anybossdeath to MAPINFO.
- fixed blue colormap
- Added parameters to A_VileAttack.
- Removed redundant definition of use_joystick from SDL/i_input.cpp.
- Turned net decompression into a non fatal error. It now drops the packet
and waits for the sender to send a new, hopefully good, packet.
- Reduced potential for overflow in R_ProjectSprite().
- Moved the IF_ADDITIVETIME check earlier in APowerup::HandlePickup so
that additive time powerups can be activated before the existing
power has entered its blink threshold.
- Added a "BlueMap" for powerup colors.
- Added a NULL screen check when detaching HUD messages.
- Added HotWax's A_SetArg.
- Gez's patch for more A_WeaponReady flags:
* WRF_NOBOB (1): Weapon won't bob
* WRF_NOFIRE (12): Weapon won't fire at all
* WRF_NOSWITCH (2): Weapon can't be switched off
* WRF_NOPRIMARY (4): Weapon will not fire its main attack
* WRF_NOSECONDARY (8): Weapon will not fire its alt attack
- Attempt to add support for Microsoft's SideWinder Strategic Commander.
- Split the joystick menu into two parts: A top level with general options
and a list of all attached controllers, and a second level for configuring
an individual controller.
- Fixed: Pressing Up at the top of a menu with more lines than fit on screen
would find an incorrect bottom position if the menu had a custom top height.
- Added the cvars joy_dinput, joy_ps2raw, and joy_xinput to enable/disable
specific game controller input systems independant of each other.
- Device change broadcasts are now sent to the Doom event queue, so
device scanning can be handled in one common place.
- Added a fast version of IsXInputDevice that uses the Raw Input device
list, because querying WMI for this information is painfully slow.
- Added support for compiling with FMOD Ex 4.26+ and running the game
with an older DLL. This combination will now produce sound.
- added submission for raising master/children/siblings.
- added submission for no decals on wall option.
- removed some useless code from SpawnMissile function.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@402 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-24 13:47:25 +00:00
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SetArg
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetArg)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_INT(pos, 0);
|
|
|
|
ACTION_PARAM_INT(value, 1);
|
|
|
|
|
|
|
|
// Set the value of the specified arg
|
|
|
|
if ((size_t)pos < countof(self->args))
|
|
|
|
{
|
|
|
|
self->args[pos] = value;
|
|
|
|
}
|
|
|
|
}
|
2009-09-15 06:19:39 +00:00
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SetSpecial
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetSpecial)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(6);
|
|
|
|
ACTION_PARAM_INT(spec, 0);
|
|
|
|
ACTION_PARAM_INT(arg0, 1);
|
|
|
|
ACTION_PARAM_INT(arg1, 2);
|
|
|
|
ACTION_PARAM_INT(arg2, 3);
|
|
|
|
ACTION_PARAM_INT(arg3, 4);
|
|
|
|
ACTION_PARAM_INT(arg4, 5);
|
|
|
|
|
|
|
|
self->special = spec;
|
|
|
|
self->args[0] = arg0;
|
|
|
|
self->args[1] = arg1;
|
|
|
|
self->args[2] = arg2;
|
|
|
|
self->args[3] = arg3;
|
|
|
|
self->args[4] = arg4;
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
2009-10-25 15:31:09 +00:00
|
|
|
// A_SetUserVar
|
2009-09-15 06:19:39 +00:00
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserVar)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(2);
|
2009-10-25 15:31:09 +00:00
|
|
|
ACTION_PARAM_NAME(varname, 0);
|
2009-09-15 06:19:39 +00:00
|
|
|
ACTION_PARAM_INT(value, 1);
|
|
|
|
|
2009-10-25 15:31:09 +00:00
|
|
|
PSymbol *sym = self->GetClass()->Symbols.FindSymbol(varname, true);
|
|
|
|
PSymbolVariable *var;
|
|
|
|
|
|
|
|
if (sym == NULL || sym->SymbolType != SYM_Variable ||
|
|
|
|
!(var = static_cast<PSymbolVariable *>(sym))->bUserVar ||
|
|
|
|
var->ValueType.Type != VAL_Int)
|
|
|
|
{
|
|
|
|
Printf("%s is not a user variable in class %s\n", varname.GetChars(),
|
|
|
|
self->GetClass()->TypeName.GetChars());
|
2009-09-15 06:19:39 +00:00
|
|
|
return;
|
2009-10-25 15:31:09 +00:00
|
|
|
}
|
|
|
|
// Set the value of the specified user variable.
|
|
|
|
*(int *)(reinterpret_cast<BYTE *>(self) + var->offset) = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_SetUserArray
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserArray)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(3);
|
|
|
|
ACTION_PARAM_NAME(varname, 0);
|
|
|
|
ACTION_PARAM_INT(pos, 1);
|
|
|
|
ACTION_PARAM_INT(value, 2);
|
|
|
|
|
|
|
|
PSymbol *sym = self->GetClass()->Symbols.FindSymbol(varname, true);
|
|
|
|
PSymbolVariable *var;
|
|
|
|
|
|
|
|
if (sym == NULL || sym->SymbolType != SYM_Variable ||
|
|
|
|
!(var = static_cast<PSymbolVariable *>(sym))->bUserVar ||
|
|
|
|
var->ValueType.Type != VAL_Array || var->ValueType.BaseType != VAL_Int)
|
|
|
|
{
|
|
|
|
Printf("%s is not a user array in class %s\n", varname.GetChars(),
|
|
|
|
self->GetClass()->TypeName.GetChars());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (pos < 0 || pos >= var->ValueType.size)
|
|
|
|
{
|
|
|
|
Printf("%d is out of bounds in array %s in class %s\n", pos, varname.GetChars(),
|
|
|
|
self->GetClass()->TypeName.GetChars());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Set the value of the specified user array at index pos.
|
|
|
|
((int *)(reinterpret_cast<BYTE *>(self) + var->offset))[pos] = value;
|
2009-09-15 06:19:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_Turn
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Turn)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_ANGLE(angle, 0);
|
|
|
|
self->angle += angle;
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
2009-10-16 16:17:24 +00:00
|
|
|
//
|
|
|
|
// A_Quake
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Quake)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(5);
|
|
|
|
ACTION_PARAM_INT(intensity, 0);
|
|
|
|
ACTION_PARAM_INT(duration, 1);
|
|
|
|
ACTION_PARAM_INT(damrad, 2);
|
|
|
|
ACTION_PARAM_INT(tremrad, 3);
|
|
|
|
ACTION_PARAM_SOUND(sound, 4);
|
|
|
|
P_StartQuake(self, 0, intensity, duration, damrad, tremrad, sound);
|
|
|
|
}
|
|
|
|
|
2009-12-25 12:10:12 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// A_Weave
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
void A_Weave(AActor *self, int xyspeed, int zspeed, fixed_t xydist, fixed_t zdist)
|
|
|
|
{
|
|
|
|
fixed_t newX, newY;
|
|
|
|
int weaveXY, weaveZ;
|
|
|
|
int angle;
|
|
|
|
fixed_t dist;
|
|
|
|
|
|
|
|
weaveXY = self->WeaveIndexXY & 63;
|
|
|
|
weaveZ = self->WeaveIndexZ & 63;
|
|
|
|
angle = (self->angle + ANG90) >> ANGLETOFINESHIFT;
|
|
|
|
|
|
|
|
if (xydist != 0 && xyspeed != 0)
|
|
|
|
{
|
|
|
|
dist = FixedMul(FloatBobOffsets[weaveXY], xydist);
|
|
|
|
newX = self->x - FixedMul (finecosine[angle], dist);
|
|
|
|
newY = self->y - FixedMul (finesine[angle], dist);
|
|
|
|
weaveXY = (weaveXY + xyspeed) & 63;
|
|
|
|
dist = FixedMul(FloatBobOffsets[weaveXY], xydist);
|
|
|
|
newX += FixedMul (finecosine[angle], dist);
|
|
|
|
newY += FixedMul (finesine[angle], dist);
|
|
|
|
P_TryMove (self, newX, newY, true);
|
|
|
|
self->WeaveIndexXY = weaveXY;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (zdist != 0 && zspeed != 0)
|
|
|
|
{
|
|
|
|
self->z -= FixedMul(FloatBobOffsets[weaveZ], zdist);
|
|
|
|
weaveZ = (weaveZ + zspeed) & 63;
|
|
|
|
self->z += FixedMul(FloatBobOffsets[weaveZ], zdist);
|
|
|
|
self->WeaveIndexZ = weaveZ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Weave)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(4);
|
|
|
|
ACTION_PARAM_INT(xspeed, 0);
|
|
|
|
ACTION_PARAM_INT(yspeed, 1);
|
|
|
|
ACTION_PARAM_FIXED(xdist, 2);
|
|
|
|
ACTION_PARAM_FIXED(ydist, 3);
|
|
|
|
A_Weave(self, xspeed, yspeed, xdist, ydist);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-16 16:17:24 +00:00
|
|
|
//===========================================================================
|
2009-09-15 06:19:39 +00:00
|
|
|
//
|
|
|
|
// A_LineEffect
|
|
|
|
//
|
|
|
|
// This allows linedef effects to be activated inside deh frames.
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
|
|
|
|
void P_TranslateLineDef (line_t *ld, maplinedef_t *mld);
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LineEffect)
|
|
|
|
{
|
|
|
|
ACTION_PARAM_START(2);
|
|
|
|
ACTION_PARAM_INT(special, 0);
|
|
|
|
ACTION_PARAM_INT(tag, 1);
|
|
|
|
|
|
|
|
line_t junk; maplinedef_t oldjunk;
|
|
|
|
bool res = false;
|
|
|
|
if (!(self->flags6 & MF6_LINEDONE)) // Unless already used up
|
|
|
|
{
|
|
|
|
if ((oldjunk.special = special)) // Linedef type
|
|
|
|
{
|
|
|
|
oldjunk.tag = tag; // Sector tag for linedef
|
|
|
|
P_TranslateLineDef(&junk, &oldjunk); // Turn into native type
|
|
|
|
res = !!LineSpecials[junk.special](NULL, self, false, junk.args[0],
|
|
|
|
junk.args[1], junk.args[2], junk.args[3], junk.args[4]);
|
|
|
|
if (res && !(junk.flags & ML_REPEAT_SPECIAL)) // If only once,
|
|
|
|
self->flags6 |= MF6_LINEDONE; // no more for this thing
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ACTION_SET_RESULT(res);
|
|
|
|
}
|