Files
DarkflameServer/dScripts/ai/MINIGAME/SG_GF/GfShootingGalleryData.cpp
Aaron Kimbrell 8d059ab1c8 feat(scripts): shooting gallery cannon and zone re-ported from the original
SG_CANNON.lua and L_GF_SG.lua line for line, as a shared cannon and
zone script (ShootingGallery folder) that a gallery fills with its
constants and targets; GF's (SGCannon, ZoneSGServer) is now that data.
The cannon gets the zone control's ActivityStateChangeRequest,
MessageBoxRespond and ObjectLoaded from the zone script, as the
original asked to be told of them.

As the original: waves end through their own EndWave<n> timer and the
last one through GameOver; targets spawn 1 s or more after their timer
starts; scores are counted at the shot's end and can go below 0; the
super charge is the shot of its cannon ball; one activity reward roll,
rated by the score; the wave, fire and preload animations and effects;
GF's spawn table as the original's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:54:26 -06:00

136 lines
6.8 KiB
C++

#include "GfShootingGalleryData.h"
namespace {
// o_ShootingGallery.lua AddSpawn: [Template ID], [Initial Spawn Time Min], [Initial Spawn Time Max], [Does Respawn],
// [Respawn Time Min], [Respawn Time Max], [Initial Speed], [Score], [Change Speed at Waypoints],
// [Chance to Change Speed], [Min Speed], [Max Speed], [Is Moving Platform], [Despawn On Last Waypoint], [Time Score]
ShootingGallery::Spawn AddSpawn(std::vector<std::string> paths, const LOT id, const float initSpawnTimeMin, const float initSpawnTimeMax,
const bool bRespawn, const float mintime, const float maxtime, const float speed, const int32_t score, const bool bChangeSpeed,
const float chanceChangeSpeed, const float minSpeed, const float maxSpeed, const bool bMovingPlatform, const bool despawnTime,
const float timeScore) {
ShootingGallery::Spawn spawn;
spawn.path = std::move(paths);
spawn.id = id;
spawn.initSpawnTimeMin = initSpawnTimeMin;
spawn.initSpawnTimeMax = initSpawnTimeMax;
spawn.bRespawn = bRespawn;
spawn.minTime = mintime;
spawn.maxTime = maxtime;
spawn.speed = speed;
spawn.score = score;
spawn.bChangeSpeed = bChangeSpeed;
spawn.speedChangeChance = chanceChangeSpeed;
spawn.minSpeed = minSpeed;
spawn.maxSpeed = maxSpeed;
spawn.bMovingPlatform = bMovingPlatform;
spawn.despawnTime = despawnTime;
spawn.timeScore = timeScore;
return spawn;
}
ShootingGallery::Constants MakeConstants() {
ShootingGallery::Constants constants;
// cannon constants
constants.CANNON_TEMPLATEID = 1864;
constants.IMPACT_SKILLID = 34;
constants.PROJECTILE_TEMPLATEID = 1822;
constants.CANNON_PLAYER_OFFSET = NiPoint3(6.652f, -2.0f, 1.5f);
constants.Reward_Model_Matrix = 157;
constants.CANNON_VELOCITY = 129.0f;
constants.CANNON_MIN_DISTANCE = 30.0f;
constants.CANNON_REFIRE_RATE = 800.0f;
constants.CANNON_BARREL_OFFSET = NiPoint3(0.0f, 4.3f, 9.0f);
constants.CANNON_SUPER_CHARGE = 6297;
constants.CANNON_PROJECTILE = 1822;
constants.CANNON_SUPERCHARGE_SKILL = 249;
constants.CANNON_SKILL = 228;
constants.CANNON_TIMEOUT = -1.0f;
constants.CANNON_FOV = 58.6f;
constants.CANNON_USE_LEADERBOARDS = true;
constants.STREAK_MOD = 2;
// Super Charger is charged for this amount of time
constants.ChargedTime = 10.0f;
// The amount of points needed to super charge
constants.ChargedPoints = 25000;
// Model reward group name
constants.Reward_Model_GrpName = "QBRewardGroup";
constants.ActivityID = 1864;
// Reward Score and Loot Matrix 1 to 5
constants.Score_Reward = { 50000, 100000, 200000, 400000, 800000 };
constants.Score_LootMatrix = { 157, 187, 188, 189, 190 };
// Wave Data: AddWave(waves, 30.0, "Wave;One") and so on
constants.waveTimeLimits = { 30.0f, 30.0f, 30.0f };
constants.FIRST_WAVE_START_TIME = 4.0f;
constants.IN_BETWEEN_WAVE_PAUSE = 7.0f;
return constants;
}
};
const ShootingGallery::Constants& GfShootingGalleryData::GetConstants() {
static const auto constants = MakeConstants();
return constants;
}
// SG_CANNON.lua: targetSettings
ShootingGallery::SpawnTable GfShootingGalleryData::GetTargetSettings() {
return {
// Wave 1 Spawns
{
// Ship 1
AddSpawn({ "Wave_1_Ship_1", "Wave_1_Ship_3" }, 6015, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Ship 2
AddSpawn({ "Wave_1_Ship_2", "Wave_1_Ship_4" }, 6300, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Sub
AddSpawn({ "Wave_1_Sub_1", "Wave_1_Sub_2" }, 6016, 0.0f, 2.0f, true, 0.0f, 2.0f, 10.0f, 1000, false, 0.0f, 1.0f, 1.0f, true, true, 0.0f),
// Sub 2
AddSpawn({ "Wave_2_Sub_1", "Wave_2_Sub_2" }, 6016, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1000, false, 0.0f, 1.0f, 1.0f, true, true, 0.0f),
// Friendly
AddSpawn({ "Wave_3_FShip_1", "Wave_3_FShip_2" }, 2168, 0.0f, 5.0f, true, 2.0f, 5.0f, 1.0f, -1000, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
},
// Wave 2 Spawns
{
// Ship 1
AddSpawn({ "Wave_1_Ship_1", "Wave_1_Ship_3" }, 6015, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Ship 2
AddSpawn({ "Wave_1_Ship_2", "Wave_1_Ship_4" }, 6300, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Ship 3
AddSpawn({ "Wave_2_Ship_1" }, 6300, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Ship 4
AddSpawn({ "Wave_2_Ship_2" }, 6015, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Sub 1
AddSpawn({ "Wave_1_Sub_1", "Wave_1_Sub_2" }, 6016, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1000, false, 0.0f, 1.0f, 1.0f, true, true, 0.0f),
// Sub 2
AddSpawn({ "Wave_2_Sub_1", "Wave_2_Sub_2" }, 6016, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1000, false, 0.0f, 1.0f, 1.0f, true, true, 0.0f),
// Duck
AddSpawn({ "Wave_1_Duck_1", "Wave_1_Duck_2" }, 5946, 5.0f, 10.0f, true, 5.0f, 10.0f, 4.0f, 5000, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Friendly
AddSpawn({ "Wave_3_FShip_1", "Wave_3_FShip_2" }, 2168, 0.0f, 5.0f, true, 2.0f, 5.0f, 1.0f, -1000, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
},
// Wave 3 Spawns
{
// Ship 1
AddSpawn({ "Wave_1_Ship_1", "Wave_1_Ship_3" }, 6015, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Ship 2
AddSpawn({ "Wave_1_Ship_2", "Wave_1_Ship_4" }, 6300, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Ship 3
AddSpawn({ "Wave_2_Ship_1", "Wave_2_Ship_2" }, 6015, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Ship 4
AddSpawn({ "Wave_3_Ship_1", "Wave_3_Ship_2" }, 6300, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1500, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Sub 1
AddSpawn({ "Wave_1_Sub_1", "Wave_1_Sub_2" }, 6016, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1000, false, 0.0f, 1.0f, 1.0f, true, true, 0.0f),
// Sub 2
AddSpawn({ "Wave_2_Sub_1", "Wave_2_Sub_2" }, 6016, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1000, false, 0.0f, 1.0f, 1.0f, true, true, 0.0f),
// Sub 3
AddSpawn({ "Wave_3_Sub_1", "Wave_3_Sub_2" }, 6016, 0.0f, 2.0f, true, 0.0f, 2.0f, 2.0f, 1000, false, 0.0f, 1.0f, 1.0f, true, true, 0.0f),
// Duck
AddSpawn({ "Wave_1_Duck_1", "Wave_1_Duck_2" }, 5946, 5.0f, 10.0f, true, 5.0f, 10.0f, 4.0f, 5000, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Ness
AddSpawn({ "Wave_1_Ness_1", "Wave_1_Ness_2", "Wave_2_Ness_1" }, 2565, 10.0f, 15.0f, true, 10.0f, 15.0f, 2.0f, 10000, false, 0.0f, 1.0f, 1.0f, true, true, 0.0f),
// Friendly
AddSpawn({ "Wave_3_FShip_1", "Wave_3_FShip_2" }, 2168, 0.0f, 5.0f, true, 2.0f, 5.0f, 1.0f, -1000, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
// Friendly 2
AddSpawn({ "Wave_3_FShip_3", "Wave_3_FShip_4" }, 2168, 0.0f, 5.0f, true, 2.0f, 5.0f, 1.0f, -1000, false, 0.0f, 1.0f, 1.0f, false, true, 0.0f),
},
};
}