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 "r_draw.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"
|
2007-12-26 16:06:03 +00:00
|
|
|
#include "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"
|
2008-09-21 18:02:38 +00:00
|
|
|
#include "autosegs.h"
|
2007-05-28 22:18:51 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// List of all flags
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// [RH] Keep GCC quiet by not using offsetof on Actor types.
|
|
|
|
#define DEFINE_FLAG(prefix, name, type, variable) { prefix##_##name, #name, (int)(size_t)&((type*)1)->variable - 1 }
|
|
|
|
#define DEFINE_FLAG2(symbol, name, type, variable) { symbol, #name, (int)(size_t)&((type*)1)->variable - 1 }
|
2008-04-11 10:16:29 +00:00
|
|
|
#define DEFINE_DEPRECATED_FLAG(name) { DEPF_##name, #name, -1 }
|
|
|
|
#define DEFINE_DUMMY_FLAG(name) { DEPF_UNUSED, #name, -1 }
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-03-01 16:59:17 +00:00
|
|
|
enum
|
|
|
|
{
|
2008-04-11 10:16:29 +00:00
|
|
|
DEPF_UNUSED,
|
2008-03-01 16:59:17 +00:00
|
|
|
DEPF_FIREDAMAGE,
|
|
|
|
DEPF_ICEDAMAGE,
|
|
|
|
DEPF_LOWGRAVITY,
|
|
|
|
DEPF_LONGMELEERANGE,
|
|
|
|
DEPF_SHORTMISSILERANGE,
|
2008-06-22 09:13:19 +00:00
|
|
|
DEPF_PICKUPFLASH,
|
|
|
|
DEPF_QUARTERGRAVITY,
|
2008-08-19 19:38:39 +00:00
|
|
|
DEPF_FIRERESIST,
|
2008-03-01 16:59:17 +00:00
|
|
|
};
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
static FFlagDef ActorFlags[]=
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-03-19 22:47:04 +00:00
|
|
|
DEFINE_FLAG(MF, PICKUP, APlayerPawn, flags),
|
2008-08-05 22:51:51 +00:00
|
|
|
DEFINE_FLAG(MF, SPECIAL, APlayerPawn, flags),
|
2007-05-28 22:18:51 +00:00
|
|
|
DEFINE_FLAG(MF, SOLID, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, SHOOTABLE, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, NOSECTOR, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, NOBLOCKMAP, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, AMBUSH, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, JUSTHIT, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, JUSTATTACKED, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, SPAWNCEILING, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, NOGRAVITY, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, DROPOFF, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, NOCLIP, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, FLOAT, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, TELEPORT, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, MISSILE, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, DROPPED, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, SHADOW, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, NOBLOOD, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, CORPSE, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, INFLOAT, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, COUNTKILL, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, COUNTITEM, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, SKULLFLY, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, NOTDMATCH, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, SPAWNSOUNDSOURCE, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, FRIENDLY, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, NOLIFTDROP, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, STEALTH, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF, ICECORPSE, AActor, flags),
|
|
|
|
DEFINE_FLAG(MF2, DONTREFLECT, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, WINDTHRUST, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, HERETICBOUNCE , AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, BLASTED, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, FLOORCLIP, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, SPAWNFLOAT, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, NOTELEPORT, AActor, flags2),
|
|
|
|
DEFINE_FLAG2(MF2_RIP, RIPPER, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, PUSHABLE, AActor, flags2),
|
|
|
|
DEFINE_FLAG2(MF2_SLIDE, SLIDESONWALLS, AActor, flags2),
|
|
|
|
DEFINE_FLAG2(MF2_PASSMOBJ, CANPASS, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, CANNOTPUSH, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, THRUGHOST, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, BOSS, AActor, flags2),
|
|
|
|
DEFINE_FLAG2(MF2_NODMGTHRUST, NODAMAGETHRUST, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, DONTTRANSLATE, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, TELESTOMP, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, FLOATBOB, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, HEXENBOUNCE, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, DOOMBOUNCE, AActor, flags2),
|
|
|
|
DEFINE_FLAG2(MF2_IMPACT, ACTIVATEIMPACT, AActor, flags2),
|
|
|
|
DEFINE_FLAG2(MF2_PUSHWALL, CANPUSHWALLS, AActor, flags2),
|
|
|
|
DEFINE_FLAG2(MF2_MCROSS, ACTIVATEMCROSS, AActor, flags2),
|
|
|
|
DEFINE_FLAG2(MF2_PCROSS, ACTIVATEPCROSS, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, CANTLEAVEFLOORPIC, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, NONSHOOTABLE, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, INVULNERABLE, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, DORMANT, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, SEEKERMISSILE, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF2, REFLECTIVE, AActor, flags2),
|
|
|
|
DEFINE_FLAG(MF3, FLOORHUGGER, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, CEILINGHUGGER, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, NORADIUSDMG, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, GHOST, AActor, flags3),
|
2008-08-10 11:29:19 +00:00
|
|
|
DEFINE_FLAG(MF3, SPECIALFLOORCLIP, AActor, flags3),
|
2007-05-28 22:18:51 +00:00
|
|
|
DEFINE_FLAG(MF3, ALWAYSPUFF, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, DONTSPLASH, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, DONTOVERLAP, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, DONTMORPH, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, DONTSQUASH, AActor, flags3),
|
2008-07-21 17:03:30 +00:00
|
|
|
DEFINE_FLAG(MF3, EXPLOCOUNT, AActor, flags3),
|
2007-05-28 22:18:51 +00:00
|
|
|
DEFINE_FLAG(MF3, FULLVOLACTIVE, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, ISMONSTER, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, SKYEXPLODE, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, STAYMORPHED, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, DONTBLAST, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, CANBLAST, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, NOTARGET, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, DONTGIB, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, NOBLOCKMONST, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, FULLVOLDEATH, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, CANBOUNCEWATER, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, NOWALLBOUNCESND, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, FOILINVUL, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, NOTELEOTHER, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, BLOODLESSIMPACT, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, NOEXPLODEFLOOR, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF3, PUFFONACTORS, AActor, flags3),
|
|
|
|
DEFINE_FLAG(MF4, QUICKTORETALIATE, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, NOICEDEATH, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, RANDOMIZE, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, FIXMAPTHINGPOS , AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, ACTLIKEBRIDGE, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, STRIFEDAMAGE, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, CANUSEWALLS, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, MISSILEMORE, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, MISSILEEVENMORE, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, FORCERADIUSDMG, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, DONTFALL, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, SEESDAGGERS, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, INCOMBAT, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, LOOKALLAROUND, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, STANDSTILL, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, SPECTRAL, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, NOSPLASHALERT, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, SYNCHRONIZED, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, NOTARGETSWITCH, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, DONTHURTSPECIES, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, SHIELDREFLECT, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, DEFLECT, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, ALLOWPARTICLES, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, EXTREMEDEATH, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, NOEXTREMEDEATH, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, FRIGHTENED, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, NOBOUNCESOUND, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, NOSKIN, AActor, flags4),
|
|
|
|
DEFINE_FLAG(MF4, BOSSDEATH, AActor, flags4),
|
|
|
|
|
|
|
|
DEFINE_FLAG(MF5, FASTER, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, FASTMELEE, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, NODROPOFF, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, BOUNCEONACTORS, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, EXPLODEONWATER, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, NODAMAGE, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, BLOODSPLATTER, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, OLDRADIUSDMG, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, DEHEXPLOSION, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, PIERCEARMOR, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, NOBLOODDECALS, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, USESPECIAL, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, NOPAIN, AActor, flags5),
|
2007-10-29 22:15:46 +00:00
|
|
|
DEFINE_FLAG(MF5, ALWAYSFAST, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, NEVERFAST, AActor, flags5),
|
2008-03-01 16:59:17 +00:00
|
|
|
DEFINE_FLAG(MF5, ALWAYSRESPAWN, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, NEVERRESPAWN, AActor, flags5),
|
|
|
|
DEFINE_FLAG(MF5, DONTRIP, AActor, flags5),
|
2008-03-24 22:16:21 +00:00
|
|
|
DEFINE_FLAG(MF5, NOINFIGHTING, AActor, flags5),
|
2008-04-03 10:49:54 +00:00
|
|
|
DEFINE_FLAG(MF5, NOINTERACTION, AActor, flags5),
|
2008-04-06 09:24:41 +00:00
|
|
|
DEFINE_FLAG(MF5, NOTIMEFREEZE, AActor, flags5),
|
2008-05-12 22:52:13 +00:00
|
|
|
DEFINE_FLAG(MF5, PUFFGETSOWNER, AActor, flags5), // [BB] added PUFFGETSOWNER
|
2008-08-04 22:30:45 +00:00
|
|
|
DEFINE_FLAG(MF5, SPECIALFIREDAMAGE, AActor, flags5),
|
2008-08-06 19:25:59 +00:00
|
|
|
DEFINE_FLAG(MF5, SUMMONEDMONSTER, AActor, flags5),
|
2008-08-07 20:16:07 +00:00
|
|
|
DEFINE_FLAG(MF5, NOVERTICALMELEERANGE, AActor, flags5),
|
2007-05-28 22:18:51 +00:00
|
|
|
|
|
|
|
// Effect flags
|
|
|
|
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
|
|
|
DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects),
|
|
|
|
DEFINE_FLAG2(FX_GRENADE, GRENADETRAIL, AActor, effects),
|
|
|
|
DEFINE_FLAG(RF, INVISIBLE, AActor, renderflags),
|
2007-12-06 08:55:17 +00:00
|
|
|
DEFINE_FLAG(RF, FORCEYBILLBOARD, AActor, renderflags),
|
|
|
|
DEFINE_FLAG(RF, FORCEXYBILLBOARD, AActor, renderflags),
|
2007-05-28 22:18:51 +00:00
|
|
|
|
|
|
|
// Deprecated flags. Handling must be performed in HandleDeprecatedFlags
|
2008-04-11 10:16:29 +00:00
|
|
|
DEFINE_DEPRECATED_FLAG(FIREDAMAGE),
|
|
|
|
DEFINE_DEPRECATED_FLAG(ICEDAMAGE),
|
|
|
|
DEFINE_DEPRECATED_FLAG(LOWGRAVITY),
|
|
|
|
DEFINE_DEPRECATED_FLAG(SHORTMISSILERANGE),
|
|
|
|
DEFINE_DEPRECATED_FLAG(LONGMELEERANGE),
|
2008-06-22 09:13:19 +00:00
|
|
|
DEFINE_DEPRECATED_FLAG(QUARTERGRAVITY),
|
2008-08-19 19:38:39 +00:00
|
|
|
DEFINE_DEPRECATED_FLAG(FIRERESIST),
|
2008-05-12 22:52:13 +00:00
|
|
|
DEFINE_DUMMY_FLAG(NONETID),
|
2008-06-22 09:13:19 +00:00
|
|
|
DEFINE_DUMMY_FLAG(ALLOWCLIENTSPAWN),
|
2007-05-28 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
static FFlagDef InventoryFlags[] =
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
|
|
|
// Inventory flags
|
|
|
|
DEFINE_FLAG(IF, QUIET, AInventory, ItemFlags),
|
|
|
|
DEFINE_FLAG(IF, AUTOACTIVATE, AInventory, ItemFlags),
|
|
|
|
DEFINE_FLAG(IF, UNDROPPABLE, AInventory, ItemFlags),
|
|
|
|
DEFINE_FLAG(IF, INVBAR, AInventory, ItemFlags),
|
|
|
|
DEFINE_FLAG(IF, HUBPOWER, AInventory, ItemFlags),
|
|
|
|
DEFINE_FLAG(IF, INTERHUBSTRIP, AInventory, ItemFlags),
|
|
|
|
DEFINE_FLAG(IF, ALWAYSPICKUP, AInventory, ItemFlags),
|
|
|
|
DEFINE_FLAG(IF, FANCYPICKUPSOUND, AInventory, ItemFlags),
|
|
|
|
DEFINE_FLAG(IF, BIGPOWERUP, AInventory, ItemFlags),
|
|
|
|
DEFINE_FLAG(IF, KEEPDEPLETED, AInventory, ItemFlags),
|
2007-07-28 12:38:10 +00:00
|
|
|
DEFINE_FLAG(IF, IGNORESKILL, AInventory, ItemFlags),
|
2008-03-01 16:59:17 +00:00
|
|
|
DEFINE_FLAG(IF, ADDITIVETIME, AInventory, ItemFlags),
|
2008-09-12 01:12:40 +00:00
|
|
|
DEFINE_FLAG(IF, NOATTENPICKUPSOUND, AInventory, ItemFlags),
|
2008-02-16 10:23:12 +00:00
|
|
|
|
2008-04-11 10:16:29 +00:00
|
|
|
DEFINE_DEPRECATED_FLAG(PICKUPFLASH),
|
2008-02-16 10:23:12 +00:00
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
static FFlagDef WeaponFlags[] =
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
|
|
|
// Weapon flags
|
|
|
|
DEFINE_FLAG(WIF, NOAUTOFIRE, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, READYSNDHALF, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, DONTBOB, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, AXEBLOOD, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, NOALERT, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, AMMO_OPTIONAL, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, ALT_AMMO_OPTIONAL, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, PRIMARY_USES_BOTH, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, WIMPY_WEAPON, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, POWERED_UP, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, STAFF2_KICKBACK, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF_BOT, EXPLOSIVE, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG2(WIF_BOT_MELEE, MELEEWEAPON, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF_BOT, BFG, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, CHEATNOTWEAPON, AWeapon, WeaponFlags),
|
|
|
|
DEFINE_FLAG(WIF, NO_AUTO_SWITCH, AWeapon, WeaponFlags),
|
2008-04-11 10:16:29 +00:00
|
|
|
|
|
|
|
DEFINE_DUMMY_FLAG(NOLMS),
|
2007-05-28 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
static const struct { const PClass *Type; FFlagDef *Defs; int NumDefs; } FlagLists[] =
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
{ RUNTIME_CLASS(AActor), ActorFlags, sizeof(ActorFlags)/sizeof(FFlagDef) },
|
|
|
|
{ RUNTIME_CLASS(AInventory), InventoryFlags, sizeof(InventoryFlags)/sizeof(FFlagDef) },
|
|
|
|
{ RUNTIME_CLASS(AWeapon), WeaponFlags, sizeof(WeaponFlags)/sizeof(FFlagDef) }
|
2007-05-28 22:18:51 +00:00
|
|
|
};
|
|
|
|
#define NUM_FLAG_LISTS 3
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Find a flag by name using a binary search
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
static int STACK_ARGS flagcmp (const void * a, const void * b)
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
return stricmp( ((FFlagDef*)a)->name, ((FFlagDef*)b)->name);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
static FFlagDef *FindFlag (FFlagDef *flags, int numflags, const char *flag)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
|
|
|
int min = 0, max = numflags - 1;
|
|
|
|
|
|
|
|
while (min <= max)
|
|
|
|
{
|
|
|
|
int mid = (min + max) / 2;
|
|
|
|
int lexval = stricmp (flag, flags[mid].name);
|
|
|
|
if (lexval == 0)
|
|
|
|
{
|
|
|
|
return &flags[mid];
|
|
|
|
}
|
|
|
|
else if (lexval > 0)
|
|
|
|
{
|
|
|
|
min = mid + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
max = mid - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
FFlagDef *FindFlag (const PClass *type, const char *part1, const char *part2)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
|
|
|
static bool flagsorted = false;
|
2008-09-21 18:02:38 +00:00
|
|
|
FFlagDef *def;
|
2007-05-28 22:18:51 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
if (!flagsorted)
|
|
|
|
{
|
|
|
|
for (i = 0; i < NUM_FLAG_LISTS; ++i)
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
qsort (FlagLists[i].Defs, FlagLists[i].NumDefs, sizeof(FFlagDef), flagcmp);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
flagsorted = true;
|
|
|
|
}
|
|
|
|
if (part2 == NULL)
|
|
|
|
{ // Search all lists
|
|
|
|
for (i = 0; i < NUM_FLAG_LISTS; ++i)
|
|
|
|
{
|
|
|
|
if (type->IsDescendantOf (FlagLists[i].Type))
|
|
|
|
{
|
|
|
|
def = FindFlag (FlagLists[i].Defs, FlagLists[i].NumDefs, part1);
|
|
|
|
if (def != NULL)
|
|
|
|
{
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // Search just the named list
|
|
|
|
for (i = 0; i < NUM_FLAG_LISTS; ++i)
|
|
|
|
{
|
|
|
|
if (stricmp (FlagLists[i].Type->TypeName.GetChars(), part1) == 0)
|
|
|
|
{
|
|
|
|
if (type->IsDescendantOf (FlagLists[i].Type))
|
|
|
|
{
|
|
|
|
return FindFlag (FlagLists[i].Defs, FlagLists[i].NumDefs, part2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//
|
|
|
|
//===========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
void HandleDeprecatedFlags(AActor *defaults, FActorInfo *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;
|
2008-03-01 16:59:17 +00:00
|
|
|
case DEPF_PICKUPFLASH:
|
2008-02-17 02:40:03 +00:00
|
|
|
if (set)
|
|
|
|
{
|
|
|
|
static_cast<AInventory*>(defaults)->PickupFlash = fuglyname("PickupFlash");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
static_cast<AInventory*>(defaults)->PickupFlash = NULL;
|
|
|
|
}
|
2008-02-16 10:23:12 +00:00
|
|
|
break;
|
2007-05-28 22:18:51 +00:00
|
|
|
default:
|
|
|
|
break; // silence GCC
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
//==========================================================================
|
|
|
|
DEFINE_INFO_PROPERTY(game, T, 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-09-21 18:02:38 +00:00
|
|
|
bag.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-09-21 18:02:38 +00:00
|
|
|
bag.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-09-21 18:02:38 +00:00
|
|
|
bag.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-09-21 18:02:38 +00:00
|
|
|
bag.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-09-21 18:02:38 +00:00
|
|
|
bag.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-09-21 18:02:38 +00:00
|
|
|
bag.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-09-21 18:02:38 +00:00
|
|
|
bag.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-09-21 18:02:38 +00:00
|
|
|
else bag.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))
|
|
|
|
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))
|
|
|
|
convid=id2;
|
2008-04-08 08:53:42 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
if (convid==-1) return;
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
if (convid<0 || convid>1000)
|
2008-04-08 08:53:42 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
I_Error ("ConversationID must be in the range [0,1000]");
|
2008-04-08 08:53:42 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else StrifeTypes[convid] = bag.Info->Class;
|
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
|
|
|
{
|
2008-08-29 08:48:51 +00:00
|
|
|
if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
Printf("'skip_super' in definition of inventory item '%s' ignored.", bag.Info->Class->TypeName.GetChars() );
|
2008-08-29 08:48:51 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
memcpy (defaults, GetDefault<AActor>(), sizeof(AActor));
|
|
|
|
if (bag.DropItemList != NULL)
|
|
|
|
{
|
|
|
|
FreeDropItemChain (bag.DropItemList);
|
|
|
|
}
|
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);
|
|
|
|
bag.Info->Class->Meta.SetMetaString(AMETA_StrifeName, 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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (AMETA_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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (AMETA_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;
|
|
|
|
|
|
|
|
if (bag.Info->PainChances == NULL) bag.Info->PainChances=new PainChanceList;
|
|
|
|
(*bag.Info->PainChances)[painType] = (BYTE)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
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(id, 0);
|
|
|
|
|
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.
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
defaults->Damage = 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-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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (AMETA_HowlSound, S_FindSound(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;
|
|
|
|
}
|
|
|
|
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
FDropItem *di = new FDropItem;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
di->Name =type;
|
2007-05-28 22:18:51 +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 18:02:38 +00:00
|
|
|
PROP_INT_PARM(prob, 1);
|
|
|
|
di->probability = prob;
|
|
|
|
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);
|
2008-09-21 18:02:38 +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[]={
|
|
|
|
"NONE","NORMAL","FUZZY","SOULTRANS","OPTFUZZY","STENCIL","TRANSLUCENT", "ADD","SHADED", 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,
|
|
|
|
STYLE_TranslucentStencil, STYLE_Translucent, STYLE_Add, STYLE_Shaded};
|
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);
|
|
|
|
if (style < 0) I_Error("Unknown render style '%s'");
|
|
|
|
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);
|
|
|
|
bag.Info->Class->Meta.SetMetaString (AMETA_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);
|
|
|
|
bag.Info->Class->Meta.SetMetaString (AMETA_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
|
|
|
{
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (ACMETA_DontHurtShooter, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (ACMETA_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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (ACMETA_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);
|
2007-05-28 22:18:51 +00:00
|
|
|
// AActor::Die() uses a height of 0 to mean "cut the height to 1/4",
|
|
|
|
// so if a height of 0 is desired, store it as -1.
|
|
|
|
bag.Info->Class->Meta.SetMetaFixed (AMETA_DeathHeight, h <= 0 ? -1 : h);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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);
|
2007-05-28 22:18:51 +00:00
|
|
|
// The note above for AMETA_DeathHeight also applies here.
|
|
|
|
bag.Info->Class->Meta.SetMetaFixed (AMETA_BurnHeight, h <= 0 ? -1 : h);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (ACMETA_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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (ACMETA_MeleeSound, S_FindSound(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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (ACMETA_MissileName, FName(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);
|
|
|
|
bag.Info->Class->Meta.SetMetaFixed (ACMETA_MissileHeight, 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);
|
2007-05-28 22:18:51 +00:00
|
|
|
int max = (gameinfo.gametype==GAME_Strife || (bag.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);
|
2007-05-28 22:18:51 +00:00
|
|
|
bag.Info->Class->Meta.SetMetaInt (AMETA_BloodColor, pe);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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)
|
|
|
|
|
|
|
|
FName blood = str;
|
2007-05-28 22:18:51 +00:00
|
|
|
// normal blood
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (AMETA_BloodType, blood);
|
|
|
|
|
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
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (AMETA_BloodType2, blood);
|
|
|
|
|
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
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (AMETA_BloodType3, blood);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(damagefactor, SF, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
PROP_FIXED_PARM(id, 0);
|
|
|
|
|
|
|
|
if (bag.Info->DamageFactors == NULL) bag.Info->DamageFactors=new DmgFactors;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
|
|
|
FName dmgType;
|
2008-09-21 18:02:38 +00:00
|
|
|
if (!stricmp(str, "Normal")) dmgType = NAME_None;
|
|
|
|
else dmgType=str;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
(*bag.Info->DamageFactors)[dmgType]=id;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_PROPERTY(poisondamage, I, Actor)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (AMETA_PoisonDamage, i);
|
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);
|
|
|
|
bag.Info->Class->Meta.SetMetaFixed (AMETA_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);
|
|
|
|
bag.Info->Class->Meta.SetMetaFixed (AMETA_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);
|
|
|
|
bag.Info->Class->Meta.SetMetaFixed (AMETA_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);
|
|
|
|
defaults->momz = 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;
|
|
|
|
if (i == 0) defaults->flags |= MF_NOGRAVITY;
|
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
|
|
|
{
|
|
|
|
defaults->flags=defaults->flags3=defaults->flags4=defaults->flags5=0;
|
|
|
|
defaults->flags2&=MF2_ARGSDEFINED; // this flag must not be cleared
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Special inventory properties
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (AIMETA_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
|
|
|
|
if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(ABasicArmorPickup)))
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
((ABasicArmorPickup*)defaults)->SaveAmount=i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
else if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(ABasicArmorBonus)))
|
|
|
|
{
|
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);
|
|
|
|
|
|
|
|
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
|
|
|
|
if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(ABasicArmorPickup)))
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
((ABasicArmorPickup*)defaults)->SavePercent = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
else if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(ABasicArmorBonus)))
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
((ABasicArmorBonus*)defaults)->SavePercent = i;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
I_Error("\"Armor.SavePercent\" 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);
|
|
|
|
|
|
|
|
defaults->Icon = TexMan.CheckForTexture(i, FTexture::TEX_MiscPatch);
|
2008-06-15 18:36:26 +00:00
|
|
|
if (!defaults->Icon.isValid())
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-17 00:14:33 +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 ((bag.Info->GameFilter == GAME_Any || bag.Info->GameFilter & gameinfo.gametype) &&
|
2008-09-21 18:02:38 +00:00
|
|
|
!(gameinfo.flags&GI_SHAREWARE) && Wads.GetLumpFile(bag.Lumpnum) != 0)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
Printf("Icon '%s' for '%s' not found\n", i, bag.Info->Class->TypeName.GetChars());
|
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
|
|
|
{
|
|
|
|
defaults->MaxAmount = gameinfo.gametype == GAME_Heretic ? 16 : 25;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
defaults->PickupFlash = fuglyname(str);
|
2008-02-16 10:23:12 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(pickupmessage, S, Inventory)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
bag.Info->Class->Meta.SetMetaString(AIMETA_PickupMessage, str);
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt(AIMETA_GiveQuest, i);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(lowmessage, IS, 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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt(AIMETA_LowHealth, i);
|
|
|
|
bag.Info->Class->Meta.SetMetaString(AIMETA_LowHealthMessage, str);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY(failmessage, S, PuzzleItem)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
bag.Info->Class->Meta.SetMetaString(AIMETA_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);
|
|
|
|
defaults->AmmoType1 = fuglyname(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
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);
|
|
|
|
defaults->AmmoType1 = fuglyname(str);
|
|
|
|
}
|
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);
|
|
|
|
defaults->AmmoType2 = fuglyname(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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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);
|
|
|
|
defaults->SisterWeaponType = fuglyname(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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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);
|
|
|
|
defaults->WeaponClass = fuglyname(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
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_INT_PARM(i, 0);
|
|
|
|
|
2007-05-28 22:18:51 +00:00
|
|
|
int alpha;
|
2008-08-09 11:35:42 +00:00
|
|
|
PalEntry * pBlendColor;
|
|
|
|
|
|
|
|
if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerup)))
|
|
|
|
{
|
|
|
|
pBlendColor = &((APowerup*)defaults)->BlendColor;
|
|
|
|
}
|
|
|
|
else if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
|
|
|
|
{
|
|
|
|
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
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
if (!stricmp(name, "INVERSEMAP"))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
*pBlendColor = INVERSECOLOR;
|
2007-05-28 22:18:51 +00:00
|
|
|
return;
|
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (!stricmp(name, "GOLDMAP"))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
*pBlendColor = GOLDCOLOR;
|
2007-05-28 22:18:51 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// [BC] Yay, more hacks.
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (!stricmp(name, "REDMAP" ))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
*pBlendColor = REDCOLOR;
|
2007-05-28 22:18:51 +00:00
|
|
|
return;
|
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (!stricmp(name, "GREENMAP" ))
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
*pBlendColor = GREENCOLOR;
|
2007-05-28 22:18:51 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
color = V_GetColor(NULL, name);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
else if (PROP_PARM_COUNT > 1)
|
|
|
|
{
|
|
|
|
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);
|
2008-09-21 18:02:38 +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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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;
|
|
|
|
|
|
|
|
if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerup)))
|
|
|
|
{
|
|
|
|
pEffectTics = &((APowerup*)defaults)->EffectTics;
|
|
|
|
}
|
|
|
|
else if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
|
|
|
|
{
|
|
|
|
pEffectTics = &((APowerupGiver*)defaults)->EffectTics;
|
|
|
|
}
|
|
|
|
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
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(powerup, mode, S, PowerupGiver)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_STRING_PARM(str, 0);
|
|
|
|
defaults->mode = (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);
|
|
|
|
defaults->PowerupType = fuglyname(str);
|
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);
|
|
|
|
bag.Info->Class->Meta.SetMetaString (APMETA_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 (' ', '_');
|
|
|
|
bag.Info->Class->Meta.SetMetaString (APMETA_SoundClass, tmp);
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
Printf("Invalid face '%s' for '%s';\nSTF replacement codes must be 3 characters.\n",
|
2008-09-21 18:02:38 +00:00
|
|
|
tmp.GetChars(), bag.Info->Class->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)
|
|
|
|
{
|
|
|
|
Printf("Invalid face '%s' for '%s';\nSTF replacement codes must be alphanumeric.\n",
|
2008-09-21 18:02:38 +00:00
|
|
|
tmp.GetChars(), bag.Info->Class->TypeName.GetChars ());
|
2008-04-05 12:14:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bag.Info->Class->Meta.SetMetaString (APMETA_Face, tmp);
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
swap (start, end);
|
|
|
|
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (APMETA_ColorRange, (start & 255) | ((end & 255) << 8));
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
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-09-21 18:02:38 +00:00
|
|
|
Printf("Icon '%s' for '%s' not found\n", z, bag.Info->Class->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);
|
|
|
|
defaults->crouchsprite = GetSpriteIndex (z);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-01-26 16:42:16 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-09-21 18:02:38 +00:00
|
|
|
DEFINE_CLASS_PROPERTY_PREFIX(player, damagescreencolor, C, PlayerPawn)
|
2008-01-26 16:42:16 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_COLOR_PARM(c, 0);
|
|
|
|
defaults->RedDamageFade = RPART (c);
|
|
|
|
defaults->GreenDamageFade = GPART (c);
|
|
|
|
defaults->BlueDamageFade = BPART (c);
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
FDropItem * di=new FDropItem;
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
di->Name = str;
|
2007-05-28 22:18:51 +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);
|
2008-09-21 18:02:38 +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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (APMETA_InvulMode, (FName)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);
|
|
|
|
bag.Info->Class->Meta.SetMetaInt (APMETA_HealingRadius, (FName)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
|
|
|
{
|
|
|
|
for (int i=0;i<5;i++)
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
PROP_FIXED_PARM(val, i);
|
|
|
|
bag.Info->Class->Meta.SetMetaFixed (APMETA_Hexenarmor0+i, val);
|
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(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
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-09-21 18:02:38 +00:00
|
|
|
// Find a property by name using a binary search
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
static int STACK_ARGS propcmp(const void * a, const void * b)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
return stricmp( (*(FPropertyInfo**)a)->name, (*(FPropertyInfo**)b)->name);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
static TArray<FPropertyInfo*> properties;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
FPropertyInfo *FindProperty(const char * string)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
static bool propsorted=false;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
if (!propsorted)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
TAutoSegIterator<FPropertyInfo *, &GRegHead, &GRegTail> probe;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
while (++probe != NULL)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
properties.Push(probe);
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
properties.ShrinkToFit();
|
|
|
|
qsort(&properties[0], properties.Size(), sizeof(properties[0]), propcmp);
|
|
|
|
propsorted=true;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
int min = 0, max = properties.Size()-1;
|
2007-05-28 22:18:51 +00:00
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
while (min <= max)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
int mid = (min + max) / 2;
|
|
|
|
int lexval = stricmp (string, properties[mid]->name);
|
|
|
|
if (lexval == 0)
|
2007-05-28 22:18:51 +00:00
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
return properties[mid];
|
|
|
|
}
|
|
|
|
else if (lexval > 0)
|
|
|
|
{
|
|
|
|
min = mid + 1;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-09-21 18:02:38 +00:00
|
|
|
max = mid - 1;
|
2007-05-28 22:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
2008-09-21 18:02:38 +00:00
|
|
|
return NULL;
|
2007-12-11 02:38:38 +00:00
|
|
|
}
|