- Added damage factors that allows to make monsters more or less resistant
to specific damage types. - Changed Dehacked parser to use the DECORATE symbol tables for code pointers instead of creating its own ones. - Removed the HandleNoSector hack and changed A_Look so that it uses the sector's sound target for actors with MF_NOSECTOR regardless of compatibility settings. - Moved initialization of weapon slots after the actor initialization. With default weapons exported to DECORATE it can't be done earlier. - Converted Doom weapons to DECORATE. - Changed backpack definition so that Doom's backpack is no longer the base class that implements its functionality. Now there is an abstract base class all backpack-like items derive from. Also moved the actual definition of Doom's backpack to DECORATE. SVN r519 (trunk)
This commit is contained in:
parent
8e229fa2b6
commit
ea4f160e35
29 changed files with 785 additions and 735 deletions
|
|
@ -1173,6 +1173,13 @@ static FActorInfo * CreateNewActor(FActorInfo ** parentc, Baggage *bag)
|
|||
bag->Info = info;
|
||||
|
||||
info->DoomEdNum = -1;
|
||||
if (parent->ActorInfo->DamageFactors != NULL)
|
||||
{
|
||||
// copy damage factors from parent
|
||||
info->DamageFactors = new DmgFactors;
|
||||
*info->DamageFactors = *parent->ActorInfo->DamageFactors;
|
||||
}
|
||||
else info->DamageFactors = NULL;
|
||||
|
||||
// Check for "replaces"
|
||||
SC_MustGetString ();
|
||||
|
|
@ -1290,15 +1297,15 @@ bool DoSpecialFunctions(FState & state, bool multistate, int * statecount, Bagga
|
|||
StateParameters[paramindex]=spec->Special;
|
||||
|
||||
// Make this consistent with all other parameter parsing
|
||||
if (SC_CheckString("("))
|
||||
if (SC_CheckToken('('))
|
||||
{
|
||||
for (i = 0; i < 5;)
|
||||
{
|
||||
StateParameters[paramindex+i+1]=ParseExpression (false, bag.Info->Class);
|
||||
i++;
|
||||
if (!SC_CheckString (",")) break;
|
||||
if (!SC_CheckToken (',')) break;
|
||||
}
|
||||
SC_MustGetStringName (")");
|
||||
SC_MustGetToken (')');
|
||||
}
|
||||
else i=0;
|
||||
|
||||
|
|
@ -1378,14 +1385,12 @@ static FString ParseStateString()
|
|||
if (SC_CheckString("::"))
|
||||
{
|
||||
SC_MustGetString ();
|
||||
statestring += "::";
|
||||
statestring += sc_String;
|
||||
statestring << "::" << sc_String;
|
||||
}
|
||||
while (SC_CheckString ("."))
|
||||
{
|
||||
SC_MustGetString ();
|
||||
statestring += ".";
|
||||
statestring += sc_String;
|
||||
statestring << "." << sc_String;
|
||||
}
|
||||
return statestring;
|
||||
}
|
||||
|
|
@ -3175,6 +3180,23 @@ static void ActorDamageType (AActor *defaults, Baggage &bag)
|
|||
else defaults->DamageType=sc_String;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
static void ActorDamageFactor (AActor *defaults, Baggage &bag)
|
||||
{
|
||||
SC_MustGetString ();
|
||||
if (bag.Info->DamageFactors == NULL) bag.Info->DamageFactors=new DmgFactors;
|
||||
|
||||
FName dmgType;
|
||||
if (SC_Compare("Normal")) dmgType = NAME_None;
|
||||
else dmgType=sc_String;
|
||||
|
||||
SC_MustGetToken(',');
|
||||
SC_MustGetFloat();
|
||||
bag.Info->DamageFactors[dmgType]=(fixed_t)(sc_Float*FRACUNIT);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
|
|
@ -4127,6 +4149,7 @@ static const ActorProps props[] =
|
|||
{ "crash", ActorCrashState, RUNTIME_CLASS(AActor) },
|
||||
{ "crush", ActorCrushState, RUNTIME_CLASS(AActor) },
|
||||
{ "damage", ActorDamage, RUNTIME_CLASS(AActor) },
|
||||
{ "damagefactor", ActorDamageFactor, RUNTIME_CLASS(AActor) },
|
||||
{ "damagetype", ActorDamageType, RUNTIME_CLASS(AActor) },
|
||||
{ "death", ActorDeathState, RUNTIME_CLASS(AActor) },
|
||||
{ "deathheight", ActorDeathHeight, RUNTIME_CLASS(AActor) },
|
||||
|
|
@ -4377,6 +4400,7 @@ void FinishThingdef()
|
|||
sprintf(fmt, "QuestItem%d", i+1);
|
||||
QuestItemClasses[i]=PClass::FindClass(fmt);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -4433,3 +4457,13 @@ void ParseClass()
|
|||
SC_MustGetAnyToken();
|
||||
}
|
||||
}
|
||||
|
||||
void ParseActionFunction()
|
||||
{
|
||||
// for now only void functions with no parameters
|
||||
SC_MustGetToken(TK_Void);
|
||||
SC_MustGetString();
|
||||
FName funcname = sc_String;
|
||||
SC_MustGetToken('(');
|
||||
SC_MustGetToken(')');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue