- Fixed: Monsters couldn't hurt other monsters of the same species if they

were supposed to hate them.
- Since I was editing the file anyway I added checks for Heretic's and Strife's
  damaging floor types to DCajunMaster::IsDangerous.
- Added a NULL pointer check to DCajunMaster::TurnToAng because a crash log
  indicated that this can happen.
- Fixed: Strife's energy pod contains 20 units when dropped by monsters.
  To achieve this I added an Ammo.DropAmount property because there are
  no other means to control this from inside a conversation script.

SVN r151 (trunk)
This commit is contained in:
Christoph Oelckers 2006-05-28 14:54:01 +00:00
parent 96f6cfd18a
commit fb31db860d
11 changed files with 63 additions and 22 deletions

View File

@ -1,3 +1,14 @@
May 28, 2006 (Changes by Graf Zahl)
- Fixed: Monsters couldn't hurt other monsters of the same species if they
were supposed to hate them.
- Since I was editing the file anyway I added checks for Heretic's and Strife's
damaging floor types to DCajunMaster::IsDangerous.
- Added a NULL pointer check to DCajunMaster::TurnToAng because a crash log
indicated that this can happen.
- Fixed: Strife's energy pod contains 20 units when dropped by monsters.
To achieve this I added an Ammo.DropAmount property because there are
no other means to control this from inside a conversation script.
May 27, 2006 (Changes by Graf Zahl)
- Fixed: FString::FormatHelper must not alter the null string.
- Fixed: FString::FormatHelper should use ReallocBuffer instead of directly

View File

@ -324,21 +324,25 @@ bool DCajunMaster::CleanAhead (AActor *thing, fixed_t x, fixed_t y, ticcmd_t *cm
void DCajunMaster::TurnToAng (AActor *actor)
{
if (actor->player->ReadyWeapon->WeaponFlags & WIF_BOT_EXPLOSIVE)
{
if (actor->player->t_roam && !actor->player->missile)
{ //Keep angle that where when shot where decided.
return;
}
}
int maxturn = MAXTURN;
if(actor->player->enemy)
if(!actor->player->dest) //happens when running after item in combat situations, or normal, prevent's weak turns
if(actor->player->ReadyWeapon->ProjectileType == NULL && !(actor->player->ReadyWeapon->WeaponFlags & WIF_BOT_MELEE))
if(Check_LOS(actor, actor->player->enemy, SHOOTFOV+5*ANGLE_1))
maxturn = 3;
if (actor->player->ReadyWeapon != NULL)
{
if (actor->player->ReadyWeapon->WeaponFlags & WIF_BOT_EXPLOSIVE)
{
if (actor->player->t_roam && !actor->player->missile)
{ //Keep angle that where when shot where decided.
return;
}
}
if(actor->player->enemy)
if(!actor->player->dest) //happens when running after item in combat situations, or normal, prevents weak turns
if(actor->player->ReadyWeapon->ProjectileType == NULL && !(actor->player->ReadyWeapon->WeaponFlags & WIF_BOT_MELEE))
if(Check_LOS(actor, actor->player->enemy, SHOOTFOV+5*ANGLE_1))
maxturn = 3;
}
int distance = actor->player->angle - actor->angle;
@ -374,6 +378,12 @@ bool DCajunMaster::IsDangerous (sector_t *sec)
|| special == dDamage_Hellslime
|| special == dDamage_Nukage
|| special == dDamage_End
|| special == dDamage_SuperHellslime;
|| special == dDamage_SuperHellslime
|| special == dDamage_LavaWimpy
|| special == dDamage_LavaHefty
|| special == dScroll_EastLavaDamage
|| special == sLight_Strobe_Hurt
|| special == Damage_InstantDeath
|| special == sDamage_SuperHellslime;
}

View File

@ -73,6 +73,7 @@ enum
AIMETA_BASE = 0x71000,
AIMETA_PickupMessage, // string
AIMETA_GiveQuest, // optionally give one of the quest items.
AIMETA_DropAmount, // specifies the amount for a dropped ammo item
};
enum

View File

@ -223,13 +223,13 @@ void A_InquisitorAttack (AActor *self)
self->z += 32*FRACBITS;
self->angle -= ANGLE_45/32;
proj = P_SpawnMissileZAimed (self, self->z + 32*FRACUNIT, self->target, RUNTIME_CLASS(AInquisitorShot));
proj = P_SpawnMissileZAimed (self, self->z, self->target, RUNTIME_CLASS(AInquisitorShot));
if (proj != NULL)
{
proj->momz += 9*FRACUNIT;
}
self->angle += ANGLE_45/16;
proj = P_SpawnMissileZAimed (self, self->z + 32*FRACUNIT, self->target, RUNTIME_CLASS(AInquisitorShot));
proj = P_SpawnMissileZAimed (self, self->z, self->target, RUNTIME_CLASS(AInquisitorShot));
if (proj != NULL)
{
proj->momz += 16*FRACUNIT;

View File

@ -188,6 +188,7 @@ IMPLEMENT_ACTOR (AEnergyPod, Strife, 2047, 75)
PROP_Inventory_MaxAmount (400)
PROP_Ammo_BackpackAmount (20)
PROP_Ammo_BackpackMaxAmount (800)
PROP_Ammo_DropAmount (20)
PROP_Inventory_Icon ("I_BRY1")
PROP_Tag ("energy_pod")
END_DEFAULTS

View File

@ -326,6 +326,7 @@ enum
ADEF_Ammo_BackpackAmount,
ADEF_Ammo_BackpackMaxAmount,
ADEF_Ammo_DropAmount,
ADEF_Weapon_Flags,
ADEF_Weapon_FlagsSet,

View File

@ -273,6 +273,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint)
case ADEF_Ammo_BackpackAmount: ammo->BackpackAmount = dataint; break;
case ADEF_Ammo_BackpackMaxAmount:ammo->BackpackMaxAmount = dataint; break;
case ADEF_Ammo_DropAmount: sgClass->Meta.SetMetaInt (AIMETA_DropAmount, dataint);
case ADEF_Weapon_Flags: weapon->WeaponFlags = dataint; break;
case ADEF_Weapon_FlagsSet: weapon->WeaponFlags |= dataint; break;

View File

@ -298,6 +298,7 @@ public:
#define PROP_Ammo_BackpackAmount(x) ADD_WORD_PROP(ADEF_Ammo_BackpackAmount,x)
#define PROP_Ammo_BackpackMaxAmount(x) ADD_WORD_PROP(ADEF_Ammo_BackpackMaxAmount,x)
#define PROP_Ammo_DropAmount(x) ADD_WORD_PROP(ADEF_Ammo_DropAmount,x)
#define PROP_Weapon_Flags(x) ADD_LONG_PROP(ADEF_Weapon_Flags,x)
#define PROP_Weapon_FlagsSet(x) ADD_LONG_PROP(ADEF_Weapon_FlagsSet,x)

View File

@ -2214,14 +2214,15 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int special, int cha
mo->flags &= ~MF_NOGRAVITY; // [RH] Make sure it is affected by gravity
if (mo->IsKindOf (RUNTIME_CLASS(AInventory)))
{
AInventory * inv = static_cast<AInventory *>(mo);
if (special > 0)
{
static_cast<AInventory *>(mo)->Amount = special;
inv->Amount = special;
}
else if (mo->IsKindOf (RUNTIME_CLASS(AAmmo)))
{
// Half ammo when dropped by bad guys.
static_cast<AInventory *>(mo)->Amount /= 2;
inv->Amount = inv->GetClass()->Meta.GetMetaInt (AIMETA_DropAmount, inv->Amount / 2 );
}
else if (mo->IsKindOf (RUNTIME_CLASS(AWeapon)))
{
@ -2229,7 +2230,7 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int special, int cha
static_cast<AWeapon *>(mo)->AmmoGive1 /= 2;
static_cast<AWeapon *>(mo)->AmmoGive2 /= 2;
}
if (static_cast<AInventory *>(mo)->SpecialDropAction (source))
if (inv->SpecialDropAction (source))
{
return NULL;
}

View File

@ -987,11 +987,15 @@ BOOL PIT_CheckThing (AActor *thing)
}
if (thing->GetSpecies() == tmthing->target->GetSpecies())
{
// Don't hurt same species or any relative
// Don't hurt same species or any relative -
// but only if the target isn't one's hostile.
if (!thing->IsHostile (tmthing->target))
{
// But only if the target isn't one's hostile.
return false;
// Allow hurting monsters the shooter hates.
if (thing->tid == 0 || tmthing->target->tid != thing->tid)
{
return false;
}
}
}
}

View File

@ -3064,6 +3064,15 @@ static void AmmoBackpackMaxAmount (AAmmo *defaults, Baggage &bag)
defaults->BackpackMaxAmount=sc_Number;
}
//==========================================================================
//
//==========================================================================
static void AmmoDropAmount (AAmmo *defaults, Baggage &bag)
{
SC_MustGetNumber();
bag.Info->Class->Meta.SetMetaInt (AIMETA_DropAmount, sc_Number);
}
//==========================================================================
//
//==========================================================================
@ -3497,6 +3506,7 @@ static const ActorProps props[] =
{ "alpha", ActorAlpha, RUNTIME_CLASS(AActor) },
{ "ammo.backpackamount", (apf)AmmoBackpackAmount, RUNTIME_CLASS(AAmmo) },
{ "ammo.backpackmaxamount", (apf)AmmoBackpackMaxAmount, RUNTIME_CLASS(AAmmo) },
{ "ammo.dropamount", (apf)AmmoDropAmount, RUNTIME_CLASS(AAmmo) },
{ "armor.maxsaveamount", (apf)ArmorMaxSaveAmount, RUNTIME_CLASS(ABasicArmorBonus) },
{ "armor.saveamount", (apf)ArmorSaveAmount, RUNTIME_CLASS(AActor) },
{ "armor.savepercent", (apf)ArmorSavePercent, RUNTIME_CLASS(AActor) },