Merge branch 'maint'

This commit is contained in:
Christoph Oelckers 2013-08-11 21:04:17 +02:00
commit fabf8272e6
4 changed files with 53 additions and 1 deletions

View File

@ -1697,7 +1697,7 @@ void APowerRegeneration::DoEffect()
{ {
if (Owner != NULL && Owner->health > 0 && (level.time & 31) == 0) if (Owner != NULL && Owner->health > 0 && (level.time & 31) == 0)
{ {
if (P_GiveBody(Owner, Strength)) if (P_GiveBody(Owner, Strength/FRACUNIT))
{ {
S_Sound(Owner, CHAN_ITEM, "*regenerate", 1, ATTN_NORM ); S_Sound(Owner, CHAN_ITEM, "*regenerate", 1, ATTN_NORM );
} }

View File

@ -46,6 +46,7 @@
#include "p_acs.h" #include "p_acs.h"
#include "p_saveg.h" #include "p_saveg.h"
#include "p_lnspec.h" #include "p_lnspec.h"
#include "p_enemy.h"
#include "m_random.h" #include "m_random.h"
#include "doomstat.h" #include "doomstat.h"
#include "c_console.h" #include "c_console.h"
@ -4233,6 +4234,7 @@ enum EACSFunctions
ACSF_PlayActorSound, ACSF_PlayActorSound,
ACSF_SpawnDecal, ACSF_SpawnDecal,
ACSF_CheckFont, ACSF_CheckFont,
ACSF_DropItem,
// ZDaemon // ZDaemon
ACSF_GetTeamScore = 19620, // (int team) ACSF_GetTeamScore = 19620, // (int team)
@ -5235,6 +5237,39 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
// bool CheckFont(str fontname) // bool CheckFont(str fontname)
return V_GetFont(FBehavior::StaticLookupString(args[0])) != NULL; return V_GetFont(FBehavior::StaticLookupString(args[0])) != NULL;
case ACSF_DropItem:
{
const char *type = FBehavior::StaticLookupString(args[1]);
int amount = argCount >= 3? args[2] : -1;
int chance = argCount >= 4? args[3] : -1;
const PClass *cls = PClass::FindClass(type);
int cnt = 0;
if (cls != NULL)
{
if (args[0] == 0)
{
if (activator != NULL)
{
P_DropItem(activator, cls, amount, chance);
cnt++;
}
}
else
{
FActorIterator it(args[0]);
AActor *actor;
while ((actor = it.Next()) != NULL)
{
P_DropItem(actor, cls, amount, chance);
cnt++;
}
}
return cnt;
}
break;
}
default: default:
break; break;
} }

View File

@ -4951,3 +4951,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetDamageType)
self->DamageType = damagetype; self->DamageType = damagetype;
} }
//==========================================================================
//
// A_DropItem
//
//==========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropItem)
{
ACTION_PARAM_START(3);
ACTION_PARAM_CLASS(spawntype, 0);
ACTION_PARAM_INT(amount, 1);
ACTION_PARAM_INT(chance, 2);
P_DropItem(self, spawntype, amount, chance);
}

View File

@ -300,6 +300,7 @@ ACTOR Actor native //: Thinker
action native A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake"); action native A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake");
action native A_SetTics(int tics); action native A_SetTics(int tics);
action native A_SetDamageType(name damagetype); action native A_SetDamageType(name damagetype);
action native A_DropItem(class<Actor> item, int dropamount = -1, int chance = -1);
action native A_CheckSightOrRange(float distance, state label); action native A_CheckSightOrRange(float distance, state label);
action native A_CheckRange(float distance, state label); action native A_CheckRange(float distance, state label);