mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
This commit is contained in:
commit
fa6a94f789
7 changed files with 47 additions and 5 deletions
|
@ -257,6 +257,7 @@ PClassActor::PClassActor()
|
||||||
WoundHealth = 6;
|
WoundHealth = 6;
|
||||||
FastSpeed = -1.;
|
FastSpeed = -1.;
|
||||||
RDFactor = 1.;
|
RDFactor = 1.;
|
||||||
|
SelfDamageFactor = 1.;
|
||||||
CameraHeight = INT_MIN;
|
CameraHeight = INT_MIN;
|
||||||
|
|
||||||
DropItems = NULL;
|
DropItems = NULL;
|
||||||
|
@ -317,6 +318,7 @@ void PClassActor::DeriveData(PClass *newclass)
|
||||||
newa->WoundHealth = WoundHealth;
|
newa->WoundHealth = WoundHealth;
|
||||||
newa->FastSpeed = FastSpeed;
|
newa->FastSpeed = FastSpeed;
|
||||||
newa->RDFactor = RDFactor;
|
newa->RDFactor = RDFactor;
|
||||||
|
newa->SelfDamageFactor = SelfDamageFactor;
|
||||||
newa->CameraHeight = CameraHeight;
|
newa->CameraHeight = CameraHeight;
|
||||||
newa->HowlSound = HowlSound;
|
newa->HowlSound = HowlSound;
|
||||||
newa->BloodType = BloodType;
|
newa->BloodType = BloodType;
|
||||||
|
|
|
@ -299,6 +299,7 @@ public:
|
||||||
int WoundHealth; // Health needed to enter wound state
|
int WoundHealth; // Health needed to enter wound state
|
||||||
double FastSpeed; // speed in fast mode
|
double FastSpeed; // speed in fast mode
|
||||||
double RDFactor; // Radius damage factor
|
double RDFactor; // Radius damage factor
|
||||||
|
double SelfDamageFactor;
|
||||||
double CameraHeight; // Height of camera when used as such
|
double CameraHeight; // Height of camera when used as such
|
||||||
FSoundID HowlSound; // Sound being played when electrocuted or poisoned
|
FSoundID HowlSound; // Sound being played when electrocuted or poisoned
|
||||||
FName BloodType; // Blood replacement type
|
FName BloodType; // Blood replacement type
|
||||||
|
|
|
@ -871,6 +871,25 @@ static void ParseOptionMenu(FScanner &sc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
static void ParseAddOptionMenu(FScanner &sc)
|
||||||
|
{
|
||||||
|
sc.MustGetString();
|
||||||
|
|
||||||
|
DMenuDescriptor **pOld = MenuDescriptors.CheckKey(sc.String);
|
||||||
|
if (pOld == nullptr || *pOld == nullptr || !(*pOld)->IsKindOf(RUNTIME_CLASS(DOptionMenuDescriptor)))
|
||||||
|
{
|
||||||
|
sc.ScriptError("%s is not an option menu that can be extended", sc.String);
|
||||||
|
}
|
||||||
|
ParseOptionMenuBody(sc, (DOptionMenuDescriptor*)(*pOld));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -935,6 +954,10 @@ void M_ParseMenuDefs()
|
||||||
{
|
{
|
||||||
ParseOptionMenu(sc);
|
ParseOptionMenu(sc);
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("ADDOPTIONMENU"))
|
||||||
|
{
|
||||||
|
ParseAddOptionMenu(sc);
|
||||||
|
}
|
||||||
else if (sc.Compare("DEFAULTOPTIONMENU"))
|
else if (sc.Compare("DEFAULTOPTIONMENU"))
|
||||||
{
|
{
|
||||||
ParseOptionMenuBody(sc, DefaultOptionMenuSettings);
|
ParseOptionMenuBody(sc, DefaultOptionMenuSettings);
|
||||||
|
|
|
@ -1020,6 +1020,11 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (target == source && damage < TELEFRAG_DAMAGE)
|
||||||
|
{
|
||||||
|
damage = int(damage * target->GetClass()->SelfDamageFactor);
|
||||||
|
}
|
||||||
|
|
||||||
// [MC] Changed it to check rawdamage here for consistency, even though that doesn't actually do anything
|
// [MC] Changed it to check rawdamage here for consistency, even though that doesn't actually do anything
|
||||||
// different here. At any rate, invulnerable is being checked before type factoring, which is then being
|
// different here. At any rate, invulnerable is being checked before type factoring, which is then being
|
||||||
// checked by player cheats/invul/buddha followed by monster buddha. This is inconsistent. Don't let the
|
// checked by player cheats/invul/buddha followed by monster buddha. This is inconsistent. Don't let the
|
||||||
|
|
|
@ -2281,9 +2281,9 @@ bool P_TryMove(AActor *thing, const DVector2 &pos,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!(thing->flags & MF_TELEPORT) && !(thing->flags3 & MF3_FLOORHUGGER))
|
if (!(thing->flags & MF_TELEPORT) && (!(thing->flags3 & MF3_FLOORHUGGER) || thing->flags5 & MF5_NODROPOFF))
|
||||||
{
|
{
|
||||||
if ((thing->flags & MF_MISSILE) && !(thing->flags6 & MF6_STEPMISSILE) && tm.floorz > thing->Z())
|
if ((thing->flags & MF_MISSILE) && !(thing->flags6 & MF6_STEPMISSILE) && tm.floorz > thing->Z() && !(thing->flags3 & MF3_FLOORHUGGER))
|
||||||
{ // [RH] Don't let normal missiles climb steps
|
{ // [RH] Don't let normal missiles climb steps
|
||||||
goto pushline;
|
goto pushline;
|
||||||
}
|
}
|
||||||
|
@ -2772,13 +2772,13 @@ bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags)
|
||||||
if (thing->Top() > tm.ceilingz)
|
if (thing->Top() > tm.ceilingz)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(thing->flags & MF_TELEPORT) && !(thing->flags3 & MF3_FLOORHUGGER))
|
if (!(thing->flags & MF_TELEPORT) && (!(thing->flags3 & MF3_FLOORHUGGER) || thing->flags5 & MF5_NODROPOFF))
|
||||||
{
|
{
|
||||||
if (tm.floorz - newz > thing->MaxStepHeight)
|
if (tm.floorz - newz > thing->MaxStepHeight)
|
||||||
{ // too big a step up
|
{ // too big a step up
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ((thing->flags & MF_MISSILE) && !(thing->flags6 & MF6_STEPMISSILE) && tm.floorz > newz)
|
else if ((thing->flags & MF_MISSILE) && !(thing->flags6 & MF6_STEPMISSILE) && tm.floorz > newz && !(thing->flags3 & MF3_FLOORHUGGER))
|
||||||
{ // [RH] Don't let normal missiles climb steps
|
{ // [RH] Don't let normal missiles climb steps
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,6 +321,7 @@ DEFINE_FIELD(PClassActor, GibHealth)
|
||||||
DEFINE_FIELD(PClassActor, WoundHealth)
|
DEFINE_FIELD(PClassActor, WoundHealth)
|
||||||
DEFINE_FIELD(PClassActor, FastSpeed)
|
DEFINE_FIELD(PClassActor, FastSpeed)
|
||||||
DEFINE_FIELD(PClassActor, RDFactor)
|
DEFINE_FIELD(PClassActor, RDFactor)
|
||||||
|
DEFINE_FIELD(PClassActor, SelfDamageFactor)
|
||||||
DEFINE_FIELD(PClassActor, CameraHeight)
|
DEFINE_FIELD(PClassActor, CameraHeight)
|
||||||
DEFINE_FIELD(PClassActor, HowlSound)
|
DEFINE_FIELD(PClassActor, HowlSound)
|
||||||
DEFINE_FIELD(PClassActor, BloodType)
|
DEFINE_FIELD(PClassActor, BloodType)
|
||||||
|
@ -2958,7 +2959,7 @@ void P_ZMovement (AActor *mo, double oldfloorz)
|
||||||
mo->Vel.Z = 0;
|
mo->Vel.Z = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (mo->flags3 & MF3_FLOORHUGGER)
|
else if ((mo->flags3 & MF3_FLOORHUGGER) && !(mo->flags5 & MF5_NODROPOFF))
|
||||||
{ // Floor huggers can go up steps
|
{ // Floor huggers can go up steps
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1430,6 +1430,16 @@ DEFINE_PROPERTY(radiusdamagefactor, F, Actor)
|
||||||
static_cast<PClassActor *>(info)->RDFactor = i;
|
static_cast<PClassActor *>(info)->RDFactor = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
DEFINE_PROPERTY(selfdamagefactor, F, Actor)
|
||||||
|
{
|
||||||
|
PROP_DOUBLE_PARM(i, 0);
|
||||||
|
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
||||||
|
static_cast<PClassActor *>(info)->SelfDamageFactor = i;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue