Merge branch 'meta'
This commit is contained in:
commit
314a642527
36 changed files with 632 additions and 684 deletions
101
src/p_mobj.cpp
101
src/p_mobj.cpp
|
|
@ -311,30 +311,13 @@ DEFINE_FIELD(AActor, ConversationRoot)
|
|||
DEFINE_FIELD(AActor, Conversation)
|
||||
DEFINE_FIELD(AActor, DecalGenerator)
|
||||
DEFINE_FIELD(AActor, fountaincolor)
|
||||
DEFINE_FIELD(AActor, CameraHeight)
|
||||
DEFINE_FIELD(AActor, RadiusDamageFactor)
|
||||
DEFINE_FIELD(AActor, SelfDamageFactor)
|
||||
DEFINE_FIELD(AActor, StealthAlpha)
|
||||
DEFINE_FIELD(AActor, WoundHealth)
|
||||
|
||||
DEFINE_FIELD(PClassActor, Obituary)
|
||||
DEFINE_FIELD(PClassActor, HitObituary)
|
||||
DEFINE_FIELD(PClassActor, DeathHeight)
|
||||
DEFINE_FIELD(PClassActor, BurnHeight)
|
||||
DEFINE_FIELD(PClassActor, BloodColor)
|
||||
DEFINE_FIELD(PClassActor, GibHealth)
|
||||
DEFINE_FIELD(PClassActor, WoundHealth)
|
||||
DEFINE_FIELD(PClassActor, FastSpeed)
|
||||
DEFINE_FIELD(PClassActor, RDFactor)
|
||||
DEFINE_FIELD(PClassActor, SelfDamageFactor)
|
||||
DEFINE_FIELD(PClassActor, StealthAlpha)
|
||||
DEFINE_FIELD(PClassActor, CameraHeight)
|
||||
DEFINE_FIELD(PClassActor, HowlSound)
|
||||
DEFINE_FIELD(PClassActor, BloodType)
|
||||
DEFINE_FIELD(PClassActor, BloodType2)
|
||||
DEFINE_FIELD(PClassActor, BloodType3)
|
||||
DEFINE_FIELD(PClassActor, DontHurtShooter)
|
||||
DEFINE_FIELD(PClassActor, ExplosionRadius)
|
||||
DEFINE_FIELD(PClassActor, ExplosionDamage)
|
||||
DEFINE_FIELD(PClassActor, MeleeDamage)
|
||||
DEFINE_FIELD(PClassActor, MeleeSound)
|
||||
DEFINE_FIELD(PClassActor, MissileName)
|
||||
DEFINE_FIELD(PClassActor, MissileHeight)
|
||||
//DEFINE_FIELD(PClassActor, BloodColor)
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
@ -495,11 +478,17 @@ void AActor::Serialize(FSerializer &arc)
|
|||
A("spriteangle", SpriteAngle)
|
||||
A("spriterotation", SpriteRotation)
|
||||
("alternative", alternative)
|
||||
A("cameraheight", CameraHeight)
|
||||
A("tag", Tag)
|
||||
A("visiblestartangle",VisibleStartAngle)
|
||||
A("visibleendangle",VisibleEndAngle)
|
||||
A("visiblestartpitch",VisibleStartPitch)
|
||||
A("visibleendpitch",VisibleEndPitch);
|
||||
A("visibleendpitch",VisibleEndPitch)
|
||||
A("woundhealth", WoundHealth)
|
||||
A("rdfactor", RadiusDamageFactor)
|
||||
A("selfdamagefactor", SelfDamageFactor)
|
||||
A("stealthalpha", StealthAlpha);
|
||||
|
||||
}
|
||||
|
||||
#undef A
|
||||
|
|
@ -3521,7 +3510,7 @@ int AActor::GetMissileDamage (int mask, int add)
|
|||
|
||||
void AActor::Howl ()
|
||||
{
|
||||
FSoundID howl = GetClass()->HowlSound;
|
||||
FSoundID howl = IntVar(NAME_HowlSound);
|
||||
if (!S_IsActorPlayingSomething(this, CHAN_BODY, howl))
|
||||
{
|
||||
S_Sound (this, CHAN_BODY, howl, 1, ATTN_NORM);
|
||||
|
|
@ -3823,6 +3812,19 @@ void AActor::SetRoll(DAngle r, bool interpolate)
|
|||
}
|
||||
}
|
||||
|
||||
PClassActor *AActor::GetBloodType(int type) const
|
||||
{
|
||||
IFVIRTUAL(AActor, GetBloodType)
|
||||
{
|
||||
VMValue params[] = { (DObject*)this, type };
|
||||
PClassActor *res;
|
||||
VMReturn ret((void**)&res);
|
||||
GlobalVMStack.Call(func, params, countof(params), &ret, 1);
|
||||
return res;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
DVector3 AActor::GetPortalTransition(double byoffset, sector_t **pSec)
|
||||
{
|
||||
|
|
@ -4101,9 +4103,9 @@ void AActor::Tick ()
|
|||
else if (visdir < 0)
|
||||
{
|
||||
Alpha -= 1.5/TICRATE;
|
||||
if (Alpha < GetClass()->StealthAlpha)
|
||||
if (Alpha < StealthAlpha)
|
||||
{
|
||||
Alpha = GetClass()->StealthAlpha;
|
||||
Alpha = StealthAlpha;
|
||||
visdir = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -4824,8 +4826,11 @@ AActor *AActor::StaticSpawn (PClassActor *type, const DVector3 &pos, replace_t a
|
|||
actor->renderflags = (actor->renderflags & ~RF_FULLBRIGHT) | ActorRenderFlags::FromInt (st->GetFullbright());
|
||||
actor->touching_sectorlist = nullptr; // NULL head of sector list // phares 3/13/98
|
||||
actor->touching_rendersectors = nullptr;
|
||||
if (G_SkillProperty(SKILLP_FastMonsters) && actor->GetClass()->FastSpeed >= 0)
|
||||
actor->Speed = actor->GetClass()->FastSpeed;
|
||||
if (G_SkillProperty(SKILLP_FastMonsters))
|
||||
{
|
||||
double f = actor->FloatVar(NAME_FastSpeed);
|
||||
if (f >= 0) actor->Speed = f;
|
||||
}
|
||||
|
||||
// set subsector and/or block links
|
||||
actor->LinkToWorld (nullptr, SpawningMapThing);
|
||||
|
|
@ -6698,10 +6703,14 @@ static double GetDefaultSpeed(PClassActor *type)
|
|||
{
|
||||
if (type == NULL)
|
||||
return 0;
|
||||
else if (G_SkillProperty(SKILLP_FastMonsters) && type->FastSpeed >= 0)
|
||||
return type->FastSpeed;
|
||||
else
|
||||
return GetDefaultByType(type)->Speed;
|
||||
|
||||
auto def = GetDefaultByType(type);
|
||||
if (G_SkillProperty(SKILLP_FastMonsters))
|
||||
{
|
||||
double f = def->FloatVar(NAME_FastSpeed);
|
||||
if (f >= 0) return f;
|
||||
}
|
||||
return def->Speed;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, GetDefaultSpeed)
|
||||
|
|
@ -7467,9 +7476,10 @@ void AActor::Crash()
|
|||
{
|
||||
FState *crashstate = NULL;
|
||||
|
||||
int gibh = GetGibHealth();
|
||||
if (DamageType != NAME_None)
|
||||
{
|
||||
if (health < GetGibHealth())
|
||||
if (health < gibh)
|
||||
{ // Extreme death
|
||||
FName labels[] = { NAME_Crash, NAME_Extreme, DamageType };
|
||||
crashstate = FindState (3, labels, true);
|
||||
|
|
@ -7481,7 +7491,7 @@ void AActor::Crash()
|
|||
}
|
||||
if (crashstate == NULL)
|
||||
{
|
||||
if (health < GetGibHealth())
|
||||
if (health < gibh)
|
||||
{ // Extreme death
|
||||
crashstate = FindState(NAME_Crash, NAME_Extreme);
|
||||
}
|
||||
|
|
@ -7587,21 +7597,20 @@ void AActor::Revive()
|
|||
|
||||
int AActor::GetGibHealth() const
|
||||
{
|
||||
int gibhealth = GetClass()->GibHealth;
|
||||
|
||||
if (gibhealth != INT_MIN)
|
||||
IFVIRTUAL(AActor, GetGibHealth)
|
||||
{
|
||||
return -abs(gibhealth);
|
||||
}
|
||||
else
|
||||
{
|
||||
return -int(SpawnHealth() * gameinfo.gibfactor);
|
||||
VMValue params[] = { (DObject*)this };
|
||||
int h;
|
||||
VMReturn ret(&h);
|
||||
GlobalVMStack.Call(func, params, 1, &ret, 1);
|
||||
return h;
|
||||
}
|
||||
return -SpawnHealth();
|
||||
}
|
||||
|
||||
double AActor::GetCameraHeight() const
|
||||
{
|
||||
return GetClass()->CameraHeight == INT_MIN ? Height / 2 : GetClass()->CameraHeight;
|
||||
return CameraHeight == INT_MIN ? Height / 2 : CameraHeight;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, GetCameraHeight)
|
||||
|
|
@ -8280,9 +8289,9 @@ void PrintMiscActorInfo(AActor *query)
|
|||
query->args[0], query->args[1], query->args[2], query->args[3],
|
||||
query->args[4], query->special1, query->special2);
|
||||
Printf("\nTID: %d", query->tid);
|
||||
Printf("\nCoord= x: %f, y: %f, z:%f, floor:%f, ceiling:%f.",
|
||||
Printf("\nCoord= x: %f, y: %f, z:%f, floor:%f, ceiling:%f, height= %f",
|
||||
query->X(), query->Y(), query->Z(),
|
||||
query->floorz, query->ceilingz);
|
||||
query->floorz, query->ceilingz, query->Height);
|
||||
Printf("\nSpeed= %f, velocity= x:%f, y:%f, z:%f, combined:%f.\n",
|
||||
query->Speed, query->Vel.X, query->Vel.Y, query->Vel.Z, query->Vel.Length());
|
||||
Printf("Scale: x:%f, y:%f\n", query->Scale.X, query->Scale.Y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue