- added submission for raising master/children/siblings.

- added submission for no decals on wall option.
- removed some useless code from SpawnMissile function.


SVN r1716 (trunk)
This commit is contained in:
Christoph Oelckers 2009-07-13 22:07:18 +00:00
parent 19f8b03738
commit 8e5b7373b8
11 changed files with 148 additions and 79 deletions

View file

@ -1,4 +1,9 @@
July 12, 2009 (Changes by Graf Zahl) July 13, 2009 (Changes by Graf Zahl)
- added submission for raising master/children/siblings.
- added submission for no decals on wall option.
- removed some useless code from SpawnMissile function.
July 12, 2009 (Changes by Graf Zahl)
- Backported 2 fixes from Skulltag: - Backported 2 fixes from Skulltag:
* A_SentinelAttack must check for a NULL target * A_SentinelAttack must check for a NULL target
* Monsters with CANTLEAVEFLOORPIC could not move because their floor * Monsters with CANTLEAVEFLOORPIC could not move because their floor

View file

@ -130,6 +130,7 @@ Note: All <bool> fields default to false unless mentioned otherwise.
smoothlighting = <bool>; // Use smooth fake contrast. smoothlighting = <bool>; // Use smooth fake contrast.
clipmidtex = <bool>; // Side's mid textures are clipped to floor and ceiling. clipmidtex = <bool>; // Side's mid textures are clipped to floor and ceiling.
wrapmidtex = <bool>; // Side's mid textures are wrapped. wrapmidtex = <bool>; // Side's mid textures are wrapped.
nodecals = <bool>; // Disables decals on the sidedef.
} }
sector sector

View file

@ -301,6 +301,7 @@ xx(Heightceiling)
xx(Lightlevel) xx(Lightlevel)
xx(Texturefloor) xx(Texturefloor)
xx(Textureceiling) xx(Textureceiling)
xx(Nodecals)
xx(Skill1) xx(Skill1)
xx(Skill2) xx(Skill2)

View file

@ -1369,60 +1369,6 @@ FUNC(LS_Thing_SpawnFacing)
return P_Thing_Spawn (arg0, it, arg1, ANGLE_MAX, arg2 ? false : true, arg3); return P_Thing_Spawn (arg0, it, arg1, ANGLE_MAX, arg2 ? false : true, arg3);
} }
static bool DoThingRaise(AActor *thing)
{
if (thing == NULL)
return false; // not valid
if (!(thing->flags & MF_CORPSE) )
return true; // not a corpse
if (thing->tics != -1)
return true; // not lying still yet
FState * RaiseState = thing->FindState(NAME_Raise);
if (RaiseState == NULL)
return true; // monster doesn't have a raise state
AActor *info = thing->GetDefault ();
thing->velx = thing->vely = 0;
// [RH] Check against real height and radius
fixed_t oldheight = thing->height;
fixed_t oldradius = thing->radius;
int oldflags = thing->flags;
thing->flags |= MF_SOLID;
thing->height = info->height; // [RH] Use real height
thing->radius = info->radius; // [RH] Use real radius
if (!P_CheckPosition (thing, thing->x, thing->y))
{
thing->flags = oldflags;
thing->radius = oldradius;
thing->height = oldheight;
return false;
}
S_Sound (thing, CHAN_BODY, "vile/raise", 1, ATTN_IDLE);
thing->SetState (RaiseState);
thing->flags = info->flags;
thing->flags2 = info->flags2;
thing->flags3 = info->flags3;
thing->flags4 = info->flags4;
thing->health = info->health;
thing->target = NULL;
thing->lastenemy = NULL;
// [RH] If it's a monster, it gets to count as another kill
if (thing->CountsAsKill())
{
level.total_monsters++;
}
return true;
}
FUNC(LS_Thing_Raise) FUNC(LS_Thing_Raise)
// Thing_Raise(tid) // Thing_Raise(tid)
{ {
@ -1431,7 +1377,7 @@ FUNC(LS_Thing_Raise)
if (arg0==0) if (arg0==0)
{ {
ok = DoThingRaise (it); ok = P_Thing_Raise (it);
} }
else else
{ {
@ -1439,7 +1385,7 @@ FUNC(LS_Thing_Raise)
while ( (target = iterator.Next ()) ) while ( (target = iterator.Next ()) )
{ {
ok |= DoThingRaise(target); ok |= P_Thing_Raise(target);
} }
} }
return ok; return ok;

View file

@ -140,6 +140,7 @@ bool P_MoveThing(AActor *source, fixed_t x, fixed_t y, fixed_t z, bool fog);
bool P_Thing_Move (int tid, AActor *source, int mapspot, bool fog); bool P_Thing_Move (int tid, AActor *source, int mapspot, bool fog);
int P_Thing_Damage (int tid, AActor *whofor0, int amount, FName type); int P_Thing_Damage (int tid, AActor *whofor0, int amount, FName type);
void P_RemoveThing(AActor * actor); void P_RemoveThing(AActor * actor);
bool P_Thing_Raise(AActor *thing);
// //
// P_ENEMY // P_ENEMY

View file

@ -4796,26 +4796,6 @@ static fixed_t GetDefaultSpeed(const PClass *type)
return GetDefaultByType(type)->Speed; return GetDefaultByType(type)->Speed;
} }
static AActor * SpawnMissile (const PClass *type, fixed_t x, fixed_t y, fixed_t z)
{
AActor *th = Spawn (type, x, y, z, ALLOW_REPLACE);
if (th != NULL)
{
// Force floor huggers to the floor and ceiling huggers to the ceiling
if (th->flags3 & MF3_FLOORHUGGER)
{
z = th->floorz;
}
else if (th->flags3 & MF3_CEILINGHUGGER)
{
z = th->ceilingz - th->height;
}
}
return th;
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// FUNC P_SpawnMissile // FUNC P_SpawnMissile
@ -4851,7 +4831,7 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
z -= source->floorclip; z -= source->floorclip;
} }
AActor *th = SpawnMissile (type, x, y, z); AActor *th = Spawn (type, x, y, z, ALLOW_REPLACE);
P_PlaySpawnSound(th, source); P_PlaySpawnSound(th, source);
th->target = source; // record missile's originator th->target = source; // record missile's originator
@ -4966,7 +4946,7 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
z -= source->floorclip; z -= source->floorclip;
} }
mo = SpawnMissile (type, source->x, source->y, z); mo = Spawn (type, source->x, source->y, z, ALLOW_REPLACE);
P_PlaySpawnSound(mo, source); P_PlaySpawnSound(mo, source);
mo->target = owner != NULL ? owner : source; // Originator mo->target = owner != NULL ? owner : source; // Originator

