mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-01-23 13:35:11 +03:00
Laser range cheat (#112)
Some checks are pending
Some checks are pending
* Add Laser Range cheat * Change range cheat to be a multiplier instead * Address bomb weirdness * Move cheat to Hooks system
This commit is contained in:
parent
b4457a03a9
commit
97e63d6b06
@ -3081,6 +3081,7 @@ void Player_SetupArwingShot(Player* player, PlayerShot* shot, f32 arg2, f32 arg3
|
|||||||
shot->timer = 30;
|
shot->timer = 30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shot->sourceId = player->num;
|
shot->sourceId = player->num;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3156,7 +3157,7 @@ void Player_TankCannon(Player* player) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!PlayerActionPreShootEvent_.event.cancelled){
|
if (!PlayerActionPreShootEvent_.event.cancelled){
|
||||||
CALL_EVENT(PlayerActionPostShootEvent, player, gLaserStrength[gPlayerNum]);
|
CALL_EVENT(PlayerActionPostShootEvent, player, &gPlayerShots[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3205,7 +3206,7 @@ void Player_ArwingLaser(Player* player) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CALL_EVENT(PlayerActionPostShootEvent, player, laser);
|
CALL_EVENT(PlayerActionPostShootEvent, player, &gPlayerShots[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player_SmartBomb(Player* player) {
|
void Player_SmartBomb(Player* player) {
|
||||||
|
@ -1247,7 +1247,7 @@ void Aquas_BlueMarineLaser(Player* player) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!PlayerActionPreShootEvent_.event.cancelled){
|
if (!PlayerActionPreShootEvent_.event.cancelled){
|
||||||
CALL_EVENT(PlayerActionPostShootEvent, player, gLaserStrength[gPlayerNum]);
|
CALL_EVENT(PlayerActionPostShootEvent, player, &gPlayerShots[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ DEFINE_EVENT(PlayerActionBoostEvent, Player* player;);
|
|||||||
DEFINE_EVENT(PlayerActionBrakeEvent, Player* player;);
|
DEFINE_EVENT(PlayerActionBrakeEvent, Player* player;);
|
||||||
|
|
||||||
DEFINE_EVENT(PlayerActionPreShootEvent, Player* player; LaserStrength laser;);
|
DEFINE_EVENT(PlayerActionPreShootEvent, Player* player; LaserStrength laser;);
|
||||||
DEFINE_EVENT(PlayerActionPostShootEvent, Player* player; LaserStrength laser;);
|
DEFINE_EVENT(PlayerActionPostShootEvent, Player* player; PlayerShot* shot;);
|
||||||
|
|
||||||
DEFINE_EVENT(PlayerActionPreShootChargedEvent, Player* player;);
|
DEFINE_EVENT(PlayerActionPreShootChargedEvent, Player* player;);
|
||||||
DEFINE_EVENT(PlayerActionPostShootChargedEvent, Player* player;);
|
DEFINE_EVENT(PlayerActionPostShootChargedEvent, Player* player;);
|
||||||
|
@ -184,6 +184,10 @@ void OnPlayerBrake(PlayerActionBrakeEvent* event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnPlayerShootPost(PlayerActionPostShootEvent* event){
|
||||||
|
event->shot->timer *= CVarGetInteger("gLaserRangeMult", 100)/100.0f;
|
||||||
|
}
|
||||||
|
|
||||||
void PortEnhancements_Init() {
|
void PortEnhancements_Init() {
|
||||||
PortEnhancements_Register();
|
PortEnhancements_Register();
|
||||||
|
|
||||||
@ -195,6 +199,7 @@ void PortEnhancements_Init() {
|
|||||||
// Register Action listeners
|
// Register Action listeners
|
||||||
REGISTER_LISTENER(PlayerActionBoostEvent, OnPlayerBoost, EVENT_PRIORITY_NORMAL);
|
REGISTER_LISTENER(PlayerActionBoostEvent, OnPlayerBoost, EVENT_PRIORITY_NORMAL);
|
||||||
REGISTER_LISTENER(PlayerActionBrakeEvent, OnPlayerBrake, EVENT_PRIORITY_NORMAL);
|
REGISTER_LISTENER(PlayerActionBrakeEvent, OnPlayerBrake, EVENT_PRIORITY_NORMAL);
|
||||||
|
REGISTER_LISTENER(PlayerActionPostShootEvent, OnPlayerShootPost, EVENT_PRIORITY_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PortEnhancements_Register() {
|
void PortEnhancements_Register() {
|
||||||
|
@ -484,6 +484,8 @@ void DrawCheatsMenu() {
|
|||||||
UIWidgets::CVarCheckbox("Infinite Bombs", "gInfiniteBombs");
|
UIWidgets::CVarCheckbox("Infinite Bombs", "gInfiniteBombs");
|
||||||
UIWidgets::CVarCheckbox("Infinite Boost/Brake", "gInfiniteBoost");
|
UIWidgets::CVarCheckbox("Infinite Boost/Brake", "gInfiniteBoost");
|
||||||
UIWidgets::CVarCheckbox("Hyper Laser", "gHyperLaser");
|
UIWidgets::CVarCheckbox("Hyper Laser", "gHyperLaser");
|
||||||
|
UIWidgets::CVarSliderInt("Laser Range Multiplier: %d%%", "gLaserRangeMult", 15, 800, 100,
|
||||||
|
{ .tooltip = "Changes how far your lasers fly." });
|
||||||
UIWidgets::CVarCheckbox("Self destruct button", "gHit64SelfDestruct", {
|
UIWidgets::CVarCheckbox("Self destruct button", "gHit64SelfDestruct", {
|
||||||
.tooltip = "Press Down on the D-PAD to instantly self destruct."
|
.tooltip = "Press Down on the D-PAD to instantly self destruct."
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user