public void InitTags(string customData) { if (string.IsNullOrWhiteSpace(customData) == false) { var descSplit = customData.Split('\n'); foreach (var tag in descSplit) { //UseChatBroadcast if (tag.Contains("[UseChatBroadcast:") == true) { this.UseChatBroadcast = TagHelper.TagBoolCheck(tag); } //ChatData if (tag.Contains("[ChatData:") == true) { var tempValue = TagHelper.TagStringCheck(tag); bool gotChat = false; if (string.IsNullOrWhiteSpace(tempValue) == false) { byte[] byteData = { }; if (TagHelper.ChatObjectTemplates.TryGetValue(tempValue, out byteData) == true) { try { var profile = MyAPIGateway.Utilities.SerializeFromBinary <ChatProfile>(byteData); if (profile != null) { ChatData = profile; gotChat = true; } else { Logger.WriteLog("Deserialized Chat Profile was Null"); } } catch (Exception e) { Logger.WriteLog("Caught Exception While Attaching to Action Profile:"); Logger.WriteLog(e.ToString()); } } else { Logger.WriteLog("Chat Profile Not in Dictionary"); } } if (!gotChat) { Logger.WriteLog("Could Not Find Chat Profile Associated To Tag: " + tag); } } //BarrelRoll if (tag.Contains("[BarrelRoll:") == true) { this.BarrelRoll = TagHelper.TagBoolCheck(tag); } //Strafe if (tag.Contains("[Strafe:") == true) { this.Strafe = TagHelper.TagBoolCheck(tag); } //ChangeAutopilotSpeed if (tag.Contains("[ChangeAutopilotSpeed:") == true) { this.ChangeAutopilotSpeed = TagHelper.TagBoolCheck(tag); } //NewAutopilotSpeed if (tag.Contains("[NewAutopilotSpeed:") == true) { this.NewAutopilotSpeed = TagHelper.TagFloatCheck(tag, this.NewAutopilotSpeed); } //SpawnEncounter if (tag.Contains("[SpawnEncounter:") == true) { this.SpawnEncounter = TagHelper.TagBoolCheck(tag); } //Spawner if (tag.Contains("[Spawner:") == true) { var tempValue = TagHelper.TagStringCheck(tag); bool gotSpawn = false; if (string.IsNullOrWhiteSpace(tempValue) == false) { byte[] byteData = { }; if (TagHelper.SpawnerObjectTemplates.TryGetValue(tempValue, out byteData) == true) { try { var profile = MyAPIGateway.Utilities.SerializeFromBinary <SpawnProfile>(byteData); if (profile != null) { Spawner = profile; gotSpawn = true; } } catch (Exception) { } } } if (!gotSpawn) { Logger.WriteLog("Could Not Find Spawn Profile Associated To Tag: " + tag); } } //SelfDestruct if (tag.Contains("[SelfDestruct:") == true) { this.SelfDestruct = TagHelper.TagBoolCheck(tag); } //Retreat if (tag.Contains("[Retreat:") == true) { this.Retreat = TagHelper.TagBoolCheck(tag); } //TerminateBehavior if (tag.Contains("[TerminateBehavior:") == true) { this.TerminateBehavior = TagHelper.TagBoolCheck(tag); } //BroadcastCurrentTarget if (tag.Contains("[BroadcastCurrentTarget:") == true) { this.BroadcastCurrentTarget = TagHelper.TagBoolCheck(tag); } //SwitchToReceivedTarget if (tag.Contains("[SwitchToReceivedTarget:") == true) { this.SwitchToReceivedTarget = TagHelper.TagBoolCheck(tag); } //BroadcastDamagerTarget if (tag.Contains("[BroadcastDamagerTarget:") == true) { this.BroadcastDamagerTarget = TagHelper.TagBoolCheck(tag); } //BroadcastSendCode if (tag.Contains("[BroadcastSendCode:") == true) { this.BroadcastSendCode = TagHelper.TagStringCheck(tag); } //SwitchToBehavior if (tag.Contains("[SwitchToBehavior:") == true) { this.SwitchToBehavior = TagHelper.TagBoolCheck(tag); } //NewBehavior if (tag.Contains("[NewBehavior:") == true) { this.NewBehavior = TagHelper.TagStringCheck(tag); } //PreserveSettingsOnBehaviorSwitch if (tag.Contains("[PreserveSettingsOnBehaviorSwitch:") == true) { this.PreserveSettingsOnBehaviorSwitch = TagHelper.TagBoolCheck(tag); } //PreserveTriggersOnBehaviorSwitch if (tag.Contains("[PreserveTriggersOnBehaviorSwitch:") == true) { this.PreserveTriggersOnBehaviorSwitch = TagHelper.TagBoolCheck(tag); } //PreserveTargetDataOnBehaviorSwitch if (tag.Contains("[PreserveTargetDataOnBehaviorSwitch:") == true) { this.PreserveTargetDataOnBehaviorSwitch = TagHelper.TagBoolCheck(tag); } //RefreshTarget if (tag.Contains("[RefreshTarget:") == true) { this.RefreshTarget = TagHelper.TagBoolCheck(tag); } //SwitchTargetProfile if (tag.Contains("[SwitchTargetProfile:") == true) { this.SwitchTargetProfile = TagHelper.TagBoolCheck(tag); } //NewTargetProfile if (tag.Contains("[NewTargetProfile:") == true) { this.NewTargetProfile = TagHelper.TagStringCheck(tag); } //TriggerTimerBlocks if (tag.Contains("[TriggerTimerBlocks:") == true) { this.TriggerTimerBlocks = TagHelper.TagBoolCheck(tag); } //TimerBlockNames if (tag.Contains("[TimerBlockNames:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.TimerBlockNames.Add(tempvalue); } } //ChangeReputationWithPlayers if (tag.Contains("[ChangeReputationWithPlayers:") == true) { this.ChangeReputationWithPlayers = TagHelper.TagBoolCheck(tag); } //ReputationChangeRadius if (tag.Contains("[ReputationChangeRadius:") == true) { this.ReputationChangeRadius = TagHelper.TagDoubleCheck(tag, ReputationChangeRadius); } //ReputationChangeFactions if (tag.Contains("[ReputationChangeFactions:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.ReputationChangeFactions.Add(tempvalue); } } //ReputationChangeAmount if (tag.Contains("[ReputationChangeAmount:") == true) { int tempValue = TagHelper.TagIntCheck(tag, 0); this.ReputationChangeAmount.Add(tempValue); } //ActivateAssertiveAntennas if (tag.Contains("[ActivateAssertiveAntennas:") == true) { this.ActivateAssertiveAntennas = TagHelper.TagBoolCheck(tag); } //ChangeAntennaOwnership if (tag.Contains("[ChangeAntennaOwnership:") == true) { this.ChangeAntennaOwnership = TagHelper.TagBoolCheck(tag); } //AntennaFactionOwner if (tag.Contains("[AntennaFactionOwner:") == true) { this.AntennaFactionOwner = TagHelper.TagStringCheck(tag); } //CreateKnownPlayerArea if (tag.Contains("[CreateKnownPlayerArea:") == true) { this.CreateKnownPlayerArea = TagHelper.TagBoolCheck(tag); } //KnownPlayerAreaRadius if (tag.Contains("[KnownPlayerAreaRadius:") == true) { this.KnownPlayerAreaRadius = TagHelper.TagDoubleCheck(tag, KnownPlayerAreaRadius); } //KnownPlayerAreaTimer if (tag.Contains("[KnownPlayerAreaTimer:") == true) { this.KnownPlayerAreaTimer = TagHelper.TagIntCheck(tag, KnownPlayerAreaTimer); } //KnownPlayerAreaMaxSpawns if (tag.Contains("[KnownPlayerAreaMaxSpawns:") == true) { this.KnownPlayerAreaMaxSpawns = TagHelper.TagIntCheck(tag, KnownPlayerAreaMaxSpawns); } //DamageToolAttacker if (tag.Contains("[DamageToolAttacker:") == true) { this.DamageToolAttacker = TagHelper.TagBoolCheck(tag); } //DamageToolAttackerAmount if (tag.Contains("[DamageToolAttackerAmount:") == true) { this.DamageToolAttackerAmount = TagHelper.TagFloatCheck(tag, this.DamageToolAttackerAmount); } //DamageToolAttackerParticle if (tag.Contains("[DamageToolAttackerParticle:") == true) { this.DamageToolAttackerParticle = TagHelper.TagStringCheck(tag); } //DamageToolAttackerSound if (tag.Contains("[DamageToolAttackerSound:") == true) { this.DamageToolAttackerSound = TagHelper.TagStringCheck(tag); } //PlayParticleEffectAtRemote if (tag.Contains("[PlayParticleEffectAtRemote:") == true) { this.PlayParticleEffectAtRemote = TagHelper.TagBoolCheck(tag); } //ParticleEffectId if (tag.Contains("[ParticleEffectId:") == true) { this.ParticleEffectId = TagHelper.TagStringCheck(tag); } //ParticleEffectOffset if (tag.Contains("[ParticleEffectOffset:") == true) { this.ParticleEffectOffset = TagHelper.TagVector3DCheck(tag); } //ParticleEffectScale if (tag.Contains("[ParticleEffectScale:") == true) { this.ParticleEffectScale = TagHelper.TagFloatCheck(tag, this.ParticleEffectScale); } //ParticleEffectMaxTime if (tag.Contains("[ParticleEffectMaxTime:") == true) { this.ParticleEffectMaxTime = TagHelper.TagFloatCheck(tag, this.ParticleEffectMaxTime); } //ParticleEffectColor if (tag.Contains("[ParticleEffectColor:") == true) { this.ParticleEffectColor = TagHelper.TagVector3DCheck(tag); } //SetBooleansTrue if (tag.Contains("[SetBooleansTrue:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.SetBooleansTrue.Add(tempvalue); } } //SetBooleansFalse if (tag.Contains("[SetBooleansFalse:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.SetBooleansFalse.Add(tempvalue); } } //IncreaseCounters if (tag.Contains("[IncreaseCounters:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.IncreaseCounters.Add(tempvalue); } } //DecreaseCounters if (tag.Contains("[DecreaseCounters:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.DecreaseCounters.Add(tempvalue); } } //ResetCounters if (tag.Contains("[ResetCounters:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.ResetCounters.Add(tempvalue); } } //SetSandboxBooleansTrue if (tag.Contains("[SetSandboxBooleansTrue:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.SetSandboxBooleansTrue.Add(tempvalue); } } //SetSandboxBooleansFalse if (tag.Contains("[SetSandboxBooleansFalse:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.SetSandboxBooleansFalse.Add(tempvalue); } } //IncreaseSandboxCounters if (tag.Contains("[IncreaseSandboxCounters:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.IncreaseSandboxCounters.Add(tempvalue); } } //DecreaseSandboxCounters if (tag.Contains("[DecreaseSandboxCounters:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.DecreaseSandboxCounters.Add(tempvalue); } } //ResetSandboxCounters if (tag.Contains("[ResetSandboxCounters:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.ResetSandboxCounters.Add(tempvalue); } } //ChangeAttackerReputation if (tag.Contains("[ChangeAttackerReputation:") == true) { this.ChangeAttackerReputation = TagHelper.TagBoolCheck(tag); } //ChangeAttackerReputationFaction if (tag.Contains("[ChangeAttackerReputationFaction:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.ChangeAttackerReputationFaction.Add(tempvalue); } } //ChangeAttackerReputationAmount if (tag.Contains("[ChangeAttackerReputationAmount:") == true) { var tempvalue = TagHelper.TagIntCheck(tag, 0); this.ChangeAttackerReputationAmount.Add(tempvalue); } //ReputationChangesForAllAttackPlayerFactionMembers if (tag.Contains("[ReputationChangesForAllAttackPlayerFactionMembers:") == true) { this.ReputationChangesForAllAttackPlayerFactionMembers = TagHelper.TagBoolCheck(tag); } //ChangeTargetProfile if (tag.Contains("[ChangeTargetProfile:") == true) { this.ChangeTargetProfile = TagHelper.TagBoolCheck(tag); } //NewTargetProfileId if (tag.Contains("[NewTargetProfileId:") == true) { this.NewTargetProfileId = TagHelper.TagStringCheck(tag); } //ChangeBlockNames if (tag.Contains("[ChangeBlockNames:") == true) { this.ChangeBlockNames = TagHelper.TagBoolCheck(tag); } //ChangeBlockNamesFrom if (tag.Contains("[ChangeBlockNamesFrom:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.ChangeBlockNamesFrom.Add(tempvalue); } } //ChangeBlockNamesTo if (tag.Contains("[ChangeBlockNamesTo:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.ChangeBlockNamesTo.Add(tempvalue); } } //ChangeAntennaRanges if (tag.Contains("[ChangeAntennaRanges:") == true) { this.ChangeAntennaRanges = TagHelper.TagBoolCheck(tag); } //AntennaNamesForRangeChange if (tag.Contains("[AntennaNamesForRangeChange:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.AntennaNamesForRangeChange.Add(tempvalue); } } //AntennaRangeChangeType if (tag.Contains("[AntennaRangeChangeType:") == true) { this.AntennaRangeChangeType = TagHelper.TagStringCheck(tag); } //AntennaRangeChangeAmount if (tag.Contains("[AntennaRangeChangeAmount:") == true) { this.AntennaRangeChangeAmount = TagHelper.TagFloatCheck(tag, this.AntennaRangeChangeAmount); } //ForceDespawn if (tag.Contains("[ForceDespawn:") == true) { this.ForceDespawn = TagHelper.TagBoolCheck(tag); } //ResetCooldownTimeOfTriggers if (tag.Contains("[ResetCooldownTimeOfTriggers:") == true) { this.ResetCooldownTimeOfTriggers = TagHelper.TagBoolCheck(tag); } //ResetTriggerCooldownNames if (tag.Contains("[ResetTriggerCooldownNames:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.ResetTriggerCooldownNames.Add(tempvalue); } } //BroadcastGenericCommand if (tag.Contains("[BroadcastGenericCommand:") == true) { this.BroadcastGenericCommand = TagHelper.TagBoolCheck(tag); } //BehaviorSpecificEventA if (tag.Contains("[BehaviorSpecificEventA:") == true) { this.BehaviorSpecificEventA = TagHelper.TagBoolCheck(tag); } //ChangeInertiaDampeners if (tag.Contains("[ChangeInertiaDampeners:") == true) { this.ChangeInertiaDampeners = TagHelper.TagBoolCheck(tag); } //InertiaDampenersEnable if (tag.Contains("[InertiaDampenersEnable:") == true) { this.InertiaDampenersEnable = TagHelper.TagBoolCheck(tag); } //EnableTriggers if (tag.Contains("[EnableTriggers:") == true) { this.EnableTriggers = TagHelper.TagBoolCheck(tag); } //EnableTriggerNames if (tag.Contains("[EnableTriggerNames:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.EnableTriggerNames.Add(tempvalue); } } //DisableTriggers if (tag.Contains("[DisableTriggers:") == true) { this.DisableTriggers = TagHelper.TagBoolCheck(tag); } //DisableTriggerNames if (tag.Contains("[DisableTriggerNames:") == true) { var tempvalue = TagHelper.TagStringCheck(tag); if (string.IsNullOrWhiteSpace(tempvalue) == false) { this.DisableTriggerNames.Add(tempvalue); } } //StaggerWarheadDetonation if (tag.Contains("[StaggerWarheadDetonation:") == true) { this.StaggerWarheadDetonation = TagHelper.TagBoolCheck(tag); } //ChangeRotationDirection if (tag.Contains("[ChangeRotationDirection:") == true) { this.ChangeRotationDirection = TagHelper.TagBoolCheck(tag); } //RotationDirection if (tag.Contains("[RotationDirection:") == true) { this.RotationDirection = TagHelper.TagDirectionEnumCheck(tag); } //GenerateExplosion if (tag.Contains("[GenerateExplosion:") == true) { this.GenerateExplosion = TagHelper.TagBoolCheck(tag); } //ExplosionOffsetFromRemote if (tag.Contains("[ExplosionOffsetFromRemote:") == true) { this.ExplosionOffsetFromRemote = TagHelper.TagVector3DCheck(tag); } //ExplosionRange if (tag.Contains("[ExplosionRange:") == true) { this.ExplosionRange = TagHelper.TagIntCheck(tag, ExplosionRange); } //ExplosionDamage if (tag.Contains("[ExplosionDamage:") == true) { this.ExplosionDamage = TagHelper.TagIntCheck(tag, ExplosionDamage); } } } }
public ActionProfile() { UseChatBroadcast = false; ChatData = new ChatProfile(); BarrelRoll = false; Strafe = false; ChangeAutopilotSpeed = false; NewAutopilotSpeed = 0; SpawnEncounter = false; Spawner = new SpawnProfile(); SelfDestruct = false; StaggerWarheadDetonation = false; Retreat = false; BroadcastCurrentTarget = false; BroadcastDamagerTarget = false; BroadcastSendCode = ""; SwitchToReceivedTarget = false; SwitchToBehavior = false; NewBehavior = ""; PreserveSettingsOnBehaviorSwitch = false; PreserveTriggersOnBehaviorSwitch = false; PreserveTargetDataOnBehaviorSwitch = false; RefreshTarget = false; TriggerTimerBlocks = false; TimerBlockNames = new List <string>(); ChangeReputationWithPlayers = false; ReputationChangeRadius = 0; ReputationChangeFactions = new List <string>(); ReputationChangeAmount = new List <int>(); ReputationChangesForAllRadiusPlayerFactionMembers = false; ChangeAttackerReputation = false; ChangeAttackerReputationFaction = new List <string>(); ChangeAttackerReputationAmount = new List <int>(); ReputationChangesForAllAttackPlayerFactionMembers = false; ActivateAssertiveAntennas = false; ChangeAntennaOwnership = false; AntennaFactionOwner = "Nobody"; CreateKnownPlayerArea = false; KnownPlayerAreaRadius = 10000; KnownPlayerAreaTimer = 30; KnownPlayerAreaMaxSpawns = -1; DamageToolAttacker = false; DamageToolAttackerAmount = 90; DamageToolAttackerParticle = ""; DamageToolAttackerSound = ""; PlayParticleEffectAtRemote = false; ParticleEffectId = ""; ParticleEffectOffset = Vector3D.Zero; ParticleEffectScale = 1; ParticleEffectMaxTime = -1; ParticleEffectColor = Vector3D.Zero; SetBooleansTrue = new List <string>(); SetBooleansFalse = new List <string>(); IncreaseCounters = new List <string>(); DecreaseCounters = new List <string>(); ResetCounters = new List <string>(); SetSandboxBooleansTrue = new List <string>(); SetSandboxBooleansFalse = new List <string>(); IncreaseSandboxCounters = new List <string>(); DecreaseSandboxCounters = new List <string>(); ResetSandboxCounters = new List <string>(); BroadcastGenericCommand = false; BehaviorSpecificEventA = false; BehaviorSpecificEventB = false; BehaviorSpecificEventC = false; BehaviorSpecificEventD = false; BehaviorSpecificEventE = false; BehaviorSpecificEventF = false; BehaviorSpecificEventG = false; BehaviorSpecificEventH = false; TerminateBehavior = false; ChangeTargetProfile = false; NewTargetProfileId = ""; ChangeBlockNames = false; ChangeBlockNamesFrom = new List <string>(); ChangeBlockNamesTo = new List <string>(); ChangeAntennaRanges = false; AntennaNamesForRangeChange = new List <string>(); AntennaRangeChangeType = "Set"; AntennaRangeChangeAmount = 0; ForceDespawn = false; ResetCooldownTimeOfTriggers = false; ResetTriggerCooldownNames = new List <string>(); ChangeInertiaDampeners = false; InertiaDampenersEnable = false; EnableTriggers = false; EnableTriggerNames = new List <string>(); DisableTriggers = false; DisableTriggerNames = new List <string>(); ChangeRotationDirection = false; RotationDirection = Direction.None; GenerateExplosion = false; ExplosionOffsetFromRemote = Vector3D.Zero; ExplosionDamage = 1; ExplosionRange = 1; ProfileSubtypeId = ""; }