- added ACS CheckActprClass function

- fixed: When a blasted actor collided with another one this other actor's
  DONTBLAST flag was not checked.
- added a global DamageFactor actor property. All damage this actor takes is multiplied
  by this factor in addition to damage type specific damage factors.


SVN r1915 (trunk)
This commit is contained in:
Christoph Oelckers 2009-10-15 20:09:22 +00:00
commit ce2e85c7b2
7 changed files with 42 additions and 7 deletions

View file

@ -2429,6 +2429,7 @@ enum
APROP_NameTag = 21,
APROP_Score = 22,
APROP_Notrigger = 23,
APROP_DamageFactor = 24,
};
// These are needed for ACS's APROP_RenderStyle
@ -2593,6 +2594,10 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
actor->Tag = FBehavior::StaticLookupString(value);
break;
case APROP_DamageFactor:
actor->DamageFactor = value;
break;
default:
// do nothing.
break;
@ -2625,6 +2630,7 @@ int DLevelScript::GetActorProperty (int tid, int property)
case APROP_Health: return actor->health;
case APROP_Speed: return actor->Speed;
case APROP_Damage: return actor->Damage; // Should this call GetMissileDamage() instead?
case APROP_DamageFactor:return actor->DamageFactor;
case APROP_Alpha: return actor->alpha;
case APROP_RenderStyle: for (int style = STYLE_None; style < STYLE_Count; ++style)
{ // Check for a legacy render style that matches.
@ -2685,6 +2691,7 @@ int DLevelScript::CheckActorProperty (int tid, int property, int value)
case APROP_Health:
case APROP_Speed:
case APROP_Damage:
case APROP_DamageFactor:
case APROP_Alpha:
case APROP_RenderStyle:
case APROP_Gravity:
@ -2900,6 +2907,7 @@ enum EACSFunctions
ACSF_SetUserVariable,
ACSF_GetUserVariable,
ACSF_Radius_Quake2,
ACSF_CheckActorClass,
};
int DLevelScript::SideFromID(int id, int side)
@ -3139,6 +3147,13 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
P_StartQuake(activator, args[0], args[1], args[2], args[3], args[4], FBehavior::StaticLookupString(args[5]));
break;
case ACSF_CheckActorClass:
{
AActor *a = args[0] == 0 ? (AActor *)activator : SingleActorFromTID(args[0], NULL);
return a->GetClass()->TypeName == FName(FBehavior::StaticLookupString(args[1]));
}
default:
break;
}