public IProfileContract BuildProfile(Period period) { IContractEmploy employContract = EmployHistory.ResolveContract(period); IContractTaxing taxingContract = TaxingHistory.ResolveContract(period); IContractHealth healthContract = HealthHistory.ResolveContract(period); IContractSocial socialContract = SocialHistory.ResolveContract(period); return(new ProfileContract(period, employContract, taxingContract, healthContract, socialContract)); }
internal void UpdateFastChangingData() { var commonData = _me.CommonData; if (_me.IsInCombat) { LastInCombatTime = DateTime.UtcNow; } IsInParty = ZetaDia.Service.Party.NumPartyMembers > 1; AcdId = _me.ACDId; RActorGuid = _me.RActorId; LastUpdated = DateTime.UtcNow; IsInTown = GameData.TownLevelAreaIds.Contains(LevelAreaId); IsInRift = GameData.RiftWorldIds.Contains(WorldSnoId); IsDead = _me.IsDead; IsIncapacitated = _me.IsFeared || _me.IsStunned || _me.IsFrozen || _me.IsBlind || IsPowerUseDisabled; IsRooted = _me.IsRooted; CurrentHealthPct = _me.HitpointsCurrentPct; PrimaryResource = GetCurrentPrimaryResource(); PrimaryResourcePct = PrimaryResource / PrimaryResourceMax; PrimaryResourceMissing = PrimaryResourceMax - PrimaryResource; SecondaryResource = _me.CurrentSecondaryResource; SecondaryResourcePct = SecondaryResource / SecondaryResourceMax; SecondaryResourceMissing = SecondaryResourceMax - SecondaryResource; Position = _me.Position; Rotation = _me.Movement.Rotation; DirectionVector = _me.Movement.DirectionVector; MovementSpeed = (float)Core.PlayerHistory.MoveSpeed; IsMoving = _me.Movement.IsMoving; IsInCombat = _me.IsInCombat; MaxBloodShards = 500 + commonData.GetAttribute <int>(ActorAttributeType.HighestSoloRiftLevel) * 10; IsMaxCriticalChance = _me.CritPercentBonusUncapped > 0 || Math.Abs(_me.CritDamagePercent - 100) < float.Epsilon; CriticalChancePct = _me.CritDamagePercent; IsJailed = _me.HasDebuff(SNOPower.MonsterAffix_JailerCast); IsFrozen = _me.IsFrozen; ParticipatingInTieredLootRun = _me.IsParticipatingInTieredLootRun; TieredLootRunlevel = _me.InTieredLootRunLevel; IsCasting = _me.LoopingAnimationEndTime > 0; IsInteractingWithGizmo = commonData.GetAttribute <bool>(ActorAttributeType.PowerBuff0VisualEffectNone, (int)SNOPower.Axe_Operate_Gizmo); CurrentAnimation = commonData.CurrentAnimation; IsInventoryLockedForGreaterRift = ZetaDia.Storage.RiftStarted && ZetaDia.Storage.CurrentRiftType == RiftType.Greater && !ZetaDia.Storage.RiftCompleted; ShieldHitpoints = commonData.GetAttribute <float>(ActorAttributeType.DamageShieldAmount); Summons = GetPlayerSummonCounts(); //var direction = ZetaDia.Me.Movement.DirectionVector; // var directionRadians = Math.Atan2(direction.X, direction.Y); //var directionDegrees = directionRadians * 180/Math.PI; //Core.Logger.Log("Player DirectionVector={0}{1} Radians={2} (DB: {3}) Degrees={4} (DB: {5})", // DirectionVector.X, // DirectionVector.Y, // directionRadians, // ZetaDia.Me.Movement.Rotation, // directionDegrees, // ZetaDia.Me.Movement.RotationDegrees // ); var wasCastingPortal = IsCastingPortal; IsCastingPortal = IsCasting && wasCastingPortal || IsCastingTownPortalOrTeleport(); CurrentHealth = _me.HitpointsCurrent; IsInBossEncounter = _me.IsInBossEncounter; HealthHistory.Add(CurrentHealth); while (HealthHistory.Count > 5) { HealthHistory.RemoveAt(0); } var averageHealth = HealthHistory.Average(); IsTakingDamage = averageHealth > CurrentHealth; // For WD Angry Chicken IsHidden = _me.IsHidden; }
void Awake() { History = new HealthHistory(HistorySeconds); }