2007-05-28 22:18:51 +00:00
|
|
|
/*
|
|
|
|
** thingdef-properties.cpp
|
|
|
|
**
|
2008-09-21 18:02:38 +00:00
|
|
|
** Actor definitions - properties and flags handling
|
2007-05-28 22:18:51 +00:00
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
** Copyright 2002-2007 Christoph Oelckers
|
|
|
|
** Copyright 2004-2007 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"
|
|
|
|
#include "actor.h"
|
|
|
|
#include "info.h"
|
|
|
|
#include "tarray.h"
|
|
|
|
#include "w_wad.h"
|
|
|
|
#include "templates.h"
|
|
|
|
#include "r_defs.h"
|
|
|
|
#include "a_pickups.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "cmdlib.h"
|
|
|
|
#include "p_lnspec.h"
|
|
|
|
#include "a_action.h"
|
|
|
|
#include "decallib.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "i_system.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "p_effect.h"
|
|
|
|
#include "v_palette.h"
|
|
|
|
#include "doomerrors.h"
|
|
|
|
#include "a_hexenglobal.h"
|
|
|
|
#include "a_weaponpiece.h"
|
|
|
|
#include "p_conversation.h"
|
|
|
|
#include "v_text.h"
|
|
|
|
#include "thingdef.h"
|
|
|
|
#include "a_sharedglobal.h"
|
2011-07-06 08:50:15 +00:00
|
|
|
#include "r_data/r_translate.h"
|
2008-04-08 08:53:42 +00:00
|
|
|
#include "a_morph.h"
|
2008-09-14 23:54:38 +00:00
|
|
|
#include "colormatcher.h"
|
2011-01-22 03:35:33 +00:00
|
|
|
#include "teaminfo.h"
|
2011-07-05 10:02:38 +00:00
|
|
|
#include "v_video.h"
|
2011-07-06 07:35:36 +00:00
|
|
|
#include "r_data/colormaps.h"
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-12-29 23:03:38 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Gets a class pointer and performs an error check for correct type
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2010-03-25 20:38:00 +00:00
|
|
|
static PClassActor *FindClassTentative(const char *name, PClass *ancestor)
|
2008-12-29 23:03:38 +00:00
|
|
|
{
|
2009-01-03 14:44:41 +00:00
|
|
|
// "" and "none" mean 'no class'
|
|
|
|
if (name == NULL || *name == 0 || !stricmp(name, "none"))
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-03-25 20:38:00 +00:00
|
|
|
PClass *cls = ancestor->FindClassTentative(name);
|
|
|
|
assert(cls != NULL); // cls can not be NULL here
|
|
|
|
if (!cls->IsDescendantOf(ancestor))
|
2008-12-29 23:03:38 +00:00
|
|
|
{
|
2012-10-18 03:19:27 +00:00
|
|
|
I_Error("%s does not inherit from %s\n", name, ancestor->TypeName.GetChars());
|
2008-12-29 23:03:38 +00:00
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
return static_cast<PClassActor *>(cls);
|
2008-12-29 23:03:38 +00:00
|
|
|
}
|
2010-03-25 20:38:00 +00:00
|
|
|
static AAmmo::MetaClass *FindClassTentativeAmmo(const char *name)
|
|
|
|
{
|
|
|
|
return static_cast<AAmmo::MetaClass *>(FindClassTentative(name, RUNTIME_CLASS(AAmmo)));
|
|
|
|
}
|
|
|
|
static AWeapon::MetaClass *FindClassTentativeWeapon(const char *name)
|
|
|
|
{
|
|
|
|
return static_cast<AWeapon::MetaClass *>(FindClassTentative(name, RUNTIME_CLASS(AWeapon)));
|
|
|
|
}
|
|
|
|
static APowerup::MetaClass *FindClassTentativePowerup(const char *name)
|
|
|
|
{
|
|
|
|
return static_cast<APowerup::MetaClass *>(FindClassTentative(name, RUNTIME_CLASS(APowerup)));
|
|
|
|
}
|
2012-07-14 03:04:41 +00:00
|
|
|
static APlayerPawn::MetaClass *FindClassTentativePlayerPawn(const char *name)
|
|
|
|
{
|
|
|
|
return static_cast<APlayerPawn::MetaClass *>(FindClassTentative(name, RUNTIME_CLASS(APlayerPawn)));
|
2008-12-29 23:03:38 +00:00
|
|
|
}
|
|
|
|
|
2013-05-05 00:01:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Sets or clears a flag, taking field width into account.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
void ModActorFlag(AActor *actor, FFlagDef *fd, bool set)
|
|
|
|
{
|
|
|
|
// Little-Endian machines only need one case, because all field sizes
|
|
|
|
// start at the same address. (Unless the machine has unaligned access
|
|
|
|
// exceptions, in which case you'll need multiple cases for it too.)
|
|
|
|
#ifdef __BIG_ENDIAN__
|
|
|
|
if (fd->fieldsize == 4)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
DWORD *flagvar = (DWORD *)((char *)actor + fd->structoffset);
|
|
|
|
if (set)
|
|
|
|
{
|
|
|
|
*flagvar |= fd->flagbit;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*flagvar &= ~fd->flagbit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef __BIG_ENDIAN__
|
|
|
|
else if (fd->fieldsize == 2)
|
|
|
|
{
|
|
|
|
WORD *flagvar = (WORD *)((char *)actor + fd->structoffset);
|
|
|
|
if (set)
|
|
|
|
{
|
|
|
|
*flagvar |= fd->flagbit;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*flagvar &= ~fd->flagbit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
assert(fd->fieldsize == 1);
|
|
|
|
BYTE *flagvar = (BYTE *)((char *)actor + fd->structoffset);
|
|
|
|
if (set)
|
|
|
|
{
|
|
|
|
*flagvar |= fd->flagbit;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*flagvar &= ~fd->flagbit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Returns whether an actor flag is true or not.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
INTBOOL CheckActorFlag(const AActor *owner, FFlagDef *fd)
|
|
|
|
{
|
|
|
|
if (fd->structoffset == -1)
|
|
|
|
{
|
2013-06-07 03:31:30 +00:00
|
|
|
return CheckDeprecatedFlags(owner, owner->GetClass(), fd->flagbit);
|
2013-05-05 00:01:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
#ifdef __BIG_ENDIAN__
|
|
|
|
if (fd->fieldsize == 4)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
return fd->flagbit & *(DWORD *)(((char*)owner) + fd->structoffset);
|
|
|
|
}
|
2014-06-28 07:52:26 +00:00
|
|
|
#ifdef __BIG_ENDIAN__
|
2013-05-05 00:01:51 +00:00
|
|
|
else if (fd->fieldsize == 2)
|
|
|
|
{
|
|
|
|
return fd->flagbit & *(WORD *)(((char*)owner) + fd->structoffset);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
assert(fd->fieldsize == 1);
|
|
|
|
return fd->flagbit & *(BYTE *)(((char*)owner) + fd->structoffset);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2013-08-12 20:38:52 +00:00
|
|
|
INTBOOL CheckActorFlag(const AActor *owner, const char *flagname, bool printerror)
|
|
|
|
{
|
|
|
|
const char *dot = strchr (flagname, '.');
|
|
|
|
FFlagDef *fd;
|
|
|
|
const PClass *cls = owner->GetClass();
|
|
|
|
|
|
|
|
if (dot != NULL)
|
|
|
|
{
|
|
|
|
FString part1(flagname, dot-flagname);
|
|
|
|
fd = FindFlag (cls, part1, dot+1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fd = FindFlag (cls, flagname, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fd != NULL)
|
|
|
|
{
|
|
|
|
return CheckActorFlag(owner, fd);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (printerror) Printf("Unknown flag '%s' in '%s'\n", flagname, cls->TypeName.GetChars());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// HandleDeprecatedFlags
|
|
|
|
//
|
|
|
|
// Handles the deprecated flags and sets the respective properties
|
|
|
|
// to appropriate values. This is solely intended for backwards
|
|
|
|
// compatibility so mixing this with code that is aware of the real
|
|
|
|
// properties is not recommended
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2010-03-24 02:49:37 +00:00
|
|
|
void HandleDeprecatedFlags(AActor *defaults, PClassActor *info, bool set, int index)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
|
|
|
switch (index)
|
|
|
|
{
|
2008-03-01 16:59:17 +00:00
|
|
|
case DEPF_FIREDAMAGE:
|
2007-05-28 22:18:51 +00:00
|
|
|
defaults->DamageType = set? NAME_Fire : NAME_None;
|
|
|
|
break;
|
2008-03-01 16:59:17 +00:00
|
|
|
case DEPF_ICEDAMAGE:
|
2007-05-28 22:18:51 +00:00
|
|
|
defaults->DamageType = set? NAME_Ice : NAME_None;
|
|
|
|
break;
|
2008-03-01 16:59:17 +00:00
|
|
|
case DEPF_LOWGRAVITY:
|
2007-05-28 22:18:51 +00:00
|
|
|
defaults->gravity = set? FRACUNIT/8 : FRACUNIT;
|
|
|
|
break;
|
2008-03-01 16:59:17 +00:00
|
|
|
case DEPF_SHORTMISSILERANGE:
|
2007-05-28 22:18:51 +00:00
|
|
|
defaults->maxtargetrange = set? 896*FRACUNIT : 0;
|
|
|
|
break;
|
2008-03-01 16:59:17 +00:00
|
|
|
case DEPF_LONGMELEERANGE:
|
2007-05-28 22:18:51 +00:00
|
|
|
defaults->meleethreshold = set? 196*FRACUNIT : 0;
|
|
|
|
break;
|
2008-06-22 09:13:19 +00:00
|
|
|
case DEPF_QUARTERGRAVITY:
|
|
|
|
defaults->gravity = set? FRACUNIT/4 : FRACUNIT;
|
|
|
|
break;
|
2008-08-19 19:38:39 +00:00
|
|
|
case DEPF_FIRERESIST:
|
2008-08-23 08:48:19 +00:00
|
|
|
info->SetDamageFactor(NAME_Fire, set? FRACUNIT/2 : FRACUNIT);
|
|
|
|
break;
|
2009-05-23 08:30:36 +00:00
|
|
|
// the bounce flags will set the compatibility bounce modes to remain compatible
|
2009-09-06 01:49:17 +00:00
|
|
|
case DEPF_HERETICBOUNCE:
|
2009-09-16 21:03:09 +00:00
|
|
|
defaults->BounceFlags &= ~(BOUNCE_TypeMask|BOUNCE_UseSeeSound);
|
2009-09-06 01:49:17 +00:00
|
|
|
if (set) defaults->BounceFlags |= BOUNCE_HereticCompat;
|
2009-05-23 08:30:36 +00:00
|
|
|
break;
|
|
|
|
case DEPF_HEXENBOUNCE:
|
2009-09-16 21:03:09 +00:00
|
|
|
defaults->BounceFlags &= ~(BOUNCE_TypeMask|BOUNCE_UseSeeSound);
|
2009-09-06 01:49:17 +00:00
|
|
|
if (set) defaults->BounceFlags |= BOUNCE_HexenCompat;
|
2009-05-23 08:30:36 +00:00
|
|
|
break;
|
|
|
|
case DEPF_DOOMBOUNCE:
|
2009-09-16 21:03:09 +00:00
|
|
|
defaults->BounceFlags &= ~(BOUNCE_TypeMask|BOUNCE_UseSeeSound);
|
2009-09-06 01:49:17 +00:00
|
|
|
if (set) defaults->BounceFlags |= BOUNCE_DoomCompat;
|
2009-05-23 08:30:36 +00:00
|
|
|
break;
|
2008-03-01 16:59:17 +00:00
|
|
|
case DEPF_PICKUPFLASH:
|
2008-02-17 02:40:03 +00:00
|
|
|
if (set)
|
|
|
|
{
|
2010-03-25 20:38:00 +00:00
|
|
|
static_cast<AInventory*>(defaults)->PickupFlash = FindClassTentative("PickupFlash", RUNTIME_CLASS(AActor));
|
2008-02-17 02:40:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
static_cast<AInventory*>(defaults)->PickupFlash = NULL;
|
|
|
|
}
|
2008-02-16 10:23:12 +00:00
|
|
|
break;
|
2009-08-02 15:54:34 +00:00
|
|
|
case DEPF_INTERHUBSTRIP: // Old system was 0 or 1, so if the flag is cleared, assume 1.
|
|
|
|
static_cast<AInventory*>(defaults)->InterHubAmount = set ? 0 : 1;
|
2007-05-28 22:18:51 +00:00
|
|
|
default:
|
|
|
|
break; // silence GCC
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-07 23:05:24 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// CheckDeprecatedFlags
|
|
|
|
//
|
|
|
|
// Checks properties related to deprecated flags, and returns true only
|
|
|
|
// if the relevant properties are configured exactly as they would have
|
|
|
|
// been by setting the flag in HandleDeprecatedFlags.
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2013-06-07 03:31:30 +00:00
|
|
|
bool CheckDeprecatedFlags(const AActor *actor, PClassActor *info, int index)
|
2011-06-07 23:05:24 +00:00
|
|
|
{
|
|
|
|
// A deprecated flag is false if
|
|
|
|
// a) it hasn't been added here
|
|
|
|
// b) any property of the actor differs from what it would be after setting the flag using HandleDeprecatedFlags
|
|
|
|
|
|
|
|
// Deprecated flags are normally replaced by something more flexible, which means a multitude of related configurations
|
|
|
|
// will report "false".
|
|
|
|
|
|
|
|
switch (index)
|
|
|
|
{
|
|
|
|
case DEPF_FIREDAMAGE:
|
|
|
|
return actor->DamageType == NAME_Fire;
|
|
|
|
case DEPF_ICEDAMAGE:
|
|
|
|
return actor->DamageType == NAME_Ice;
|
|
|
|
case DEPF_LOWGRAVITY:
|
|
|
|
return actor->gravity == FRACUNIT/8;
|
|
|
|
case DEPF_SHORTMISSILERANGE:
|
|
|
|
return actor->maxtargetrange == 896*FRACUNIT;
|
|
|
|
case DEPF_LONGMELEERANGE:
|
|
|
|
return actor->meleethreshold == 196*FRACUNIT;
|
|
|
|
case DEPF_QUARTERGRAVITY:
|
|
|
|
return actor->gravity == FRACUNIT/4;
|
|
|
|
case DEPF_FIRERESIST:
|
|
|
|
if (info->DamageFactors)
|
|
|
|
{
|
|
|
|
fixed_t *df = info->DamageFactors->CheckKey(NAME_Fire);
|
|
|
|
return df && (*df) == FRACUNIT / 2;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
|
|
|
|
case DEPF_HERETICBOUNCE:
|
|
|
|
return (actor->BounceFlags & (BOUNCE_TypeMask|BOUNCE_UseSeeSound)) == BOUNCE_HereticCompat;
|
|
|
|
|
|
|
|
case DEPF_HEXENBOUNCE:
|
|
|
|
return (actor->BounceFlags & (BOUNCE_TypeMask|BOUNCE_UseSeeSound)) == BOUNCE_HexenCompat;
|
|
|
|
|
|
|
|
case DEPF_DOOMBOUNCE:
|
|
|
|
return (actor->BounceFlags & (BOUNCE_TypeMask|BOUNCE_UseSeeSound)) == BOUNCE_DoomCompat;
|
|
|
|
|
|
|
|
case DEPF_PICKUPFLASH:
|
2013-05-05 00:01:51 +00:00
|
|
|
return static_cast<const AInventory*>(actor)->PickupFlash == PClass::FindClass("PickupFlash");
|
2011-06-07 23:05:24 +00:00
|
|
|
// A pure name lookup may or may not be more efficient, but I know no static identifier for PickupFlash.
|
|
|
|
|
|
|
|
case DEPF_INTERHUBSTRIP:
|
2013-05-05 00:01:51 +00:00
|
|
|
return !(static_cast<const AInventory*>(actor)->InterHubAmount);
|
2011-06-07 23:05:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false; // Any entirely unknown flag is not set
|
|
|
|
}
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
//==========================================================================
|
2007-05-28 22:18:51 +00:00
|
|
|
//
|
2008-09-21 18:02:38 +00:00
|
|
|
//
|
2007-05-28 22:18:51 +00:00
|
|
|
//
|
2008-09-21 18:02:38 +00:00
|
|
|
//==========================================================================
|
|
|
|
int MatchString (const char *in, const char **strings)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
int i;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
for (i = 0; *strings != NULL; i++)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
if (!stricmp(in, *strings++))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
return i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
return -1;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-09-21 18:02:38 +00:00
|
|
|
// Info Property handlers
|
|
|
|
//
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
//==========================================================================
|
2007-05-28 22:18:51 +00:00
|
|
|
//
|
2008-09-21 18:02:38 +00:00
|
|
|
//==========================================================================
|
2009-10-16 16:04:19 +00:00
|
|
|
DEFINE_INFO_PROPERTY(game, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
if (!stricmp(str, "Doom"))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
info->GameFilter |= GAME_Doom;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (!stricmp(str, "Heretic"))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
info->GameFilter |= GAME_Heretic;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (!stricmp(str, "Hexen"))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
info->GameFilter |= GAME_Hexen;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (!stricmp(str, "Raven"))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
info->GameFilter |= GAME_Raven;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (!stricmp(str, "Strife"))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
info->GameFilter |= GAME_Strife;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (!stricmp(str, "Chex"))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
info->GameFilter |= GAME_Chex;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (!stricmp(str, "Any"))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
info->GameFilter = GAME_Any;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
I_Error ("Unknown game type %s", str);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
//==========================================================================
|
2007-05-28 22:18:51 +00:00
|
|
|
//
|
2008-09-21 18:02:38 +00:00
|
|
|
//==========================================================================
|
|
|
|
DEFINE_INFO_PROPERTY(spawnid, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
if (id<0 || id>255)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
I_Error ("SpawnID must be in the range [0,255]");
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-12-07 12:11:59 +00:00
|
|
|
else info->SpawnID=(BYTE)id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_INFO_PROPERTY(conversationid, IiI, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(convid, 0);
|
|
|
|
PROP_INT_PARM(id1, 1);
|
|
|
|
PROP_INT_PARM(id2, 2);
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
// Handling for Strife teaser IDs - only of meaning for the standard items
|
|
|
|
// as PWADs cannot be loaded with the teasers.
|
|
|
|
if (PROP_PARM_COUNT > 1)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
if ((gameinfo.flags & (GI_SHAREWARE|GI_TEASER2)) == (GI_SHAREWARE))
|
2010-03-24 02:49:37 +00:00
|
|
|
convid = id1;
|
2008-04-08 08:53:42 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
if ((gameinfo.flags & (GI_SHAREWARE|GI_TEASER2)) == (GI_SHAREWARE|GI_TEASER2))
|
2010-03-24 02:49:37 +00:00
|
|
|
convid = id2;
|
2008-04-08 08:53:42 +00:00
|
|
|
|
2010-03-24 02:49:37 +00:00
|
|
|
}
|
2010-08-20 12:20:51 +00:00
|
|
|
|
|
|
|
if (convid <= 0) return; // 0 is not usable because the dialogue scripts use it as 'no object'.
|
2010-09-16 03:14:32 +00:00
|
|
|
SetStrifeType(convid, info);
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-09-21 18:02:38 +00:00
|
|
|
// Property handlers
|
2007-05-28 22:18:51 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(skip_super, 0, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
2008-08-29 08:48:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
bag.ScriptPosition.Message(MSG_WARNING,
|
2010-03-24 02:49:37 +00:00
|
|
|
"'skip_super' in definition of inventory item '%s' ignored.", info->TypeName.GetChars() );
|
2008-12-07 12:11:59 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (bag.StateSet)
|
|
|
|
{
|
|
|
|
bag.ScriptPosition.Message(MSG_WARNING,
|
|
|
|
"'skip_super' must appear before any state definitions.");
|
2008-08-29 08:48:51 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-07-31 10:15:33 +00:00
|
|
|
memcpy ((void *)defaults, (void *)GetDefault<AActor>(), sizeof(AActor));
|
2008-09-22 18:55:29 +00:00
|
|
|
ResetBaggage (&bag, RUNTIME_CLASS(AActor));
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(tag, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2011-01-12 00:17:13 +00:00
|
|
|
defaults->SetTag(str);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(health, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
defaults->health=id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(gibhealth, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->GibHealth = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(woundhealth, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->WoundHealth = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(reactiontime, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
defaults->reactiontime=id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(painchance, ZI, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
PROP_INT_PARM(id, 1);
|
|
|
|
if (str == NULL)
|
|
|
|
{
|
|
|
|
defaults->PainChance=id;
|
|
|
|
}
|
|
|
|
else
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
|
|
|
FName painType;
|
2008-09-21 18:02:38 +00:00
|
|
|
if (!stricmp(str, "Normal")) painType = NAME_None;
|
|
|
|
else painType=str;
|
|
|
|
|
2010-03-07 09:13:41 +00:00
|
|
|
info->SetPainChance(painType, id);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
2009-10-08 17:43:50 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(painthreshold, I, Actor)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
|
|
|
|
defaults->PainThreshold = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
2007-05-28 22:18:51 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(damage, X, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2012-10-28 04:36:52 +00:00
|
|
|
PROP_EXP_PARM(id, 0);
|
2008-09-21 18:02:38 +00:00
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
// Damage can either be a single number, in which case it is subject
|
|
|
|
// to the original damage calculation rules. Or, it can be an expression
|
|
|
|
// and will be calculated as-is, ignoring the original rules. For
|
|
|
|
// compatibility reasons, expressions must be enclosed within
|
|
|
|
// parentheses.
|
|
|
|
|
2012-10-28 04:36:52 +00:00
|
|
|
// Store this expression here for now. It will be converted to a function
|
|
|
|
// later once all actors have been processed.
|
2013-07-26 02:42:30 +00:00
|
|
|
if (id == NULL)
|
|
|
|
{
|
|
|
|
defaults->Damage = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
defaults->Damage = (VMFunction *)(uintptr_t)(ActorDamageFuncs.Push(id) + 1);
|
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2011-06-13 09:16:57 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(projectilekickback, I, Actor)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
|
|
|
|
defaults->projectileKickback = id;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(speed, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->Speed = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(floatspeed, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->FloatSpeed=id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(radius, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->radius=id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(height, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->height=id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
2008-10-05 11:23:41 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(projectilepassheight, F, Actor)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->projectilepassheight=id;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
2007-05-28 22:18:51 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(mass, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
defaults->Mass=id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(xscale, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->scaleX = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(yscale, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->scaleY = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(scale, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->scaleX = defaults->scaleY = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2013-05-30 08:52:29 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2013-05-31 18:10:41 +00:00
|
|
|
DEFINE_PROPERTY(floatbobphase, I, Actor)
|
2013-05-30 08:52:29 +00:00
|
|
|
{
|
2013-05-30 21:10:54 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
2013-05-30 08:52:29 +00:00
|
|
|
if (id < -1 || id >= 64) I_Error ("FloatBobPhase must be in range [-1,63]");
|
|
|
|
defaults->FloatBobPhase = id;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(args, Iiiii, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
for (int i = 0; i < PROP_PARM_COUNT; i++)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, i);
|
|
|
|
defaults->args[i] = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
defaults->flags2|=MF2_ARGSDEFINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(seesound, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->SeeSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(attacksound, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->AttackSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2009-05-30 23:08:29 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(bouncesound, S, Actor)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->BounceSound = str;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(wallbouncesound, S, Actor)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->WallBounceSound = str;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(painsound, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->PainSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(deathsound, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->DeathSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(activesound, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->ActiveSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(howlsound, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->HowlSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2010-03-21 08:09:45 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(crushpainsound, S, Actor)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->CrushPainSound = str;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(dropitem, S_i_i, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(type, 0);
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
// create a linked list of dropitems
|
|
|
|
if (!bag.DropItemSet)
|
|
|
|
{
|
|
|
|
bag.DropItemSet = true;
|
|
|
|
bag.DropItemList = NULL;
|
|
|
|
}
|
|
|
|
|
2010-03-25 20:38:00 +00:00
|
|
|
DDropItem *di = new DDropItem;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2010-03-25 20:38:00 +00:00
|
|
|
di->Name = type;
|
|
|
|
di->Probability = 255;
|
|
|
|
di->Amount = -1;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
if (PROP_PARM_COUNT > 1)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(prob, 1);
|
2010-03-25 20:38:00 +00:00
|
|
|
di->Probability = prob;
|
2008-09-21 18:02:38 +00:00
|
|
|
if (PROP_PARM_COUNT > 2)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-28 07:23:15 +00:00
|
|
|
PROP_INT_PARM(amt, 2);
|
2010-03-25 20:38:00 +00:00
|
|
|
di->Amount = amt;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
di->Next = bag.DropItemList;
|
|
|
|
bag.DropItemList = di;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(renderstyle, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
static const char * renderstyles[]={
|
2014-04-22 11:32:33 +00:00
|
|
|
"NONE", "NORMAL", "FUZZY", "SOULTRANS", "OPTFUZZY", "STENCIL",
|
2014-05-13 19:16:06 +00:00
|
|
|
"TRANSLUCENT", "ADD", "SHADED", "SHADOW", "SUBTRACT", "ADDSTENCIL", "ADDSHADED", NULL };
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
static const int renderstyle_values[]={
|
|
|
|
STYLE_None, STYLE_Normal, STYLE_Fuzzy, STYLE_SoulTrans, STYLE_OptFuzzy,
|
2014-04-22 11:32:33 +00:00
|
|
|
STYLE_TranslucentStencil, STYLE_Translucent, STYLE_Add, STYLE_Shaded,
|
2014-05-13 19:16:06 +00:00
|
|
|
STYLE_Shadow, STYLE_Subtract, STYLE_AddStencil, STYLE_AddShaded};
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
// make this work for old style decorations, too.
|
|
|
|
if (!strnicmp(str, "style_", 6)) str+=6;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
int style = MatchString(str, renderstyles);
|
2008-10-14 03:21:53 +00:00
|
|
|
if (style < 0) I_Error("Unknown render style '%s'", str);
|
2008-09-21 18:02:38 +00:00
|
|
|
defaults->RenderStyle = LegacyRenderStyles[renderstyle_values[style]];
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(defaultalpha, 0, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
defaults->alpha = gameinfo.gametype == GAME_Heretic ? HR_SHADOW : HX_SHADOW;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(alpha, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->alpha = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(obituary, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->Obituary = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(hitobituary, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->HitObituary = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(donthurtshooter, 0, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->DontHurtShooter = true;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(explosionradius, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->ExplosionRadius = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(explosiondamage, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->ExplosionDamage = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(deathheight, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(h, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->DeathHeight = MAX(0, h);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(burnheight, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(h, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->BurnHeight = MAX(0, h);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(maxtargetrange, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->maxtargetrange = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(meleethreshold, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->meleethreshold = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(meleedamage, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->MeleeDamage = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(meleerange, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->meleerange = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(meleesound, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->MeleeSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(missiletype, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->MissileName = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(missileheight, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->MissileHeight = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2009-06-05 21:44:34 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(pushfactor, F, Actor)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->pushfactor = id;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(translation, L, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(type, 0);
|
|
|
|
|
|
|
|
if (type == 0)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(trans, 1);
|
2008-12-07 12:11:59 +00:00
|
|
|
int max = (gameinfo.gametype==GAME_Strife || (info->GameFilter&GAME_Strife)) ? 6:2;
|
2008-09-21 18:02:38 +00:00
|
|
|
if (trans < 0 || trans > max)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
I_Error ("Translation must be in the range [0,%d]", max);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
defaults->Translation = TRANSLATION(TRANSLATION_Standard, trans);
|
2008-01-26 23:20:34 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
FRemapTable CurrentTranslation;
|
|
|
|
|
2007-12-26 16:06:03 +00:00
|
|
|
CurrentTranslation.MakeIdentity();
|
2008-09-21 18:02:38 +00:00
|
|
|
for(int i = 1; i < PROP_PARM_COUNT; i++)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, i);
|
|
|
|
if (i== 1 && PROP_PARM_COUNT == 2 && !stricmp(str, "Ice"))
|
|
|
|
{
|
|
|
|
defaults->Translation = TRANSLATION(TRANSLATION_Standard, 7);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CurrentTranslation.AddToTranslation(str);
|
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
defaults->Translation = CurrentTranslation.StoreTranslation ();
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-26 15:50:52 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(stencilcolor, C, Actor)
|
2008-01-26 15:50:52 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_COLOR_PARM(color, 0);
|
2008-01-26 15:50:52 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
defaults->fillcolor = color | (ColorMatcher.Pick (RPART(color), GPART(color), BPART(color)) << 24);
|
2008-01-26 15:50:52 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(bloodcolor, C, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_COLOR_PARM(color, 0);
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
PalEntry pe = color;
|
|
|
|
pe.a = CreateBloodTranslation(pe);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->BloodColor = pe;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(bloodtype, Sss, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0)
|
|
|
|
PROP_STRING_PARM(str1, 1)
|
|
|
|
PROP_STRING_PARM(str2, 2)
|
|
|
|
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
PClassActor *ainfo = static_cast<PClassActor *>(info);
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
FName blood = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
// normal blood
|
2010-03-25 20:38:00 +00:00
|
|
|
ainfo->BloodType = blood;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
if (PROP_PARM_COUNT > 1)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
blood = str1;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
// blood splatter
|
2010-03-25 20:38:00 +00:00
|
|
|
ainfo->BloodType2 = blood;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
if (PROP_PARM_COUNT > 2)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
blood = str2;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
// axe blood
|
2010-03-25 20:38:00 +00:00
|
|
|
ainfo->BloodType3 = blood;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2009-05-23 08:30:36 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(bouncetype, S, Actor)
|
|
|
|
{
|
2009-09-14 19:44:14 +00:00
|
|
|
static const char *names[] = { "None", "Doom", "Heretic", "Hexen", "DoomCompat", "HereticCompat", "HexenCompat", "Grenade", "Classic", NULL };
|
|
|
|
static const int flags[] = { BOUNCE_None,
|
2009-09-06 01:49:17 +00:00
|
|
|
BOUNCE_Doom, BOUNCE_Heretic, BOUNCE_Hexen,
|
2009-09-14 19:44:14 +00:00
|
|
|
BOUNCE_DoomCompat, BOUNCE_HereticCompat, BOUNCE_HexenCompat,
|
|
|
|
BOUNCE_Grenade, BOUNCE_Classic, };
|
2009-05-23 08:30:36 +00:00
|
|
|
PROP_STRING_PARM(id, 0);
|
2009-09-06 01:49:17 +00:00
|
|
|
int match = MatchString(id, names);
|
|
|
|
if (match < 0)
|
|
|
|
{
|
|
|
|
I_Error("Unknown bouncetype %s", id);
|
|
|
|
match = 0;
|
|
|
|
}
|
|
|
|
defaults->BounceFlags &= ~(BOUNCE_TypeMask | BOUNCE_UseSeeSound);
|
|
|
|
defaults->BounceFlags |= flags[match];
|
2012-04-26 03:36:01 +00:00
|
|
|
if (defaults->BounceFlags & (BOUNCE_Actors | BOUNCE_AllActors))
|
|
|
|
{
|
|
|
|
// PASSMOBJ is irrelevant for normal missiles, but not for bouncers.
|
|
|
|
defaults->flags2 |= MF2_PASSMOBJ;
|
|
|
|
}
|
2009-05-23 08:30:36 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(bouncefactor, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->bouncefactor = clamp<fixed_t>(id, 0, FRACUNIT);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-06-10 09:16:01 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(wallbouncefactor, F, Actor)
|
2008-06-10 09:16:01 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
defaults->wallbouncefactor = clamp<fixed_t>(id, 0, FRACUNIT);
|
2008-06-10 09:16:01 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(bouncecount, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
defaults->bouncecount = id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2009-12-23 11:41:24 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-12-25 00:19:28 +00:00
|
|
|
DEFINE_PROPERTY(weaveindexXY, I, Actor)
|
2009-12-23 11:41:24 +00:00
|
|
|
{
|
|
|
|
PROP_INT_PARM(id, 0);
|
2009-12-25 00:19:28 +00:00
|
|
|
defaults->WeaveIndexXY = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(weaveindexZ, I, Actor)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
defaults->WeaveIndexZ = id;
|
2009-12-23 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(minmissilechance, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
defaults->MinMissileChance=id;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(damagetype, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
if (!stricmp(str, "Normal")) defaults->DamageType = NAME_None;
|
|
|
|
else defaults->DamageType=str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2011-06-13 17:15:09 +00:00
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(paintype, S, Actor)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
if (!stricmp(str, "Normal")) defaults->PainType = NAME_None;
|
|
|
|
else defaults->PainType=str;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(deathtype, S, Actor)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
if (!stricmp(str, "Normal")) defaults->DeathType = NAME_None;
|
|
|
|
else defaults->DeathType=str;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-10-15 20:09:22 +00:00
|
|
|
DEFINE_PROPERTY(damagefactor, ZF, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2008-10-07 18:21:03 +00:00
|
|
|
PROP_FIXED_PARM(id, 1);
|
2008-09-21 18:02:38 +00:00
|
|
|
|
2009-10-15 20:09:22 +00:00
|
|
|
if (str == NULL)
|
|
|
|
{
|
|
|
|
defaults->DamageFactor = id;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FName dmgType;
|
|
|
|
if (!stricmp(str, "Normal")) dmgType = NAME_None;
|
|
|
|
else dmgType=str;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2010-03-07 09:13:41 +00:00
|
|
|
info->SetDamageFactor(dmgType, id);
|
2009-10-15 20:09:22 +00:00
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(decal, S, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->DecalGenerator = (FDecalBase *)intptr_t(int(FName(str)));
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(maxstepheight, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(i, 0);
|
|
|
|
defaults->MaxStepHeight = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(maxdropoffheight, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(i, 0);
|
|
|
|
defaults->MaxDropOffHeight = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2010-07-23 21:36:17 +00:00
|
|
|
DEFINE_PROPERTY(poisondamage, Iii, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2010-07-23 21:36:17 +00:00
|
|
|
PROP_INT_PARM(poisondamage, 0);
|
|
|
|
PROP_INT_PARM(poisonduration, 1);
|
|
|
|
PROP_INT_PARM(poisonperiod, 2);
|
|
|
|
|
|
|
|
defaults->PoisonDamage = poisondamage;
|
|
|
|
if (PROP_PARM_COUNT == 1)
|
|
|
|
{
|
|
|
|
defaults->PoisonDuration = INT_MIN;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
defaults->PoisonDuration = poisonduration;
|
|
|
|
|
|
|
|
if (PROP_PARM_COUNT > 2)
|
|
|
|
defaults->PoisonPeriod = poisonperiod;
|
|
|
|
else
|
|
|
|
defaults->PoisonPeriod = 0;
|
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
2011-06-13 10:39:14 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(poisondamagetype, S, Actor)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(poisondamagetype, 0);
|
|
|
|
|
|
|
|
defaults->PoisonDamageType = poisondamagetype;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(fastspeed, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(i, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->FastSpeed = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(radiusdamagefactor, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(i, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->RDFactor = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(cameraheight, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(i, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
|
|
|
static_cast<PClassActor *>(info)->CameraHeight = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(vspeed, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(i, 0);
|
2009-06-30 20:57:51 +00:00
|
|
|
defaults->velz = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(gravity, F, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(i, 0);
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
if (i < 0) I_Error ("Gravity must not be negative.");
|
|
|
|
defaults->gravity = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2014-07-29 04:15:50 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(friction, F, Actor)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(i, 0);
|
|
|
|
|
|
|
|
if (i < 0) I_Error ("Friction must not be negative.");
|
|
|
|
defaults->Friction = i;
|
|
|
|
}
|
|
|
|
|
2009-05-11 15:15:06 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(species, S, Actor)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(n, 0);
|
|
|
|
defaults->Species = n;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(clearflags, 0, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2009-06-30 21:35:14 +00:00
|
|
|
defaults->flags =
|
|
|
|
defaults->flags3 =
|
|
|
|
defaults->flags4 =
|
|
|
|
defaults->flags5 =
|
2013-08-12 18:09:21 +00:00
|
|
|
defaults->flags6 =
|
|
|
|
defaults->flags7 = 0;
|
2009-06-30 21:35:14 +00:00
|
|
|
defaults->flags2 &= MF2_ARGSDEFINED; // this flag must not be cleared
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(monster, 0, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
// sets the standard flags for a monster
|
2007-05-28 22:18:51 +00:00
|
|
|
defaults->flags|=MF_SHOOTABLE|MF_COUNTKILL|MF_SOLID;
|
|
|
|
defaults->flags2|=MF2_PUSHWALL|MF2_MCROSS|MF2_PASSMOBJ;
|
|
|
|
defaults->flags3|=MF3_ISMONSTER;
|
|
|
|
defaults->flags4|=MF4_CANUSEWALLS;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(projectile, 0, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
|
|
|
// sets the standard flags for a projectile
|
|
|
|
defaults->flags|=MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE;
|
|
|
|
defaults->flags2|=MF2_IMPACT|MF2_PCROSS|MF2_NOTELEPORT;
|
|
|
|
if (gameinfo.gametype&GAME_Raven) defaults->flags5|=MF5_BLOODSPLATTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
2009-09-15 14:16:55 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(activation, N, Actor)
|
|
|
|
{
|
2009-10-09 20:35:07 +00:00
|
|
|
// How the thing behaves when activated by death, USESPECIAL or BUMPSPECIAL
|
2009-09-15 14:16:55 +00:00
|
|
|
PROP_INT_PARM(val, 0);
|
|
|
|
defaults->activationtype = val;
|
|
|
|
}
|
|
|
|
|
2011-01-22 03:35:33 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(designatedteam, I, Actor)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(val, 0);
|
|
|
|
if(val < 0 || (val >= (signed) Teams.Size() && val != TEAM_NONE))
|
|
|
|
I_Error("Invalid team designation.\n");
|
|
|
|
defaults->DesignatedTeam = val;
|
|
|
|
}
|
|
|
|
|
2011-09-08 01:28:26 +00:00
|
|
|
//==========================================================================
|
|
|
|
// [BB]
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(visibletoteam, I, Actor)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->VisibleToTeam=i+1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
// [BB]
|
|
|
|
//==========================================================================
|
2012-06-21 07:55:59 +00:00
|
|
|
DEFINE_PROPERTY(visibletoplayerclass, Ssssssssssssssssssss, Actor)
|
2011-09-08 01:28:26 +00:00
|
|
|
{
|
2011-09-23 08:23:51 +00:00
|
|
|
info->VisibleToPlayerClass.Clear();
|
2011-09-13 20:13:26 +00:00
|
|
|
for(int i = 0;i < PROP_PARM_COUNT;++i)
|
2011-09-10 04:24:40 +00:00
|
|
|
{
|
|
|
|
PROP_STRING_PARM(n, i);
|
2011-09-23 08:23:51 +00:00
|
|
|
if (*n != 0)
|
2012-07-14 03:04:41 +00:00
|
|
|
info->VisibleToPlayerClass.Push(FindClassTentativePlayerPawn(n));
|
2011-09-10 04:24:40 +00:00
|
|
|
}
|
2011-09-08 01:28:26 +00:00
|
|
|
}
|
|
|
|
|
2012-03-11 09:08:35 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(accuracy, I, Actor)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->accuracy = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_PROPERTY(stamina, I, Actor)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->stamina = i;
|
|
|
|
}
|
|
|
|
|
2009-09-15 14:16:55 +00:00
|
|
|
//==========================================================================
|
2007-05-28 22:18:51 +00:00
|
|
|
//
|
|
|
|
// Special inventory properties
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2011-09-23 08:23:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2012-06-21 07:55:59 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(restrictedto, Ssssssssssssssssssss, Inventory)
|
2011-09-23 08:23:51 +00:00
|
|
|
{
|
|
|
|
info->RestrictedToPlayerClass.Clear();
|
|
|
|
for(int i = 0;i < PROP_PARM_COUNT;++i)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(n, i);
|
|
|
|
if (*n != 0)
|
2012-07-14 03:04:41 +00:00
|
|
|
info->RestrictedToPlayerClass.Push(FindClassTentativePlayerPawn(n));
|
2011-09-23 08:23:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2012-06-21 07:55:59 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(forbiddento, Ssssssssssssssssssss, Inventory)
|
2011-09-23 08:23:51 +00:00
|
|
|
{
|
|
|
|
info->ForbiddenToPlayerClass.Clear();
|
|
|
|
for(int i = 0;i < PROP_PARM_COUNT;++i)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(n, i);
|
|
|
|
if (*n != 0)
|
2012-07-14 03:04:41 +00:00
|
|
|
info->ForbiddenToPlayerClass.Push(FindClassTentativePlayerPawn(n));
|
2011-09-23 08:23:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(backpackamount, I, Ammo)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->BackpackAmount = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(backpackmaxamount, I, Ammo)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->BackpackMaxAmount = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(dropamount, I, Ammo)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassAmmo)));
|
|
|
|
static_cast<PClassAmmo *>(info)->DropAmount = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(armor, maxsaveamount, I, BasicArmorBonus)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->MaxSaveAmount = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(armor, maxbonus, I, BasicArmorBonus)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->BonusCount = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(armor, maxbonusmax, I, BasicArmorBonus)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->BonusMax = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(saveamount, I, Armor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
// Special case here because this property has to work for 2 unrelated classes
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(ABasicArmorPickup)))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
((ABasicArmorPickup*)defaults)->SaveAmount=i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
else if (info->IsDescendantOf(RUNTIME_CLASS(ABasicArmorBonus)))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
((ABasicArmorBonus*)defaults)->SaveAmount=i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
I_Error("\"Armor.SaveAmount\" requires an actor of type \"Armor\"");
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(savepercent, F, Armor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(i, 0);
|
|
|
|
|
2008-12-07 12:11:59 +00:00
|
|
|
i = clamp(i, 0, 100*FRACUNIT)/100;
|
2007-05-28 22:18:51 +00:00
|
|
|
// Special case here because this property has to work for 2 unrelated classes
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(ABasicArmorPickup)))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
((ABasicArmorPickup*)defaults)->SavePercent = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
else if (info->IsDescendantOf(RUNTIME_CLASS(ABasicArmorBonus)))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
((ABasicArmorBonus*)defaults)->SavePercent = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
I_Error("\"Armor.SavePercent\" requires an actor of type \"Armor\"\n");
|
2008-12-06 10:22:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(maxabsorb, I, Armor)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
|
|
|
|
// Special case here because this property has to work for 2 unrelated classes
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(ABasicArmorPickup)))
|
2008-12-06 10:22:37 +00:00
|
|
|
{
|
|
|
|
((ABasicArmorPickup*)defaults)->MaxAbsorb = i;
|
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
else if (info->IsDescendantOf(RUNTIME_CLASS(ABasicArmorBonus)))
|
2008-12-06 10:22:37 +00:00
|
|
|
{
|
|
|
|
((ABasicArmorBonus*)defaults)->MaxAbsorb = i;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
I_Error("\"Armor.MaxAbsorb\" requires an actor of type \"Armor\"\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(maxfullabsorb, I, Armor)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
|
|
|
|
// Special case here because this property has to work for 2 unrelated classes
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(ABasicArmorPickup)))
|
2008-12-06 10:22:37 +00:00
|
|
|
{
|
|
|
|
((ABasicArmorPickup*)defaults)->MaxFullAbsorb = i;
|
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
else if (info->IsDescendantOf(RUNTIME_CLASS(ABasicArmorBonus)))
|
2008-12-06 10:22:37 +00:00
|
|
|
{
|
|
|
|
((ABasicArmorBonus*)defaults)->MaxFullAbsorb = i;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
I_Error("\"Armor.MaxFullAbsorb\" requires an actor of type \"Armor\"\n");
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(amount, I, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->Amount = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(icon, S, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(i, 0);
|
|
|
|
|
2012-07-01 02:57:00 +00:00
|
|
|
if (i == NULL || i[0] == '\0')
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2012-07-01 02:57:00 +00:00
|
|
|
defaults->Icon.SetNull();
|
|
|
|
}
|
|
|
|
else
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2012-07-01 02:57:00 +00:00
|
|
|
defaults->Icon = TexMan.CheckForTexture(i, FTexture::TEX_MiscPatch);
|
|
|
|
if (!defaults->Icon.isValid())
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2012-07-01 02:57:00 +00:00
|
|
|
// Don't print warnings if the item is for another game or if this is a shareware IWAD.
|
|
|
|
// Strife's teaser doesn't contain all the icon graphics of the full game.
|
|
|
|
if ((info->GameFilter == GAME_Any || info->GameFilter & gameinfo.gametype) &&
|
|
|
|
!(gameinfo.flags&GI_SHAREWARE) && Wads.GetLumpFile(bag.Lumpnum) != 0)
|
|
|
|
{
|
|
|
|
bag.ScriptPosition.Message(MSG_WARNING,
|
2012-07-14 03:04:41 +00:00
|
|
|
"Icon '%s' for '%s' not found\n", i, info->TypeName.GetChars());
|
2012-07-01 02:57:00 +00:00
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-08-02 15:54:34 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(interhubamount, I, Inventory)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->InterHubAmount = i;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(maxamount, I, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->MaxAmount = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(defmaxamount, 0, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2009-09-08 21:01:24 +00:00
|
|
|
defaults->MaxAmount = gameinfo.definventorymaxamount;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-16 10:23:12 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(pickupflash, S, Inventory)
|
2008-02-16 10:23:12 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
defaults->PickupFlash = FindClassTentative(str, RUNTIME_CLASS(AActor));
|
2008-02-16 10:23:12 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-10-16 16:04:19 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(pickupmessage, T, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassInventory)));
|
|
|
|
static_cast<PClassInventory *>(info)->PickupMessage = str;
|
2008-09-21 18:02:38 +00:00
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(pickupsound, S, Inventory)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->PickupSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2009-06-09 17:13:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
// Dummy for Skulltag compatibility...
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(pickupannouncerentry, S, Inventory)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(respawntics, I, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->RespawnTics = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(usesound, S, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->UseSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(givequest, I, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassInventory)));
|
|
|
|
static_cast<PClassInventory *>(info)->GiveQuest = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-10-16 16:04:19 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(lowmessage, IT, Health)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
PROP_STRING_PARM(str, 1);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassHealth)));
|
|
|
|
static_cast<PClassHealth *>(info)->LowHealth = i;
|
|
|
|
static_cast<PClassHealth *>(info)->LowHealthMessage = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2009-02-28 21:38:20 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(autouse, I, HealthPickup)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->autousemode = i;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(number, I, PuzzleItem)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->PuzzleItemNumber = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-10-16 16:04:19 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(failmessage, T, PuzzleItem)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPuzzleItem)));
|
|
|
|
static_cast<PClassPuzzleItem *>(info)->PuzzFailMessage = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(ammogive, I, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->AmmoGive1 = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(ammogive1, I, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->AmmoGive1 = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(ammogive2, I, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
2008-09-27 07:57:41 +00:00
|
|
|
defaults->AmmoGive2 = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-09-21 18:02:38 +00:00
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(ammotype, S, Weapon)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
2009-12-19 07:44:04 +00:00
|
|
|
if (!stricmp(str, "none") || *str == 0) defaults->AmmoType1 = NULL;
|
2010-03-25 20:38:00 +00:00
|
|
|
else defaults->AmmoType1 = FindClassTentativeAmmo(str);
|
2008-09-21 18:02:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
2007-05-28 22:18:51 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(ammotype1, S, Weapon)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
2009-12-19 07:44:04 +00:00
|
|
|
if (!stricmp(str, "none") || *str == 0) defaults->AmmoType1 = NULL;
|
2010-03-25 20:38:00 +00:00
|
|
|
else defaults->AmmoType1 = FindClassTentativeAmmo(str);
|
2008-09-21 18:02:38 +00:00
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(ammotype2, S, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2009-12-19 07:44:04 +00:00
|
|
|
if (!stricmp(str, "none") || *str == 0) defaults->AmmoType1 = NULL;
|
2010-03-25 20:38:00 +00:00
|
|
|
else defaults->AmmoType2 = FindClassTentativeAmmo(str);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(ammouse, I, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->AmmoUse1 = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(ammouse1, I, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->AmmoUse1 = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(ammouse2, I, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->AmmoUse2 = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(kickback, I, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->Kickback = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-08-09 11:35:42 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(defaultkickback, 0, Weapon)
|
2008-08-09 11:35:42 +00:00
|
|
|
{
|
|
|
|
defaults->Kickback = gameinfo.defKickback;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(readysound, S, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->ReadySound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(selectionorder, I, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->SelectionOrder = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2013-03-24 02:25:12 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(minselectionammo1, I, Weapon)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->MinSelAmmo1 = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(minselectionammo2, I, Weapon)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->MinSelAmmo2 = i;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(sisterweapon, S, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
defaults->SisterWeaponType = FindClassTentativeWeapon(str);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(upsound, S, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->UpSound = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(yadjust, F, Weapon)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(i, 0);
|
|
|
|
defaults->YAdjust = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2012-05-02 20:58:29 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(bobstyle, S, Weapon)
|
|
|
|
{
|
|
|
|
static const char *names[] = { "Normal", "Inverse", "Alpha", "InverseAlpha", "Smooth", "InverseSmooth", NULL };
|
2013-01-17 19:25:22 +00:00
|
|
|
static const int styles[] = { AWeapon::BobNormal,
|
2012-05-02 20:58:29 +00:00
|
|
|
AWeapon::BobInverse, AWeapon::BobAlpha, AWeapon::BobInverseAlpha,
|
|
|
|
AWeapon::BobSmooth, AWeapon::BobInverseSmooth, };
|
|
|
|
PROP_STRING_PARM(id, 0);
|
|
|
|
int match = MatchString(id, names);
|
|
|
|
if (match < 0)
|
|
|
|
{
|
|
|
|
I_Error("Unknown bobstyle %s", id);
|
|
|
|
match = 0;
|
|
|
|
}
|
2013-01-17 19:25:22 +00:00
|
|
|
defaults->BobStyle = styles[match];
|
2012-05-02 20:58:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(bobspeed, F, Weapon)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(i, 0);
|
|
|
|
defaults->BobSpeed = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(bobrangex, F, Weapon)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(i, 0);
|
|
|
|
defaults->BobRangeX = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(bobrangey, F, Weapon)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(i, 0);
|
|
|
|
defaults->BobRangeY = i;
|
|
|
|
}
|
|
|
|
|
2009-02-20 00:53:25 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(slotnumber, I, Weapon)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(i, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassWeapon)));
|
|
|
|
static_cast<PClassWeapon *>(info)->SlotNumber = i;
|
2009-02-20 00:53:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(slotpriority, F, Weapon)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(i, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassWeapon)));
|
|
|
|
static_cast<PClassWeapon *>(info)->SlotPriority = i;
|
2009-02-20 00:53:25 +00:00
|
|
|
}
|
|
|
|
|
2010-02-19 08:10:04 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY(preferredskin, S, Weapon)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
// NoOp - only for Skulltag compatibility
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(number, I, WeaponPiece)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->PieceValue = 1 << (i-1);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(weapon, S, WeaponPiece)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
defaults->WeaponClass = FindClassTentativeWeapon(str);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(powerup, color, C_f, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2009-09-21 13:15:36 +00:00
|
|
|
static const char *specialcolormapnames[] = {
|
|
|
|
"INVERSEMAP", "GOLDMAP", "REDMAP", "GREENMAP", "BLUEMAP", NULL };
|
2008-09-21 18:02:38 +00:00
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
int alpha;
|
2008-08-09 11:35:42 +00:00
|
|
|
PalEntry * pBlendColor;
|
|
|
|
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(APowerup)))
|
2008-08-09 11:35:42 +00:00
|
|
|
{
|
|
|
|
pBlendColor = &((APowerup*)defaults)->BlendColor;
|
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
else if (info->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
|
2008-08-09 11:35:42 +00:00
|
|
|
{
|
|
|
|
pBlendColor = &((APowerupGiver*)defaults)->BlendColor;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
I_Error("\"powerup.color\" requires an actor of type \"Powerup\"\n");
|
2008-08-11 22:42:38 +00:00
|
|
|
return;
|
2008-08-09 11:35:42 +00:00
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(mode, 0);
|
|
|
|
PROP_INT_PARM(color, 1);
|
|
|
|
|
|
|
|
if (mode == 1)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(name, 1);
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2009-09-21 13:15:36 +00:00
|
|
|
// We must check the old special colormap names for compatibility
|
|
|
|
int v = MatchString(name, specialcolormapnames);
|
|
|
|
if (v >= 0)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2009-09-21 13:15:36 +00:00
|
|
|
*pBlendColor = MakeSpecialColormap(v);
|
2009-07-17 01:17:06 +00:00
|
|
|
return;
|
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
color = V_GetColor(NULL, name);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-10-05 08:50:47 +00:00
|
|
|
if (PROP_PARM_COUNT > 2)
|
2008-09-21 18:02:38 +00:00
|
|
|
{
|
|
|
|
PROP_FLOAT_PARM(falpha, 2);
|
|
|
|
alpha=int(falpha*255);
|
|
|
|
}
|
|
|
|
else alpha = 255/3;
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
alpha=clamp<int>(alpha, 0, 255);
|
2009-09-22 08:06:52 +00:00
|
|
|
if (alpha != 0) *pBlendColor = MAKEARGB(alpha, 0, 0, 0) | color;
|
2008-08-09 11:35:42 +00:00
|
|
|
else *pBlendColor = 0;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2009-09-21 13:15:36 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-09-22 02:54:19 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(powerup, colormap, FFFfff, Inventory)
|
2009-09-21 13:15:36 +00:00
|
|
|
{
|
|
|
|
PalEntry * pBlendColor;
|
|
|
|
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(APowerup)))
|
2009-09-21 13:15:36 +00:00
|
|
|
{
|
|
|
|
pBlendColor = &((APowerup*)defaults)->BlendColor;
|
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
else if (info->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
|
2009-09-21 13:15:36 +00:00
|
|
|
{
|
|
|
|
pBlendColor = &((APowerupGiver*)defaults)->BlendColor;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
I_Error("\"powerup.colormap\" requires an actor of type \"Powerup\"\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-09-22 02:54:19 +00:00
|
|
|
if (PROP_PARM_COUNT == 3)
|
|
|
|
{
|
|
|
|
PROP_FLOAT_PARM(r, 0);
|
|
|
|
PROP_FLOAT_PARM(g, 1);
|
|
|
|
PROP_FLOAT_PARM(b, 2);
|
|
|
|
*pBlendColor = MakeSpecialColormap(AddSpecialColormap(0, 0, 0, r, g, b));
|
|
|
|
}
|
|
|
|
else if (PROP_PARM_COUNT == 6)
|
|
|
|
{
|
|
|
|
PROP_FLOAT_PARM(r1, 0);
|
|
|
|
PROP_FLOAT_PARM(g1, 1);
|
|
|
|
PROP_FLOAT_PARM(b1, 2);
|
2009-09-22 10:05:27 +00:00
|
|
|
PROP_FLOAT_PARM(r2, 3);
|
|
|
|
PROP_FLOAT_PARM(g2, 4);
|
|
|
|
PROP_FLOAT_PARM(b2, 5);
|
2009-09-22 02:54:19 +00:00
|
|
|
*pBlendColor = MakeSpecialColormap(AddSpecialColormap(r1, g1, b1, r2, g2, b2));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
I_Error("\"power.colormap\" must have either 3 or 6 parameters\n");
|
|
|
|
}
|
2009-09-21 13:15:36 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(powerup, duration, I, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
int *pEffectTics;
|
|
|
|
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(APowerup)))
|
2008-08-09 11:35:42 +00:00
|
|
|
{
|
|
|
|
pEffectTics = &((APowerup*)defaults)->EffectTics;
|
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
else if (info->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
|
2008-08-09 11:35:42 +00:00
|
|
|
{
|
|
|
|
pEffectTics = &((APowerupGiver*)defaults)->EffectTics;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-06-04 22:05:12 +00:00
|
|
|
I_Error("\"powerup.duration\" requires an actor of type \"Powerup\"\n");
|
2008-08-11 22:42:38 +00:00
|
|
|
return;
|
2008-08-09 11:35:42 +00:00
|
|
|
}
|
2008-08-11 23:16:37 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
*pEffectTics = (i >= 0) ? i : -i * TICRATE;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-06-30 22:10:51 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(powerup, strength, F, Inventory)
|
|
|
|
{
|
|
|
|
fixed_t *pStrength;
|
|
|
|
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(APowerup)))
|
2009-06-30 22:10:51 +00:00
|
|
|
{
|
|
|
|
pStrength = &((APowerup*)defaults)->Strength;
|
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
else if (info->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
|
2009-06-30 22:10:51 +00:00
|
|
|
{
|
|
|
|
pStrength = &((APowerupGiver*)defaults)->Strength;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
I_Error("\"powerup.strength\" requires an actor of type \"Powerup\"\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
PROP_FIXED_PARM(f, 0);
|
2013-08-12 07:13:55 +00:00
|
|
|
*pStrength = f;
|
2009-06-30 22:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(powerup, mode, S, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2009-06-30 22:10:51 +00:00
|
|
|
FName *pMode;
|
2010-03-24 02:49:37 +00:00
|
|
|
if (info->IsDescendantOf(RUNTIME_CLASS(APowerup)))
|
2009-06-30 22:10:51 +00:00
|
|
|
{
|
|
|
|
pMode = &((APowerup*)defaults)->Mode;
|
|
|
|
}
|
2010-03-24 02:49:37 +00:00
|
|
|
else if (info->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
|
2009-06-30 22:10:51 +00:00
|
|
|
{
|
|
|
|
pMode = &((APowerupGiver*)defaults)->Mode;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
I_Error("\"powerup.mode\" requires an actor of type \"Powerup\"\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
*pMode = (FName)str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(powerup, type, S, PowerupGiver)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2008-12-29 23:03:38 +00:00
|
|
|
|
|
|
|
// Yuck! What was I thinking when I decided to prepend "Power" to the name?
|
|
|
|
// Now it's too late to change it...
|
2010-03-24 02:49:37 +00:00
|
|
|
PClassActor *cls = PClass::FindActor(str);
|
2009-01-01 15:09:49 +00:00
|
|
|
if (cls == NULL || !cls->IsDescendantOf(RUNTIME_CLASS(APowerup)))
|
2008-12-29 23:03:38 +00:00
|
|
|
{
|
|
|
|
FString st;
|
|
|
|
st.Format("%s%s", strnicmp(str, "power", 5)? "Power" : "", str);
|
2010-03-25 20:38:00 +00:00
|
|
|
cls = FindClassTentativePowerup(st);
|
2008-12-29 23:03:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
defaults->PowerupType = cls;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// [GRB] Special player properties
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, displayname, S, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->DisplayName = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, soundclass, S, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
FString tmp = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
tmp.ReplaceChars (' ', '_');
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->SoundClass = tmp;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-05 12:14:33 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, face, S, PlayerPawn)
|
2008-04-05 12:14:33 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
FString tmp = str;
|
2008-04-05 12:14:33 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
tmp.ToUpper();
|
2008-04-05 12:14:33 +00:00
|
|
|
if (tmp.Len() != 3)
|
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
bag.ScriptPosition.Message(MSG_WARNING,
|
|
|
|
"Invalid face '%s' for '%s';\nSTF replacement codes must be 3 characters.\n",
|
2010-03-24 02:49:37 +00:00
|
|
|
tmp.GetChars(), info->TypeName.GetChars ());
|
2008-04-05 12:14:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool valid = (
|
|
|
|
(((tmp[0] >= 'A') && (tmp[0] <= 'Z')) || ((tmp[0] >= '0') && (tmp[0] <= '9'))) &&
|
|
|
|
(((tmp[1] >= 'A') && (tmp[1] <= 'Z')) || ((tmp[1] >= '0') && (tmp[1] <= '9'))) &&
|
|
|
|
(((tmp[2] >= 'A') && (tmp[2] <= 'Z')) || ((tmp[2] >= '0') && (tmp[2] <= '9')))
|
|
|
|
);
|
|
|
|
if (!valid)
|
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
bag.ScriptPosition.Message(MSG_WARNING,
|
|
|
|
"Invalid face '%s' for '%s';\nSTF replacement codes must be alphanumeric.\n",
|
2010-03-24 02:49:37 +00:00
|
|
|
tmp.GetChars(), info->TypeName.GetChars ());
|
2008-04-05 12:14:33 +00:00
|
|
|
}
|
|
|
|
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->Face = tmp;
|
2008-04-05 12:14:33 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, colorrange, I_I, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(start, 0);
|
2008-09-24 23:22:55 +00:00
|
|
|
PROP_INT_PARM(end, 1);
|
2007-05-28 22:18:51 +00:00
|
|
|
|
|
|
|
if (start > end)
|
2010-07-23 21:19:59 +00:00
|
|
|
swapvalues (start, end);
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->ColorRangeStart = start;
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->ColorRangeEnd = end;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2010-03-06 02:51:23 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2012-03-16 02:23:31 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, colorset, ISIIIiiiiiiiiiiiiiiiiiiiiiiii, PlayerPawn)
|
2010-03-06 02:51:23 +00:00
|
|
|
{
|
|
|
|
PROP_INT_PARM(setnum, 0);
|
|
|
|
PROP_STRING_PARM(setname, 1);
|
|
|
|
PROP_INT_PARM(rangestart, 2);
|
|
|
|
PROP_INT_PARM(rangeend, 3);
|
|
|
|
PROP_INT_PARM(representative_color, 4);
|
|
|
|
|
|
|
|
FPlayerColorSet color;
|
|
|
|
color.Name = setname;
|
|
|
|
color.Lump = -1;
|
|
|
|
color.FirstColor = rangestart;
|
|
|
|
color.LastColor = rangeend;
|
|
|
|
color.RepresentativeColor = representative_color;
|
2012-03-16 02:23:31 +00:00
|
|
|
color.NumExtraRanges = 0;
|
|
|
|
|
|
|
|
if (PROP_PARM_COUNT > 5)
|
|
|
|
{
|
|
|
|
int count = PROP_PARM_COUNT - 5;
|
|
|
|
int start = 5;
|
|
|
|
|
|
|
|
while (count >= 4)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(range_start, start+0);
|
|
|
|
PROP_INT_PARM(range_end, start+1);
|
|
|
|
PROP_INT_PARM(first_color, start+2);
|
|
|
|
PROP_INT_PARM(last_color, start+3);
|
|
|
|
int extra = color.NumExtraRanges++;
|
2012-03-20 02:22:17 +00:00
|
|
|
assert (extra < (int)countof(color.Extra));
|
2012-03-16 02:23:31 +00:00
|
|
|
|
|
|
|
color.Extra[extra].RangeStart = range_start;
|
|
|
|
color.Extra[extra].RangeEnd = range_end;
|
|
|
|
color.Extra[extra].FirstColor = first_color;
|
|
|
|
color.Extra[extra].LastColor = last_color;
|
|
|
|
count -= 4;
|
|
|
|
start += 4;
|
|
|
|
}
|
|
|
|
if (count != 0)
|
|
|
|
{
|
|
|
|
bag.ScriptPosition.Message(MSG_WARNING, "Extra ranges require 4 parameters each.\n");
|
|
|
|
}
|
|
|
|
}
|
2010-03-06 02:51:23 +00:00
|
|
|
|
|
|
|
if (setnum < 0)
|
|
|
|
{
|
|
|
|
bag.ScriptPosition.Message(MSG_WARNING, "Color set number must not be negative.\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-04-04 17:06:04 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->ColorSets.Insert(setnum, color);
|
2010-03-06 02:51:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, colorsetfile, ISSI, PlayerPawn)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(setnum, 0);
|
|
|
|
PROP_STRING_PARM(setname, 1);
|
|
|
|
PROP_STRING_PARM(rangefile, 2);
|
|
|
|
PROP_INT_PARM(representative_color, 3);
|
|
|
|
|
|
|
|
FPlayerColorSet color;
|
|
|
|
color.Name = setname;
|
|
|
|
color.Lump = Wads.CheckNumForName(rangefile);
|
|
|
|
color.RepresentativeColor = representative_color;
|
2012-03-16 02:23:31 +00:00
|
|
|
color.NumExtraRanges = 0;
|
|
|
|
|
2010-03-06 02:51:23 +00:00
|
|
|
if (setnum < 0)
|
|
|
|
{
|
|
|
|
bag.ScriptPosition.Message(MSG_WARNING, "Color set number must not be negative.\n");
|
|
|
|
}
|
|
|
|
else if (color.Lump >= 0)
|
|
|
|
{
|
2010-04-04 17:06:04 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->ColorSets.Insert(setnum, color);
|
2010-03-06 02:51:23 +00:00
|
|
|
}
|
|
|
|
}
|
2010-03-07 09:13:41 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, clearcolorset, I, PlayerPawn)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(setnum, 0);
|
|
|
|
|
|
|
|
if (setnum < 0)
|
|
|
|
{
|
|
|
|
bag.ScriptPosition.Message(MSG_WARNING, "Color set number must not be negative.\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-04-04 17:06:04 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->ColorSets.Remove(setnum);
|
2010-03-07 09:13:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, attackzoffset, F, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(z, 0);
|
|
|
|
defaults->AttackZOffset = z;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, jumpz, F, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(z, 0);
|
|
|
|
defaults->JumpZ = z;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2012-08-14 03:24:59 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, GruntSpeed, F, PlayerPawn)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(z, 0);
|
|
|
|
defaults->GruntSpeed = z;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, FallingScreamSpeed, FF, PlayerPawn)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(minz, 0);
|
|
|
|
PROP_FIXED_PARM(maxz, 0);
|
|
|
|
defaults->FallingScreamMinSpeed = minz;
|
|
|
|
defaults->FallingScreamMaxSpeed = maxz;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, spawnclass, L, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(type, 0);
|
|
|
|
|
|
|
|
if (type == 0)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(val, 1);
|
2008-05-11 21:16:32 +00:00
|
|
|
if (val > 0) defaults->SpawnMask |= 1<<(val-1);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
for(int i=1; i<PROP_PARM_COUNT; i++)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, i);
|
|
|
|
|
|
|
|
if (!stricmp(str, "Any"))
|
|
|
|
defaults->SpawnMask = 0;
|
|
|
|
else if (!stricmp(str, "Fighter"))
|
|
|
|
defaults->SpawnMask |= 1;
|
|
|
|
else if (!stricmp(str, "Cleric"))
|
|
|
|
defaults->SpawnMask |= 2;
|
|
|
|
else if (!stricmp(str, "Mage"))
|
|
|
|
defaults->SpawnMask |= 4;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, viewheight, F, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(z, 0);
|
|
|
|
defaults->ViewHeight = z;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2013-07-22 20:37:50 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, userange, F, PlayerPawn)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(z, 0);
|
|
|
|
defaults->UseRange = z;
|
|
|
|
}
|
|
|
|
|
2013-08-09 09:57:14 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, aircapacity, F, PlayerPawn)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(z, 0);
|
|
|
|
defaults->AirCapacity = z;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, forwardmove, F_f, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(m, 0);
|
|
|
|
defaults->ForwardMove1 = defaults->ForwardMove2 = m;
|
|
|
|
if (PROP_PARM_COUNT > 1)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(m2, 1);
|
|
|
|
defaults->ForwardMove2 = m2;
|
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, sidemove, F_f, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(m, 0);
|
|
|
|
defaults->SideMove1 = defaults->SideMove2 = m;
|
|
|
|
if (PROP_PARM_COUNT > 1)
|
|
|
|
{
|
|
|
|
PROP_FIXED_PARM(m2, 1);
|
|
|
|
defaults->SideMove2 = m2;
|
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, maxhealth, I, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(z, 0);
|
|
|
|
defaults->MaxHealth = z;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2009-08-07 04:20:28 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, mugshotmaxhealth, I, PlayerPawn)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(z, 0);
|
|
|
|
defaults->MugShotMaxHealth = z;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, runhealth, I, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(z, 0);
|
|
|
|
defaults->RunHealth = z;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, morphweapon, S, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(z, 0);
|
|
|
|
defaults->MorphWeapon = FName(z);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2011-01-01 11:16:46 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, flechettetype, S, PlayerPawn)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, 0);
|
2012-07-14 03:04:41 +00:00
|
|
|
defaults->FlechetteType = FindClassTentative(str, RUNTIME_CLASS(AArtiPoisonBag));
|
2011-01-01 11:16:46 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, scoreicon, S, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(z, 0);
|
|
|
|
defaults->ScoreIcon = TexMan.CheckForTexture(z, FTexture::TEX_MiscPatch);
|
2008-06-15 18:36:26 +00:00
|
|
|
if (!defaults->ScoreIcon.isValid())
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-12-07 12:11:59 +00:00
|
|
|
bag.ScriptPosition.Message(MSG_WARNING,
|
2010-03-24 02:49:37 +00:00
|
|
|
"Icon '%s' for '%s' not found\n", z, info->TypeName.GetChars ());
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, crouchsprite, S, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(z, 0);
|
2009-03-29 08:55:15 +00:00
|
|
|
if (strlen(z) == 4)
|
|
|
|
{
|
|
|
|
defaults->crouchsprite = GetSpriteIndex (z);
|
|
|
|
}
|
|
|
|
else if (*z == 0)
|
|
|
|
{
|
|
|
|
defaults->crouchsprite = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
I_Error("Sprite name must have exactly 4 characters");
|
|
|
|
}
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-01-26 16:42:16 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2011-06-06 22:23:43 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, damagescreencolor, Cfs, PlayerPawn)
|
2008-01-26 16:42:16 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_COLOR_PARM(c, 0);
|
2011-06-06 22:23:43 +00:00
|
|
|
|
|
|
|
PalEntry color = c;
|
|
|
|
|
2010-07-16 03:46:20 +00:00
|
|
|
if (PROP_PARM_COUNT < 3) // Because colors count as 2 parms
|
|
|
|
{
|
2011-06-06 22:23:43 +00:00
|
|
|
color.a = 255;
|
|
|
|
defaults->DamageFade = color;
|
|
|
|
}
|
|
|
|
else if (PROP_PARM_COUNT < 4)
|
|
|
|
{
|
|
|
|
PROP_FLOAT_PARM(a, 2);
|
|
|
|
|
|
|
|
color.a = BYTE(255 * clamp(a, 0.f, 1.f));
|
|
|
|
defaults->DamageFade = color;
|
2010-07-16 03:46:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PROP_FLOAT_PARM(a, 2);
|
2011-06-06 22:23:43 +00:00
|
|
|
PROP_STRING_PARM(type, 3);
|
|
|
|
|
|
|
|
color.a = BYTE(255 * clamp(a, 0.f, 1.f));
|
2012-10-17 04:24:54 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->PainFlashes.Insert(type, color);
|
2010-07-16 03:46:20 +00:00
|
|
|
}
|
2008-01-26 16:42:16 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// [GRB] Store start items in drop item list
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, startitem, S_i, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
|
|
|
|
// create a linked list of startitems
|
2007-05-28 22:18:51 +00:00
|
|
|
if (!bag.DropItemSet)
|
|
|
|
{
|
|
|
|
bag.DropItemSet = true;
|
|
|
|
bag.DropItemList = NULL;
|
|
|
|
}
|
|
|
|
|
2010-03-25 20:38:00 +00:00
|
|
|
DDropItem *di = new DDropItem;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
di->Name = str;
|
2010-03-25 20:38:00 +00:00
|
|
|
di->Probability = 255;
|
|
|
|
di->Amount = 1;
|
2008-09-21 18:02:38 +00:00
|
|
|
if (PROP_PARM_COUNT > 1)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 22:25:23 +00:00
|
|
|
PROP_INT_PARM(amt, 1);
|
2010-03-25 20:38:00 +00:00
|
|
|
di->Amount = amt;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
di->Next = bag.DropItemList;
|
|
|
|
bag.DropItemList = di;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, invulnerabilitymode, S, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->InvulMode = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, healradiustype, S, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
static_cast<PClassPlayerPawn *>(info)->HealingRadiusType = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, hexenarmor, FFFFF, PlayerPawn)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
|
|
for (int i = 0; i < 5; i++)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(val, i);
|
2010-03-25 20:38:00 +00:00
|
|
|
static_cast<PClassPlayerPawn *>(info)->HexenArmor[i] = val;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-14 17:28:18 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, portrait, S, PlayerPawn)
|
|
|
|
{
|
2012-07-14 03:04:41 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
2010-09-14 17:28:18 +00:00
|
|
|
PROP_STRING_PARM(val, 0);
|
2012-07-14 03:04:41 +00:00
|
|
|
static_cast<PClassPlayerPawn *>(info)->Portrait = val;
|
2010-09-14 17:28:18 +00:00
|
|
|
}
|
|
|
|
|
2009-02-20 00:53:25 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, weaponslot, ISsssssssssssssssssssssssssssssssssssssssssss, PlayerPawn)
|
|
|
|
{
|
|
|
|
PROP_INT_PARM(slot, 0);
|
|
|
|
|
2010-03-25 20:38:00 +00:00
|
|
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
2009-02-20 00:53:25 +00:00
|
|
|
if (slot < 0 || slot > 9)
|
|
|
|
{
|
|
|
|
I_Error("Slot must be between 0 and 9.");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FString weapons;
|
|
|
|
|
|
|
|
for(int i = 1; i < PROP_PARM_COUNT; ++i)
|
|
|
|
{
|
|
|
|
PROP_STRING_PARM(str, i);
|
|
|
|
weapons << ' ' << str;
|
|
|
|
}
|
2010-03-25 20:38:00 +00:00
|
|
|
static_cast<PClassPlayerPawn *>(info)->Slot[slot] = &weapons[1];
|
2009-02-20 00:53:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-04-08 08:53:42 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(playerclass, S, MorphProjectile)
|
2008-04-08 08:53:42 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->PlayerClass = FName(str);
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(monsterclass, S, MorphProjectile)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->MonsterClass = FName(str);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(duration, I, MorphProjectile)
|
2008-04-08 08:53:42 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->Duration = i >= 0 ? i : -i*TICRATE;
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(morphstyle, M, MorphProjectile)
|
2008-04-08 08:53:42 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->MorphStyle = i;
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(morphflash, S, MorphProjectile)
|
2008-04-08 08:53:42 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->MorphFlash = FName(str);
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(unmorphflash, S, MorphProjectile)
|
2008-04-08 08:53:42 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->UnMorphFlash = FName(str);
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(playerclass, S, PowerMorph)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->PlayerClass = FName(str);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-08 08:53:42 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(morphstyle, M, PowerMorph)
|
2008-04-08 08:53:42 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
defaults->MorphStyle = i;
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(morphflash, S, PowerMorph)
|
2008-04-08 08:53:42 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->MorphFlash = FName(str);
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(unmorphflash, S, PowerMorph)
|
2008-04-08 08:53:42 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->UnMorphFlash = FName(str);
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
|