View file

@ -424,6 +424,60 @@ void P_RemoveThing(AActor * actor)
} }
} }
bool P_Thing_Raise(AActor *thing)
{
if (thing == NULL)
return false; // not valid
if (!(thing->flags & MF_CORPSE) )
return true; // not a corpse
if (thing->tics != -1)
return true; // not lying still yet
FState * RaiseState = thing->FindState(NAME_Raise);
if (RaiseState == NULL)
return true; // monster doesn't have a raise state
AActor *info = thing->GetDefault ();
thing->velx = thing->vely = 0;
// [RH] Check against real height and radius
fixed_t oldheight = thing->height;
fixed_t oldradius = thing->radius;
int oldflags = thing->flags;
thing->flags |= MF_SOLID;
thing->height = info->height; // [RH] Use real height
thing->radius = info->radius; // [RH] Use real radius
if (!P_CheckPosition (thing, thing->x, thing->y))
{
thing->flags = oldflags;
thing->radius = oldradius;
thing->height = oldheight;
return false;
}
S_Sound (thing, CHAN_BODY, "vile/raise", 1, ATTN_IDLE);
thing->SetState (RaiseState);
thing->flags = info->flags;
thing->flags2 = info->flags2;
thing->flags3 = info->flags3;
thing->flags4 = info->flags4;
thing->health = info->health;
thing->target = NULL;
thing->lastenemy = NULL;
// [RH] If it's a monster, it gets to count as another kill
if (thing->CountsAsKill())
{
level.total_monsters++;
}
return true;
}
CCMD (dumpspawnables) CCMD (dumpspawnables)
{ {

View file

@ -973,6 +973,10 @@ struct UDMFParser
Flag(sd->Flags, WALLF_CLIP_MIDTEX, key); Flag(sd->Flags, WALLF_CLIP_MIDTEX, key);
continue; continue;
case NAME_Nodecals:
Flag(sd->Flags, WALLF_NOAUTODECALS, key);
continue;
default: default:
break; break;

View file

@ -2549,6 +2549,78 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveChildren)
} }
} }
//===========================================================================
//
// A_RemoveSiblings
//
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveSiblings)
{
TThinkerIterator<AActor> it;
AActor * mo;
ACTION_PARAM_START(1);
ACTION_PARAM_BOOL(removeall,0);
while ( (mo = it.Next()) )
{
if ( ( mo->master == self->master ) && ( mo != self ) && ( ( mo->health <= 0 ) || removeall) )
{
P_RemoveThing(mo);
}
}
}
//===========================================================================
//
// A_RaiseMaster
//
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_RaiseMaster)
{
if (self->master != NULL)
{
P_Thing_Raise(self->master);
}
}
//===========================================================================
//
// A_RaiseChildren
//
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren)
{
TThinkerIterator<AActor> it;
AActor * mo;
while (mo = it.Next())
{
if ( mo->master == self )
{
P_Thing_Raise(mo);
}
}
}
//===========================================================================
//
// A_RaiseSiblings
//
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_RaiseSiblings)
{
TThinkerIterator<AActor> it;
AActor * mo;
while ( (mo = it.Next()) )
{
if ( ( mo->master == self->master ) && ( mo != self ) )
{
P_Thing_Raise(mo);
}
}
}
//=========================================================================== //===========================================================================
// //
// A_MonsterRefire // A_MonsterRefire

View file

@ -197,9 +197,13 @@ ACTOR Actor native //: Thinker
action native A_JumpIf(bool expression, state label); action native A_JumpIf(bool expression, state label);
action native A_RemoveMaster(); action native A_RemoveMaster();
action native A_RemoveChildren(bool removeall = false); action native A_RemoveChildren(bool removeall = false);
action native A_RemoveSiblings(bool removeall = false);
action native A_KillMaster(); action native A_KillMaster();
action native A_KillChildren(); action native A_KillChildren();
action native A_KillSiblings(); action native A_KillSiblings();
action native A_RaiseMaster();
action native A_RaiseChildren();
action native A_RaiseSiblings();
action native A_CheckFloor(state label); action native A_CheckFloor(state label);
action native A_CheckCeiling(state label); action native A_CheckCeiling(state label);
action native A_PlayerSkinCheck(state label); action native A_PlayerSkinCheck(state label);

View file

@ -633,6 +633,7 @@ ACTOR MaceFX4 native
-NOGRAVITY -NOGRAVITY
+TELESTOMP +TELESTOMP
+THRUGHOST +THRUGHOST
-NOTELEPORT
BounceType "HereticCompat" BounceType "HereticCompat"
SeeSound "" SeeSound ""