mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Merge branch 'develop' into develop_mirrors
This commit is contained in:
commit
2e17f7f8d9
6 changed files with 12 additions and 12 deletions
|
@ -837,7 +837,7 @@ void AimWeapon(ItemInfo& laraItem, ArmInfo& arm, const WeaponInfo& weaponInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Include snowmobile gun in GetAmmo(), otherwise the player won't be able to shoot while controlling it. -- TokyoSU 2023.04.21
|
// TODO: Include snowmobile gun in GetAmmo(), otherwise the player won't be able to shoot while controlling it. -- TokyoSU 2023.04.21
|
||||||
FireWeaponType FireWeapon(LaraWeaponType weaponType, ItemInfo& targetEntity, ItemInfo& laraItem, const EulerAngles& armOrient)
|
FireWeaponType FireWeapon(LaraWeaponType weaponType, ItemInfo* targetEntity, ItemInfo& laraItem, const EulerAngles& armOrient)
|
||||||
{
|
{
|
||||||
auto& player = *GetLaraInfo(&laraItem);
|
auto& player = *GetLaraInfo(&laraItem);
|
||||||
auto& ammo = GetAmmo(player, weaponType);
|
auto& ammo = GetAmmo(player, weaponType);
|
||||||
|
@ -872,14 +872,14 @@ FireWeaponType FireWeapon(LaraWeaponType weaponType, ItemInfo& targetEntity, Ite
|
||||||
GetFloor(pos.x, pos.y, pos.z, &roomNumber);
|
GetFloor(pos.x, pos.y, pos.z, &roomNumber);
|
||||||
vOrigin.RoomNumber = roomNumber;
|
vOrigin.RoomNumber = roomNumber;
|
||||||
|
|
||||||
if (&targetEntity == nullptr)
|
if (targetEntity == nullptr)
|
||||||
{
|
{
|
||||||
auto vTarget = GameVector(target);
|
auto vTarget = GameVector(target);
|
||||||
GetTargetOnLOS(&vOrigin, &vTarget, false, true);
|
GetTargetOnLOS(&vOrigin, &vTarget, false, true);
|
||||||
return FireWeaponType::Miss;
|
return FireWeaponType::Miss;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto spheres = targetEntity.GetSpheres();
|
auto spheres = targetEntity->GetSpheres();
|
||||||
int closestJointIndex = NO_VALUE;
|
int closestJointIndex = NO_VALUE;
|
||||||
float closestDist = INFINITY;
|
float closestDist = INFINITY;
|
||||||
for (int i = 0; i < spheres.size(); i++)
|
for (int i = 0; i < spheres.size(); i++)
|
||||||
|
@ -909,7 +909,7 @@ FireWeaponType FireWeapon(LaraWeaponType weaponType, ItemInfo& targetEntity, Ite
|
||||||
// NOTE: It seems that entities hit by the player in the normal way must have GetTargetOnLOS return false.
|
// NOTE: It seems that entities hit by the player in the normal way must have GetTargetOnLOS return false.
|
||||||
// It's strange, but this replicates original behaviour until we fully understand what is happening.
|
// It's strange, but this replicates original behaviour until we fully understand what is happening.
|
||||||
if (!GetTargetOnLOS(&vOrigin, &vTarget, false, true))
|
if (!GetTargetOnLOS(&vOrigin, &vTarget, false, true))
|
||||||
HitTarget(&laraItem, &targetEntity, &vTarget, weapon.Damage, false, closestJointIndex);
|
HitTarget(&laraItem, targetEntity, &vTarget, weapon.Damage, false, closestJointIndex);
|
||||||
|
|
||||||
return FireWeaponType::PossibleHit;
|
return FireWeaponType::PossibleHit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ GAME_OBJECT_ID GetWeaponObjectMeshID(ItemInfo& laraItem, LaraWeaponType weapon
|
||||||
|
|
||||||
void HandleWeapon(ItemInfo& laraItem);
|
void HandleWeapon(ItemInfo& laraItem);
|
||||||
void AimWeapon(ItemInfo& laraItem, ArmInfo& arm, const WeaponInfo& weaponInfo);
|
void AimWeapon(ItemInfo& laraItem, ArmInfo& arm, const WeaponInfo& weaponInfo);
|
||||||
FireWeaponType FireWeapon(LaraWeaponType weaponType, ItemInfo& targetEntity, ItemInfo& laraItem, const EulerAngles& armOrient);
|
FireWeaponType FireWeapon(LaraWeaponType weaponType, ItemInfo* targetEntity, ItemInfo& laraItem, const EulerAngles& armOrient);
|
||||||
|
|
||||||
void FindNewTarget(ItemInfo& laraItem, const WeaponInfo& weaponInfo);
|
void FindNewTarget(ItemInfo& laraItem, const WeaponInfo& weaponInfo);
|
||||||
void LaraTargetInfo(ItemInfo& laraItem, const WeaponInfo& weaponInfo);
|
void LaraTargetInfo(ItemInfo& laraItem, const WeaponInfo& weaponInfo);
|
||||||
|
|
|
@ -395,7 +395,7 @@ void FireShotgun(ItemInfo& laraItem)
|
||||||
armOrient.y + scatter * (GetRandomControl() - ANGLE(90.0f)) / 65536,
|
armOrient.y + scatter * (GetRandomControl() - ANGLE(90.0f)) / 65536,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
if (FireWeapon(LaraWeaponType::Shotgun, *player.TargetEntity, laraItem, wobbledArmOrient) != FireWeaponType::NoAmmo)
|
if (FireWeapon(LaraWeaponType::Shotgun, player.TargetEntity, laraItem, wobbledArmOrient) != FireWeaponType::NoAmmo)
|
||||||
hasFired = true;
|
hasFired = true;
|
||||||
|
|
||||||
// HACK: Compensate for spending 6 units of shotgun ammo. -- Lwmte, 18.11.22
|
// HACK: Compensate for spending 6 units of shotgun ammo. -- Lwmte, 18.11.22
|
||||||
|
@ -1152,7 +1152,7 @@ void FireHK(ItemInfo& laraItem, bool inaccurateMode)
|
||||||
Weapons[(int)LaraWeaponType::HK].Damage = damage / 3;
|
Weapons[(int)LaraWeaponType::HK].Damage = damage / 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FireWeapon(LaraWeaponType::HK, *player.TargetEntity, laraItem, angles) != FireWeaponType::NoAmmo)
|
if (FireWeapon(LaraWeaponType::HK, player.TargetEntity, laraItem, angles) != FireWeaponType::NoAmmo)
|
||||||
{
|
{
|
||||||
player.LeftArm.GunSmoke = 12;
|
player.LeftArm.GunSmoke = 12;
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ static void AnimateWeapon(ItemInfo& laraItem, LaraWeaponType weaponType, bool& h
|
||||||
arm.Orientation.y + laraItem.Pose.Orientation.y,
|
arm.Orientation.y + laraItem.Pose.Orientation.y,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
if (FireWeapon(weaponType, *player.TargetEntity, laraItem, armOrient) != FireWeaponType::NoAmmo)
|
if (FireWeapon(weaponType, player.TargetEntity, laraItem, armOrient) != FireWeaponType::NoAmmo)
|
||||||
{
|
{
|
||||||
arm.GunSmoke = 28;
|
arm.GunSmoke = 28;
|
||||||
TriggerGunShell(isRightWeapon ? true : false, ID_GUNSHELL, weaponType);
|
TriggerGunShell(isRightWeapon ? true : false, ID_GUNSHELL, weaponType);
|
||||||
|
|
|
@ -680,8 +680,8 @@ namespace TEN::Entities::Vehicles
|
||||||
lara->RightArm.Orientation.y + laraItem->Pose.Orientation.y,
|
lara->RightArm.Orientation.y + laraItem->Pose.Orientation.y,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
FireWeapon(LaraWeaponType::Snowmobile, *lara->TargetEntity, *laraItem, angles);
|
FireWeapon(LaraWeaponType::Snowmobile, lara->TargetEntity, *laraItem, angles);
|
||||||
FireWeapon(LaraWeaponType::Snowmobile, *lara->TargetEntity, *laraItem, angles);
|
FireWeapon(LaraWeaponType::Snowmobile, lara->TargetEntity, *laraItem, angles);
|
||||||
SoundEffect(weapon.SampleNum, &laraItem->Pose);
|
SoundEffect(weapon.SampleNum, &laraItem->Pose);
|
||||||
skidooItem->ItemFlags[0] = 4;
|
skidooItem->ItemFlags[0] = 4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,7 +297,7 @@ if not exist "%ScriptsDir%\Strings.lua" xcopy /Y "$(SolutionDir)Scripts\Strings.
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
<PrecompiledHeaderFile>framework.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>framework.h</PrecompiledHeaderFile>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>MinSpace</Optimization>
|
||||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
@ -377,7 +377,7 @@ if not exist "%ScriptsDir%\Strings.lua" xcopy /Y "$(SolutionDir)Scripts\Strings.
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
<PrecompiledHeaderFile>framework.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>framework.h</PrecompiledHeaderFile>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>MinSpace</Optimization>
|
||||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue