This repository has been archived by the owner on Sep 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Secondary Navgrids/ExpCurves and Scoreboards (#1383)
* Packets - Introduced `NotifyS2C_HandleCapturePointUpdate` and `NotifyS2C_HandleGameScore`. - Deleted `MovementType`, as it wasn't used anymore. * Monsters - Deleted the system to delay targetability during spawn animations i made but never finished. * APIMapFunctionManager - Introduced `NotifyGameScore` and `NotifyHandleCapturePointUpdate`. * MapScriptMetaData - Introduced `ExpCurveOverride` and `NavGridOverride`. * MapScriptHandler - Moved things around in order to the `MapData`, `CollisionHandler`, `PathingHandler` and `NavigationGrid` variables only get loaded after the MapScript, so they can properly take into account the new overrides in `MapScriptMetaData`. * Config - Deleted `MapData`, now all references to MapData are to the MapData located in MapScriptHandler. * Scripts - Updated Map8's `LevelScript` and `LevelScriptObjects` so it can properly handle the scoreboard (Didn't script any of the mechanics related to it). - Introduced `LevelScriptAscension`. Although Ascension doesn't have a separate LevelScript in League files, i believe it is different enough to deserve a deticated, standalone LevelScript. - I didn't do much to the Ascension script due to the lack of a replay file to take accurate information from. I only added features directly present in the Odin gamemode, such as `SpeedShrines`, `Props`, and some of the `HealthRelics`.
- Loading branch information
1 parent
023d8b6
commit b18de15
Showing
20 changed files
with
430 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
Content/LeagueSandbox-Scripts/Maps/Map8/LevelScriptAscension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Numerics; | ||
using GameServerCore.Domain; | ||
using GameServerCore.Domain.GameObjects; | ||
using GameServerCore.Enums; | ||
using LeagueSandbox.GameServer.Content; | ||
using LeagueSandbox.GameServer.Scripting.CSharp; | ||
using GameServerCore.Scripting.CSharp; | ||
using static LeagueSandbox.GameServer.API.ApiFunctionManager; | ||
using static LeagueSandbox.GameServer.API.ApiMapFunctionManager; | ||
|
||
namespace MapScripts.Map8 | ||
{ | ||
public class ASCENSION : IMapScript | ||
{ | ||
public IMapScriptMetadata MapScriptMetadata { get; set; } = new MapScriptMetadata | ||
{ | ||
MinionSpawnEnabled = false, | ||
StartingGold = 1300.0f, | ||
OverrideSpawnPoints = true, | ||
RecallSpellItemId = 2005, | ||
GoldPerSecond = 9.85f, | ||
FirstGoldTime = 5 * 1000, | ||
InitialLevel = 3, | ||
ExpRange = 1250.0f, | ||
GoldRange = 0.0f, | ||
NavGridOverride = "AIPathASCENSION", | ||
ExpCurveOverride = "ExpCurveASCENSION" | ||
}; | ||
|
||
public virtual IGlobalData GlobalData { get; set; } = new GlobalData(); | ||
public bool HasFirstBloodHappened { get; set; } = false; | ||
public long NextSpawnTime { get; set; } = 90 * 1000; | ||
public string LaneMinionAI { get; set; } = "LaneMinionAI"; | ||
|
||
//Values i got the values for 5 players from replay packets, the value for 1 player is just a guess of mine by using !coords command in-game | ||
public Dictionary<TeamId, Dictionary<int, Dictionary<int, Vector2>>> PlayerSpawnPoints { get; } = new Dictionary<TeamId, Dictionary<int, Dictionary<int, Vector2>>> | ||
{ | ||
{TeamId.TEAM_BLUE, new Dictionary<int, Dictionary<int, Vector2>>{ | ||
{ 5, new Dictionary<int, Vector2>{ | ||
{ 1, new Vector2(687.99036f, 4281.2314f) }, | ||
{ 2, new Vector2(687.99036f, 4061.2314f) }, | ||
{ 3, new Vector2(478.79034f,3993.2314f) }, | ||
{ 4, new Vector2(349.39032f,4171.2314f) }, | ||
{ 5, new Vector2(438.79034f,4349.2314f) } | ||
}}, | ||
{1, new Dictionary<int, Vector2>{ | ||
{ 1, new Vector2(580f, 4124f) } | ||
}} | ||
}}, | ||
|
||
{TeamId.TEAM_PURPLE, new Dictionary<int, Dictionary<int, Vector2>> | ||
{ { 5, new Dictionary<int, Vector2>{ | ||
{ 1, new Vector2(13468.365f,4281.2324f) }, | ||
{ 2, new Vector2(13468.365f,4061.2324f) }, | ||
{ 3, new Vector2(13259.165f,3993.2324f) }, | ||
{ 4, new Vector2(13129.765f,4171.2324f) }, | ||
{ 5, new Vector2(13219.165f,4349.2324f) } | ||
}}, | ||
{1, new Dictionary<int, Vector2>{ | ||
{ 1, new Vector2(13310f, 4124f) } | ||
}} | ||
}}, | ||
|
||
}; | ||
|
||
//Minion models for this map | ||
public Dictionary<TeamId, Dictionary<MinionSpawnType, string>> MinionModels { get; set; } = new Dictionary<TeamId, Dictionary<MinionSpawnType, string>> | ||
{ | ||
{TeamId.TEAM_BLUE, new Dictionary<MinionSpawnType, string>{ | ||
{MinionSpawnType.MINION_TYPE_MELEE, "Blue_Minion_Basic"}, | ||
{MinionSpawnType.MINION_TYPE_CASTER, "Blue_Minion_Wizard"}, | ||
{MinionSpawnType.MINION_TYPE_CANNON, "Blue_Minion_MechCannon"}, | ||
{MinionSpawnType.MINION_TYPE_SUPER, "Blue_Minion_MechMelee"} | ||
}}, | ||
{TeamId.TEAM_PURPLE, new Dictionary<MinionSpawnType, string>{ | ||
{MinionSpawnType.MINION_TYPE_MELEE, "Red_Minion_Basic"}, | ||
{MinionSpawnType.MINION_TYPE_CASTER, "Red_Minion_Wizard"}, | ||
{MinionSpawnType.MINION_TYPE_CANNON, "Red_Minion_MechCannon"}, | ||
{MinionSpawnType.MINION_TYPE_SUPER, "Red_Minion_MechMelee"} | ||
}} | ||
}; | ||
|
||
public void Init(Dictionary<GameObjectTypes, List<MapObject>> mapObjects) | ||
{ | ||
//TODO: Implement Dynamic Minion spawn mechanics for Map8 | ||
//SpawnEnabled = map.IsMinionSpawnEnabled(); | ||
AddSurrender(1200000.0f, 300000.0f, 30.0f); | ||
CreateLevelProps.CreateProps(); | ||
LevelScriptObjectsAscension.LoadObjects(mapObjects); | ||
} | ||
|
||
Dictionary<TeamId, int> TeamScores = new Dictionary<TeamId, int> { { TeamId.TEAM_BLUE, 200}, { TeamId.TEAM_PURPLE, 200} }; | ||
public void OnMatchStart() | ||
{ | ||
LevelScriptObjectsAscension.OnMatchStart(); | ||
NeutralMinionSpawnAscension.InitializeNeutrals(); | ||
|
||
foreach(var team in TeamScores.Keys) | ||
{ | ||
NotifyGameScore(team, TeamScores[team]); | ||
} | ||
} | ||
|
||
public void Update(float diff) | ||
{ | ||
NeutralMinionSpawnAscension.OnUpdate(diff); | ||
} | ||
|
||
public void SpawnAllCamps() | ||
{ | ||
NeutralMinionSpawnAscension.ForceCampSpawn(); | ||
} | ||
|
||
public Vector2 GetFountainPosition(TeamId team) | ||
{ | ||
return LevelScriptObjects.FountainList[team].Position; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
Content/LeagueSandbox-Scripts/Maps/Map8/LevelScriptObjectsAscension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
using GameServerCore.Domain.GameObjects; | ||
using GameServerCore.Enums; | ||
using static LeagueSandbox.GameServer.API.ApiMapFunctionManager; | ||
using System.Collections.Generic; | ||
using GameServerCore.Domain; | ||
using System.Numerics; | ||
using static LeagueSandbox.GameServer.API.ApiFunctionManager; | ||
|
||
namespace MapScripts.Map8 | ||
{ | ||
public static class LevelScriptObjectsAscension | ||
{ | ||
private static Dictionary<GameObjectTypes, List<MapObject>> _mapObjects; | ||
|
||
static List<IMinion> InfoPoints = new List<IMinion>(); | ||
public static Dictionary<TeamId, IFountain> FountainList = new Dictionary<TeamId, IFountain>(); | ||
static Dictionary<TeamId, List<ILaneTurret>> TurretList = new Dictionary<TeamId, List<ILaneTurret>> { { TeamId.TEAM_BLUE, new List<ILaneTurret>() }, { TeamId.TEAM_PURPLE, new List<ILaneTurret>() } }; | ||
|
||
static string LaneTurretAI = "TurretAI"; | ||
|
||
public static Dictionary<TeamId, string> TowerModels { get; set; } = new Dictionary<TeamId, string> | ||
{ | ||
{TeamId.TEAM_BLUE, "OdinOrderTurretShrine" }, | ||
|
||
{TeamId.TEAM_PURPLE, "OdinChaosTurretShrine" } | ||
}; | ||
|
||
public static void LoadObjects(Dictionary<GameObjectTypes, List<MapObject>> mapObjects) | ||
{ | ||
_mapObjects = mapObjects; | ||
|
||
CreateBuildings(); | ||
LoadFountains(); | ||
} | ||
|
||
public static void OnMatchStart() | ||
{ | ||
LoadShops(); | ||
} | ||
|
||
public static void OnUpdate(float diff) | ||
{ | ||
foreach (var fountain in FountainList.Values) | ||
{ | ||
fountain.Update(diff); | ||
} | ||
} | ||
|
||
static void LoadFountains() | ||
{ | ||
foreach (var fountain in _mapObjects[GameObjectTypes.ObjBuilding_SpawnPoint]) | ||
{ | ||
var team = fountain.GetTeamID(); | ||
FountainList.Add(team, CreateFountain(team, new Vector2(fountain.CentralPoint.X, fountain.CentralPoint.Z))); | ||
} | ||
} | ||
|
||
static void LoadShops() | ||
{ | ||
foreach (var shop in _mapObjects[GameObjectTypes.ObjBuilding_Shop]) | ||
{ | ||
NotifySpawn(CreateShop(shop.Name, new Vector2(shop.CentralPoint.X, shop.CentralPoint.Z), shop.GetTeamID())); | ||
} | ||
} | ||
|
||
static void CreateBuildings() | ||
{ | ||
foreach (var turretObj in _mapObjects[GameObjectTypes.ObjAIBase_Turret]) | ||
{ | ||
var teamId = turretObj.GetTeamID(); | ||
var position = new Vector2(turretObj.CentralPoint.X, turretObj.CentralPoint.Z); | ||
var fountainTurret = CreateLaneTurret(turretObj.Name + "_A", TowerModels[teamId], position, teamId, TurretType.FOUNTAIN_TURRET, LaneID.NONE, LaneTurretAI, turretObj); | ||
TurretList[teamId].Add(fountainTurret); | ||
AddObject(fountainTurret); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.