Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Credits
- **ChrisLv_CN** - interceptor logic, LaserTrails, laser fixes, general assistance (work relicensed under [following permission](images/ChrisLv-relicense.png))
- **Xkein** - general assistance, YRpp edits
- **thomassneddon** - general assistance
- **Starkku** - Warhead shield penetration & breaking, strafing aircraft weapon customization, vehicle DeployFire fixes/improvements, stationary VehicleTypes, Burst logic improvements, TechnoType auto-firing weapons, Secondary weapon fallback customization, weapon target type filtering, AreaFire targeting customization, CreateUnit improvements, Attached animation & jumpjet unit layer customization, IsSimpleDeployer improvements, Shield modification warheads, Warhead decloaking toggle, Warp(In/Out)Weapon, Grinder improvements / additions, Attached animation position customization, Critical hit logic additions, Aircraft & jumpjet speed modifiers fix, Vehicle custom palette fix
- **Starkku** - Warhead shield penetration & breaking, strafing aircraft weapon customization, vehicle DeployFire fixes/improvements, stationary VehicleTypes, Burst logic improvements, TechnoType auto-firing weapons, Secondary weapon fallback customization, weapon target type filtering, AreaFire targeting customization, CreateUnit improvements, Attached animation & jumpjet unit layer customization, IsSimpleDeployer improvements, Shield modification warheads, Warhead decloaking toggle, Warp(In/Out)Weapon, Grinder improvements / additions, Attached animation position customization, Critical hit logic additions, Aircraft & jumpjet speed modifiers fix, Local warhead screen shaking, Vehicle custom palette fix
- **SukaHati (Erzoid)** - Minimum interceptor guard range
- **Morton (MortonPL)** - XDrawOffset, Shield passthrough & absorption, building LimboDelivery, fix for Image in art rules, power delta counter
- **mevitar** - honorary shield tester *triple* award
Expand Down
10 changes: 10 additions & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,14 @@ In `rulesmd.ini`:
```ini
[SOMEWARHEAD] ; WarheadType
DecloakDamagedTargets=true ; boolean
```

### Restricting screen shaking to current view

- You can now specify whether or not the warhead can only shake screen (`ShakeX/Ylo/hi`) if it is detonated while visible on current screen view.

In `rulesmd.ini`:
```ini
[SOMEWARHEAD] ; WarheadType
ShakeIsLocal=false ; boolean
```
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ New:
- Shared Ammo for transports to passengers (by FS-21)
- Additional critical hit logic customizations (by Starkku)
- Laser trails for VoxelAnims (by Otamaa)
- Local warhead screen shaking (by Starkku)

Vanilla fixes:
- Fixed laser drawing code to allow for thicker lasers in house color draw mode (by Kerbiter, ChrisLv_CN)
Expand Down
19 changes: 19 additions & 0 deletions src/Ext/Bullet/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <Misc/CaptureManager.h>

#include <TechnoClass.h>
#include <TacticalClass.h>

// has everything inited except SpawnNextAnim at this point
DEFINE_HOOK(0x466556, BulletClass_Init_SetLaserTrail, 0x6)
Expand Down Expand Up @@ -194,4 +195,22 @@ DEFINE_HOOK(0x46A3D6, BulletClass_Shrapnel_Forced, 0xA)
return Shrapnel;

return Skip;
}

DEFINE_HOOK(0x4690D4, BulletClass_Logics_ScreenShake, 0x6)
{
enum { SkipShaking = 0x469130 };

GET(WarheadTypeClass*, pWarhead, EAX);
GET_BASE(CoordStruct*, pCoords, 0x8);

if (auto const pExt = WarheadTypeExt::ExtMap.Find(pWarhead))
{
Point2D screenCoords;

if (pExt->ShakeIsLocal && !TacticalClass::Instance->CoordsToClient(*pCoords, &screenCoords))
return SkipShaking;
}

return 0;
}
6 changes: 2 additions & 4 deletions src/Ext/WarheadType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->RemoveMindControl.Read(exINI, pSection, "RemoveMindControl");
this->AnimList_PickRandom.Read(exINI, pSection, "AnimList.PickRandom");
this->DecloakDamagedTargets.Read(exINI, pSection, "DecloakDamagedTargets");
this->ShakeIsLocal.Read(exINI, pSection, "ShakeIsLocal");

// Crits
this->Crit_Chance.Read(exINI, pSection, "Crit.Chance");
Expand Down Expand Up @@ -136,16 +137,13 @@ void WarheadTypeExt::ExtData::Serialize(T& Stm)
.Process(this->SpySat)
.Process(this->BigGap)
.Process(this->TransactMoney)

.Process(this->SplashList)
.Process(this->SplashList_PickRandom)

.Process(this->RemoveDisguise)
.Process(this->RemoveMindControl)

.Process(this->AnimList_PickRandom)

.Process(this->DecloakDamagedTargets)
.Process(this->ShakeIsLocal)

.Process(this->Crit_Chance)
.Process(this->Crit_ApplyChancePerTarget)
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/WarheadType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class WarheadTypeExt
Valueable<bool> RemoveMindControl;
Valueable<bool> AnimList_PickRandom;
Valueable<bool> DecloakDamagedTargets;
Valueable<bool> ShakeIsLocal;

Valueable<double> Crit_Chance;
Valueable<bool> Crit_ApplyChancePerTarget;
Expand Down Expand Up @@ -87,6 +88,7 @@ class WarheadTypeExt
, RemoveMindControl { false }
, AnimList_PickRandom { false }
, DecloakDamagedTargets { true }
, ShakeIsLocal { false }

, Crit_Chance { 0.0 }
, Crit_ApplyChancePerTarget { false }
Expand Down