gzdoom-gles/wadsrc/static/zscript/hexen/baseweapons.txt

64 lines
1.3 KiB
Text
Raw Normal View History

2016-10-17 21:27:34 +00:00
// The Doom and Heretic players are not excluded from pickup in case
// somebody wants to use these weapons with either of those games.
2016-11-26 21:25:49 +00:00
class FighterWeapon : Weapon
2016-10-17 21:27:34 +00:00
{
Default
{
Weapon.Kickback 150;
Inventory.ForbiddenTo "ClericPlayer", "MagePlayer";
}
}
2016-11-26 21:25:49 +00:00
class ClericWeapon : Weapon
2016-10-17 21:27:34 +00:00
{
Default
{
Weapon.Kickback 150;
Inventory.ForbiddenTo "FighterPlayer", "MagePlayer";
}
}
class MageWeapon : Weapon native
{
Default
{
Weapon.Kickback 150;
Inventory.ForbiddenTo "FighterPlayer", "ClericPlayer";
}
}
2016-11-26 21:25:49 +00:00
extend class Actor
{
//============================================================================
//
// AdjustPlayerAngle
//
//============================================================================
const MAX_ANGLE_ADJUST = (5.);
void AdjustPlayerAngle(FTranslatedLineTarget t)
{
// normally this will adjust relative to the actual direction to the target,
// but with arbitrary portals that cannot be calculated so using the actual
// attack angle is the only option.
double atkangle = t.unlinked ? t.angleFromSource : AngleTo(t.linetarget);
double difference = deltaangle(Angle, atkangle);
if (abs(difference) > MAX_ANGLE_ADJUST)
{
if (difference > 0)
{
angle += MAX_ANGLE_ADJUST;
}
else
{
angle -= MAX_ANGLE_ADJUST;
}
}
else
{
angle = t.angleFromSource;
}
}
}