Вынес спонсорский еквип при спавне в отдельный параметр
This commit is contained in:
parent
9bf3a5dbac
commit
d30786097b
3 changed files with 50 additions and 57 deletions
|
|
@ -23,29 +23,25 @@ public sealed class SponsorLoadoutSystem : EntitySystem
|
|||
if (_sponsorsManager == null)
|
||||
return;
|
||||
|
||||
if (!_sponsorsManager.TryGetPrototypes(ev.Player.UserId, out var prototypes))
|
||||
if (!_sponsorsManager.TryGetSpawnEquipment(ev.Player.UserId, out var spawnEquipment))
|
||||
return;
|
||||
foreach (var loadoutId in prototypes)
|
||||
{
|
||||
if (!_prototypeManager.TryIndex<SponsorLoadoutPrototype>(loadoutId, out var loadout))
|
||||
continue;
|
||||
var isSponsorHave = !prototypes.Contains(loadoutId);
|
||||
var isWhitelisted = ev.JobId != null &&
|
||||
loadout.WhitelistJobs != null &&
|
||||
!loadout.WhitelistJobs.Contains(ev.JobId);
|
||||
var isBlacklisted = ev.JobId != null &&
|
||||
loadout.BlacklistJobs != null &&
|
||||
loadout.BlacklistJobs.Contains(ev.JobId);
|
||||
var isSpeciesRestricted = loadout.SpeciesRestrictions != null &&
|
||||
loadout.SpeciesRestrictions.Contains(ev.Profile.Species);
|
||||
if (!_prototypeManager.TryIndex<SponsorLoadoutPrototype>(spawnEquipment, out var loadout))
|
||||
return;
|
||||
var isWhitelisted = ev.JobId != null &&
|
||||
loadout.WhitelistJobs != null &&
|
||||
!loadout.WhitelistJobs.Contains(ev.JobId);
|
||||
var isBlacklisted = ev.JobId != null &&
|
||||
loadout.BlacklistJobs != null &&
|
||||
loadout.BlacklistJobs.Contains(ev.JobId);
|
||||
var isSpeciesRestricted = loadout.SpeciesRestrictions != null &&
|
||||
loadout.SpeciesRestrictions.Contains(ev.Profile.Species);
|
||||
|
||||
if (isSponsorHave || isWhitelisted || isBlacklisted || isSpeciesRestricted)
|
||||
continue;
|
||||
if (isWhitelisted || isBlacklisted || isSpeciesRestricted)
|
||||
return;
|
||||
|
||||
if (!_prototypeManager.TryIndex(loadout.Equipment, out var startingGear))
|
||||
continue;
|
||||
if (!_prototypeManager.TryIndex(loadout.Equipment, out var startingGear))
|
||||
return;
|
||||
|
||||
_spawn.EquipStartingGear(ev.Mob, startingGear);
|
||||
}
|
||||
_spawn.EquipStartingGear(ev.Mob, startingGear);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,77 +1,70 @@
|
|||
#Knight_of_the_Sun:
|
||||
- type: sponsorLoadout
|
||||
id: SunriseUplink40Loadout
|
||||
equipment: SunriseUplink40
|
||||
id: SunriseSponsorTier2
|
||||
equipment: SunriseSponsorTier2
|
||||
|
||||
- type: startingGear
|
||||
id: SunriseUplink40
|
||||
id: SunriseSponsorTier2
|
||||
storage:
|
||||
neck: ClothingNeckSunriseBadge
|
||||
back:
|
||||
- SunriseUplink40
|
||||
|
||||
#Sun:
|
||||
- type: sponsorLoadout
|
||||
id: SunriseUplink80Loadout
|
||||
equipment: SunriseUplink80
|
||||
id: SunriseSponsorTier3
|
||||
equipment: SunriseSponsorTier3
|
||||
|
||||
- type: startingGear
|
||||
id: SunriseUplink80
|
||||
id: SunriseSponsorTier3
|
||||
storage:
|
||||
neck: ClothingNeckSunriseBadge
|
||||
back:
|
||||
- SunriseUplink80
|
||||
|
||||
#Endless_Summer
|
||||
- type: sponsorLoadout
|
||||
id: SunriseUplink100Loadout
|
||||
equipment: SunriseUplink100
|
||||
id: SunriseSponsorTier4
|
||||
equipment: SunriseSponsorTier4
|
||||
|
||||
- type: startingGear
|
||||
id: SunriseUplink100
|
||||
id: SunriseSponsorTier4
|
||||
storage:
|
||||
neck: ClothingNeckSunriseBadge
|
||||
back:
|
||||
- SunriseUplink100
|
||||
|
||||
#Badge
|
||||
- type: sponsorLoadout
|
||||
id: SunriseBadgeLoadout
|
||||
equipment: ClothingNeckSunriseBadge
|
||||
|
||||
- type: startingGear
|
||||
id: ClothingNeckSunriseBadge
|
||||
equipment:
|
||||
neck: ClothingNeckSunriseBadge
|
||||
|
||||
# FISHSTATION UPLINKS:
|
||||
|
||||
# first level?
|
||||
- type: sponsorLoadout
|
||||
id: FishStationUplink40Loadout
|
||||
equipment: FishStationUplink40
|
||||
id: FishSponsorTier1
|
||||
equipment: FishSponsorTier1
|
||||
|
||||
- type: startingGear
|
||||
id: FishStationUplink40
|
||||
id: FishSponsorTier1
|
||||
storage:
|
||||
back:
|
||||
- FishStationUplink40
|
||||
|
||||
# second level?
|
||||
- type: sponsorLoadout
|
||||
id: FishStationUplink80Loadout
|
||||
equipment: FishStationUplink80
|
||||
id: FishSponsorTier2
|
||||
equipment: FishSponsorTier2
|
||||
|
||||
- type: startingGear
|
||||
id: FishStationUplink80
|
||||
id: FishSponsorTier2
|
||||
storage:
|
||||
back:
|
||||
- FishStationUplink80
|
||||
|
||||
# third level?
|
||||
- type: sponsorLoadout
|
||||
id: FishStationUplink100Loadout
|
||||
equipment: FishStationUplink100
|
||||
id: FishSponsorTier3
|
||||
equipment: FishSponsorTier3
|
||||
|
||||
- type: startingGear
|
||||
id: FishStationUplink100
|
||||
id: FishSponsorTier3
|
||||
storage:
|
||||
back:
|
||||
- FishStationUplink100
|
||||
|
|
@ -80,33 +73,33 @@
|
|||
|
||||
# first level?
|
||||
- type: sponsorLoadout
|
||||
id: NeweraStationUplink40Loadout
|
||||
equipment: NeweraStationUplink40
|
||||
id: NeweraSponsorTier1
|
||||
equipment: NeweraSponsorTier1
|
||||
|
||||
- type: startingGear
|
||||
id: NeweraStationUplink40
|
||||
id: NeweraSponsorTier1
|
||||
storage:
|
||||
back:
|
||||
- NeweraStationUplink40
|
||||
|
||||
# second level?
|
||||
- type: sponsorLoadout
|
||||
id: NeweraStationUplink80Loadout
|
||||
equipment: NeweraStationUplink80
|
||||
id: NeweraSponsorTier2
|
||||
equipment: NeweraSponsorTier2
|
||||
|
||||
- type: startingGear
|
||||
id: NeweraStationUplink80
|
||||
id: NeweraSponsorTier2
|
||||
storage:
|
||||
back:
|
||||
- NeweraStationUplink80
|
||||
|
||||
# third level?
|
||||
- type: sponsorLoadout
|
||||
id: NeweraStationUplink100Loadout
|
||||
equipment: NeweraStationUplink100
|
||||
id: NeweraSponsorTier3
|
||||
equipment: NeweraSponsorTier3
|
||||
|
||||
- type: startingGear
|
||||
id: NeweraStationUplink100
|
||||
id: NeweraSponsorTier3
|
||||
storage:
|
||||
back:
|
||||
- NeweraStationUplink100
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public interface ISharedSponsorsManager
|
|||
public bool TryGetPrototypes(NetUserId userId, [NotNullWhen(true)] out List<string>? prototypes);
|
||||
public bool TryGetOocTitle(NetUserId userId, [NotNullWhen(true)] out string? title);
|
||||
public bool TryGetOocColor(NetUserId userId, [NotNullWhen(true)] out Color? color);
|
||||
public bool TryGetSpawnEquipment(NetUserId userId, [NotNullWhen(true)] out string? spawnEquipment);
|
||||
public bool TryGetGhostThemes(NetUserId userId, [NotNullWhen(true)] out List<string>? ghostTheme);
|
||||
public bool TryGetBypassRoles(NetUserId userId, [NotNullWhen(true)] out List<string>? bypassRoles);
|
||||
public int GetSizeFlavor(NetUserId userId);
|
||||
|
|
@ -75,6 +76,9 @@ public sealed class SponsorInfo
|
|||
[JsonPropertyName("ghostThemes")]
|
||||
public string[] GhostThemes { get; set; } = [];
|
||||
|
||||
[JsonPropertyName("spawnEquipment")]
|
||||
public string? SpawnEquipment { get; set; }
|
||||
|
||||
[JsonPropertyName("allowedMarkings")]
|
||||
public string[] AllowedMarkings { get; set; } = [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue